[Erp5-report] r45723 ivan - in /erp5/trunk/bt5/erp5_xhtml_jquery_style: SkinTemplateItem/po...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 28 13:34:59 CEST 2011


Author: ivan
Date: Thu Apr 28 13:34:59 2011
New Revision: 45723

URL: http://svn.erp5.org?rev=45723&view=rev
Log:
Add two helper functions.

Modified:
    erp5/trunk/bt5/erp5_xhtml_jquery_style/SkinTemplateItem/portal_skins/erp5_xhtml_jquery_style/erp5.js.xml
    erp5/trunk/bt5/erp5_xhtml_jquery_style/bt/revision

Modified: erp5/trunk/bt5/erp5_xhtml_jquery_style/SkinTemplateItem/portal_skins/erp5_xhtml_jquery_style/erp5.js.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_xhtml_jquery_style/SkinTemplateItem/portal_skins/erp5_xhtml_jquery_style/erp5.js.xml?rev=45723&r1=45722&r2=45723&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_xhtml_jquery_style/SkinTemplateItem/portal_skins/erp5_xhtml_jquery_style/erp5.js.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_xhtml_jquery_style/SkinTemplateItem/portal_skins/erp5_xhtml_jquery_style/erp5.js.xml [utf8] Thu Apr 28 13:34:59 2011
@@ -159,7 +159,7 @@ function matchRightFieldset(element, ign
 \n
 function fixLeftRightHeightAndFocus(fix_height) {\n
   if (fix_height == 1) {\n
-    buildTables(document.getElementsByTagName(\'fieldset\'),\n
+     buildTables(document.getElementsByTagName(\'fieldset\'),\n
                 matchLeftFieldset, matchRightFieldset,\n
                 "fake");\n
   }\n
@@ -330,11 +330,46 @@ var rewriteIndentedSelect = function() {
   }\n
 }\n
 \n
+function queryStringToArray(query_string){\n
+  /*\n
+    Turn a query string into a "dictionary"\n
+  */\n
+  var final ={};\n
+  var b = query_string.split(\'&\');\n
+  $.each(b, function(x,y){\n
+    var temp = y.split(\'=\');\n
+    final[temp[0]] = temp[1];});\n
+  return final  \n
+}\n
+\n
+function submitLinkAsHtmlForm(event){\n
+  /*\n
+  Parse link into form arguments and pass everything as a \n
+  form (together with rest of page\'s input elements).\n
+  */\n
+  url = $(this).attr("href")\n
+  form = $("form")\n
+  method = url.substring(0, url.indexOf(\'?\'))\n
+  query_string = url.substring(url.indexOf(\'?\')+1)\n
+  params = queryStringToArray(query_string)\n
+  $.each(params, function(key, value) {\n
+    if (!$(\'*[name="\' + key + \'"]\').length){\n
+      // key not part of HTML namespace\n
+      form.append(\'<input type="hidden" name="\' + key+ \'" value="\' + value + \'">\');\n
+    }});\n
+  // submit form  \n
+  form.attr("action", method)\n
+  form.submit()\n
+  event.stopPropagation()  \n
+  return false;\n
+}\n
+\n
 if (navigator.userAgent.toLowerCase().indexOf(\'firefox\') != -1)\n
   $(document).ready(rewriteIndentedSelect);\n
 $(document).ready(resizeIFrameOnLoad);\n
 $(document).ready(addOnChangeEventHandler);\n
-$(document).ready(indexAllCheckBoxesAtBTInstallationOnLoad);
+$(document).ready(indexAllCheckBoxesAtBTInstallationOnLoad);\n
+
 
 ]]></string> </value>
         </item>

Modified: erp5/trunk/bt5/erp5_xhtml_jquery_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_xhtml_jquery_style/bt/revision?rev=45723&r1=45722&r2=45723&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_xhtml_jquery_style/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_xhtml_jquery_style/bt/revision [utf8] Thu Apr 28 13:34:59 2011
@@ -1 +1 @@
-16
\ No newline at end of file
+17
\ No newline at end of file



More information about the Erp5-report mailing list