public
Description: Yet another lightbox script, this one's for the bleeding edge of prototype/scriptaculous
Clone URL: git://github.com/tdreyno/darkbox.git
add fancy zoom
Thomas Reynolds (author)
Wed Feb 13 11:18:35 -0800 2008
commit  fa489ca7acab5de669f82090dc8f88249855ae49
tree    6c6b6ea3cf6551cf1b7a519e562cb6ef4ddac806
parent  1588d1cfaf3e5cd39e0567d7f10764d484daf077
...
3
4
5
6
 
7
8
9
...
58
59
60
61
 
 
 
 
 
 
 
 
 
 
 
62
63
64
...
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
 
150
...
3
4
5
 
6
7
8
9
...
58
59
60
 
61
62
63
64
65
66
67
68
69
70
71
72
73
74
...
118
119
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
122
123
0
@@ -3,7 +3,7 @@ Prototype.Browser.IE7 = Prototype.Browser.IE && !Prototype.Browser.IE6;
0
 
0
 // We'll need some hackery to survice IE6
0
 if (Prototype.Browser.IE6)
0
- Darkbox.require('get_page_size.js');
0
+ Darkbox.require('js/get_page_size.js');
0
 
0
 // Allows us to attach before and after events to any function call.
0
 Function.prototype.eventWrapper = function(obj, event_name) {
0
@@ -58,7 +58,17 @@ var Darkbox = {
0
 
0
   // inserting via DOM fails in Safari 2.0, so brute force approach
0
   require: function(libraryName) {
0
- document.write('<script type="text/javascript" src="js/'+libraryName+'"><\/script>');
0
+ if ((arguments[1]) && (arguments[1] == true)) {
0
+ var path = ''; // Do not calculate prefix path
0
+ } else {
0
+ var elem = $$("script").select(function(elem) {
0
+ return (elem.src && elem.src.match(/darkbox2\.js/))
0
+ }).first();
0
+
0
+ var path = elem.src.replace(/darkbox2\.js$/,'');
0
+ }
0
+
0
+ document.write('<script type="text/javascript" src="'+path+libraryName+'.js"><\/script>');
0
   },
0
   
0
   Effect: {
0
@@ -108,41 +118,4 @@ var Darkbox = {
0
   }
0
 };
0
 
0
-var DarkboxPopup = Class.create({
0
- initialize: function(elem) {
0
- this.source = $(elem);
0
-
0
- this.options = Object.extend({
0
- opacity: 0.75,
0
- effect: Darkbox.Effect,
0
- style: Darkbox.Style,
0
- modal: false
0
- }, arguments[1] || {});
0
-
0
- if (Object.isString(this.options.listen_to))
0
- this.options.listen_to = $$(this.options.listen_to);
0
-
0
- if (Object.isElement(this.options.listen_to))
0
- this.options.listen_to = $A([ this.options.listen_to ]);
0
-
0
- if (Object.isArray(this.options.listen_to))
0
- this.options.listen_to.invoke('observe', 'click', this.show.bindAsEventListener(this));
0
-
0
- if (!Darkbox.overlay) Darkbox.setup();
0
- },
0
-
0
- show: function() {
0
- // If we get a click event, kill it
0
- if (arguments[0]) arguments[0].stop();
0
-
0
- if (Darkbox.active == this) return;
0
- if (Darkbox.active) Darkbox.hide();
0
- Darkbox.active = this;
0
- Darkbox.show();
0
- },
0
-
0
- hide: function() {
0
- if (Darkbox.active != this) return;
0
- Darkbox.hide();
0
- }
0
-});
0
\ No newline at end of file
0
+Darkbox.require('darkbox_popup')
0
\ No newline at end of file

Comments

    No one has commented yet.