From f952040dd44b914b2d5e405567eb655757dfc85d Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 17 Sep 2009 11:03:35 +0200 Subject: added shadowbody, first js gallery initializer and template modifications --- public/javascripts/shadowbox/adapters/README | 11 +++++++++++ public/javascripts/shadowbox/adapters/shadowbox-base.js | 1 + public/javascripts/shadowbox/adapters/shadowbox-dojo.js | 1 + public/javascripts/shadowbox/adapters/shadowbox-ext.js | 1 + public/javascripts/shadowbox/adapters/shadowbox-jquery.js | 1 + public/javascripts/shadowbox/adapters/shadowbox-mootools.js | 1 + public/javascripts/shadowbox/adapters/shadowbox-prototype.js | 1 + public/javascripts/shadowbox/adapters/shadowbox-yui.js | 1 + 8 files changed, 18 insertions(+) create mode 100644 public/javascripts/shadowbox/adapters/README create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-base.js create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-dojo.js create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-ext.js create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-jquery.js create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-mootools.js create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-prototype.js create mode 100644 public/javascripts/shadowbox/adapters/shadowbox-yui.js (limited to 'public/javascripts/shadowbox/adapters') diff --git a/public/javascripts/shadowbox/adapters/README b/public/javascripts/shadowbox/adapters/README new file mode 100644 index 0000000..5083961 --- /dev/null +++ b/public/javascripts/shadowbox/adapters/README @@ -0,0 +1,11 @@ +A Shadowbox "adapter" is a small helper file that makes it easy to use +Shadowbox with a given JavaScript framework. Since most JavaScript frameworks +tend to contain a basic set of very similar functions (for retrieving style +information on elements or handling events, for example) it is not necessary to +tie Shadowbox to a particular framework. Instead, the adapter can use the +underlying framework that is already loaded on the page to reuse some of the +code. + +If you do not see an adapter for your favorite framework in this directory, feel +free to create your own and implement the same interface as the others. It may +then be used the same as you would use any other. diff --git a/public/javascripts/shadowbox/adapters/shadowbox-base.js b/public/javascripts/shadowbox/adapters/shadowbox-base.js new file mode 100644 index 0000000..bfe0573 --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-base.js @@ -0,0 +1 @@ +if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var b=Shadowbox.client,a=document.defaultView,d;if(b.isIE6){d=[];function c(){var h;for(var g=0,f=d.length;g<\/script>");document.getElementById("__onDOMReady").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}Shadowbox.lib.addEvent(window,"load",a)})(); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-dojo.js b/public/javascripts/shadowbox/adapters/shadowbox-dojo.js new file mode 100644 index 0000000..f264c9b --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-dojo.js @@ -0,0 +1 @@ +if(typeof dojo=="undefined"){throw"Unable to load Shadowbox adapter, Dojo not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=[];return{getStyle:function(c,b){return dojo.style(c,b)},remove:function(b){dojo._destroyElement(b)},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(e,b,d){var c=dojo.connect(e,b,d);a.push({el:e,name:b,handle:c})},removeEvent:function(d,b,c){dojo.forEach(a,function(f,e){if(f&&f.el==d&&f.name==b){dojo.disconnect(f.handle);a[e]=null}})},append:function(d,c){if(d.insertAdjacentHTML){d.insertAdjacentHTML("BeforeEnd",c)}else{if(d.lastChild){var b=d.ownerDocument.createRange();b.setStartAfter(d.lastChild);var e=b.createContextualFragment(c);d.appendChild(e)}else{d.innerHTML=c}}}}}();dojo.addOnLoad(Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-ext.js b/public/javascripts/shadowbox/adapters/shadowbox-ext.js new file mode 100644 index 0000000..e88063b --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-ext.js @@ -0,0 +1 @@ +if(typeof Ext=="undefined"){throw"Unable to load Shadowbox adapter, Ext not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=Ext.lib.Event;return{getStyle:function(c,b){return Ext.get(c).getStyle(b)},remove:function(b){Ext.get(b).remove()},getTarget:function(b){return a.getTarget(b)},getPageXY:function(b){return[a.getPageX(b),a.getPageY(b)]},preventDefault:function(b){a.preventDefault(b)},keyCode:function(b){return a.getCharCode(b)},addEvent:function(d,b,c){a.addListener(d,b,c)},removeEvent:function(d,b,c){a.removeListener(d,b,c)},append:function(c,b){Ext.DomHelper.append(c,b)}}}();Ext.onReady(Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-jquery.js b/public/javascripts/shadowbox/adapters/shadowbox-jquery.js new file mode 100644 index 0000000..a0965a4 --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-jquery.js @@ -0,0 +1 @@ +if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(a){return{getStyle:function(c,b){return a(c).css(b)},remove:function(b){a(b).remove()},getTarget:function(b){return b.target},getPageXY:function(b){return[b.pageX,b.pageY]},preventDefault:function(b){b.preventDefault()},keyCode:function(b){return b.keyCode},addEvent:function(d,b,c){a(d).bind(b,c)},removeEvent:function(d,b,c){a(d).unbind(b,c)},append:function(c,b){a(c).append(b)}}}(jQuery);jQuery(Shadowbox.load);(function(a){a.fn.shadowbox=function(b){return this.each(function(){var d=a(this);var e=a.extend({},b||{},a.metadata?d.metadata():a.meta?d.data():{});var c=this.className||"";e.width=parseInt((c.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((c.match(/h:(\d+)/)||[])[1])||e.height;Shadowbox.setup(d,e)})}})(jQuery); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-mootools.js b/public/javascripts/shadowbox/adapters/shadowbox-mootools.js new file mode 100644 index 0000000..58c0015 --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-mootools.js @@ -0,0 +1 @@ +if(typeof MooTools=="undefined"){throw"Unable to load Shadowbox adapter, MooTools not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib={getStyle:function(b,a){return $(b).getStyle(a)},remove:function(a){a.parentNode.removeChild(a)},getTarget:function(a){return a.target},getPageXY:function(a){return[a.page.x,a.page.y]},preventDefault:function(a){a.preventDefault()},keyCode:function(a){return a.code},addEvent:function(c,a,b){$(c).addEvent(a,b)},removeEvent:function(c,a,b){$(c).removeEvent(a,b)},append:function(c,b){if(c.insertAdjacentHTML){c.insertAdjacentHTML("BeforeEnd",b)}else{if(c.lastChild){var a=c.ownerDocument.createRange();a.setStartAfter(c.lastChild);var d=a.createContextualFragment(b);c.appendChild(d)}else{c.innerHTML=b}}}};window.addEvent("domready",Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-prototype.js b/public/javascripts/shadowbox/adapters/shadowbox-prototype.js new file mode 100644 index 0000000..637dd87 --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-prototype.js @@ -0,0 +1 @@ +if(typeof Prototype=="undefined"){throw"Unable to load Shadowbox adapter, Prototype not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib={getStyle:function(b,a){return Element.getStyle(b,a)},remove:function(a){Element.remove(a)},getTarget:function(a){return Event.element(a)},getPageXY:function(b){var a=Event.pointer(b);return[a.x,a.y]},preventDefault:function(a){Event.stop(a)},keyCode:function(a){return a.keyCode},addEvent:function(c,a,b){Event.observe(c,a,b)},removeEvent:function(c,a,b){Event.stopObserving(c,a,b)},append:function(b,a){Element.insert(b,a)}};document.observe("dom:loaded",Shadowbox.load); \ No newline at end of file diff --git a/public/javascripts/shadowbox/adapters/shadowbox-yui.js b/public/javascripts/shadowbox/adapters/shadowbox-yui.js new file mode 100644 index 0000000..f045d76 --- /dev/null +++ b/public/javascripts/shadowbox/adapters/shadowbox-yui.js @@ -0,0 +1 @@ +if(typeof YAHOO=="undefined"){throw"Unable to load Shadowbox adapter, YAHOO not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}Shadowbox.lib=function(){var a=YAHOO.util.Event;var b=YAHOO.util.Dom;return{getStyle:function(d,c){return b.getStyle(d,c)},remove:function(c){c.parentNode.removeChild(c)},getTarget:function(c){return a.getTarget(c)},getPageXY:function(c){return[a.getPageX(c),a.getPageY(c)]},preventDefault:function(c){a.preventDefault(c)},keyCode:function(c){return c.keyCode},addEvent:function(e,c,d){a.addListener(e,c,d)},removeEvent:function(e,c,d){a.removeListener(e,c,d)},append:function(e,d){if(e.insertAdjacentHTML){e.insertAdjacentHTML("BeforeEnd",d)}else{if(e.lastChild){var c=e.ownerDocument.createRange();c.setStartAfter(e.lastChild);var f=c.createContextualFragment(d);e.appendChild(f)}else{e.innerHTML=d}}}}}();YAHOO.util.Event.onDOMReady(Shadowbox.load); \ No newline at end of file -- cgit v1.3