comparison client/digitallibrary/jquery/jquery.digilib.js @ 641:8f40f7b6fd20 jquery

some small aboutdiv fixes
author hertzhaft
date Wed, 19 Jan 2011 15:53:08 +0100
parents fcb887110471
children c108607e1bc0
comparison
equal deleted inserted replaced
640:fcb887110471 641:8f40f7b6fd20
225 // create HTML structure 225 // create HTML structure
226 setupScalerDiv(data); 226 setupScalerDiv(data);
227 setupButtons(data, 'actionsStandard'); 227 setupButtons(data, 'actionsStandard');
228 // bird's eye view creation 228 // bird's eye view creation
229 if (settings.isBirdDivVisible) { 229 if (settings.isBirdDivVisible) {
230 setupBirdDiv(data); 230 setupBirdDiv(data);
231 } 231 }
232 // about window creation - TODO: could be deferred? restrict to only one item? 232 // about window creation - TODO: could be deferred? restrict to only one item?
233 setupAboutDiv(data); 233 setupAboutDiv(data);
234 }); 234 });
235 }, 235 },
292 } 292 }
293 }; 293 };
294 294
295 // sets a key to a value (relative values with +/- if relative=true) 295 // sets a key to a value (relative values with +/- if relative=true)
296 var setNumValue = function(settings, key, value) { 296 var setNumValue = function(settings, key, value) {
297 if (isNumber(value)) return settings[key] = value;
297 var sign = value.substring(0,1); 298 var sign = value.substring(0,1);
298 if (sign === '+' || sign === '-') { 299 if (sign === '+' || sign === '-') {
299 if (settings[key] == null) { 300 if (settings[key] == null) {
300 // this doesn't make much sense but still... 301 // this doesn't make much sense but still...
301 settings[key] = 0; 302 settings[key] = 0;
619 // display marks 620 // display marks
620 renderMarks(data); 621 renderMarks(data);
621 // show birds eye view 622 // show birds eye view
622 //showDiv(settings.isBirdDivVisible); 623 //showDiv(settings.isBirdDivVisible);
623 //digilib.showArrows(); // show arrow overlays for zoom navigation 624 //digilib.showArrows(); // show arrow overlays for zoom navigation
624 // done -- hide about div 625 // done -- hide about div ---
625 settings.isAboutDivVisible = showDiv(null, data.$aboutDiv, 0); 626 // --- why? This only leads to suprise effects when displayed programmatically
627 // settings.isAboutDivVisible = showDiv(null, data.$aboutDiv, 0);
626 }; 628 };
627 }; 629 };
628 630
629 // place marks on the image 631 // place marks on the image
630 var renderMarks = function (data) { 632 var renderMarks = function (data) {
641 $mark.offset({ left : mpos.x, top : mpos.y}); 643 $mark.offset({ left : mpos.x, top : mpos.y});
642 } 644 }
643 } 645 }
644 }; 646 };
645 647
648 // auxiliary function (from Douglas Crockford, A.10)
649 var isNumber = function isNumber(value) {
650 return typeof value === 'number' && isFinite(value);
651 };
652
646 // auxiliary function to crop senseless precision 653 // auxiliary function to crop senseless precision
647 var cropFloat = function (x) { 654 var cropFloat = function (x) {
648 return parseInt(10000 * x, 10) / 10000; 655 return parseInt(10000 * x, 10) / 10000;
649 }; 656 };
650 657