[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_2RC1-1580-gf7ffcf8

Michal Čihař nijel at users.sourceforge.net
Tue Apr 13 13:40:23 CEST 2010


The branch, master has been updated
       via  f7ffcf89752a742c29dcb411b2006bf334867093 (commit)
       via  37aca1ec064eae332270c0a4e6220042fe307e0c (commit)
       via  4bc0c8aafe30ddc90980e6df8cbca95e137d43f3 (commit)
      from  71ff89c2feac8e2edde26d6d9d83fabf1c4c4742 (commit)


- Log -----------------------------------------------------------------
commit f7ffcf89752a742c29dcb411b2006bf334867093
Author: Michal Čihař <mcihar at novell.com>
Date:   Tue Apr 13 13:38:30 2010 +0200

    Convert new column checks to jQuery.

commit 37aca1ec064eae332270c0a4e6220042fe307e0c
Author: Michal Čihař <mcihar at novell.com>
Date:   Tue Apr 13 13:34:51 2010 +0200

    Convert PDF pages designer to use jQuery.

commit 4bc0c8aafe30ddc90980e6df8cbca95e137d43f3
Author: Michal Čihař <mcihar at novell.com>
Date:   Tue Apr 13 11:57:42 2010 +0200

    Convert to jQuery initialisation.

-----------------------------------------------------------------------

Summary of changes:
 js/functions.js |   68 ++++++++++++++++++++++++++++--------------------------
 pdf_pages.php   |    4 +-
 2 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index 2f15915..908ced2 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -702,13 +702,14 @@ function checkTableEditForm(theForm, fieldsCnt)
 
     for (i=0; i<fieldsCnt; i++)
     {
-        id = "field_" + i + "_2";
-        elm = getElement(id);
-        if (elm.value == 'VARCHAR' || elm.value == 'CHAR' || elm.value == 'BIT' || elm.value == 'VARBINARY' || elm.value == 'BINARY') {
-            elm2 = getElement("field_" + i + "_3");
-            val = parseInt(elm2.value);
-            elm3 = getElement("field_" + i + "_1");
-            if (isNaN(val) && elm3.value != "") {
+        id = "#field_" + i + "_2";
+        elm = $(id);
+        val = elm.val()
+        if (val == 'VARCHAR' || val == 'CHAR' || val == 'BIT' || val == 'VARBINARY' || val == 'BINARY') {
+            elm2 = $("#field_" + i + "_3");
+            val = parseInt(elm2.val());
+            elm3 = $("#field_" + i + "_1");
+            if (isNaN(val) && elm3.val() != "") {
                 elm2.select();
                 alert(PMA_messages['strNotNumber']);
                 elm2.focus();
@@ -914,7 +915,7 @@ function PMA_markRowsInit() {
         }
     }
 }
-window.onload=PMA_markRowsInit;
+$(document).ready(PMA_markRowsInit);
 
 /**
  * marks all rows and selects its first checkbox inside the given element
@@ -1421,8 +1422,8 @@ function getElement(e,f){
   * Refresh the WYSIWYG-PDF scratchboard after changes have been made
   */
 function refreshDragOption(e) {
-    myid = getElement(e);
-    if (myid.style.visibility == 'visible') {
+    var elm = $('#' + e);
+    if (elm.css('visibility') == 'visible') {
         refreshLayout();
     }
 }
@@ -1431,35 +1432,35 @@ function refreshDragOption(e) {
   * Refresh/resize the WYSIWYG-PDF scratchboard
   */
 function refreshLayout() {
-        myid = getElement('pdflayout');
+    var elm = $('#pdflayout')
+    var orientation = $('#orientation_opt').val();
+    var paper = $('#paper_opt').val();
 
-        if (document.pdfoptions.orientation.value == 'P') {
-            posa = 'x';
-            posb = 'y';
-        } else {
-            posa = 'y';
-            posb = 'x';
-        }
-
-        myid.style.width = pdfPaperSize(document.pdfoptions.paper.value, posa) + 'px';
-        myid.style.height = pdfPaperSize(document.pdfoptions.paper.value, posb) + 'px';
+    if (orientation == 'P') {
+        posa = 'x';
+        posb = 'y';
+    } else {
+        posa = 'y';
+        posb = 'x';
+    }
+    elm.css('width', pdfPaperSize(paper, posa) + 'px');
+    elm.css('height', pdfPaperSize(paper, posb) + 'px');
 }
 
 /**
   * Show/hide the WYSIWYG-PDF scratchboard
   */
 function ToggleDragDrop(e) {
-    myid = getElement(e);
-
-    if (myid.style.visibility == 'hidden') {
-        init();
-        myid.style.visibility = 'visible';
-        myid.style.display = 'block';
-        document.edcoord.showwysiwyg.value = '1';
+    var elm = $('#' + e);
+    if (elm.css('visibility') == 'hidden') {
+        PDFinit(); /* Defined in pdf_pages.php */
+        elm.css('visibility', 'visible');
+        elm.css('display', 'block');
+        $('#showwysiwyg').val('1')
     } else {
-        myid.style.visibility = 'hidden';
-        myid.style.display = 'none';
-        document.edcoord.showwysiwyg.value = '0';
+        elm.css('visibility', 'hidden');
+        elm.css('display', 'none');
+        $('#showwysiwyg').val('0')
     }
 }
 
@@ -1468,10 +1469,11 @@ function ToggleDragDrop(e) {
   * the fields inside the scratchboard.
   */
 function dragPlace(no, axis, value) {
+    var elm = $('#table_' + no);
     if (axis == 'x') {
-        getElement("table_" + no).style.left = value + 'px';
+        elm.css('left', value + 'px');
     } else {
-        getElement("table_" + no).style.top  = value + 'px';
+        elm.css('top', value + 'px');
     }
 }
 
diff --git a/pdf_pages.php b/pdf_pages.php
index b7f93c5..9227d74 100644
--- a/pdf_pages.php
+++ b/pdf_pages.php
@@ -381,7 +381,7 @@ foreach ($array_sh_page AS $key => $temp_sh_page) {
 </div>
 <script type="text/javascript">
 //<![CDATA[
-function init() {
+function PDFinit() {
     refreshLayout();
     myid = getElement('pdflayout');
     <?php echo $draginit; ?>
@@ -479,7 +479,7 @@ function resetDrag() {
         echo "\n" . '    </table>' . "\n";
 
         echo "\n" . '    <input type="hidden" name="c_table_rows" value="' . ($i + 1) . '" />';
-        echo ($cfg['WYSIWYG-PDF'] ? "\n" . '    <input type="hidden" name="showwysiwyg" value="' . ((isset($showwysiwyg) && $showwysiwyg == '1') ? '1' : '0') . '" />' : '');
+        echo ($cfg['WYSIWYG-PDF'] ? "\n" . '    <input type="hidden" id="showwysiwyg" name="showwysiwyg" value="' . ((isset($showwysiwyg) && $showwysiwyg == '1') ? '1' : '0') . '" />' : '');
         echo "\n" . '    <input type="checkbox" name="with_field_names" ' . (isset($with_field_names) ? 'checked="checked"' : ''). ' />' . $strColumnNames . '<br />';
         echo "\n" . '    <input type="submit" value="' . $strSave . '" />';
         echo "\n" . '</form>' . "\n\n";


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list