comparison client/digitallibrary/jquery/jquery.digilib.js @ 849:2b7143c331c3 jquery

first step towards zoom arrows
author hertzhaft
date Tue, 08 Mar 2011 09:07:07 +0100
parents 8aa2891583f1
children 34b20eec036b
comparison
equal deleted inserted replaced
848:a43810d16ee5 849:2b7143c331c3
226 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","help","reset","toggleoptions"], 226 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","help","reset","toggleoptions"],
227 'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","scale","lessoptions"], 227 'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","scale","lessoptions"],
228 'buttonSets' : ['standardSet', 'specialSet'] 228 'buttonSets' : ['standardSet', 'specialSet']
229 } 229 }
230 }, 230 },
231 // arrow overlays for moving the zoomed area
232 'zoomArrows' : true,
233 // zoom arrow image info
234 'zoomArrowImg' : {
235 // path to arrow images (must end with a slash)
236 'imagePath' : 'img/',
237 // minimal width of the arrow bar (pixel)
238 'minwidth' : 6,
239 // image file names
240 'up' : 'up.png',
241 'down' : 'down.png',
242 'left' : 'left.png',
243 'right' : 'right.png'
244 },
231 // number of visible button groups 245 // number of visible button groups
232 'visibleButtonSets' : 1, 246 'visibleButtonSets' : 1,
233 // is the "about" window shown? 247 // is the "about" window shown?
234 'isAboutDivVisible' : false, 248 'isAboutDivVisible' : false,
235 // default size of background image for drag-scroll (same as Bird's Eye View image) 249 // default size of background image for drag-scroll (same as Bird's Eye View image)
237 'bgImgHeight' : 200, 251 'bgImgHeight' : 200,
238 // maximum width or height of background image for drag-scroll 252 // maximum width or height of background image for drag-scroll
239 'maxBgSize' : 10000, 253 'maxBgSize' : 10000,
240 // parameters used by background image 254 // parameters used by background image
241 'bgImgParams' : ['fn','pn','dw','dh','mo','rot'], 255 'bgImgParams' : ['fn','pn','dw','dh','mo','rot'],
242 // space to be left free in full page display, default value is for scrollbar 256 // reserved space in full page display (default value accounts for vertical scrollbar)
243 'scalerInset' : 10 257 'scalerInset' : 10
244 }; 258 };
245 259
246 // list of plugins 260 // list of plugins
247 var plugins = {}; 261 var plugins = {};
309 delete cp.pn; 323 delete cp.pn;
310 $.extend(params, cp); 324 $.extend(params, cp);
311 } 325 }
312 } 326 }
313 } 327 }
314 // store $(this) element in data, needs a deep copy 328 // setup $elem.data, needs "deep copy" because of nesting
315 elemSettings = $.extend(true, {}, settings, params); 329 elemSettings = $.extend(true, {}, settings, params);
316 data = { 330 data = {
331 // let $(this) know about $(this) :-)
317 $elem : $elem, 332 $elem : $elem,
333 // let $elem have its own copy of settings
318 settings : elemSettings, 334 settings : elemSettings,
335 // and of the URL query parameters
319 queryParams : params, 336 queryParams : params,
320 // TODO: move plugins reference out of data 337 // TODO: move plugins reference out of data
321 plugins : plugins 338 plugins : plugins
322 }; 339 };
323 // store in jQuery data element 340 // store in jQuery data element
367 // create HTML structure for scaler, taking width of buttons div into account 384 // create HTML structure for scaler, taking width of buttons div into account
368 setupScalerDiv(data); 385 setupScalerDiv(data);
369 highlightButtons(data); 386 highlightButtons(data);
370 // about window creation - TODO: could be deferred? restrict to only one item? 387 // about window creation - TODO: could be deferred? restrict to only one item?
371 setupAboutDiv(data); 388 setupAboutDiv(data);
389 // arrow overlays for moving zoomed detail
390 setupZoomArrows(data);
372 // send setup event 391 // send setup event
373 $(data).trigger('setup'); 392 $(data).trigger('setup');
374 }); 393 });
375 }, 394 },
376 395
1050 data.$buttonSets[buttonSetIdx] = $buttonsDiv; 1069 data.$buttonSets[buttonSetIdx] = $buttonsDiv;
1051 } 1070 }
1052 return $buttonsDiv; 1071 return $buttonsDiv;
1053 }; 1072 };
1054 1073
1074 // creates arrow overlays for moving the zoomed area
1075 var setupZoomArrows = function (data) {
1076 var $elem = data.$elem;
1077 var settings = data.settings;
1078 var show = settings.zoomArrows;
1079 console.log('zoom arrows:', show);
1080 if (!show) return;
1081 };
1082
1055 // creates HTML structure for the about view in elem 1083 // creates HTML structure for the about view in elem
1056 var setupAboutDiv = function (data) { 1084 var setupAboutDiv = function (data) {
1057 var $elem = data.$elem; 1085 var $elem = data.$elem;
1058 var settings = data.settings; 1086 var settings = data.settings;
1059 var $aboutDiv = $('<div class="about" style="display:none"/>'); 1087 var $aboutDiv = $('<div class="about" style="display:none"/>');