global debug switch
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
|
||||
<script src="bower_components/jquery/dist/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="bower_components/KeyboardJS/dist/keyboard.min.js" charset="utf-8"></script>
|
||||
<script src="js/settings.js" charset="utf-8"></script>
|
||||
<script src="js/pages.js" charset="utf-8"></script>
|
||||
<script src="js/dist/main.min.js" charset="utf-8"></script>
|
||||
</body>
|
||||
|
||||
Vendored
+3
-2
@@ -7,7 +7,8 @@ $('li.active',_$railway).on('click',function(event){dp=$(this).attr('class').mat
|
||||
function nextPages(){var i=_active_pages_keys.indexOf(_current_dp_key)+1;if(i<=_active_pages_keys.length-1){_current_dp_key=_active_pages_keys[i];changePages();}};function prevPages(){var i=_active_pages_keys.indexOf(_current_dp_key)-1;if(i>=0){_current_dp_key=_active_pages_keys[i];changePages();}};function changePages(){console.log("changePages",_current_dp_key);$('li',_$railway).removeClass('current');if(typeof _ACTIVE_PAGES[_current_dp_key]!=="undefined"){_current_dp_ob=_ACTIVE_PAGES[_current_dp_key];updatePagesDisplay();updatePaginationDisplay();updateRailwayDisplay();updateHash();updatePagesOverlays();}};function updatePagesDisplay(){if(typeof _current_dp_ob[0].bg!=="undefined"){var pl=_current_dp_ob[0];_$page_left.css({'background-image':"url("+_bgs_prefix+pl.bg+")"}).removeClass(pageClassToRemove).addClass('page-'+pl.page);_$pagi_l_txt.text(pl.page);}else{_$page_left.css({'background-image':"none"});_$pagi_l_txt.text("");}
|
||||
if(typeof _current_dp_ob[1].bg!=="undefined"){var pr=_current_dp_ob[1];_$page_right.css({'background-image':"url("+_bgs_prefix+pr.bg+")"}).removeClass(pageClassToRemove).addClass('page-'+pr.page);_$pagi_r_txt.text(pr.page);}else{_$page_right.css({'background-image':"none"});_$pagi_r_txt.text("");}};function pageClassToRemove(){var c=$(this).attr('class').match(/page-+\d+/);if(c&&c.length)
|
||||
return c[0];};function updatePaginationDisplay(){var i=_active_pages_keys.indexOf(_current_dp_key);if(i==0){_$pagi_l_arrow.addClass('hidden');}else{_$pagi_l_arrow.removeClass('hidden')}
|
||||
if(i==_active_pages_keys.length-1){_$pagi_r_arrow.addClass('hidden');}else{_$pagi_r_arrow.removeClass('hidden')}};function updateRailwayDisplay(){$('li.double-page-'+_current_dp_key).addClass('current');};function updatePagesOverlays(){console.log("updatePagesOverlays");resetOverlays();var lr=0,p_ob,$p,map;for(var i in _current_dp_ob){p_ob=_current_dp_ob[i];console.log("p_ob",p_ob);$p=lr==0?_$maps_left:_$maps_right;for(var m in p_ob.overlays){map=p_ob.overlays[m];console.log('map',map);$p.append($('<div>').addClass("map").attr('overlay',map.over).attr('debug',map.debug).css({"left":map.x+"mm","top":map.y+"mm","width":map.w+"mm","height":map.h+"mm"}).bind("mouseover",function(e){$(this).parents('.page').find('.overlay').css({'background-image':'url(images/overlays/'+$(this).attr('overlay')+')'});}).bind("mouseout",function(e){$(this).parents('.page').find('.overlay').css({'background-image':'none'});}));}
|
||||
if(i==_active_pages_keys.length-1){_$pagi_r_arrow.addClass('hidden');}else{_$pagi_r_arrow.removeClass('hidden')}};function updateRailwayDisplay(){$('li.double-page-'+_current_dp_key).addClass('current');};function updatePagesOverlays(){console.log("updatePagesOverlays");resetOverlays();var lr=0,p_ob,$p,map;for(var i in _current_dp_ob){p_ob=_current_dp_ob[i];console.log("p_ob",p_ob);$p=lr==0?_$maps_left:_$maps_right;for(var m in p_ob.overlays){map=p_ob.overlays[m];console.log('map',map);$p.append($('<div>').addClass("map").attr('overlay',map.over).attr('debug',_SETTINGS.debug?map.debug:_SETTINGS.debug).css({"left":map.x+"mm","top":map.y+"mm","width":map.w+"mm","height":map.h+"mm"}).bind("mouseover",function(e){$(this).parents('.page').find('.overlay').css({'background-image':'url(images/overlays/'+$(this).attr('overlay')+')'});}).bind("mouseout",function(e){$(this).parents('.page').find('.overlay').css({'background-image':'none'});}));}
|
||||
lr++;}};function resetOverlays(){$('.overlay, .maps','.page').css({'background-image':'none'}).children().remove();}
|
||||
function initHashNav(){h=window.location.hash;console.log('hash',h);_current_dp_key=h.match(/^#(\d+)$/)[1];}
|
||||
function initHashNav(){console.log('initHashNav');h=window.location.hash;console.log('hash',h);if(h)
|
||||
_current_dp_key=h.match(/^#(\d+)$/)[1];}
|
||||
function updateHash(){window.location.hash=_current_dp_key;};function initkeyboard(){keyboardJS.bind('right',function(event){nextPages();});keyboardJS.bind('left',function(event){prevPages();});};function initPagination(){$('.wrapper-l .l',_$pagination).on('click',function(event){prevPages();});$('.wrapper-r .l',_$pagination).on('click',function(event){nextPages();});};init();});
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
var _SETTINGS={'debug':false};
|
||||
+4
-2
@@ -241,7 +241,7 @@ $(document).ready(function() {
|
||||
$('<div>')
|
||||
.addClass("map")
|
||||
.attr('overlay', map.over)
|
||||
.attr('debug', map.debug)
|
||||
.attr('debug', _SETTINGS.debug ? map.debug : _SETTINGS.debug)
|
||||
.css({
|
||||
"left":map.x+"mm",
|
||||
"top":map.y+"mm",
|
||||
@@ -277,9 +277,11 @@ $(document).ready(function() {
|
||||
// /_/ |_/_/ /_/\___/_/ /_/\____/_/ /____/
|
||||
|
||||
function initHashNav(){
|
||||
console.log('initHashNav');
|
||||
h = window.location.hash;
|
||||
console.log('hash',h);
|
||||
_current_dp_key = h.match(/^#(\d+)$/)[1];
|
||||
if(h)
|
||||
_current_dp_key = h.match(/^#(\d+)$/)[1];
|
||||
}
|
||||
|
||||
function updateHash(){
|
||||
|
||||
+1030
-84
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
var _SETTINGS={
|
||||
// global debug switch :
|
||||
// - false to hide all repers
|
||||
// - true to allow to diplay some repers
|
||||
'debug':true
|
||||
};
|
||||
Reference in New Issue
Block a user