From 78b5a1f6bf86bd92dea95da40a1e2d35676cdbd2 Mon Sep 17 00:00:00 2001 From: phuong_vu Date: Fri, 5 Oct 2012 12:06:55 +0700 Subject: [PATCH] Minor refactor on amd-js example portlet --- .../portlets/amd-js/src/main/webapp/jqueryPlugin/view.jsp | 2 -- .../src/main/webapp/requirejs/jsp/requirejsPortlet.jsp | 8 ++++---- .../webui/component/UISampleRightClickPopupMenu.gtmpl | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/portlets/amd-js/src/main/webapp/jqueryPlugin/view.jsp b/examples/portlets/amd-js/src/main/webapp/jqueryPlugin/view.jsp index 2ab0f3eef..d2377e2bc 100644 --- a/examples/portlets/amd-js/src/main/webapp/jqueryPlugin/view.jsp +++ b/examples/portlets/amd-js/src/main/webapp/jqueryPlugin/view.jsp @@ -17,7 +17,6 @@ <module> <name>jquery-plugin</name> <script> - <name>jquery-plugin</name> <path>/jqueryPlugin/jquery-plugin.js</path> </script> <depends> @@ -30,7 +29,6 @@ <name>JQueryPluginPortlet</name> <module> <script> - <name>jqueryPlugin</name> <path>/jqueryPlugin/jqueryPluginPortlet.js</path> </script> <depends> diff --git a/examples/portlets/amd-js/src/main/webapp/requirejs/jsp/requirejsPortlet.jsp b/examples/portlets/amd-js/src/main/webapp/requirejs/jsp/requirejsPortlet.jsp index c985824a5..efd85c25a 100644 --- a/examples/portlets/amd-js/src/main/webapp/requirejs/jsp/requirejsPortlet.jsp +++ b/examples/portlets/amd-js/src/main/webapp/requirejs/jsp/requirejsPortlet.jsp @@ -20,13 +20,15 @@
    +
  1. + All js files in this example are native requirejs. The code shown is simplified to make it easier to read +
  2. Each js library should be a GateIn resource - declare it in gatein-resources.xml
                      <module>
                         <name>text</name>     
                         <script>
    -                       <name>requirejs.text</name>
                            <path>/requirejs/js/plugins/text.js</path>
                         </script>
                         <depends>
    @@ -39,7 +41,6 @@
                        <name>RequireJSPortlet</name>
                        <module>
                           <script>
    -                         <name>starter</name>
                              <path>/requirejs/js/requirejsPortlet.js</path>
                           </script>
                           <depends>
    @@ -62,7 +63,7 @@
     					
    • "text.js" is not only a native requirejs lib, but also a requirejs-plugin. We use <resource> tag - to declare a requirejs-plugin resource + to declare a requirejs-plugin resource
    • Notice how we use <depends> tag to declare dependencies - @@ -84,7 +85,6 @@ <module> <name>foo</name> <script> - <name>foo</name> <path>/path/foo.js</path> </script> <depends> diff --git a/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleRightClickPopupMenu.gtmpl b/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleRightClickPopupMenu.gtmpl index fc3c4ec45..a017e51ba 100644 --- a/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleRightClickPopupMenu.gtmpl +++ b/testsuite/webuibasedsamples/src/main/webapp/groovy/webui/component/UISampleRightClickPopupMenu.gtmpl @@ -11,8 +11,8 @@ String id = uicomponent.getParent().getId(); JavascriptManager jsmanager = _ctx.getRequestContext().getJavascriptManager(); - jsmanager.require("SHARED/webui-ext", "webuiExt") - .addScripts("webuiExt.UIRightClickPopupMenu.disableContextMenu('"+id+"') ;"); + jsmanager.require("SHARED/uiRightClickPopupMenu", "uiRightClickPopupMenu") + .addScripts("uiRightClickPopupMenu.disableContextMenu('"+id+"') ;"); uicomponent.renderUIComponent(uiPopupMenu) ; } %>