[Erp5-report] r39255 rafael - in /erp5/trunk/bt5/tiolive_base: SkinTemplateItem/portal_skin...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 15 20:00:06 CEST 2010


Author: rafael
Date: Fri Oct 15 20:00:05 2010
New Revision: 39255

URL: http://svn.erp5.org?rev=39255&view=rev
Log:
Get javascript from portal_wizard to enable documentation gadget.

The usage of portal_wizard for this is deprecated for this propose and will be removed soon.

Added:
    erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_getJavaScriptRelativeUrlList.xml
    erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousAdvertisementGadget.xml
    erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousDocumentationGadget.xml
    erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/erp5_tabber.js.xml
Modified:
    erp5/trunk/bt5/tiolive_base/bt/revision

Added: erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_getJavaScriptRelativeUrlList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_getJavaScriptRelativeUrlList.xml?rev=39255&view=auto
==============================================================================
--- erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_getJavaScriptRelativeUrlList.xml (added)
+++ erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_getJavaScriptRelativeUrlList.xml [utf8] Fri Oct 15 20:00:05 2010
@@ -0,0 +1,132 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string># This script returns an iterable of the paths to standard JavaScript objects.\n
+# If you want to customize your own site, please override this script\n
+# in your own skin folder. Note that the returned items must be\n
+# relative URLs instead of absolute URLs, i.e. they must be traversable\n
+# from the portal object. This is required for further processing of JavaScript\n
+# data, e.g. compression.\n
+#\n
+# BBB: For the history, erp5_xhtml_appearance.js is included by default when\n
+#      js_list is not pre-defined before the global definitions.\n
+\n
+js_list = (\'MochiKit/MochiKit.js\',\n
+           \'erp5_knowledge_box.js\',\n
+           \'erp5.js\',\n
+           \'portal_wizard/proxy/web_site_module/express_frame/express_advertisement.js\',)\n
+return js_list\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>js_list</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_getJavaScriptRelativeUrlList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousAdvertisementGadget.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousAdvertisementGadget.xml?rev=39255&view=auto
==============================================================================
--- erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousAdvertisementGadget.xml (added)
+++ erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousAdvertisementGadget.xml [utf8] Fri Oct 15 20:00:05 2010
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<div class=\'gadget_advertisement\'><!-- Advertisement--></div>\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_viewAnonymousAdvertisementGadget</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousDocumentationGadget.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousDocumentationGadget.xml?rev=39255&view=auto
==============================================================================
--- erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousDocumentationGadget.xml (added)
+++ erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/ERP5Site_viewAnonymousDocumentationGadget.xml [utf8] Fri Oct 15 20:00:05 2010
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+<div class=\'gadget_documentation\'><!-- Documentation Gadget --></div>\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_viewAnonymousDocumentationGadget</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/erp5_tabber.js.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/erp5_tabber.js.xml?rev=39255&view=auto
==============================================================================
--- erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/erp5_tabber.js.xml (added)
+++ erp5/trunk/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/erp5_tabber.js.xml [utf8] Fri Oct 15 20:00:05 2010
@@ -0,0 +1,196 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Cacheable__manager_id</string> </key>
+            <value> <string>http_cache</string> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+var loading_deferred = undefined;\n
+\n
+function replaceContent(req) {\n
+  if (loading_deferred) {\n
+    loading_deferred.cancel();\n
+    loading_deferred = undefined;\n
+  }\n
+  //var container = $(\'container\');\n
+  var container = MochiKit.DOM.getElement("container");\n
+  container.innerHTML = req.responseText;\n
+\n
+  addOnClickEventsToTabs(req);\n
+}\n
+\n
+function showServerSideError(req) {\n
+  if (loading_deferred) {\n
+    loading_deferred.cancel();\n
+    loading_deferred = undefined;\n
+  }\n
+  //var container = $(\'container\');\n
+  var container = MochiKit.DOM.getElement("container");\n
+  container.innerHTML = \'Server side error.\';\n
+\n
+  addOnClickEventsToTabs(req);\n
+}\n
+\n
+function showLoadingMessage() {\n
+  //var container = $(\'container\');\n
+  var container = MochiKit.DOM.getElement("container");\n
+  container.innerHTML = \'<div><p style="text-align: left; vertical-align: middle; font-size: large;">Loading...</p></div>\';\n
+  loading_deferred = undefined;\n
+}\n
+\n
+function selectTab(e) {\n
+  //var tab_box = $(\'tab_box\');\n
+  //var item_list = tab_box.getElementsByTagName(\'li\');\n
+  var item_list = MochiKit.DOM.getElementsByTagAndClassName("li", null, "tab_box");\n
+  for (var i = 0; i < item_list.length; i++) {\n
+    var item = item_list[i];\n
+    //var node = item.getElementsByTagName(\'a\')[0];\n
+    var node = MochiKit.DOM.getFirstElementByTagAndClassName("a", null, item);\n
+    if (this == node) {\n
+      if (getNodeAttribute(item, \'class\') != \'selected\') {\n
+        MochiKit.DOM.setNodeAttribute(item, \'class\', \'selected\');\n
+      }\n
+      node.blur();\n
+    } else {\n
+      if (getNodeAttribute(item, \'class\') != \'non_selected\') {\n
+        MochiKit.DOM.setNodeAttribute(item, \'class\', \'non_selected\');\n
+      }\n
+    }\n
+    MochiKit.Signal.disconnectAll(node, \'onclick\');\n
+    MochiKit.Signal.connect(node, \'onclick\', function (e) { e.stop(); });\n
+  }\n
+\n
+  var mapping = {\n
+  <tal:block \n
+  tal:replace="structure python: \',\\n\'.join([\'%s: \\x22%s\\x22\' %(x[\'id\'], x[\'renderer\']) for x in context.ERP5Site_getTabList(add_all_tabs=1)])"></tal:block>\n
+  };\n
+\n
+  var url = mapping[this.parentNode.id];\n
+  var d = MochiKit.Async.doSimpleXMLHttpRequest(url);\n
+  d.addCallbacks(replaceContent, showServerSideError);\n
+  e.stop();\n
+\n
+  loading_deferred = MochiKit.Async.callLater(0.3, showLoadingMessage);\n
+\n
+  // Set a cookie.\n
+  document.cookie = \'erp5_site_selected_tab=\' + escape(this.parentNode.id);\n
+}\n
+<tal:block tal:define="portal python: context.getPortalObject();\n
+                       portal_url python: portal.absolute_url();\n
+                       witch_server_root python: portal.portal_preferences.getPreferredWitchToolServerRoot();\n
+                       site_url python: \'\\x22%s/portal_wizard/proxy/%s\\x22\' %(portal_url,witch_server_root)">\n
+  function showProductList() {\n
+    site_url = <tal:block tal:replace="site_url"></tal:block>;\n
+    var url = site_url+"/web_site_module/express_frame/ERP5Site_getExpressProductListFrame";\n
+    var d = doSimpleXMLHttpRequest(url);\n
+    d.addBoth(replaceContent)\n
+    loading_deferred = callLater(0.3, showLoadingMessage);\n
+  }\n
+\n
+  function showProduct(reference) {\n
+    site_url =  <tal:block tal:replace="site_url"></tal:block>;\n
+    var url = site_url+"/web_site_module/express_frame/ERP5Site_getExpressProductFrame?reference=";\n
+    url = url + reference;\n
+    var d = doSimpleXMLHttpRequest(url);\n
+    d.addBoth(replaceContent)\n
+    loading_deferred = callLater(0.3, showLoadingMessage);\n
+  }\n
+</tal:block>\n
+\n
+function addOnClickEventsToTabs(e) {\n
+  //var tab_box = $(\'tab_box\');\n
+  //var item_list = tab_box.getElementsByTagName(\'li\');\n
+  var item_list = MochiKit.DOM.getElementsByTagAndClassName("li", null, "tab_box");\n
+  for (var i = 0; i < item_list.length; i++) {\n
+    //connect(item_list[i], \'onclick\', function(e){e.stop();})\n
+    //var node = item_list[i].getElementsByTagName(\'a\')[0];\n
+    var node = MochiKit.DOM.getFirstElementByTagAndClassName("a", null, item_list[i]);\n
+    MochiKit.Signal.disconnectAll(node, \'onclick\');\n
+    MochiKit.Signal.connect(node, \'onclick\', selectTab);\n
+  }\n
+  return true;\n
+}\n
+\n
+connect(window, \'onload\', addOnClickEventsToTabs);\n
+\n
+function showProductOnLoad() {\n
+var tmp = window.location.search.substring(1).split("&");\n
+\n
+var GET = [];\n
+for (var i in tmp)\n
+  if (tmp[i].indexOf("=")!=-1)\n
+    GET[decodeURI(tmp[i].substring(0, tmp[i].indexOf("=")))] = decodeURI(tmp[i].substring(tmp[i].indexOf("=")+1));\n
+  else\n
+    GET[decodeURI(tmp[i])]=\'\';\n
+if (GET["jumptab"])\n
+  {\n
+    if (GET["reference"])\n
+      {\n
+       showProduct(GET["reference"]);\n
+      }\n
+    else\n
+      {\n
+        showProductList();\n
+      }\n
+  }\n
+}\n
+\n
+addLoadEvent(showProductOnLoad);
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>erp5_tabber.js</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/tiolive_base/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/tiolive_base/bt/revision?rev=39255&r1=39254&r2=39255&view=diff
==============================================================================
--- erp5/trunk/bt5/tiolive_base/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/tiolive_base/bt/revision [utf8] Fri Oct 15 20:00:05 2010
@@ -1 +1 @@
-77
\ No newline at end of file
+78
\ No newline at end of file




More information about the Erp5-report mailing list