# HG changeset patch # User robcast # Date 1295014875 -3600 # Node ID 1b6202aba26eb1a476fe7bf265a6cd78b4d8c5fa # Parent cd9f657d49facb9920fa92d9f916082d4972925a work on button creation (reinstated jquery-test) diff -r cd9f657d49fa -r 1b6202aba26e client/digitallibrary/jquery/jquery-test.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/jquery/jquery-test.html Fri Jan 14 15:21:15 2011 +0100 @@ -0,0 +1,55 @@ + + + + + Digilib jQuery Test HTML + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+ + + diff -r cd9f657d49fa -r 1b6202aba26e client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Fri Jan 14 13:47:30 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Fri Jan 14 15:21:15 2011 +0100 @@ -152,7 +152,7 @@ // button groups 'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","options"], 'buttonsSpecial' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","options"], - 'buttonsCustom' : [], + 'buttonsCustom' : [] }; // parameters from the query string @@ -190,6 +190,7 @@ } // create HTML structure setupScalerDiv($elem, elemSettings); + setupButtons($elem, elemSettings, 'buttonsStandard'); }); }, @@ -299,18 +300,16 @@ for (var i = 0; i < buttonNames.length; i++) { var buttonName = buttonNames[i]; var buttonConfig = settings.buttons[buttonName]; - var $button = buttondiv.append('
'); - $button - .attr('id', 'digilib-button-' + buttonName) - .bind('click', function(){ buttonConfig.onclick }) - .append('') - .attr('title', buttonConfig.toolTip ) - .append('') - .attr('src', settings.buttonsImagePath + buttonConfig.img); - }; - } + var $button = $buttonDiv.append('
'); + $button.addClass('digilib-button-' + buttonName); + var $link = $button.append(''); + $link.bind('click', buttonConfig.onclick) + .attr('title', buttonConfig.toolTip ); + var $img = $link.append(''); + $img.attr('src', settings.buttonsImagePath + buttonConfig.img); + }; + } return $buttonDiv; - } }; // hook plugin into jquery