comparison client/digitallibrary/jquery/jquery.digilib.js @ 654:43d920645156 jquery

mirroring works now persist bird's eye view in clop=birdview
author robcast
date Sat, 22 Jan 2011 22:03:20 +0100
parents 2390d548ae0b
children 7694475609ed
comparison
equal deleted inserted replaced
653:2390d548ae0b 654:43d920645156
83 onclick : "removeMark", 83 onclick : "removeMark",
84 tooltip : "delete the last mark", 84 tooltip : "delete the last mark",
85 img : "delmark.png" 85 img : "delmark.png"
86 }, 86 },
87 hmir : { 87 hmir : {
88 onclick : "javascript:mirror('h')", 88 onclick : ["mirror", "h"],
89 tooltip : "mirror horizontally", 89 tooltip : "mirror horizontally",
90 img : "mirror-horizontal.png" 90 img : "mirror-horizontal.png"
91 }, 91 },
92 vmir : { 92 vmir : {
93 onclick : "javascript:mirror('v')", 93 onclick : ["mirror", "v"],
94 tooltip : "mirror vertically", 94 tooltip : "mirror vertically",
95 img : "mirror-vertical.png" 95 img : "mirror-vertical.png"
96 }, 96 },
97 rot : { 97 rot : {
98 onclick : "javascript:setParamWin('rot', 'Rotate (0..360) clockwise')", 98 onclick : "javascript:setParamWin('rot', 'Rotate (0..360) clockwise')",
185 'buttons' : buttons, 185 'buttons' : buttons,
186 // path to button images (must end with a slash) 186 // path to button images (must end with a slash)
187 'buttonsImagePath' : '../greyskin/', 187 'buttonsImagePath' : '../greyskin/',
188 // button groups 188 // button groups
189 //'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","options"], 189 //'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","options"],
190 'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","mark","delmark","back","fwd","page","bird","SEP","help","reset","options"], 190 'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","mark","delmark","hmir","vmir","back","fwd","page","bird","help","options"],
191 'buttonsSpecial' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","options"], 191 'buttonsSpecial' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","options"],
192 'buttonsCustom' : [], 192 'buttonsCustom' : [],
193 // is birdView shown? 193 // is birdView shown?
194 'isBirdDivVisible' : false, 194 'isBirdDivVisible' : false,
195 // dimensions of bird's eye window 195 // dimensions of bird's eye window
253 unpackParams(data); 253 unpackParams(data);
254 // create HTML structure 254 // create HTML structure
255 setupScalerDiv(data); 255 setupScalerDiv(data);
256 setupButtons(data, 'buttonsStandard'); 256 setupButtons(data, 'buttonsStandard');
257 // bird's eye view creation 257 // bird's eye view creation
258 if (settings.isBirdDivVisible) { 258 if (elemSettings.isBirdDivVisible) {
259 setupBirdDiv(data); 259 setupBirdDiv(data);
260 } 260 }
261 // about window creation - TODO: could be deferred? restrict to only one item? 261 // about window creation - TODO: could be deferred? restrict to only one item?
262 setupAboutDiv(data); 262 setupAboutDiv(data);
263 }); 263 });
353 353
354 // remove the last mark 354 // remove the last mark
355 removeMark : function (data) { 355 removeMark : function (data) {
356 data.marks.pop(); 356 data.marks.pop();
357 redisplay(data); 357 redisplay(data);
358 },
359
360 // mirror the image
361 mirror : function (data, mode) {
362 var flags = data.scalerFlags;
363 if (mode === 'h') {
364 if (flags.hmir) {
365 delete flags.hmir;
366 } else {
367 flags.hmir = 1;
368 }
369 } else {
370 if (flags.vmir) {
371 delete flags.vmir;
372 } else {
373 flags.vmir = 1;
374 }
375 }
376 redisplay(data);
358 } 377 }
359 378
360 }; 379 };
361 380
362 // returns parameters from page url 381 // returns parameters from page url
476 for (var i = 0; i < pa.length ; i++) { 495 for (var i = 0; i < pa.length ; i++) {
477 opts[pa[i]] = pa[i]; 496 opts[pa[i]] = pa[i];
478 } 497 }
479 } 498 }
480 data.dlOpts = opts; 499 data.dlOpts = opts;
500 // birdview option
501 if (opts.birdview) {
502 settings.isBirdDivVisible = 1;
503 }
481 }; 504 };
482 505
483 // put objects back into parameters 506 // put objects back into parameters
484 var packParams = function (data) { 507 var packParams = function (data) {
485 var settings = data.settings; 508 var settings = data.settings;
508 mo += ','; 531 mo += ',';
509 } 532 }
510 mo += f; 533 mo += f;
511 } 534 }
512 settings.mo = mo; 535 settings.mo = mo;
536 }
537 // digilib option birdview
538 if (settings.isBirdDivVisible) {
539 data.dlOpts.birdview = 1;
513 } 540 }
514 // digilib options 541 // digilib options
515 if (data.dlOpts) { 542 if (data.dlOpts) {
516 var clop = ''; 543 var clop = '';
517 for (var o in data.dlOpts) { 544 for (var o in data.dlOpts) {