# HG changeset patch # User hertzhaft # Date 1329592491 -3600 # Node ID c3931ec5485fb963b78cc787240ec5acb3dab59c # Parent 168e8aa7e9a58e49055e3336906b28052ae65f44 write a console error when a button is not defined diff -r 168e8aa7e9a5 -r c3931ec5485f webapp/src/main/webapp/jquery/jquery-test-embedded.html --- a/webapp/src/main/webapp/jquery/jquery-test-embedded.html Sat Feb 18 19:57:04 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery-test-embedded.html Sat Feb 18 20:14:51 2012 +0100 @@ -12,7 +12,7 @@ /* padding for buttons and bird-div */ padding-right: 18px; padding-bottom: 100px; - /* width: 220px; */ + width: 220px; } div.svg { @@ -55,6 +55,7 @@ + diff -r 168e8aa7e9a5 -r c3931ec5485f webapp/src/main/webapp/jquery/jquery.digilib.buttons.js --- a/webapp/src/main/webapp/jquery/jquery.digilib.buttons.js Sat Feb 18 19:57:04 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.buttons.js Sat Feb 18 20:14:51 2012 +0100 @@ -79,7 +79,7 @@ }, rot : { onclick : "rotate", - //onclick : ["slider", "rot"], + onclick : ["slider", "rot"], tooltip : "rotate image", icon : "rotate.png" }, @@ -146,7 +146,6 @@ label : "Rotation angle", tooltip : "rotate image", icon : "rotate.png", - okcancel : true, 'min' : 0, 'max' : 360, 'start' : 90 @@ -155,7 +154,6 @@ label : "Brightness", tooltip : "set numeric value to be added", icon : "brightness.png", - okcancel : true, 'min' : -255, 'max' : 255, 'start' : 0 @@ -164,7 +162,6 @@ label : "Contrast", tooltip : "set numeric value to be multiplied", icon : "contrast.png", - okcancel : true, 'min' : -8, 'max' : 8, 'start' : 0 @@ -173,7 +170,6 @@ label : "Red value", tooltip : "set red value", icon : "rgb.png", - okcancel : false, 'min' : 0, 'max' : 255, 'start' : 127 @@ -183,7 +179,6 @@ label : "Green value", tooltip : "set green value", icon : "rgb.png", - okcancel : false, 'min' : 0, 'max' : 255, 'start' : 127 @@ -193,7 +188,6 @@ label : "Blue value", tooltip : "set blue value", icon : "rgb.png", - okcancel : false, 'min' : 0, 'max' : 255, 'start' : 127 @@ -662,6 +656,10 @@ imagePath = settings.digilibBaseUrl + '/jquery/' + imagePath; } var buttonConfig = settings.buttons[buttonName]; + if (buttonConfig == null) { + console.error('Could not create button: ' + buttonName); + return; + } // button properties var action = buttonConfig.onclick; var tooltip = buttonConfig.tooltip;