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/players/README | 35 ++++++++++++++++++++++ .../javascripts/shadowbox/players/shadowbox-flv.js | 1 + .../shadowbox/players/shadowbox-html.js | 1 + .../shadowbox/players/shadowbox-iframe.js | 1 + .../javascripts/shadowbox/players/shadowbox-img.js | 1 + .../javascripts/shadowbox/players/shadowbox-qt.js | 1 + .../javascripts/shadowbox/players/shadowbox-swf.js | 1 + .../javascripts/shadowbox/players/shadowbox-wmp.js | 1 + 8 files changed, 42 insertions(+) create mode 100644 public/javascripts/shadowbox/players/README create mode 100644 public/javascripts/shadowbox/players/shadowbox-flv.js create mode 100644 public/javascripts/shadowbox/players/shadowbox-html.js create mode 100644 public/javascripts/shadowbox/players/shadowbox-iframe.js create mode 100644 public/javascripts/shadowbox/players/shadowbox-img.js create mode 100644 public/javascripts/shadowbox/players/shadowbox-qt.js create mode 100644 public/javascripts/shadowbox/players/shadowbox-swf.js create mode 100644 public/javascripts/shadowbox/players/shadowbox-wmp.js (limited to 'public/javascripts/shadowbox/players') diff --git a/public/javascripts/shadowbox/players/README b/public/javascripts/shadowbox/players/README new file mode 100644 index 0000000..7f32991 --- /dev/null +++ b/public/javascripts/shadowbox/players/README @@ -0,0 +1,35 @@ +A Shadowbox "player" is a class that is used specifically for displaying a +particular medium. For example, an image player is included for displaying +images, a QuickTime player is included for playing QuickTime movies, etc. + +All players should implement the same interface. This makes it possible for the +Shadowbox class to know what methods to call and properties to check on player +objects. + +The interface is described here, with some simple explanations of how each +method and/or property is to be used. + +METHOD/PROPERTY DESCRIPTION + +height (Number) The height of the object (in pixels) +width (Number) The width of the object (in pixels) +ready (optional, Boolean) True if the content is ready to be + loaded, false otherwise. Useful when the script should wait + until the content loads before proceeding (see below) +resizable (optional, Boolean) True if the content can be dynamically + resized by the script (e.g. images, but not most movie + formats) +append() Appends this object to the DOM +remove() Removes this object from the DOM +onLoad() (optional) Called after the content is loaded and the + loading layer is hidden +onWindowResize() (optional) Called when the window is resized + +If the ready property is set to false, the script will wait until it is set true +before proceeding to call the onReady callback. This property should be changed +in some callback function within the player class itself. + +In this case, the object's height and width do not need to be made available +immediately (because they may not initially be known). However, in the same +callback, the height and width should be set. See the Shadowbox.img class (in +shadowbox-img.js) for an example of this behavior. diff --git a/public/javascripts/shadowbox/players/shadowbox-flv.js b/public/javascripts/shadowbox/players/shadowbox-flv.js new file mode 100644 index 0000000..1925e69 --- /dev/null +++ b/public/javascripts/shadowbox/players/shadowbox-flv.js @@ -0,0 +1 @@ +(function(b){var a=b.util,c=20;b.flv=function(d){this.obj=d;this.resizable=true;this.height=d.height?parseInt(d.height,10):300;if(b.options.showMovieControls==true){this.height+=c}this.width=d.width?parseInt(d.width,10):300};b.flv.prototype={append:function(l,e,n){this.id=e;var j=document.createElement("div");j.id=e;l.appendChild(j);var k=n.resize_h,o=n.resize_w,f=b.path+"libraries/mediaplayer/player.swf",m=b.options.flashVersion,d=b.path+"libraries/swfobject/expressInstall.swf",g=a.apply({file:this.obj.content,height:k,width:o,autostart:(b.options.autoplayMovies?"true":"false"),controlbar:(b.options.showMovieControls?"bottom":"none"),backcolor:"0x000000",frontcolor:"0xCCCCCC",lightcolor:"0x557722"},b.options.flashVars),i=b.options.flashParams;swfobject.embedSWF(f,e,o,k,m,d,g,i)},remove:function(){swfobject.expressInstallCallback();swfobject.removeSWF(this.id)}}})(Shadowbox); \ No newline at end of file diff --git a/public/javascripts/shadowbox/players/shadowbox-html.js b/public/javascripts/shadowbox/players/shadowbox-html.js new file mode 100644 index 0000000..e01f846 --- /dev/null +++ b/public/javascripts/shadowbox/players/shadowbox-html.js @@ -0,0 +1 @@ +(function(a){a.html=function(b){this.obj=b;this.height=b.height?parseInt(b.height,10):300;this.width=b.width?parseInt(b.width,10):500};a.html.prototype={append:function(b,e,c){this.id=e;var d=document.createElement("div");d.id=e;d.className="html";d.innerHTML=this.obj.content;b.appendChild(d)},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b)}}}})(Shadowbox); \ No newline at end of file diff --git a/public/javascripts/shadowbox/players/shadowbox-iframe.js b/public/javascripts/shadowbox/players/shadowbox-iframe.js new file mode 100644 index 0000000..eeac848 --- /dev/null +++ b/public/javascripts/shadowbox/players/shadowbox-iframe.js @@ -0,0 +1 @@ +(function(a){a.iframe=function(c){this.obj=c;var b=document.getElementById("sb-overlay");this.height=c.height?parseInt(c.height,10):b.offsetHeight;this.width=c.width?parseInt(c.width,10):b.offsetWidth};a.iframe.prototype={append:function(b,e,d){this.id=e;var c='