The branch, master has been updated via 1962e36e3370926917ed750eeddfa3ca03dfb52a (commit) via e808b244d72c2d8ab0120340489ec8fd5e35e92e (commit) via 5b1c85455c2ab8b8c96d1e6271eab6360c14eaea (commit) from 2c4c45a68d564b0e09602e9b29c1fdc99f1c1d16 (commit)
- Log ----------------------------------------------------------------- commit 1962e36e3370926917ed750eeddfa3ca03dfb52a Author: Piotr Przybylski piotrprz@gmail.com Date: Sat Jul 9 23:39:12 2011 +0200
Remove unused getElementsByClassName
commit e808b244d72c2d8ab0120340489ec8fd5e35e92e Author: Piotr Przybylski piotrprz@gmail.com Date: Sat Jul 9 23:38:29 2011 +0200
Remove unused addEvent and removeEvent
commit 5b1c85455c2ab8b8c96d1e6271eab6360c14eaea Author: Piotr Przybylski piotrprz@gmail.com Date: Sat Jul 9 23:31:58 2011 +0200
Simplify fractionReplace
-----------------------------------------------------------------------
Summary of changes: js/common.js | 72 ------------------------------------------------------ js/tbl_change.js | 17 +----------- 2 files changed, 2 insertions(+), 87 deletions(-)
diff --git a/js/common.js b/js/common.js index b3e996c..b595108 100644 --- a/js/common.js +++ b/js/common.js @@ -15,78 +15,6 @@ var querywindow = ''; var query_to_load = '';
/** - * attach a function to object event - * - * <code> - * addEvent(window, 'load', PMA_initPage); - * </code> - * @param object or id - * @param string event type (load, mouseover, focus, ...) - * @param function to be attached - */ -function addEvent(obj, type, fn) -{ - if (obj.attachEvent) { - obj['e' + type + fn] = fn; - obj[type + fn] = function() {obj['e' + type + fn](window.event);} - obj.attachEvent('on' + type, obj[type + fn]); - } else { - obj.addEventListener(type, fn, false); - } -} - -/** - * detach/remove a function from an object event - * - * @param object or id - * @param event type (load, mouseover, focus, ...) - * @param function naem of function to be attached - */ -function removeEvent(obj, type, fn) -{ - if (obj.detachEvent) { - obj.detachEvent('on' + type, obj[type + fn]); - obj[type + fn] = null; - } else { - obj.removeEventListener(type, fn, false); - } -} - -/** - * get DOM elements by html class - * - * @param string class_name - name of class - * @param node node - search only sub nodes of this node (optional) - * @param string tag - search only these tags (optional) - */ -function getElementsByClassName(class_name, node, tag) -{ - var classElements = new Array(); - - if (node == null) { - node = document; - } - if (tag == null) { - tag = '*'; - } - - var j = 0, teststr; - var els = node.getElementsByTagName(tag); - var elsLen = els.length; - - for (i = 0; i < elsLen; i++) { - if (els[i].className.indexOf(class_name) != -1) { - teststr = "," + els[i].className.split(" ").join(",") + ","; - if (teststr.indexOf("," + class_name + ",") != -1) { - classElements[j] = els[i]; - j++; - } - } - } - return classElements; -} - -/** * sets current selected db * * @param string db name diff --git a/js/tbl_change.js b/js/tbl_change.js index 8fc7eca..5e6ce84 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -70,21 +70,8 @@ function daysInFebruary (year){ //function to convert single digit to double digit function fractionReplace(num) { - num=parseInt(num); - var res="00"; - switch(num) - { - case 1:res= "01";break; - case 2:res= "02";break; - case 3:res= "03";break; - case 4:res= "04";break; - case 5:res= "05";break; - case 6:res= "06";break; - case 7:res= "07";break; - case 8:res= "08";break; - case 9:res= "09";break; - } - return res; + num = parseInt(num); + return num >= 1 && num <= 9 ? '0' + num : '00'; }
/* function to check the validity of date
hooks/post-receive