From 153ac119af3bf49146c6cb1c948390deaa273b3c Mon Sep 17 00:00:00 2001 From: Gabriel von Heijne Date: Tue, 11 Dec 2012 12:39:03 +0100 Subject: [PATCH] [#113] Add new resources for the API driven maps Add 'map_for_project' and 'map_for_organisation' resources that produce a lean dataset for use with the API driven maps. The resources don't include any foreign key data except the locations and also excludes a number of long text fields. --- akvo/api/resources.py | 84 +++++++++++++++++++ ...a8490eec7ef52da368ee4ada57a71784bd45c2.js} | 2 +- akvo/mediaroot/akvo/js/src/akvo-maps.js | 3 +- akvo/scripts/asset_manager/map.py | 2 +- 4 files changed, 88 insertions(+), 3 deletions(-) rename akvo/mediaroot/akvo/js/build/{akvo_script_min_4382c3c6a13a12372c2f3f7a60b11486570d5c75.js => akvo_script_min_35a8490eec7ef52da368ee4ada57a71784bd45c2.js} (96%) diff --git a/akvo/api/resources.py b/akvo/api/resources.py index 5868f8100c..a5b7712511 100644 --- a/akvo/api/resources.py +++ b/akvo/api/resources.py @@ -38,10 +38,12 @@ 'LinkResource', 'OrganisationResource', 'OrganisationLocationResource', + 'OrganisationMapResource', 'PartnershipResource', 'ProjectResource', 'ProjectCommentResource', 'ProjectLocationResource', + 'ProjectMapResource', 'ProjectUpdateResource', 'UserResource', 'UserProfileResource', @@ -317,6 +319,41 @@ class Meta: ) +class OrganisationMapResource(ConditionalFullResource): + """ + a limited resource for delivering data to be used when creating maps + """ + locations = ConditionalFullToManyField('akvo.api.resources.OrganisationLocationResource', 'locations', null=True) + primary_location = fields.ToOneField('akvo.api.resources.OrganisationLocationResource', 'primary_location', full=True, null=True) + + class Meta: + allowed_methods = ['get'] + queryset = Organisation.objects.all() + resource_name = 'map_for_organisation' + include_absolute_url = True + + filtering = dict( + # other fields + iati_org_id = ALL, + name = ALL, + organisation_type = ALL, + # foreign keys + locations = ALL_WITH_RELATIONS, + partnerships = ALL_WITH_RELATIONS, + ) + + def dehydrate(self, bundle): + """ add thumbnails inline info for Organisation.logo + """ + bundle = super(OrganisationMapResource, self).dehydrate(bundle) + del bundle.data['description'] + bundle.data['logo'] = { + 'original': bundle.data['logo'], + 'thumbnails': get_extra_thumbnails(bundle.obj.logo), + } + return bundle + + class PartnershipResource(ConditionalFullResource): organisation = ConditionalFullToOneField('akvo.api.resources.OrganisationResource', 'organisation') project = ConditionalFullToOneField('akvo.api.resources.ProjectResource', 'project') @@ -430,6 +467,53 @@ class Meta: ) +class ProjectMapResource(ConditionalFullResource): + """ + a limited resource for delivering data to be used when creating maps + """ + locations = ConditionalFullToManyField('akvo.api.resources.ProjectLocationResource', 'locations') + primary_location = fields.ToOneField('akvo.api.resources.ProjectLocationResource', 'primary_location', full=True, null=True) + + class Meta: + allowed_methods = ['get'] + queryset = Project.objects.published() + resource_name = 'map_for_project' + include_absolute_url = True + + filtering = dict( + # other fields + status = ALL, + title = ALL, + budget = ALL, + funds = ALL, + funds_needed = ALL, + # foreign keys + benchmarks = ALL_WITH_RELATIONS, + budget_items = ALL_WITH_RELATIONS, + categories = ALL_WITH_RELATIONS, + goals = ALL_WITH_RELATIONS, + invoices = ALL_WITH_RELATIONS, + links = ALL_WITH_RELATIONS, + locations = ALL_WITH_RELATIONS, + partnerships = ALL_WITH_RELATIONS, + project_comments = ALL_WITH_RELATIONS, + project_updates = ALL_WITH_RELATIONS, + ) + + def dehydrate(self, bundle): + """ add thumbnails inline info for Project.current_image + """ + bundle = super(ProjectMapResource, self).dehydrate(bundle) + ignored_fields = ('goals_overview', 'current_status', 'project_plan', 'sustainability', 'background', 'project_rating', 'notes',) + for field in ignored_fields: + del bundle.data[field] + bundle.data['current_image'] = { + 'original': bundle.data['current_image'], + 'thumbnails': get_extra_thumbnails(bundle.obj.current_image), + } + return bundle + + class ProjectUpdateResource(ConditionalFullResource): project = ConditionalFullToOneField('akvo.api.resources.ProjectResource', 'project') user = ConditionalFullToOneField('akvo.api.resources.UserResource', 'user') diff --git a/akvo/mediaroot/akvo/js/build/akvo_script_min_4382c3c6a13a12372c2f3f7a60b11486570d5c75.js b/akvo/mediaroot/akvo/js/build/akvo_script_min_35a8490eec7ef52da368ee4ada57a71784bd45c2.js similarity index 96% rename from akvo/mediaroot/akvo/js/build/akvo_script_min_4382c3c6a13a12372c2f3f7a60b11486570d5c75.js rename to akvo/mediaroot/akvo/js/build/akvo_script_min_35a8490eec7ef52da368ee4ada57a71784bd45c2.js index cd05a58a6b..9850695ee8 100644 --- a/akvo/mediaroot/akvo/js/build/akvo_script_min_4382c3c6a13a12372c2f3f7a60b11486570d5c75.js +++ b/akvo/mediaroot/akvo/js/build/akvo_script_min_35a8490eec7ef52da368ee4ada57a71784bd45c2.js @@ -7,4 +7,4 @@ */ (function(){var e=false,h=/xyz/.test(function(){xyz;})?/\b__super\b/:/.*/,b=function(){},g=this;b.extend=function(n){var m=this.prototype;e=true;var l=new this();e=false;for(var k in n){if(k){l[k]=typeof n[k]=="function"&&typeof m[k]=="function"&&h.test(n[k])?(function(o,p){return function(){var r=this.__super;this.__super=m[o];var q=p.apply(this,arguments);this.__super=r;return q;};})(k,n[k]):n[k];}}function j(){if(!e&&this.__constructor){this.__constructor.apply(this,arguments);}}j.prototype=l;j.constructor=j;j.extend=arguments.callee;return j;};var f=b.extend({loop:function(l,k){var j=this;if(typeof l=="number"){l=new Array(l);}jQuery.each(l,function(){k.call(j,arguments[1],arguments[0]);});return l;},create:function(l,k){l=l||"div";var j=document.createElement(l);if(k){j.className=k;}return j;},getElements:function(j){var k={};this.loop(jQuery(j),this.proxy(function(l){this.push(l,k);}));return k;},setStyle:function(k,j){jQuery(k).css(j);return this;},getStyle:function(k,j,m){var l=jQuery(k).css(j);return m?this.parseValue(l):l;},cssText:function(j){var l=document.createElement("style");this.getElements("head")[0].appendChild(l);if(l.styleSheet){l.styleSheet.cssText=j;}else{var k=document.createTextNode(j);l.appendChild(k);}return this;},touch:function(l){var k=l.nextSibling;var j=l.parentNode;j.removeChild(l);if(k){j.insertBefore(l,k);}else{j.appendChild(l);}if(l.styleSheet&&l.styleSheet.imports.length){this.loop(l.styleSheet.imports,function(m){l.styleSheet.addImport(m.href);});}},loadCSS:function(j,m){var l=this.getElements('link[href="'+j+'"]').length;if(l){m.call(null);return l[0];}var k=this.create("link");k.rel="stylesheet";k.href=j;if(typeof m=="function"){this.wait(function(){return !!document.body;},function(){var n=this.create("div","galleria-container galleria-stage");this.moveOut(n);document.body.appendChild(n);var o=this.proxy(function(){var r="";var q;if(document.defaultView&&document.defaultView.getComputedStyle){q=document.defaultView.getComputedStyle(n,"");this.loop(q,function(s){r+=s+q.getPropertyValue(s);});}else{if(n.currentStyle){q=n.currentStyle;this.loop(q,function(s,t){r+=t+s;});}}return r;});var p=o();this.wait(function(){return o()!==p;},function(){document.body.removeChild(n);m.call(k);},function(){i.raise("Could not confirm theme CSS");},2000);});}g.setTimeout(this.proxy(function(){var n=this.getElements('link[rel="stylesheet"],style');if(n.length){n[0].parentNode.insertBefore(k,n[0]);}else{this.getElements("head")[0].appendChild(k);}if(i.IE){this.loop(n,function(o){this.touch(o);});}}),2);return k;},moveOut:function(j){return this.setStyle(j,{position:"absolute",left:"-10000px",display:"block"});},moveIn:function(j){return this.setStyle(j,{left:"0"});},reveal:function(j){return jQuery(j).show();},hide:function(j){return jQuery(j).hide();},mix:function(){return jQuery.extend.apply(jQuery,arguments);},proxy:function(k,j){if(typeof k!=="function"){return function(){};}j=j||this;return function(){return k.apply(j,Array.prototype.slice.call(arguments));};},listen:function(l,k,j){jQuery(l).bind(k,j);},forget:function(l,k,j){jQuery(l).unbind(k,j);},dispatch:function(k,j){jQuery(k).trigger(j);},clone:function(k,j){j=j||false;return jQuery(k).clone(j)[0];},removeAttr:function(k,j){this.loop(j.split(" "),function(l){jQuery(k).removeAttr(l);});},push:function(j,k){if(typeof k.length=="undefined"){k.length=0;}Array.prototype.push.call(k,j);return j;},width:function(k,j){return this.meassure(k,j,"Width");},height:function(k,j){return this.meassure(k,j,"Height");},meassure:function(l,k,o){var m=jQuery(l);var j=k?m["outer"+o](true):m[o.toLowerCase()]();if(i.QUIRK){var n=o=="Width"?["left","right"]:["top","bottom"];this.loop(n,function(p){j+=m.css("border-"+p+"-width").replace(/[^\d]/g,"")*1;j+=m.css("padding-"+p).replace(/[^\d]/g,"")*1;});}return j;},toggleClass:function(m,l,j){if(typeof j!=="undefined"){var k=j?"addClass":"removeClass";jQuery(m)[k](l);return this;}jQuery(m).toggleClass(l);return this;},hideAll:function(j){jQuery(j).find("*").hide();},animate:function(k,j){j.complete=this.proxy(j.complete);var l=jQuery(k);if(!l.length){return;}if(j.from){l.css(from);}l.animate(j.to,{duration:j.duration||400,complete:j.complete,easing:j.easing||"swing"});},wait:function(k,n,m,j){k=this.proxy(k);n=this.proxy(n);m=this.proxy(m);var l=new Date().getTime()+(j||3000);g.setTimeout(function(){if(k()){n();return false;}if(new Date().getTime()>=l){m();n();return false;}g.setTimeout(arguments.callee,2);},2);return this;},loadScript:function(l,o){var k=document.createElement("script");k.src=l;k.async=true;var j=false;var n=this;k.onload=k.onreadystatechange=function(){if(!j&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){j=true;if(typeof o=="function"){o.call(n,this);}k.onload=k.onreadystatechange=null;}};var m=document.getElementsByTagName("script")[0];m.parentNode.insertBefore(k,m);return this;},parseValue:function(k){if(typeof k=="number"){return k;}else{if(typeof k=="string"){var j=k.match(/\-?\d/g);return j&&j.constructor==Array?j.join("")*1:0;}else{return 0;}}}});var c=f.extend({__constructor:function(j){this.image=null;this.elem=this.create("div","galleria-image");this.setStyle(this.elem,{overflow:"hidden",position:"relative"});this.order=j;this.orig={w:0,h:0,r:1};},cache:{},ready:false,add:function(k){if(this.cache[k]){return this.cache[k];}var j=new Image();j.src=k;this.setStyle(j,{display:"block"});if(j.complete&&j.width){this.cache[k]=j;return j;}j.onload=(function(l){return function(){l.cache[k]=j;};})(this);return j;},isCached:function(j){return this.cache[j]?this.cache[j].complete:false;},make:function(k){var j=this.cache[k]||this.add(k);return this.clone(j);},load:function(j,k){k=this.proxy(k);this.elem.innerHTML="";this.image=this.make(j);this.moveOut(this.image);this.elem.appendChild(this.image);this.wait(function(){return(this.image.complete&&this.image.width);},function(){this.orig={h:this.h||this.image.height,w:this.w||this.image.width};k({target:this.image,scope:this});},function(){i.raise("image not loaded in 20 seconds: "+j);},20000);return this;},scale:function(k){var m=this.mix({width:0,height:0,min:undefined,max:undefined,margin:0,complete:function(){},position:"center",crop:false},k);if(!this.image){return this;}var l,j;this.wait(function(){l=m.width||this.width(this.elem);j=m.height||this.height(this.elem);return l&&j;},function(){var n=(l-m.margin*2)/this.orig.w;var q=(j-m.margin*2)/this.orig.h;var s={"true":Math.max(n,q),width:n,height:q,"false":Math.min(n,q)};var p=s[m.crop.toString()];if(m.max){p=Math.min(m.max,p);}if(m.min){p=Math.max(m.min,p);}this.setStyle(this.elem,{width:l,height:j});this.image.width=Math.ceil(this.orig.w*p);this.image.height=Math.ceil(this.orig.h*p);var r=this.proxy(function(y,x,w){var v=0;if(/\%/.test(y)){var z=parseInt(y)/100;v=Math.ceil(this.image[x]*-1*z+w*z);}else{v=parseInt(y);}return v;});var t={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};var u={};var o={};this.loop(m.position.toLowerCase().split(" "),function(w,v){if(w=="center"){w="50%";}u[v?"top":"left"]=w;});this.loop(u,function(w,v){if(t.hasOwnProperty(w)){o=this.mix(o,t[w]);}});u=u.top?this.mix(u,o):o;u=this.mix({top:"50%",left:"50%"},u);this.setStyle(this.image,{position:"relative",top:r(u.top,"height",j),left:r(u.left,"width",l)});this.ready=true;m.complete.call(this);});return this;}});var i=g.Galleria=f.extend({__constructor:function(l){this.theme=undefined;this.options=l;this.playing=false;this.playtime=5000;this.active=null;this.queue={};this.data={};this.dom={};var n=this.keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8},map:{},bound:false,press:this.proxy(function(q){var p=q.keyCode||q.which;if(n.map[p]&&typeof n.map[p]=="function"){n.map[p].call(this,q);}}),attach:this.proxy(function(r){for(var q in r){var p=q.toUpperCase();if(n.keys[p]){n.map[n.keys[p]]=r[q];}}if(!n.bound){n.bound=true;this.listen(document,"keydown",n.press);}}),detach:this.proxy(function(){n.bound=false;this.forget(document,"keydown",n.press);})};this.timeouts={trunk:{},add:function(u,t,s,q){q=q||false;this.clear(u);if(q){var r=this;var p=t;t=function(){p();r.add(u,t,s);};}this.trunk[u]=g.setTimeout(t,s);},clear:function(q){if(q&&this.trunk[q]){g.clearTimeout(this.trunk[q]);delete this.trunk[q];}else{if(typeof q=="undefined"){for(var p in this.trunk){g.clearTimeout(this.trunk[p]);delete this.trunk[p];}}}}};this.controls={0:null,1:null,active:0,swap:function(){this.active=this.active?0:1;},getActive:function(){return this[this.active];},getNext:function(){return this[Math.abs(this.active-1)];}};var j=this.fullscreen={scrolled:0,enter:this.proxy(function(){this.toggleClass(this.get("container"),"fullscreen");j.scrolled=jQuery(g).scrollTop();this.loop(j.getElements(),function(r,q){j.styles[q]=r.getAttribute("style");r.removeAttribute("style");});this.setStyle(j.getElements(0),{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:10000});var p={height:"100%",overflow:"hidden",margin:0,padding:0};this.setStyle(j.getElements(1),p);this.setStyle(j.getElements(2),p);this.attachKeyboard({escape:this.exitFullscreen,right:this.next,left:this.prev});this.rescale(this.proxy(function(){this.trigger(i.FULLSCREEN_ENTER);}));this.listen(g,"resize",j.scale);}),scale:this.proxy(function(){this.rescale();}),exit:this.proxy(function(){this.toggleClass(this.get("container"),"fullscreen",false);if(!j.styles.length){return;}this.loop(j.getElements(),function(q,p){q.removeAttribute("style");q.setAttribute("style",j.styles[p]);});g.scrollTo(0,j.scrolled);this.detachKeyboard();this.rescale(this.proxy(function(){this.trigger(i.FULLSCREEN_EXIT);}));this.forget(g,"resize",j.scale);}),styles:[],getElements:this.proxy(function(q){var p=[this.get("container"),document.body,this.getElements("html")[0]];return q?p[q]:p;})};var m=this.idle={trunk:[],bound:false,add:this.proxy(function(s,r,q){if(!s){return;}if(!m.bound){m.addEvent();}s=jQuery(s);var t={};for(var p in r){t[p]=s.css(p);}s.data("idle",{from:t,to:r,complete:true,busy:false,fn:this.proxy(q)});m.addTimer();m.trunk.push(s);}),remove:this.proxy(function(p){p=jQuery(p);this.loop(m.trunk,function(r,q){if(r&&!r.not(p).length){m.show(p);m.trunk.splice(q,1);}});if(!m.trunk.length){m.removeEvent();this.clearTimer("idle");}}),addEvent:this.proxy(function(){m.bound=true;this.listen(this.get("container"),"mousemove click",m.showAll);}),removeEvent:this.proxy(function(){m.bound=false;this.forget(this.get("container"),"mousemove click",m.showAll);}),addTimer:this.proxy(function(){this.addTimer("idle",this.proxy(function(){m.hide();}),this.options.idle_time);}),hide:this.proxy(function(){this.trigger(i.IDLE_ENTER);this.loop(m.trunk,function(p){var q=p.data("idle");q.complete=false;q.fn();p.animate(q.to,{duration:600,queue:false,easing:"swing"});});}),showAll:this.proxy(function(){this.clearTimer("idle");this.loop(m.trunk,function(p){m.show(p);});}),show:this.proxy(function(p){var q=p.data("idle");if(!q.busy&&!q.complete){q.busy=true;this.trigger(i.IDLE_EXIT);p.animate(q.from,{duration:300,queue:false,easing:"swing",complete:function(){$(this).data("idle").busy=false;$(this).data("idle").complete=true;}});}m.addTimer();})};var o=this.lightbox={w:0,h:0,initialized:false,active:null,init:this.proxy(function(){if(o.initialized){return;}o.initialized=true;var p="lightbox-overlay lightbox-box lightbox-content lightbox-shadow lightbox-title lightbox-info lightbox-close lightbox-prev lightbox-next lightbox-counter";this.loop(p.split(" "),function(q){this.addElement(q);o[q.split("-")[1]]=this.get(q);});o.image=new Galleria.Picture();this.append({"lightbox-box":["lightbox-shadow","lightbox-content","lightbox-close"],"lightbox-info":["lightbox-title","lightbox-counter","lightbox-next","lightbox-prev"],"lightbox-content":["lightbox-info"]});document.body.appendChild(o.overlay);document.body.appendChild(o.box);o.content.appendChild(o.image.elem);o.close.innerHTML="×";o.prev.innerHTML="◄";o.next.innerHTML="►";this.listen(o.close,"click",o.hide);this.listen(o.overlay,"click",o.hide);this.listen(o.next,"click",o.showNext);this.listen(o.prev,"click",o.showPrev);if(this.options.lightbox_clicknext){this.setStyle(o.image.elem,{cursor:"pointer"});this.listen(o.image.elem,"click",o.showNext);}this.setStyle(o.overlay,{position:"fixed",display:"none",opacity:this.options.overlay_opacity,top:0,left:0,width:"100%",height:"100%",background:this.options.overlay_background,zIndex:99990});this.setStyle(o.box,{position:"fixed",display:"none",width:400,height:400,top:"50%",left:"50%",marginTop:-200,marginLeft:-200,zIndex:99991});this.setStyle(o.shadow,{background:"#000",opacity:0.4,width:"100%",height:"100%",position:"absolute"});this.setStyle(o.content,{backgroundColor:"#fff",position:"absolute",top:10,left:10,right:10,bottom:10,overflow:"hidden"});this.setStyle(o.info,{color:"#444",fontSize:"11px",fontFamily:"arial,sans-serif",height:13,lineHeight:"13px",position:"absolute",bottom:10,left:10,right:10,opacity:0});this.setStyle(o.close,{background:"#fff",height:20,width:20,position:"absolute",textAlign:"center",cursor:"pointer",top:10,right:10,lineHeight:"22px",fontSize:"16px",fontFamily:"arial,sans-serif",color:"#444",zIndex:99999});this.setStyle(o.image.elem,{top:10,left:10,right:10,bottom:30,position:"absolute"});this.loop("title prev next counter".split(" "),function(r){var q={display:"inline","float":"left"};if(r!="title"){this.mix(q,{"float":"right"});if(r!="counter"){this.mix(q,{cursor:"pointer"});}else{this.mix(q,{marginLeft:8});}}this.setStyle(o[r],q);});this.loop("prev next close".split(" "),function(q){this.listen(o[q],"mouseover",this.proxy(function(){this.setStyle(o[q],{color:"#000"});}));this.listen(o[q],"mouseout",this.proxy(function(){this.setStyle(o[q],{color:"#444"});}));});this.trigger(i.LIGHTBOX_OPEN);}),rescale:this.proxy(function(x){var p=Math.min(this.width(g),o.w);var t=Math.min(this.height(g),o.h);var u=Math.min((p-60)/o.w,(t-80)/o.h);var s=(o.w*u)+40;var v=(o.h*u)+60;var q={width:s,height:v,marginTop:Math.ceil(v/2)*-1,marginLeft:Math.ceil(s)/2*-1};if(!x){this.animate(o.box,{to:q,duration:this.options.lightbox_transition_speed,easing:"galleria",complete:function(){this.trigger({type:i.LIGHTBOX_IMAGE,imageTarget:o.image.image});this.moveIn(o.image.image);this.animate(o.image.image,{to:{opacity:1},duration:this.options.lightbox_fade_speed});this.animate(o.info,{to:{opacity:1},duration:this.options.lightbox_fade_speed});}});}else{this.setStyle(o.box,q);}}),hide:this.proxy(function(){o.image.image=null;this.forget(g,"resize",o.rescale);this.hide(o.box);this.setStyle(o.info,{opacity:0});this.animate(o.overlay,{to:{opacity:0},duration:200,complete:function(){this.hide(o.overlay);this.setStyle(o.overlay,{opacity:this.options.overlay_opacity});this.trigger(i.LIGHTBOX_CLOSE);}});}),showNext:this.proxy(function(){o.show(this.getNext(o.active));}),showPrev:this.proxy(function(){o.show(this.getPrev(o.active));}),show:this.proxy(function(p){if(!o.initialized){o.init();}this.forget(g,"resize",o.rescale);p=typeof p=="number"?p:this.getIndex();o.active=p;var r=this.getData(p);var q=this.data.length;this.setStyle(o.info,{opacity:0});o.image.load(r.image,function(s){o.w=s.scope.orig.w;o.h=s.scope.orig.h;this.setStyle(s.target,{width:"100.5%",height:"100.5%",top:0,zIndex:99998,opacity:0});o.title.innerHTML=r.title;o.counter.innerHTML=(p+1)+" / "+q;this.listen(g,"resize",o.rescale);o.rescale();});this.reveal(o.overlay);this.reveal(o.box);})};this.thumbnails={width:0};this.stageWidth=0;this.stageHeight=0;var k="container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description info-author thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter";k=k.split(" ");this.loop(k,function(p){this.dom[p]=this.create("div","galleria-"+p);});this.target=this.dom.target=l.target.nodeName?l.target:this.getElements(l.target)[0];if(!this.target){i.raise("Target not found.");}},init:function(){this.options=this.mix(i.theme.defaults,this.options);this.options=this.mix({autoplay:false,carousel:true,carousel_follow:true,carousel_speed:400,carousel_steps:"auto",clicknext:false,data_config:function(k){return{};},data_image_selector:"img",data_source:this.target,data_type:"auto",debug:false,extend:function(k){},height:"auto",idle_time:3000,image_crop:false,image_margin:0,image_pan:false,image_pan_smoothness:12,image_position:"50%",keep_source:false,lightbox_clicknext:true,lightbox_fade_speed:200,lightbox_transition_speed:300,link_source_images:true,max_scale_ratio:undefined,min_scale_ratio:undefined,on_image:function(l,k){},overlay_opacity:0.85,overlay_background:"#0b0b0b",popup_links:false,preload:2,queue:true,show:0,show_info:true,show_counter:true,show_imagenav:true,thumb_crop:true,thumb_fit:true,thumb_margin:0,thumb_quality:"auto",thumbnails:true,transition:i.transitions.fade,transition_speed:400},this.options);var j=this.options;this.bind(i.DATA,function(){this.run();});if(j.clicknext){this.loop(this.data,function(k){delete k.link;});this.setStyle(this.get("stage"),{cursor:"pointer"});this.listen(this.get("stage"),"click",this.proxy(function(){this.next();}));}this.bind(i.IMAGE,function(k){j.on_image.call(this,k.imageTarget,k.thumbTarget);});this.bind(i.READY,function(){if(i.History){i.History.change(this.proxy(function(k){var l=parseInt(k.value.replace(/\//,""));if(isNaN(l)){g.history.go(-1);}else{this.show(l,undefined,true);}}));}i.theme.init.call(this,j);j.extend.call(this,j);if(/^[0-9]{1,4}$/.test(d)&&i.History){this.show(d,undefined,true);}else{if(typeof j.show=="number"){this.show(j.show);}}if(j.autoplay){if(typeof j.autoplay=="number"){this.playtime=j.autoplay;}this.trigger(i.PLAY);this.playing=true;}});this.load();return this;},bind:function(k,j){this.listen(this.get("container"),k,this.proxy(j));return this;},unbind:function(j){this.forget(this.get("container"),j);},trigger:function(j){j=typeof j=="object"?this.mix(j,{scope:this}):{type:j,scope:this};this.dispatch(this.get("container"),j);return this;},addIdleState:function(){this.idle.add.apply(this,arguments);return this;},removeIdleState:function(){this.idle.remove.apply(this,arguments);return this;},enterIdleMode:function(){this.idle.hide();return this;},exitIdleMode:function(){this.idle.show();return this;},addTimer:function(){this.timeouts.add.apply(this.timeouts,arguments);return this;},clearTimer:function(){this.timeouts.clear.apply(this.timeouts,arguments);return this;},enterFullscreen:function(){this.fullscreen.enter.apply(this,arguments);return this;},exitFullscreen:function(){this.fullscreen.exit.apply(this,arguments);return this;},openLightbox:function(){this.lightbox.show.apply(this,arguments);},closeLightbox:function(){this.lightbox.hide.apply(this,arguments);},getActive:function(){return this.controls.getActive();},getActiveImage:function(){return this.getActive().image||null;},run:function(){var q=this.options;if(!this.data.length){i.raise("Data is empty.");}if(!q.keep_source&&!Galleria.IE){this.target.innerHTML="";}this.loop(2,function(){var o=new c();this.setStyle(o.elem,{position:"absolute",top:0,left:0});this.setStyle(this.get("images"),{position:"relative",top:0,left:0,width:"100%",height:"100%"});this.get("images").appendChild(o.elem);this.push(o,this.controls);},this);if(q.carousel){this.bind(i.THUMBNAIL,this.parseCarousel);}this.build();this.target.appendChild(this.get("container"));this.loop(["info","counter","image-nav"],function(o){if(q["show_"+o.replace(/-/,"")]===false){this.moveOut(this.get(o));}});var j=0;var n=0;for(var l=0;this.data[l];l++){var k;if(q.thumbnails===true){k=new c(l);var p=this.data[l].thumb||this.data[l].image;this.get("thumbnails").appendChild(k.elem);j=this.getStyle(k.elem,"width",true);n=this.getStyle(k.elem,"height",true);if(q.thumb_fit&&q.thum_crop!==true){this.setStyle(k.elem,{width:0,height:0});}k.load(p,this.proxy(function(o){var r=o.target.width;o.scope.scale({width:j,height:n,crop:q.thumb_crop,margin:q.thumb_margin,complete:this.proxy(function(){var t=["left","top"];var s=["Height","Width"];this.loop(s,function(u,w){if((!q.thumb_crop||q.thumb_crop==u.toLowerCase())&&q.thumb_fit){var v={};var x=s[Math.abs(w-1)].toLowerCase();v[x]=o.target[x];this.setStyle(o.target.parentNode,v);var v={};v[t[w]]=0;this.setStyle(o.target,v);}o.scope["outer"+u]=this[u.toLowerCase()](o.target.parentNode,true);});this.toggleQuality(o.target,q.thumb_quality===true||(q.thumb_quality=="auto"&&r0){this.setStyle(n,{top:Math.max(r*-1,Math.min(0,j))});}if(t>0){this.setStyle(n,{left:Math.max(t*-1,Math.min(0,k))});}});this.forget(this.get("stage"),"mousemove");this.listen(this.get("stage"),"mousemove",m);this.addTimer("pan",o,30,true);},removePan:function(){this.forget(this.get("stage"),"mousemove");this.clearTimer("pan");},parseCarousel:function(m){var k=0;var l=0;var j=[0];this.loop(this.thumbnails,function(n,o){if(n.ready){k+=n.outerWidth||this.width(n.elem,true);j[o+1]=k;l=Math.max(l,this.height(n.elem));}});this.toggleClass(this.get("thumbnails-container"),"galleria-carousel",k>this.stageWidth);this.setStyle(this.get("thumbnails-list"),{overflow:"hidden",position:"relative"});this.setStyle(this.get("thumbnails"),{width:k,height:l,position:"relative",overflow:"hidden"});if(!this.carousel){this.initCarousel();}this.carousel.max=k;this.carousel.hooks=j;this.carousel.width=this.width(this.get("thumbnails-list"));this.carousel.setClasses();},initCarousel:function(){var j=this.carousel={right:this.get("thumb-nav-right"),left:this.get("thumb-nav-left"),update:this.proxy(function(){this.parseCarousel();}),width:0,current:0,set:function(k){k=Math.max(k,0);while(j.hooks[k-1]+j.width>j.max&&k>=0){k--;}j.current=k;j.animate();},hooks:[],getLast:function(k){k=k||j.current;return k-1;},follow:function(k){if(k==0||k==j.hooks.length-2){j.set(k);return;}var l=j.current;while(j.hooks[l]-j.hooks[j.current]l){j.set(k-l+j.current+2);}}},max:0,setClasses:this.proxy(function(){this.toggleClass(j.left,"disabled",!j.current);this.toggleClass(j.right,"disabled",j.hooks[j.current]+j.width>j.max);}),animate:this.proxy(function(k){j.setClasses();this.animate(this.get("thumbnails"),{to:{left:j.hooks[j.current]*-1},duration:this.options.carousel_speed,easing:"galleria",queue:false});})};this.listen(j.right,"click",this.proxy(function(l){if(this.options.carousel_steps=="auto"){for(var k=j.current;kj.width){j.set(k-2);break;}}}else{j.set(j.current+this.options.carousel_steps);}}));this.listen(j.left,"click",this.proxy(function(l){if(this.options.carousel_steps=="auto"){for(var k=j.current;k>=0;k--){if(j.hooks[j.current]-j.hooks[k]>j.width){j.set(k+2);break;}else{if(k==0){j.set(0);break;}}}}else{j.set(j.current-this.options.carousel_steps);}}));},addElement:function(){this.loop(arguments,function(j){this.dom[j]=this.create("div","galleria-"+j);});return this;},getDimensions:function(j){return{w:j.width,h:j.height,cw:this.stageWidth,ch:this.stageHeight,top:(this.stageHeight-j.height)/2,left:(this.stageWidth-j.width)/2};},attachKeyboard:function(j){this.keyboard.attach(j);return this;},detachKeyboard:function(){this.keyboard.detach();return this;},build:function(){this.append({"info-text":["info-title","info-description","info-author"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info"]});this.current=this.create("span","current");this.current.innerHTML="-";this.get("counter").innerHTML=' / '+this.data.length+"";this.prependChild("counter",this.current);},appendChild:function(j,l){try{this.get(j).appendChild(this.get(l));}catch(k){}},prependChild:function(j,l){var l=this.get(l)||l;try{this.get(j).insertBefore(l,this.get(j).firstChild);}catch(k){}},remove:function(){var j=Array.prototype.slice.call(arguments);this.jQuery(j.join(",")).remove();},append:function(m){for(var l in m){if(m[l].constructor==Array){for(var k=0;m[l][k];k++){this.appendChild(l,m[l][k]);}}else{this.appendChild(l,m[l]);}}return this;},rescale:function(k,j,n){var m=this.options;n=this.proxy(n);if(typeof k=="function"){n=this.proxy(k);k=undefined;}var l=this.proxy(function(){this.stageWidth=k||this.width(this.get("stage"));this.stageHeight=j||this.height(this.get("stage"));this.controls.getActive().scale({width:this.stageWidth,height:this.stageHeight,crop:m.image_crop,max:m.max_scale_ratio,min:m.min_scale_ratio,margin:m.image_margin,position:m.image_position});if(this.carousel){this.carousel.update();}this.trigger(i.RESCALE);n();});if(i.WEBKIT&&!k&&!j){this.addTimer("scale",l,5);}else{l.call(this);}},show:function(k,j,l){if(!this.options.queue&&this.queue.stalled){return;}j=typeof j!="undefined"?!!j:k0){var k,q=this.getNext();try{for(var u=m.preload;u>0;u--){k=new c();k.add(this.getData(q).image);q=this.getNext(q);}}catch(x){}}this.trigger({type:i.LOADSTART,cached:r,index:w,imageTarget:v.image,thumbTarget:this.thumbnails[w].image});jQuery(this.thumbnails[w].elem).addClass("active").siblings(".active").removeClass("active");v.load(j,this.proxy(function(n){v.scale({width:this.stageWidth,height:this.stageHeight,crop:m.image_crop,max:m.max_scale_ratio,min:m.min_scale_ratio,margin:m.image_margin,position:m.image_position,complete:this.proxy(function(){if(s.image){this.toggleQuality(s.image,false);}this.toggleQuality(v.image,false);this.trigger({type:i.LOADFINISH,cached:r,index:w,imageTarget:v.image,thumbTarget:this.thumbnails[w].image});this.queue.stalled=true;var o=i.transitions[m.transition]||m.transition;this.removePan();this.setInfo(w);this.setCounter(w);if(typeof o=="function"){o.call(this,{prev:s.image,next:v.image,rewind:t,speed:m.transition_speed||400},l);}else{l();}})});}));},getNext:function(j){j=typeof j=="number"?j:this.active;return j==this.data.length-1?0:j+1;},getPrev:function(j){j=typeof j=="number"?j:this.active;return j===0?this.data.length-1:j-1;},next:function(){if(this.data.length>1){this.show(this.getNext(),false);}return this;},prev:function(){if(this.data.length>1){this.show(this.getPrev(),true);}return this;},get:function(j){return j in this.dom?this.dom[j]:null;},getData:function(j){return this.data[j]||this.data[this.active];},getIndex:function(){return typeof this.active==="number"?this.active:0;},play:function(j){this.trigger(i.PLAY);this.playing=true;this.playtime=j||this.playtime;this.playCheck();return this;},pause:function(){this.trigger(i.PAUSE);this.playing=false;return this;},playCheck:function(){var n=0;var k=20;var m=function(){return new Date().getTime();};var j=m();if(this.playing){this.clearTimer("play");var l=this.proxy(function(){n=m()-j;if(n>=this.playtime&&this.playing){this.clearTimer("play");this.next();return;}if(this.playing){this.trigger({type:i.PROGRESS,percent:Math.ceil(n/this.playtime*100),seconds:Math.floor(n/1000),milliseconds:n});this.addTimer("play",l,k);}});this.addTimer("play",l,k);}},setActive:function(j){this.active=j;return this;},setCounter:function(j){j=j||this.active;this.current.innerHTML=j+1;return this;},setInfo:function(j){var k=this.getData(j||this.active);this.loop(["title","description","author"],function(m){var n=this.get("info-"+m);var l=k[m]&&k[m].length?"reveal":"hide";this[l](n);if(k[m]){n.innerHTML=k[m];}});return this;},hasInfo:function(k){var m=this.getData(k);var j="title description author".split(" ");for(var l=0;j[l];l++){if(m[j[l]]&&m[j[l]].length){return true;}}return false;},getDataObject:function(k){var j={image:"",thumb:"",title:"",description:"",author:"",link:""};return k?this.mix(j,k):j;},jQuery:function(l){var j=[];this.loop(l.split(","),this.proxy(function(m){m=m.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.get(m)){j.push(m);}}));var k=jQuery(this.get(j.shift()));this.loop(j,this.proxy(function(m){k=k.add(this.get(m));}));return k;},$:function(j){return this.jQuery(j);},toggleQuality:function(j,k){if(!i.IE7||typeof j=="undefined"||!j){return this;}if(typeof k==="undefined"){k=j.style.msInterpolationMode=="nearest-neighbor";}j.style.msInterpolationMode=k?"bicubic":"nearest-neighbor";return this;},unload:function(){},load:function(){var l=0;var m=this.options;if((m.data_type=="auto"&&typeof m.data_source=="object"&&!(m.data_source instanceof jQuery)&&!m.data_source.tagName)||m.data_type=="json"||m.data_source.constructor==Array){this.data=m.data_source;this.trigger(i.DATA);}else{var k=jQuery(m.data_source).find(m.data_image_selector);var j=this.proxy(function(q){var p,o,n=q.parentNode;if(n&&n.nodeName=="A"){if(n.href.match(/\.(png|gif|jpg|jpeg)/i)){p=n.href;}else{o=n.href;}}var r=this.getDataObject({title:q.title,thumb:q.src,image:p||q.src,description:q.alt,link:o||q.getAttribute("longdesc"),elem:q});return this.mix(r,m.data_config(q));});this.loop(k,function(n){l++;this.push(j(n),this.data);if(!m.keep_source&&!Galleria.IE){n.parentNode.removeChild(n);}if(l==k.length){this.trigger(i.DATA);}});}}});i.log=function(){try{console.log.apply(console,Array.prototype.slice.call(arguments));}catch(j){try{opera.postError.apply(opera,arguments);}catch(k){alert(Array.prototype.join.call(arguments," "));}}};var a=navigator.userAgent.toLowerCase();var d=g.location.hash.replace(/#\//,"");i.DATA="data";i.READY="ready";i.THUMBNAIL="thumbnail";i.LOADSTART="loadstart";i.LOADFINISH="loadfinish";i.IMAGE="image";i.THEMELOAD="themeload";i.PLAY="play";i.PAUSE="pause";i.PROGRESS="progress";i.FULLSCREEN_ENTER="fullscreen_enter";i.FULLSCREEN_EXIT="fullscreen_exit";i.IDLE_ENTER="idle_enter";i.IDLE_EXIT="idle_exit";i.RESCALE="rescale";i.LIGHTBOX_OPEN="lightbox_open";i.LIGHTBOX_CLOSE="lightbox_cloe";i.LIGHTBOX_IMAGE="lightbox_image";i.IE8=(typeof(XDomainRequest)!=="undefined");i.IE7=!!(g.XMLHttpRequest&&document.expando);i.IE6=(!g.XMLHttpRequest);i.IE=!!(i.IE6||i.IE7);i.WEBKIT=/webkit/.test(a);i.SAFARI=/safari/.test(a);i.CHROME=/chrome/.test(a);i.QUIRK=(i.IE&&document.compatMode&&document.compatMode=="BackCompat");i.MAC=/mac/.test(navigator.platform.toLowerCase());i.OPERA=!!g.opera;i.Picture=c;i.addTheme=function(m){var l={};var n=["name","author","version","defaults","init"];var k=i.prototype;k.loop(n,function(o){if(!m[o]){i.raise(o+" not specified in theme.");}if(o!="name"&&o!="init"){l[o]=m[o];}});l.init=m.init;if(m.css){var j;k.loop(k.getElements("script"),function(p){var o=new RegExp("galleria."+m.name.toLowerCase()+".js");if(o.test(p.src)){j=p.src.replace(/[^\/]*$/,"")+m.css;k.loadCSS(j,function(){i.theme=l;jQuery(document).trigger(i.THEMELOAD);});}});if(!j){i.raise("No theme CSS loaded");}}return l;};i.raise=function(j){if(i.debug){throw new Error(j);}};i.loadTheme=function(j){i.prototype.loadScript(j);};i.galleries=[];i.get=function(j){if(i.galleries[j]){return i.galleries[j];}else{if(typeof j!=="number"){return i.galleries;}else{i.raise("Gallery index not found");}}};jQuery.easing.galleria=function(k,l,j,n,m){if((l/=m/2)<1){return n/2*l*l*l*l+j;}return -n/2*((l-=2)*l*l*l-2)+j;};i.transitions={add:function(j,k){if(j!=arguments.callee.name){this[j]=k;}},fade:function(k,j){jQuery(k.next).show().css("opacity",0).animate({opacity:1},k.speed,j);if(k.prev){jQuery(k.prev).css("opacity",1).animate({opacity:0},k.speed);}},flash:function(k,j){jQuery(k.next).css("opacity",0);if(k.prev){jQuery(k.prev).animate({opacity:0},(k.speed/2),function(){jQuery(k.next).animate({opacity:1},k.speed,j);});}else{jQuery(k.next).animate({opacity:1},k.speed,j);}},pulse:function(k,j){if(k.prev){jQuery(k.prev).css("opacity",0);}jQuery(k.next).css("opacity",0).animate({opacity:1},k.speed,j);},slide:function(n,k){var m=jQuery(n.next).parent();var j=this.$("images");var l=this.stageWidth;m.css({left:l*(n.rewind?-1:1)});j.animate({left:l*(n.rewind?1:-1)},{duration:n.speed,queue:false,easing:"galleria",complete:function(){j.css("left",0);m.css("left",0);k();}});},fadeslide:function(k,j){if(k.prev){jQuery(k.prev).css({opacity:1,left:0}).animate({opacity:0,left:50*(k.rewind?1:-1)},{duration:k.speed,queue:false,easing:"swing"});}jQuery(k.next).css({left:50*(k.rewind?-1:1),opacity:0}).animate({opacity:1,left:0},{duration:k.speed,complete:j,queue:false,easing:"swing"});}};i.addTransition=function(){i.transitions.add.apply(this,arguments);};jQuery.fn.galleria=function(k){k=k||{};var j=this.selector;return this.each(function(){if(!k.keep_source){jQuery(this).children().hide();}k=i.prototype.mix(k,{target:this});var l=i.prototype.height(this)||i.prototype.getStyle(this,"height",true);if(!k.height&&l){k=i.prototype.mix({height:l},k);}i.debug=!!k.debug;var m=new i(k);Galleria.galleries.push(m);if(i.theme){m.init();}else{jQuery(document).bind(i.THEMELOAD,function(){m.init();});}});};})(); /* jquery-ui-map rc1 | Johan S�ll Larsson */ -eval(function(h,b,j,f,g,i){g=function(a){return(a35?String.fromCharCode(a+29):a.toString(36));};if(!"".replace(/^/,String)){while(j--){i[g(j)]=f[j]||g(j);}f=[function(a){return i[a];}];g=function(){return"\\w+";};j=1;}while(j--){if(f[j]){h=h.replace(new RegExp("\\b"+g(j)+"\\b","g"),f[j]);}}return h;}('(3(d){d.a=3(a,b){j c=a.w(".")[0],a=a.w(".")[1];d[c]=d[c]||{};d[c][a]=3(a,b){K.I&&2.16(a,b)};d[c][a].J=d.n({1A:c,1z:a},b);d.S[a]=3(b){j g="1y"===1D b,f=H.J.12.15(K,1),i=2;l(g&&"1C"===b.1B(0,1))9 i;2.13(3(){j h=d.Z(2,a);h||(h=d.Z(2,a,k d[c][a](b,2)));l(g&&(h=h[b].10(h,f),"4"===b||o!=h))i=h});9 i}};d.a("1x.1t",{r:{1s:"1r",1w:5},1v:3(a,b){l(b)2.r[a]=b,2.4("8").B(a,b);P 9 2.r[a]},16:3(a,b){2.C=b;a=a||{};m.n(2.r,a,{1e:2.D(a.1e)});2.1c();2.1j&&2.1j()},1c:3(){j a=2;2.q={8:k 6.7.1u(a.C,a.r),L:[],t:[],u:[]};6.7.s.1N(a.q.8,"1M",3(){d(a.C).19("1L",a.q.8)});a.F(a.r.1Q,a.q.8)},1d:3(a){j b=2.4("1i",k 6.7.1P);b.n(2.D(a));2.4("8").1O(b)},1K:3(a){j b=2.4("8").1G();9 b?b.1F(a.18()):!1},1E:3(a,b){2.4("8").1J[b].O(2.z(a))},1I:3(a,b){a.8=2.4("8");a.Y=2.D(a.Y);j c=k(a.1H||6.7.1k)(a),e=2.4("L");c.V?e[c.V]=c:e.O(c);c.1i&&2.1d(c.18());2.F(b,a.8,c);9 d(c)},y:3(a){2.G(2.4(a));2.B(a,[])},G:3(a){A(j b R a)a.U(b)&&(a[b]p 6.7.T?(6.7.s.X(a[b]),a[b].x&&a[b].x(o)):a[b]p H&&2.G(a[b]),a[b]=o)},1p:3(a,b,c){a=2.4(a);b.v=d.1l(b.v)?b.v:[b.v];A(j e R a)l(a.U(e)){j g=!1,f;A(f R b.v)l(-1")){A(j e=a.14(/ /g,"").w(">"),d=0;d "+a,[]).O(c);9 d(c)},2p:3(a,b){(!b?2.4("t > E",k 6.7.E):2.4("t > E",k 6.7.E(b,a))).M(m.n({8:2.4("8")},a))},2b:3(a,b,c){2.4("t > "+a,k 6.7.1X(b,m.n({8:2.4("8")},c)))},1W:3(a,b,c){j d=2,g=2.4("u > 1f",k 6.7.1f),f=2.4("u > 1g",k 6.7.1g);b&&f.M(b);g.1Y(a,3(a,b){"20"===b?(f.1Z(a),f.x(d.4("8"))):f.x(o);c(a,b)})},1S:3(a,b){2.4("8").1R(2.4("u > 1a",k 6.7.1a(2.z(a),b)))},1T:3(a,b){2.4("u > 1b",k 6.7.1b).1V(a,b)}});m.S.n({17:3(a){6.7.s.19(2[0],a);9 2},W:3(a,b,c){6.7&&2[0]p 6.7.T?6.7.s.1U(2[0],a,b):c?2.1h(a,b,c):2.1h(a,b);9 2},27:3(a){6.7&&2[0]p 6.7.T?a?6.7.s.26(2[0],a):6.7.s.X(2[0]):2.28(a);9 2}});m.13("2a 29 22 21 23 25 24".w(" "),3(a,b){m.S[b]=3(a,d){9 2.W(b,a,d)}})})(m);',62,154,"||this|function|get||google|maps|map|return||||||||||var|new|if|jQuery|extend|null|instanceof|instance|options|event|overlays|services|value|split|setMap|clear|_unwrap|for|set|el|_latLng|FusionTablesLayer|_call|_c|Array|length|prototype|arguments|markers|setOptions|LatLng|push|else|iw|in|fn|MVCObject|hasOwnProperty|id|addEventListener|clearInstanceListeners|position|data|apply|operator|slice|each|replace|call|_setup|triggerEvent|getPosition|trigger|StreetViewPanorama|Geocoder|_create|addBounds|center|DirectionsService|DirectionsRenderer|bind|bounds|_init|Marker|isArray|AND|inArray|break|find|property|roadmap|mapTypeId|gmap|Map|option|zoom|ui|string|pluginName|namespace|substring|_|typeof|addControl|contains|getBounds|marker|addMarker|controls|inViewport|init|bounds_changed|addListenerOnce|fitBounds|LatLngBounds|callback|setStreetView|displayStreetView|search|addListener|geocode|displayDirections|KmlLayer|route|setDirections|OK|mouseover|dblclick|mouseout|dragend|drag|clearListeners|removeEventListener|unbind|rightclick|click|loadKML|close|closeInfoWindow|refresh|resize|getCenter|openInfoWindow|indexOf|infoWindow|open|InfoWindow|setCenter|Object|isFunction|loadFusion|addShape|destroy|removeData|name".split("|"),0,{}));this.Handlebars={};(function(c){c.VERSION="1.0.rc.1";c.helpers={};c.partials={};c.registerHelper=function(e,f,d){if(d){f.not=d;}this.helpers[e]=f;};c.registerPartial=function(d,e){this.partials[d]=e;};c.registerHelper("helperMissing",function(d){if(arguments.length===2){return undefined;}else{throw new Error("Could not find property '"+d+"'");}});var a=Object.prototype.toString,b="[object Function]";c.registerHelper("blockHelperMissing",function(g,f){var d=f.inverse||function(){},i=f.fn;var e="";var h=a.call(g);if(h===b){g=g.call(this);}if(g===true){return i(this);}else{if(g===false||g==null){return d(this);}else{if(h==="[object Array]"){if(g.length>0){return c.helpers.each(g,f);}else{return d(this);}}else{return i(g);}}}});c.K=function(){};c.createFrame=Object.create||function(d){c.K.prototype=d;var e=new c.K();c.K.prototype=null;return e;};c.registerHelper("each",function(k,g){var l=g.fn,d=g.inverse;var f="",m;if(g.data){m=c.createFrame(g.data);}if(k&&k.length>0){for(var h=0,e=k.length;h2){o.push("'"+this.terminals_[A]+"'");}}if(this.lexer.showPosition){C="Parse error on line "+(t+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+o.join(", ")+", got '"+(this.terminals_[F]||F)+"'";}else{C="Parse error on line "+(t+1)+": Unexpected "+(F==1?"end of input":"'"+(this.terminals_[F]||F)+"'");}this.parseError(C,{text:this.lexer.match,token:this.terminals_[F]||F,line:this.lexer.yylineno,loc:j,expected:o});}}if(E[0] instanceof Array&&E.length>1){throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+F);}switch(E[0]){case 1:n.push(F);I.push(this.lexer.yytext);u.push(this.lexer.yylloc);n.push(E[1]);F=null;if(!B){G=this.lexer.yyleng;i=this.lexer.yytext;t=this.lexer.yylineno;j=this.lexer.yylloc;if(k>0){k--;}}else{F=B;B=null;}break;case 2:H=this.productions_[E[1]][1];D.$=I[I.length-H];D._$={first_line:u[u.length-(H||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(H||1)].first_column,last_column:u[u.length-1].last_column};if(l){D._$.range=[u[u.length-(H||1)].range[0],u[u.length-1].range[1]];}v=this.performAction.call(D,i,G,t,this.yy,E[1],I,u);if(typeof v!=="undefined"){return v;}if(H){n=n.slice(0,-1*H*2);I=I.slice(0,-1*H);u=u.slice(0,-1*H);}n.push(this.productions_[E[1]][0]);I.push(D.$);u.push(D._$);h=J[n[n.length-2]][n[n.length-1]];n.push(h);break;case 3:return true;}}return true;}};var a=(function(){var k=({EOF:1,parseError:function m(p,o){if(this.yy.parser){this.yy.parser.parseError(p,o);}else{throw new Error(p);}},setInput:function(o){this._input=o;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0];}this.offset=0;return this;},input:function(){var p=this._input[0];this.yytext+=p;this.yyleng++;this.offset++;this.match+=p;this.matched+=p;var o=p.match(/(?:\r\n?|\n).*/g);if(o){this.yylineno++;this.yylloc.last_line++;}else{this.yylloc.last_column++;}if(this.options.ranges){this.yylloc.range[1]++;}this._input=this._input.slice(1);return p;},unput:function(q){var o=q.length;var p=q.split(/(?:\r\n?|\n)/g);this._input=q+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-o-1);this.offset-=o;var t=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(p.length-1){this.yylineno-=p.length-1;}var s=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===t.length?this.yylloc.first_column:0)+t[t.length-p.length].length-p[0].length:this.yylloc.first_column-o};if(this.options.ranges){this.yylloc.range=[s[0],s[0]+this.yyleng-o];}return this;},more:function(){this._more=true;return this;},less:function(o){this.unput(this.match.slice(o));},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"");},upcomingInput:function(){var o=this.match;if(o.length<20){o+=this._input.substr(0,20-o.length);}return(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"");},showPosition:function(){var o=this.pastInput();var p=new Array(o.length+1).join("-");return o+this.upcomingInput()+"\n"+p+"^";},next:function(){if(this.done){return this.EOF;}if(!this._input){this.done=true;}var u,s,p,r,q,o;if(!this._more){this.yytext="";this.match="";}var v=this._currentRules();for(var t=0;ts[0].length)){s=p;r=t;if(!this.options.flex){break;}}}if(s){o=s[0].match(/(?:\r\n?|\n).*/g);if(o){this.yylineno+=o.length;}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length};this.yytext+=s[0];this.match+=s[0];this.matches=s;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng];}this._more=false;this._input=this._input.slice(s[0].length);this.matched+=s[0];u=this.performAction.call(this,this.yy,this,v[r],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false;}if(u){return u;}else{return;}}if(this._input===""){return this.EOF;}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno});}},lex:function h(){var o=this.next();if(typeof o!=="undefined"){return o;}else{return this.lex();}},begin:function i(o){this.conditionStack.push(o);},popState:function n(){return this.conditionStack.pop();},_currentRules:function l(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;},topState:function(){return this.conditionStack[this.conditionStack.length-2];},pushState:function i(o){this.begin(o);}});k.options={};k.performAction=function j(s,p,r,o){var q=o;switch(r){case 0:if(p.yytext.slice(-1)!=="\\"){this.begin("mu");}if(p.yytext.slice(-1)==="\\"){p.yytext=p.yytext.substr(0,p.yyleng-1),this.begin("emu");}if(p.yytext){return 14;}break;case 1:return 14;break;case 2:if(p.yytext.slice(-1)!=="\\"){this.popState();}if(p.yytext.slice(-1)==="\\"){p.yytext=p.yytext.substr(0,p.yyleng-1);}return 14;break;case 3:return 24;break;case 4:return 16;break;case 5:return 20;break;case 6:return 19;break;case 7:return 19;break;case 8:return 23;break;case 9:return 23;break;case 10:p.yytext=p.yytext.substr(3,p.yyleng-5);this.popState();return 15;break;case 11:return 22;break;case 12:return 35;break;case 13:return 34;break;case 14:return 34;break;case 15:return 37;break;case 16:break;case 17:this.popState();return 18;break;case 18:this.popState();return 18;break;case 19:p.yytext=p.yytext.substr(1,p.yyleng-2).replace(/\\"/g,'"');return 29;break;case 20:p.yytext=p.yytext.substr(1,p.yyleng-2).replace(/\\"/g,'"');return 29;break;case 21:p.yytext=p.yytext.substr(1);return 27;break;case 22:return 31;break;case 23:return 31;break;case 24:return 30;break;case 25:return 34;break;case 26:p.yytext=p.yytext.substr(1,p.yyleng-2);return 34;break;case 27:return"INVALID";break;case 28:return 5;break;}};k.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];k.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],inclusive:false},emu:{rules:[2],inclusive:false},INITIAL:{rules:[0,1,28],inclusive:true}};return k;})();g.lexer=a;function e(){this.yy={};}e.prototype=g;g.Parser=e;return new e;})();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=handlebars;exports.Parser=handlebars.Parser;exports.parse=function(){return handlebars.parse.apply(handlebars,arguments);};exports.main=function commonjsMain(a){if(!a[1]){throw new Error("Usage: "+a[0]+" FILE");}var c,b;if(typeof process!=="undefined"){c=require("fs").readFileSync(require("path").resolve(a[1]),"utf8");}else{c=require("file").path(require("file").cwd()).join(a[1]).read({charset:"utf-8"});}return exports.parser.parse(c);};if(typeof module!=="undefined"&&require.main===module){exports.main(typeof process!=="undefined"?process.argv.slice(1):require("system").args);}}Handlebars.Parser=handlebars;Handlebars.parse=function(a){Handlebars.Parser.yy=Handlebars.AST;return Handlebars.Parser.parse(a);};Handlebars.print=function(a){return new Handlebars.PrintVisitor().accept(a);};Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(b,a){}};Handlebars.log=function(b,a){Handlebars.logger.log(b,a);};(function(){Handlebars.AST={};Handlebars.AST.ProgramNode=function(c,b){this.type="program";this.statements=c;if(b){this.inverse=new Handlebars.AST.ProgramNode(b);}};Handlebars.AST.MustacheNode=function(g,d,c){this.type="mustache";this.escaped=!c;this.hash=d;var f=this.id=g[0];var e=this.params=g.slice(1);var b=this.eligibleHelper=f.isSimple;this.isHelper=b&&(e.length||d);};Handlebars.AST.PartialNode=function(c,b){this.type="partial";this.id=c;this.context=b;};var a=function(b,c){if(b.original!==c.original){throw new Handlebars.Exception(b.original+" doesn't match "+c.original);}};Handlebars.AST.BlockNode=function(d,c,b,e){a(d.id,e);this.type="block";this.mustache=d;this.program=c;this.inverse=b;if(this.inverse&&!this.program){this.isInverse=true;}};Handlebars.AST.ContentNode=function(b){this.type="content";this.string=b;};Handlebars.AST.HashNode=function(b){this.type="hash";this.pairs=b;};Handlebars.AST.IdNode=function(f){this.type="ID";this.original=f.join(".");var d=[],g=0;for(var e=0,b=f.length;e":">",'"':""","'":"'","`":"`"};var d=/[&<>"'`]/g;var b=/[&<>"'`]/;var a=function(e){return c[e]||"&";};Handlebars.Utils={escapeExpression:function(e){if(e instanceof Handlebars.SafeString){return e.toString();}else{if(e==null||e===false){return"";}}if(!b.test(e)){return e;}return e.replace(d,a);},isEmpty:function(e){if(typeof e==="undefined"){return true;}else{if(e===null){return true;}else{if(e===false){return true;}else{if(Object.prototype.toString.call(e)==="[object Array]"&&e.length===0){return true;}else{return false;}}}}}};})();Handlebars.Compiler=function(){};Handlebars.JavaScriptCompiler=function(){};(function(g,f){g.prototype={compiler:g,disassemble:function(){var p=this.opcodes,o,m=[],r,q;for(var n=0,h=p.length;n0){this.source[1]=this.source[1]+", "+p.join(", ");}if(!this.isChild){var j=[];for(var n in this.context.aliases){this.source[1]=this.source[1]+", "+n+"="+this.context.aliases[n];}}if(this.source[1]){this.source[1]="var "+this.source[1].substring(2)+";";}if(!this.isChild){this.source[1]+="\n"+this.context.programs.join("\n")+"\n";}if(!this.environment.isSimple){this.source.push("return buffer;");}var q=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var m=0,h=this.environment.depths.list.length;mthis.stackVars.length){this.stackVars.push("stack"+this.stackSlot);}return"stack"+this.stackSlot;},popStack:function(){var h=this.compileStack.pop();if(h instanceof c){return h.value;}else{this.stackSlot--;return h;}},topStack:function(){var h=this.compileStack[this.compileStack.length-1];if(h instanceof c){return h.value;}else{return h;}},quotedString:function(h){return'"'+h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"';},setupHelper:function(k,i){var j=[];this.setupParams(k,j);var h=this.nameLookup("helpers",i,"helper");return{params:j,name:h,callParams:["depth0"].concat(j).join(", "),helperMissingParams:["depth0",this.quotedString(i)].concat(j).join(", ")};},setupParams:function(o,n){var k=[],p=[],m,h,j;k.push("hash:"+this.popStack());h=this.popStack();j=this.popStack();if(j||h){if(!j){this.context.aliases.self="this";j="self.noop";}if(!h){this.context.aliases.self="this";h="self.noop";}k.push("inverse:"+h);k.push("fn:"+j);}for(var l=0;l>0,x=arguments[2];while(w{{title}}{{#if thumb}}
{{/if}}');l=function(o,n){n.url=o.absolute_url;n.title=o.name;try{n.thumb=o.logo.thumbnails.map_thumb;}catch(p){n.thumb="";}return n;};g=function(o,n){n.url=o.absolute_url;n.title=o.title;try{n.thumb=o.current_image.thumbnails.map_thumb;}catch(p){n.thumb="";}return n;};$.each(j,function(p,o){if(i.object_id){$.each(o.locations,function(r,q){if(i.resource==="organisation"){q=l(o,q);}else{q=g(o,q);}f(m,q,h);});}else{var n;n=o.primary_location;if(n){if(i.resource==="organisation"){n=l(o,n);}else{n=g(o,n);}f(m,n,h);}}});if(isNaN(i.object)&&k.meta.next!==null){b(m,k.meta.next);}};f=function(k,h,i){var g,j;j=k.mapOpts;g=j.host+"rsr/media/core/img/";if(j.marker_icon){g=g+j.marker_icon;}else{if(j.resource==="organisation"){g=g+"redMarker.png";}else{g=g+"blueMarker.png";}}if(j.type==="static"||j.type==="small"){if(j.type==="static"){g=new google.maps.MarkerImage(g,null,null,null,new google.maps.Size(10.5,17));}$(k.mapElement).gmap("addMarker",{position:new google.maps.LatLng(h.latitude,h.longitude),clickable:false,icon:g,bounds:true});if($(k.mapElement).gmap("get","map").getZoom()>8){$(k.mapElement).gmap("get","map").setZoom(8);}}else{$(k.mapElement).gmap("addMarker",{position:new google.maps.LatLng(h.latitude,h.longitude),icon:g,bounds:true}).click(function(){$(k.mapElement).gmap("openInfoWindow",{content:i(h)},this);});}};b=function(k,i){var g=$.url(i),h=Handlebars.compile("{{host}}{{path}}?format=jsonp&depth=1&limit={{limit}}&offset={{offset}}&callback=?"),j=h({host:g.attr("host"),path:g.attr("path"),limit:Number(g.param("limit")),offset:Number(g.param("offset"))});$.getJSON(j,function(l){d(k,l);});};c=function(h){var g;if(h==="static"){g={draggable:false,mapTypeControl:false,navigationControl:true,scaleControl:false,scrollwheel:false,streetViewControl:false,zoom:0};}else{if(h==="small"){g={draggable:true,mapTypeControl:false,navigationControl:true,scaleControl:true,scrollwheel:false,streetViewControl:false,zoom:0};}else{g={draggable:true,mapTypeControl:true,navigationControl:true,scaleControl:true,scrollwheel:true,streetViewControl:false,zoom:2};}}return g;};}()); \ No newline at end of file +eval(function(h,b,j,f,g,i){g=function(a){return(a35?String.fromCharCode(a+29):a.toString(36));};if(!"".replace(/^/,String)){while(j--){i[g(j)]=f[j]||g(j);}f=[function(a){return i[a];}];g=function(){return"\\w+";};j=1;}while(j--){if(f[j]){h=h.replace(new RegExp("\\b"+g(j)+"\\b","g"),f[j]);}}return h;}('(3(d){d.a=3(a,b){j c=a.w(".")[0],a=a.w(".")[1];d[c]=d[c]||{};d[c][a]=3(a,b){K.I&&2.16(a,b)};d[c][a].J=d.n({1A:c,1z:a},b);d.S[a]=3(b){j g="1y"===1D b,f=H.J.12.15(K,1),i=2;l(g&&"1C"===b.1B(0,1))9 i;2.13(3(){j h=d.Z(2,a);h||(h=d.Z(2,a,k d[c][a](b,2)));l(g&&(h=h[b].10(h,f),"4"===b||o!=h))i=h});9 i}};d.a("1x.1t",{r:{1s:"1r",1w:5},1v:3(a,b){l(b)2.r[a]=b,2.4("8").B(a,b);P 9 2.r[a]},16:3(a,b){2.C=b;a=a||{};m.n(2.r,a,{1e:2.D(a.1e)});2.1c();2.1j&&2.1j()},1c:3(){j a=2;2.q={8:k 6.7.1u(a.C,a.r),L:[],t:[],u:[]};6.7.s.1N(a.q.8,"1M",3(){d(a.C).19("1L",a.q.8)});a.F(a.r.1Q,a.q.8)},1d:3(a){j b=2.4("1i",k 6.7.1P);b.n(2.D(a));2.4("8").1O(b)},1K:3(a){j b=2.4("8").1G();9 b?b.1F(a.18()):!1},1E:3(a,b){2.4("8").1J[b].O(2.z(a))},1I:3(a,b){a.8=2.4("8");a.Y=2.D(a.Y);j c=k(a.1H||6.7.1k)(a),e=2.4("L");c.V?e[c.V]=c:e.O(c);c.1i&&2.1d(c.18());2.F(b,a.8,c);9 d(c)},y:3(a){2.G(2.4(a));2.B(a,[])},G:3(a){A(j b R a)a.U(b)&&(a[b]p 6.7.T?(6.7.s.X(a[b]),a[b].x&&a[b].x(o)):a[b]p H&&2.G(a[b]),a[b]=o)},1p:3(a,b,c){a=2.4(a);b.v=d.1l(b.v)?b.v:[b.v];A(j e R a)l(a.U(e)){j g=!1,f;A(f R b.v)l(-1")){A(j e=a.14(/ /g,"").w(">"),d=0;d "+a,[]).O(c);9 d(c)},2p:3(a,b){(!b?2.4("t > E",k 6.7.E):2.4("t > E",k 6.7.E(b,a))).M(m.n({8:2.4("8")},a))},2b:3(a,b,c){2.4("t > "+a,k 6.7.1X(b,m.n({8:2.4("8")},c)))},1W:3(a,b,c){j d=2,g=2.4("u > 1f",k 6.7.1f),f=2.4("u > 1g",k 6.7.1g);b&&f.M(b);g.1Y(a,3(a,b){"20"===b?(f.1Z(a),f.x(d.4("8"))):f.x(o);c(a,b)})},1S:3(a,b){2.4("8").1R(2.4("u > 1a",k 6.7.1a(2.z(a),b)))},1T:3(a,b){2.4("u > 1b",k 6.7.1b).1V(a,b)}});m.S.n({17:3(a){6.7.s.19(2[0],a);9 2},W:3(a,b,c){6.7&&2[0]p 6.7.T?6.7.s.1U(2[0],a,b):c?2.1h(a,b,c):2.1h(a,b);9 2},27:3(a){6.7&&2[0]p 6.7.T?a?6.7.s.26(2[0],a):6.7.s.X(2[0]):2.28(a);9 2}});m.13("2a 29 22 21 23 25 24".w(" "),3(a,b){m.S[b]=3(a,d){9 2.W(b,a,d)}})})(m);',62,154,"||this|function|get||google|maps|map|return||||||||||var|new|if|jQuery|extend|null|instanceof|instance|options|event|overlays|services|value|split|setMap|clear|_unwrap|for|set|el|_latLng|FusionTablesLayer|_call|_c|Array|length|prototype|arguments|markers|setOptions|LatLng|push|else|iw|in|fn|MVCObject|hasOwnProperty|id|addEventListener|clearInstanceListeners|position|data|apply|operator|slice|each|replace|call|_setup|triggerEvent|getPosition|trigger|StreetViewPanorama|Geocoder|_create|addBounds|center|DirectionsService|DirectionsRenderer|bind|bounds|_init|Marker|isArray|AND|inArray|break|find|property|roadmap|mapTypeId|gmap|Map|option|zoom|ui|string|pluginName|namespace|substring|_|typeof|addControl|contains|getBounds|marker|addMarker|controls|inViewport|init|bounds_changed|addListenerOnce|fitBounds|LatLngBounds|callback|setStreetView|displayStreetView|search|addListener|geocode|displayDirections|KmlLayer|route|setDirections|OK|mouseover|dblclick|mouseout|dragend|drag|clearListeners|removeEventListener|unbind|rightclick|click|loadKML|close|closeInfoWindow|refresh|resize|getCenter|openInfoWindow|indexOf|infoWindow|open|InfoWindow|setCenter|Object|isFunction|loadFusion|addShape|destroy|removeData|name".split("|"),0,{}));this.Handlebars={};(function(c){c.VERSION="1.0.rc.1";c.helpers={};c.partials={};c.registerHelper=function(e,f,d){if(d){f.not=d;}this.helpers[e]=f;};c.registerPartial=function(d,e){this.partials[d]=e;};c.registerHelper("helperMissing",function(d){if(arguments.length===2){return undefined;}else{throw new Error("Could not find property '"+d+"'");}});var a=Object.prototype.toString,b="[object Function]";c.registerHelper("blockHelperMissing",function(g,f){var d=f.inverse||function(){},i=f.fn;var e="";var h=a.call(g);if(h===b){g=g.call(this);}if(g===true){return i(this);}else{if(g===false||g==null){return d(this);}else{if(h==="[object Array]"){if(g.length>0){return c.helpers.each(g,f);}else{return d(this);}}else{return i(g);}}}});c.K=function(){};c.createFrame=Object.create||function(d){c.K.prototype=d;var e=new c.K();c.K.prototype=null;return e;};c.registerHelper("each",function(k,g){var l=g.fn,d=g.inverse;var f="",m;if(g.data){m=c.createFrame(g.data);}if(k&&k.length>0){for(var h=0,e=k.length;h2){o.push("'"+this.terminals_[A]+"'");}}if(this.lexer.showPosition){C="Parse error on line "+(t+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+o.join(", ")+", got '"+(this.terminals_[F]||F)+"'";}else{C="Parse error on line "+(t+1)+": Unexpected "+(F==1?"end of input":"'"+(this.terminals_[F]||F)+"'");}this.parseError(C,{text:this.lexer.match,token:this.terminals_[F]||F,line:this.lexer.yylineno,loc:j,expected:o});}}if(E[0] instanceof Array&&E.length>1){throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+F);}switch(E[0]){case 1:n.push(F);I.push(this.lexer.yytext);u.push(this.lexer.yylloc);n.push(E[1]);F=null;if(!B){G=this.lexer.yyleng;i=this.lexer.yytext;t=this.lexer.yylineno;j=this.lexer.yylloc;if(k>0){k--;}}else{F=B;B=null;}break;case 2:H=this.productions_[E[1]][1];D.$=I[I.length-H];D._$={first_line:u[u.length-(H||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(H||1)].first_column,last_column:u[u.length-1].last_column};if(l){D._$.range=[u[u.length-(H||1)].range[0],u[u.length-1].range[1]];}v=this.performAction.call(D,i,G,t,this.yy,E[1],I,u);if(typeof v!=="undefined"){return v;}if(H){n=n.slice(0,-1*H*2);I=I.slice(0,-1*H);u=u.slice(0,-1*H);}n.push(this.productions_[E[1]][0]);I.push(D.$);u.push(D._$);h=J[n[n.length-2]][n[n.length-1]];n.push(h);break;case 3:return true;}}return true;}};var a=(function(){var k=({EOF:1,parseError:function m(p,o){if(this.yy.parser){this.yy.parser.parseError(p,o);}else{throw new Error(p);}},setInput:function(o){this._input=o;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0];}this.offset=0;return this;},input:function(){var p=this._input[0];this.yytext+=p;this.yyleng++;this.offset++;this.match+=p;this.matched+=p;var o=p.match(/(?:\r\n?|\n).*/g);if(o){this.yylineno++;this.yylloc.last_line++;}else{this.yylloc.last_column++;}if(this.options.ranges){this.yylloc.range[1]++;}this._input=this._input.slice(1);return p;},unput:function(q){var o=q.length;var p=q.split(/(?:\r\n?|\n)/g);this._input=q+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-o-1);this.offset-=o;var t=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(p.length-1){this.yylineno-=p.length-1;}var s=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===t.length?this.yylloc.first_column:0)+t[t.length-p.length].length-p[0].length:this.yylloc.first_column-o};if(this.options.ranges){this.yylloc.range=[s[0],s[0]+this.yyleng-o];}return this;},more:function(){this._more=true;return this;},less:function(o){this.unput(this.match.slice(o));},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"");},upcomingInput:function(){var o=this.match;if(o.length<20){o+=this._input.substr(0,20-o.length);}return(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"");},showPosition:function(){var o=this.pastInput();var p=new Array(o.length+1).join("-");return o+this.upcomingInput()+"\n"+p+"^";},next:function(){if(this.done){return this.EOF;}if(!this._input){this.done=true;}var u,s,p,r,q,o;if(!this._more){this.yytext="";this.match="";}var v=this._currentRules();for(var t=0;ts[0].length)){s=p;r=t;if(!this.options.flex){break;}}}if(s){o=s[0].match(/(?:\r\n?|\n).*/g);if(o){this.yylineno+=o.length;}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length};this.yytext+=s[0];this.match+=s[0];this.matches=s;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng];}this._more=false;this._input=this._input.slice(s[0].length);this.matched+=s[0];u=this.performAction.call(this,this.yy,this,v[r],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false;}if(u){return u;}else{return;}}if(this._input===""){return this.EOF;}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno});}},lex:function h(){var o=this.next();if(typeof o!=="undefined"){return o;}else{return this.lex();}},begin:function i(o){this.conditionStack.push(o);},popState:function n(){return this.conditionStack.pop();},_currentRules:function l(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;},topState:function(){return this.conditionStack[this.conditionStack.length-2];},pushState:function i(o){this.begin(o);}});k.options={};k.performAction=function j(s,p,r,o){var q=o;switch(r){case 0:if(p.yytext.slice(-1)!=="\\"){this.begin("mu");}if(p.yytext.slice(-1)==="\\"){p.yytext=p.yytext.substr(0,p.yyleng-1),this.begin("emu");}if(p.yytext){return 14;}break;case 1:return 14;break;case 2:if(p.yytext.slice(-1)!=="\\"){this.popState();}if(p.yytext.slice(-1)==="\\"){p.yytext=p.yytext.substr(0,p.yyleng-1);}return 14;break;case 3:return 24;break;case 4:return 16;break;case 5:return 20;break;case 6:return 19;break;case 7:return 19;break;case 8:return 23;break;case 9:return 23;break;case 10:p.yytext=p.yytext.substr(3,p.yyleng-5);this.popState();return 15;break;case 11:return 22;break;case 12:return 35;break;case 13:return 34;break;case 14:return 34;break;case 15:return 37;break;case 16:break;case 17:this.popState();return 18;break;case 18:this.popState();return 18;break;case 19:p.yytext=p.yytext.substr(1,p.yyleng-2).replace(/\\"/g,'"');return 29;break;case 20:p.yytext=p.yytext.substr(1,p.yyleng-2).replace(/\\"/g,'"');return 29;break;case 21:p.yytext=p.yytext.substr(1);return 27;break;case 22:return 31;break;case 23:return 31;break;case 24:return 30;break;case 25:return 34;break;case 26:p.yytext=p.yytext.substr(1,p.yyleng-2);return 34;break;case 27:return"INVALID";break;case 28:return 5;break;}};k.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];k.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],inclusive:false},emu:{rules:[2],inclusive:false},INITIAL:{rules:[0,1,28],inclusive:true}};return k;})();g.lexer=a;function e(){this.yy={};}e.prototype=g;g.Parser=e;return new e;})();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=handlebars;exports.Parser=handlebars.Parser;exports.parse=function(){return handlebars.parse.apply(handlebars,arguments);};exports.main=function commonjsMain(a){if(!a[1]){throw new Error("Usage: "+a[0]+" FILE");}var c,b;if(typeof process!=="undefined"){c=require("fs").readFileSync(require("path").resolve(a[1]),"utf8");}else{c=require("file").path(require("file").cwd()).join(a[1]).read({charset:"utf-8"});}return exports.parser.parse(c);};if(typeof module!=="undefined"&&require.main===module){exports.main(typeof process!=="undefined"?process.argv.slice(1):require("system").args);}}Handlebars.Parser=handlebars;Handlebars.parse=function(a){Handlebars.Parser.yy=Handlebars.AST;return Handlebars.Parser.parse(a);};Handlebars.print=function(a){return new Handlebars.PrintVisitor().accept(a);};Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(b,a){}};Handlebars.log=function(b,a){Handlebars.logger.log(b,a);};(function(){Handlebars.AST={};Handlebars.AST.ProgramNode=function(c,b){this.type="program";this.statements=c;if(b){this.inverse=new Handlebars.AST.ProgramNode(b);}};Handlebars.AST.MustacheNode=function(g,d,c){this.type="mustache";this.escaped=!c;this.hash=d;var f=this.id=g[0];var e=this.params=g.slice(1);var b=this.eligibleHelper=f.isSimple;this.isHelper=b&&(e.length||d);};Handlebars.AST.PartialNode=function(c,b){this.type="partial";this.id=c;this.context=b;};var a=function(b,c){if(b.original!==c.original){throw new Handlebars.Exception(b.original+" doesn't match "+c.original);}};Handlebars.AST.BlockNode=function(d,c,b,e){a(d.id,e);this.type="block";this.mustache=d;this.program=c;this.inverse=b;if(this.inverse&&!this.program){this.isInverse=true;}};Handlebars.AST.ContentNode=function(b){this.type="content";this.string=b;};Handlebars.AST.HashNode=function(b){this.type="hash";this.pairs=b;};Handlebars.AST.IdNode=function(f){this.type="ID";this.original=f.join(".");var d=[],g=0;for(var e=0,b=f.length;e":">",'"':""","'":"'","`":"`"};var d=/[&<>"'`]/g;var b=/[&<>"'`]/;var a=function(e){return c[e]||"&";};Handlebars.Utils={escapeExpression:function(e){if(e instanceof Handlebars.SafeString){return e.toString();}else{if(e==null||e===false){return"";}}if(!b.test(e)){return e;}return e.replace(d,a);},isEmpty:function(e){if(typeof e==="undefined"){return true;}else{if(e===null){return true;}else{if(e===false){return true;}else{if(Object.prototype.toString.call(e)==="[object Array]"&&e.length===0){return true;}else{return false;}}}}}};})();Handlebars.Compiler=function(){};Handlebars.JavaScriptCompiler=function(){};(function(g,f){g.prototype={compiler:g,disassemble:function(){var p=this.opcodes,o,m=[],r,q;for(var n=0,h=p.length;n0){this.source[1]=this.source[1]+", "+p.join(", ");}if(!this.isChild){var j=[];for(var n in this.context.aliases){this.source[1]=this.source[1]+", "+n+"="+this.context.aliases[n];}}if(this.source[1]){this.source[1]="var "+this.source[1].substring(2)+";";}if(!this.isChild){this.source[1]+="\n"+this.context.programs.join("\n")+"\n";}if(!this.environment.isSimple){this.source.push("return buffer;");}var q=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var m=0,h=this.environment.depths.list.length;mthis.stackVars.length){this.stackVars.push("stack"+this.stackSlot);}return"stack"+this.stackSlot;},popStack:function(){var h=this.compileStack.pop();if(h instanceof c){return h.value;}else{this.stackSlot--;return h;}},topStack:function(){var h=this.compileStack[this.compileStack.length-1];if(h instanceof c){return h.value;}else{return h;}},quotedString:function(h){return'"'+h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"';},setupHelper:function(k,i){var j=[];this.setupParams(k,j);var h=this.nameLookup("helpers",i,"helper");return{params:j,name:h,callParams:["depth0"].concat(j).join(", "),helperMissingParams:["depth0",this.quotedString(i)].concat(j).join(", ")};},setupParams:function(o,n){var k=[],p=[],m,h,j;k.push("hash:"+this.popStack());h=this.popStack();j=this.popStack();if(j||h){if(!j){this.context.aliases.self="this";j="self.noop";}if(!h){this.context.aliases.self="this";h="self.noop";}k.push("inverse:"+h);k.push("fn:"+j);}for(var l=0;l>0,x=arguments[2];while(w{{title}}{{#if thumb}}
{{/if}}');l=function(o,n){n.url=o.absolute_url;n.title=o.name;try{n.thumb=o.logo.thumbnails.map_thumb;}catch(p){n.thumb="";}return n;};g=function(o,n){n.url=o.absolute_url;n.title=o.title;try{n.thumb=o.current_image.thumbnails.map_thumb;}catch(p){n.thumb="";}return n;};$.each(j,function(p,o){if(i.object_id){$.each(o.locations,function(r,q){if(i.resource==="organisation"){q=l(o,q);}else{q=g(o,q);}f(m,q,h);});}else{var n;n=o.primary_location;if(n){if(i.resource==="organisation"){n=l(o,n);}else{n=g(o,n);}f(m,n,h);}}});if(isNaN(i.object)&&k.meta.next!==null){b(m,k.meta.next);}};f=function(k,h,i){var g,j;j=k.mapOpts;g=j.host+"rsr/media/core/img/";if(j.marker_icon){g=g+j.marker_icon;}else{if(j.resource==="organisation"){g=g+"redMarker.png";}else{g=g+"blueMarker.png";}}if(j.type==="static"||j.type==="small"){if(j.type==="static"){g=new google.maps.MarkerImage(g,null,null,null,new google.maps.Size(10.5,17));}$(k.mapElement).gmap("addMarker",{position:new google.maps.LatLng(h.latitude,h.longitude),clickable:false,icon:g,bounds:true});if($(k.mapElement).gmap("get","map").getZoom()>8){$(k.mapElement).gmap("get","map").setZoom(8);}}else{$(k.mapElement).gmap("addMarker",{position:new google.maps.LatLng(h.latitude,h.longitude),icon:g,bounds:true}).click(function(){$(k.mapElement).gmap("openInfoWindow",{content:i(h)},this);});}};b=function(k,i){var g=$.url(i),h=Handlebars.compile("{{host}}{{path}}?format=jsonp&depth=1&limit={{limit}}&offset={{offset}}&callback=?"),j=h({host:g.attr("host"),path:g.attr("path"),limit:Number(g.param("limit")),offset:Number(g.param("offset"))});$.getJSON(j,function(l){d(k,l);});};c=function(h){var g;if(h==="static"){g={draggable:false,mapTypeControl:false,navigationControl:true,scaleControl:false,scrollwheel:false,streetViewControl:false,zoom:0};}else{if(h==="small"){g={draggable:true,mapTypeControl:false,navigationControl:true,scaleControl:true,scrollwheel:false,streetViewControl:false,zoom:0};}else{g={draggable:true,mapTypeControl:true,navigationControl:true,scaleControl:true,scrollwheel:true,streetViewControl:false,zoom:2};}}return g;};}()); \ No newline at end of file diff --git a/akvo/mediaroot/akvo/js/src/akvo-maps.js b/akvo/mediaroot/akvo/js/src/akvo-maps.js index a407e9a5d8..2b884d1c29 100644 --- a/akvo/mediaroot/akvo/js/src/akvo-maps.js +++ b/akvo/mediaroot/akvo/js/src/akvo-maps.js @@ -45,8 +45,9 @@ getResourceUrl = function (map) { var opts, url, limit; opts = map.mapOpts; + // call /api/v1/map_for_project/ or /api/v1/map_for_organisation/ resources //TODO: derive the host from the current page URL instead maybe? - url = opts.host + 'api/v1/' + opts.resource + '/'; + url = opts.host + 'api/v1/map_for_' + opts.resource + '/'; //limit = 0 means all objects. If this becomes too heavy limit can be set to get the objects in multiple chunks limit = 0; // if object_id holds a value then that's the ID of the object we want to fetch diff --git a/akvo/scripts/asset_manager/map.py b/akvo/scripts/asset_manager/map.py index b46fe0d8bf..8b3312cee0 100644 --- a/akvo/scripts/asset_manager/map.py +++ b/akvo/scripts/asset_manager/map.py @@ -1 +1 @@ -BUNDLE_MAP = {'partner_sites_style': {'path': 'partner_sites/css/', 'hash': '3b28cc631adecc91703230abb41b0c8125065c27', 'type': 'css'}, 'widget_project_updates': {'path': 'widgets/project_updates/css/', 'hash': '57ddaa0abcaef475a634bc2d6d0d59dc924ba109', 'type': 'css'}, 'akvo_ps_machinery_js': {'path': 'partner_sites/js/', 'hash': '2fcbb22efb57981a99cd9746f3b98575b4fa2b3c', 'type': 'js'}, 'widget_project_small': {'path': 'widgets/project_small/css/', 'hash': '984d858f5eff775d79c942a17358e5817a4092e2', 'type': 'css'}, 'widget_cobranded_leader': {'path': 'widgets/cobranded_leader/css/', 'hash': '1ae4b5057b7a715f2e00c20588bdc20a119dff39', 'type': 'css'}, 'partner_sites_script': {'path': 'partner_sites/js/', 'hash': 'a039f7e10cb45144d27a621a0469d61851dd5d02', 'type': 'js'}, 'akvo_ie6_style': {'path': 'akvo/css/', 'hash': '2c103c8bc0834a3e4145e6ce86541613b898d552', 'type': 'css'}, 'widget_cobranded_banner': {'path': 'widgets/cobranded_banner/css/', 'hash': '31ddbde98bffa9e8705c4b9a945d94202e20131b', 'type': 'css'}, 'widget_cobranded_narrow': {'path': 'widgets/cobranded_narrow/css/', 'hash': '572e7203abead79cf733c5687d67a9b4f8cf0a0c', 'type': 'css'}, 'akvo_machinery_js': {'path': 'akvo/js/', 'hash': 'c88b72cf88f3f6cb1803e5907a35f3e19e8e5b3b', 'type': 'js'}, 'widget_project_list': {'path': 'widgets/project_list/css/', 'hash': '64aaf44be5a55cabef3a0713a826c365eb7c20f2', 'type': 'css'}, 'widget_project': {'path': 'widgets/project/css/', 'hash': '4611d301f23eb9e63ed276d0b51dea16def73b52', 'type': 'css'}, 'widget_project_contribute': {'path': 'widgets/project_contribute/css/', 'hash': '36d113a496eec7965e63b0d67728a0612f8673e4', 'type': 'css'}, 'akvo_script': {'path': 'akvo/js/', 'hash': '4382c3c6a13a12372c2f3f7a60b11486570d5c75', 'type': 'js'}, 'akvo_style': {'path': 'akvo/css/', 'hash': '0fed68a1b4c8f0e737f7d288a0eb672a47551f6e', 'type': 'css'}, 'widget_cobranded_short': {'path': 'widgets/cobranded_short/css/', 'hash': '9b3f65379cf13146713cca113e6e8d2f621ab4de', 'type': 'css'}, 'widget_project_narrow': {'path': 'widgets/project_narrow/css/', 'hash': '984d858f5eff775d79c942a17358e5817a4092e2', 'type': 'css'}} \ No newline at end of file +BUNDLE_MAP = {'partner_sites_style': {'path': 'partner_sites/css/', 'hash': '3b28cc631adecc91703230abb41b0c8125065c27', 'type': 'css'}, 'widget_project_updates': {'path': 'widgets/project_updates/css/', 'hash': '57ddaa0abcaef475a634bc2d6d0d59dc924ba109', 'type': 'css'}, 'akvo_ps_machinery_js': {'path': 'partner_sites/js/', 'hash': '2fcbb22efb57981a99cd9746f3b98575b4fa2b3c', 'type': 'js'}, 'widget_project_small': {'path': 'widgets/project_small/css/', 'hash': '984d858f5eff775d79c942a17358e5817a4092e2', 'type': 'css'}, 'widget_cobranded_leader': {'path': 'widgets/cobranded_leader/css/', 'hash': '1ae4b5057b7a715f2e00c20588bdc20a119dff39', 'type': 'css'}, 'partner_sites_script': {'path': 'partner_sites/js/', 'hash': 'a039f7e10cb45144d27a621a0469d61851dd5d02', 'type': 'js'}, 'akvo_ie6_style': {'path': 'akvo/css/', 'hash': '2c103c8bc0834a3e4145e6ce86541613b898d552', 'type': 'css'}, 'widget_cobranded_banner': {'path': 'widgets/cobranded_banner/css/', 'hash': '31ddbde98bffa9e8705c4b9a945d94202e20131b', 'type': 'css'}, 'widget_cobranded_narrow': {'path': 'widgets/cobranded_narrow/css/', 'hash': '572e7203abead79cf733c5687d67a9b4f8cf0a0c', 'type': 'css'}, 'akvo_machinery_js': {'path': 'akvo/js/', 'hash': 'c88b72cf88f3f6cb1803e5907a35f3e19e8e5b3b', 'type': 'js'}, 'widget_project_list': {'path': 'widgets/project_list/css/', 'hash': '64aaf44be5a55cabef3a0713a826c365eb7c20f2', 'type': 'css'}, 'widget_project': {'path': 'widgets/project/css/', 'hash': '4611d301f23eb9e63ed276d0b51dea16def73b52', 'type': 'css'}, 'widget_project_contribute': {'path': 'widgets/project_contribute/css/', 'hash': '36d113a496eec7965e63b0d67728a0612f8673e4', 'type': 'css'}, 'akvo_script': {'path': 'akvo/js/', 'hash': '35a8490eec7ef52da368ee4ada57a71784bd45c2', 'type': 'js'}, 'akvo_style': {'path': 'akvo/css/', 'hash': '0fed68a1b4c8f0e737f7d288a0eb672a47551f6e', 'type': 'css'}, 'widget_cobranded_short': {'path': 'widgets/cobranded_short/css/', 'hash': '9b3f65379cf13146713cca113e6e8d2f621ab4de', 'type': 'css'}, 'widget_project_narrow': {'path': 'widgets/project_narrow/css/', 'hash': '984d858f5eff775d79c942a17358e5817a4092e2', 'type': 'css'}} \ No newline at end of file