refinerycms 0.9.4.5 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +20 -9
- data/Rakefile +10 -0
- data/bin/refinery +53 -0
- data/bin/refinery-update-core +23 -0
- data/config/environment.rb +2 -2
- data/config/preinitializer.rb +24 -0
- data/public/javascripts/application.js +0 -1
- data/public/javascripts/jquery/jquery.js +4373 -8
- data/public/javascripts/livepipe.js +10 -186
- data/public/javascripts/{admin.js → refinery/admin.js} +0 -0
- data/public/javascripts/{wymeditor → refinery}/boot_wym.js +0 -0
- data/public/javascripts/{dialog.js → refinery/dialog.js} +0 -0
- data/public/javascripts/{parse_url.js → refinery/parse_url.js} +0 -0
- data/public/javascripts/{prototype.enhancements.js → refinery/prototype.enhancements.js} +0 -0
- data/public/javascripts/{tooltips.js → refinery/tooltips.js} +0 -0
- data/public/javascripts/tabs.js +135 -133
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +4 -5
- data/public/stylesheets/formatting.css +5 -0
- data/public/stylesheets/home.css +5 -0
- data/public/stylesheets/{formatting.css.example → refinery/formatting.css} +45 -34
- data/public/stylesheets/refinery/home.css +0 -0
- data/public/stylesheets/{refinery.css → refinery/refinery.css} +77 -36
- data/public/stylesheets/refinery/theme.css +36 -0
- data/public/stylesheets/{thickbox.css → refinery/thickbox.css} +0 -0
- data/public/stylesheets/{tooltips.css → refinery/tooltips.css} +0 -0
- data/public/stylesheets/theme.css +1 -36
- data/script/about +3 -0
- data/script/console +3 -0
- data/script/dbconsole +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/profiler +3 -0
- data/script/performance/request +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/vendor/plugins/authentication/app/views/sessions/new.html.erb +5 -5
- data/vendor/plugins/images/app/views/admin/images/index.html.erb +4 -5
- data/vendor/plugins/images/app/views/admin/images/insert.html.erb +1 -1
- data/vendor/plugins/inquiries/app/views/admin/inquiries/index.html.erb +3 -4
- data/vendor/plugins/news/app/views/admin/news_items/index.html.erb +4 -5
- data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +3 -4
- data/vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb +4 -4
- data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +4 -2
- data/vendor/plugins/pages/app/views/admin/pages/index.html.erb +4 -5
- data/vendor/plugins/refinery/app/views/admin/_head.html.erb +7 -5
- data/vendor/plugins/refinery/app/views/admin/_menu.html.erb +2 -2
- data/vendor/plugins/refinery/app/views/layouts/admin.html.erb +25 -17
- data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +1 -1
- data/vendor/plugins/refinery/init.rb +1 -0
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +9 -12
- data/vendor/plugins/refinery/lib/refinery/admin_base_controller.rb +2 -3
- data/vendor/plugins/refinery_dialogs/app/views/layouts/admin_dialog.html.erb +1 -1
- data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +3 -4
- metadata +35 -85
- data/public/javascripts/jquery/README +0 -67
- data/public/javascripts/jquery/jquery.ui.draggable.js +0 -1
- data/public/javascripts/jquery/jquery.ui.js +0 -1
- data/public/javascripts/jquery/jquery.ui.resizable.js +0 -1
- data/public/javascripts/jquery/jquery.ui.sortable.js +0 -1
- data/public/javascripts/overlabel.js +0 -66
- data/public/stylesheets/application.css.example +0 -76
- data/public/stylesheets/home.css.example +0 -27
- data/public/stylesheets/overlabel.css +0 -21
@@ -110,197 +110,21 @@ Element.addMethods({
|
|
110
110
|
}
|
111
111
|
});
|
112
112
|
|
113
|
-
//mouseenter, mouseleave
|
114
|
-
//from http://dev.rubyonrails.org/attachment/ticket/8354/event_mouseenter_106rc1.patch
|
115
|
-
Object.extend(Event, (function() {
|
116
|
-
var cache = Event.cache;
|
117
|
-
|
118
|
-
function getEventID(element) {
|
119
|
-
if (element._prototypeEventID) return element._prototypeEventID[0];
|
120
|
-
arguments.callee.id = arguments.callee.id || 1;
|
121
|
-
return element._prototypeEventID = [++arguments.callee.id];
|
122
|
-
}
|
123
|
-
|
124
|
-
function getDOMEventName(eventName) {
|
125
|
-
if (eventName && eventName.include(':')) return "dataavailable";
|
126
|
-
//begin extension
|
127
|
-
if(!Prototype.Browser.IE){
|
128
|
-
eventName = {
|
129
|
-
mouseenter: 'mouseover',
|
130
|
-
mouseleave: 'mouseout'
|
131
|
-
}[eventName] || eventName;
|
132
|
-
}
|
133
|
-
//end extension
|
134
|
-
return eventName;
|
135
|
-
}
|
136
|
-
|
137
|
-
function getCacheForID(id) {
|
138
|
-
return cache[id] = cache[id] || { };
|
139
|
-
}
|
140
|
-
|
141
|
-
function getWrappersForEventName(id, eventName) {
|
142
|
-
var c = getCacheForID(id);
|
143
|
-
return c[eventName] = c[eventName] || [];
|
144
|
-
}
|
145
|
-
|
146
|
-
function createWrapper(element, eventName, handler) {
|
147
|
-
var id = getEventID(element);
|
148
|
-
var c = getWrappersForEventName(id, eventName);
|
149
|
-
if (c.pluck("handler").include(handler)) return false;
|
150
|
-
|
151
|
-
var wrapper = function(event) {
|
152
|
-
if (!Event || !Event.extend ||
|
153
|
-
(event.eventName && event.eventName != eventName))
|
154
|
-
return false;
|
155
|
-
|
156
|
-
Event.extend(event);
|
157
|
-
handler.call(element, event);
|
158
|
-
};
|
159
|
-
|
160
|
-
//begin extension
|
161
|
-
if(!(Prototype.Browser.IE) && ['mouseenter','mouseleave'].include(eventName)){
|
162
|
-
wrapper = wrapper.wrap(function(proceed,event) {
|
163
|
-
var rel = event.relatedTarget;
|
164
|
-
var cur = event.currentTarget;
|
165
|
-
if(rel && rel.nodeType == Node.TEXT_NODE)
|
166
|
-
rel = rel.parentNode;
|
167
|
-
if(rel && rel != cur && !rel.descendantOf(cur))
|
168
|
-
return proceed(event);
|
169
|
-
});
|
170
|
-
}
|
171
|
-
//end extension
|
172
|
-
|
173
|
-
wrapper.handler = handler;
|
174
|
-
c.push(wrapper);
|
175
|
-
return wrapper;
|
176
|
-
}
|
177
|
-
|
178
|
-
function findWrapper(id, eventName, handler) {
|
179
|
-
var c = getWrappersForEventName(id, eventName);
|
180
|
-
return c.find(function(wrapper) { return wrapper.handler == handler });
|
181
|
-
}
|
182
|
-
|
183
|
-
function destroyWrapper(id, eventName, handler) {
|
184
|
-
var c = getCacheForID(id);
|
185
|
-
if (!c[eventName]) return false;
|
186
|
-
c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
|
187
|
-
}
|
188
|
-
|
189
|
-
function destroyCache() {
|
190
|
-
for (var id in cache)
|
191
|
-
for (var eventName in cache[id])
|
192
|
-
cache[id][eventName] = null;
|
193
|
-
}
|
194
|
-
|
195
|
-
if (window.attachEvent) {
|
196
|
-
window.attachEvent("onunload", destroyCache);
|
197
|
-
}
|
198
|
-
|
199
|
-
return {
|
200
|
-
observe: function(element, eventName, handler) {
|
201
|
-
element = $(element);
|
202
|
-
var name = getDOMEventName(eventName);
|
203
|
-
|
204
|
-
var wrapper = createWrapper(element, eventName, handler);
|
205
|
-
if (!wrapper) return element;
|
206
|
-
|
207
|
-
if (element.addEventListener) {
|
208
|
-
element.addEventListener(name, wrapper, false);
|
209
|
-
} else {
|
210
|
-
element.attachEvent("on" + name, wrapper);
|
211
|
-
}
|
212
|
-
|
213
|
-
return element;
|
214
|
-
},
|
215
|
-
|
216
|
-
stopObserving: function(element, eventName, handler) {
|
217
|
-
element = $(element);
|
218
|
-
var id = getEventID(element), name = getDOMEventName(eventName);
|
219
|
-
|
220
|
-
if (!handler && eventName) {
|
221
|
-
getWrappersForEventName(id, eventName).each(function(wrapper) {
|
222
|
-
element.stopObserving(eventName, wrapper.handler);
|
223
|
-
});
|
224
|
-
return element;
|
225
|
-
|
226
|
-
} else if (!eventName) {
|
227
|
-
Object.keys(getCacheForID(id)).each(function(eventName) {
|
228
|
-
element.stopObserving(eventName);
|
229
|
-
});
|
230
|
-
return element;
|
231
|
-
}
|
232
|
-
|
233
|
-
var wrapper = findWrapper(id, eventName, handler);
|
234
|
-
if (!wrapper) return element;
|
235
|
-
|
236
|
-
if (element.removeEventListener) {
|
237
|
-
element.removeEventListener(name, wrapper, false);
|
238
|
-
} else {
|
239
|
-
element.detachEvent("on" + name, wrapper);
|
240
|
-
}
|
241
|
-
|
242
|
-
destroyWrapper(id, eventName, handler);
|
243
|
-
|
244
|
-
return element;
|
245
|
-
},
|
246
|
-
|
247
|
-
fire: function(element, eventName, memo) {
|
248
|
-
element = $(element);
|
249
|
-
if (element == document && document.createEvent && !element.dispatchEvent)
|
250
|
-
element = document.documentElement;
|
251
|
-
|
252
|
-
var event;
|
253
|
-
if (document.createEvent) {
|
254
|
-
event = document.createEvent("HTMLEvents");
|
255
|
-
event.initEvent("dataavailable", true, true);
|
256
|
-
} else {
|
257
|
-
event = document.createEventObject();
|
258
|
-
event.eventType = "ondataavailable";
|
259
|
-
}
|
260
|
-
|
261
|
-
event.eventName = eventName;
|
262
|
-
event.memo = memo || { };
|
263
|
-
|
264
|
-
if (document.createEvent) {
|
265
|
-
element.dispatchEvent(event);
|
266
|
-
} else {
|
267
|
-
element.fireEvent(event.eventType, event);
|
268
|
-
}
|
269
|
-
|
270
|
-
return Event.extend(event);
|
271
|
-
}
|
272
|
-
};
|
273
|
-
})());
|
274
|
-
|
275
|
-
Object.extend(Event, Event.Methods);
|
276
|
-
|
277
|
-
Element.addMethods({
|
278
|
-
fire: Event.fire,
|
279
|
-
observe: Event.observe,
|
280
|
-
stopObserving: Event.stopObserving
|
281
|
-
});
|
282
|
-
|
283
|
-
Object.extend(document, {
|
284
|
-
fire: Element.Methods.fire.methodize(),
|
285
|
-
observe: Element.Methods.observe.methodize(),
|
286
|
-
stopObserving: Element.Methods.stopObserving.methodize()
|
287
|
-
});
|
288
|
-
|
289
113
|
//mouse:wheel
|
290
114
|
(function(){
|
291
115
|
function wheel(event){
|
292
|
-
var delta;
|
116
|
+
var delta, element, custom_event;
|
293
117
|
// normalize the delta
|
294
|
-
if(event.wheelDelta) // IE & Opera
|
118
|
+
if (event.wheelDelta) { // IE & Opera
|
295
119
|
delta = event.wheelDelta / 120;
|
296
|
-
else if (event.detail) // W3C
|
120
|
+
} else if (event.detail) { // W3C
|
297
121
|
delta =- event.detail / 3;
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
});
|
303
|
-
if(custom_event.stopped){
|
122
|
+
}
|
123
|
+
if (!delta) { return; }
|
124
|
+
element = Event.extend(event).target;
|
125
|
+
element = Element.extend(element.nodeType === Node.TEXT_NODE ? element.parentNode : element);
|
126
|
+
custom_event = element.fire('mouse:wheel',{ delta: delta });
|
127
|
+
if (custom_event.stopped) {
|
304
128
|
Event.stop(event);
|
305
129
|
return false;
|
306
130
|
}
|
@@ -353,4 +177,4 @@ var IframeShim = Class.create({
|
|
353
177
|
this.element.remove();
|
354
178
|
return this;
|
355
179
|
}
|
356
|
-
});
|
180
|
+
});
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/public/javascripts/tabs.js
CHANGED
@@ -7,141 +7,143 @@
|
|
7
7
|
* @require prototype.js, livepipe.js
|
8
8
|
*/
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
if(typeof(
|
13
|
-
|
10
|
+
/*global window, document, Prototype, $, $A, $H, $break, Class, Element, Event, Control */
|
11
|
+
|
12
|
+
if(typeof(Prototype) == "undefined") {
|
13
|
+
throw "Control.Tabs requires Prototype to be loaded."; }
|
14
|
+
if(typeof(Object.Event) == "undefined") {
|
15
|
+
throw "Control.Tabs requires Object.Event to be loaded."; }
|
14
16
|
|
15
17
|
Control.Tabs = Class.create({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
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
|
-
|
18
|
+
initialize: function(tab_list_container,options){
|
19
|
+
if(!$(tab_list_container)) {
|
20
|
+
throw "Control.Tabs could not find the element: " + tab_list_container; }
|
21
|
+
this.activeContainer = false;
|
22
|
+
this.activeLink = false;
|
23
|
+
this.containers = $H({});
|
24
|
+
this.links = [];
|
25
|
+
Control.Tabs.instances.push(this);
|
26
|
+
this.options = {
|
27
|
+
beforeChange: Prototype.emptyFunction,
|
28
|
+
afterChange: Prototype.emptyFunction,
|
29
|
+
hover: false,
|
30
|
+
linkSelector: 'li a',
|
31
|
+
setClassOnContainer: false,
|
32
|
+
activeClassName: 'active',
|
33
|
+
defaultTab: 'first',
|
34
|
+
autoLinkExternal: true,
|
35
|
+
targetRegExp: /#(.+)$/,
|
36
|
+
showFunction: Element.show,
|
37
|
+
hideFunction: Element.hide
|
38
|
+
};
|
39
|
+
Object.extend(this.options,options || {});
|
40
|
+
(typeof(this.options.linkSelector == 'string') ?
|
41
|
+
$(tab_list_container).select(this.options.linkSelector) :
|
42
|
+
this.options.linkSelector($(tab_list_container))
|
43
|
+
).findAll(function(link){
|
44
|
+
return (/^#/).exec((Prototype.Browser.WebKit ? decodeURIComponent(link.href) : link.href).replace(window.location.href.split('#')[0],''));
|
45
|
+
}).each(function(link){
|
46
|
+
this.addTab(link);
|
47
|
+
}.bind(this));
|
48
|
+
this.containers.values().each(Element.hide);
|
49
|
+
if(this.options.defaultTab == 'first') {
|
50
|
+
this.setActiveTab(this.links.first());
|
51
|
+
} else if(this.options.defaultTab == 'last') {
|
52
|
+
this.setActiveTab(this.links.last());
|
53
|
+
} else {
|
54
|
+
this.setActiveTab(this.options.defaultTab); }
|
55
|
+
var targets = this.options.targetRegExp.exec(window.location);
|
56
|
+
if(targets && targets[1]){
|
57
|
+
targets[1].split(',').each(function(target){
|
58
|
+
this.setActiveTab(this.links.find(function(link){
|
59
|
+
return link.key == target;
|
60
|
+
}));
|
61
|
+
}.bind(this));
|
62
|
+
}
|
63
|
+
if(this.options.autoLinkExternal){
|
64
|
+
$A(document.getElementsByTagName('a')).each(function(a){
|
65
|
+
if(!this.links.include(a)){
|
66
|
+
var clean_href = a.href.replace(window.location.href.split('#')[0],'');
|
67
|
+
if(clean_href.substring(0,1) == '#'){
|
68
|
+
if(this.containers.keys().include(clean_href.substring(1))){
|
69
|
+
$(a).observe('click',function(event,clean_href){
|
70
|
+
this.setActiveTab(clean_href.substring(1));
|
71
|
+
}.bindAsEventListener(this,clean_href));
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}.bind(this));
|
76
|
+
}
|
77
|
+
},
|
78
|
+
addTab: function(link){
|
79
|
+
this.links.push(link);
|
80
|
+
link.key = link.getAttribute('href').replace(window.location.href.split('#')[0],'').split('#').last().replace(/#/,'');
|
81
|
+
var container = $(link.key);
|
82
|
+
if(!container) {
|
83
|
+
throw "Control.Tabs: #" + link.key + " was not found on the page."; }
|
84
|
+
this.containers.set(link.key,container);
|
85
|
+
link[this.options.hover ? 'onmouseover' : 'onclick'] = function(link){
|
86
|
+
if(window.event) {
|
87
|
+
Event.stop(window.event); }
|
88
|
+
this.setActiveTab(link);
|
89
|
+
return false;
|
90
|
+
}.bind(this,link);
|
91
|
+
},
|
92
|
+
setActiveTab: function(link){
|
93
|
+
if(!link && typeof(link) == 'undefined') {
|
94
|
+
return; }
|
95
|
+
if(typeof(link) == 'string'){
|
96
|
+
this.setActiveTab(this.links.find(function(_link){
|
97
|
+
return _link.key == link;
|
98
|
+
}));
|
99
|
+
}else if(typeof(link) == 'number'){
|
100
|
+
this.setActiveTab(this.links[link]);
|
101
|
+
}else{
|
102
|
+
if(this.notify('beforeChange',this.activeContainer,this.containers.get(link.key)) === false) {
|
103
|
+
return; }
|
104
|
+
if(this.activeContainer) {
|
105
|
+
this.options.hideFunction(this.activeContainer); }
|
106
|
+
this.links.each(function(item){
|
107
|
+
(this.options.setClassOnContainer ? $(item.parentNode) : item).removeClassName(this.options.activeClassName);
|
108
|
+
}.bind(this));
|
109
|
+
(this.options.setClassOnContainer ? $(link.parentNode) : link).addClassName(this.options.activeClassName);
|
110
|
+
this.activeContainer = this.containers.get(link.key);
|
111
|
+
this.activeLink = link;
|
112
|
+
this.options.showFunction(this.containers.get(link.key));
|
113
|
+
this.notify('afterChange',this.containers.get(link.key));
|
114
|
+
}
|
115
|
+
},
|
116
|
+
next: function(){
|
117
|
+
this.links.each(function(link,i){
|
118
|
+
if(this.activeLink == link && this.links[i + 1]){
|
119
|
+
this.setActiveTab(this.links[i + 1]);
|
120
|
+
throw $break;
|
121
|
+
}
|
122
|
+
}.bind(this));
|
123
|
+
},
|
124
|
+
previous: function(){
|
125
|
+
this.links.each(function(link,i){
|
126
|
+
if(this.activeLink == link && this.links[i - 1]){
|
127
|
+
this.setActiveTab(this.links[i - 1]);
|
128
|
+
throw $break;
|
129
|
+
}
|
130
|
+
}.bind(this));
|
131
|
+
},
|
132
|
+
first: function(){
|
133
|
+
this.setActiveTab(this.links.first());
|
134
|
+
},
|
135
|
+
last: function(){
|
136
|
+
this.setActiveTab(this.links.last());
|
137
|
+
}
|
136
138
|
});
|
137
139
|
Object.extend(Control.Tabs,{
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
140
|
+
instances: [],
|
141
|
+
findByTabId: function(id){
|
142
|
+
return Control.Tabs.instances.find(function(tab){
|
143
|
+
return tab.links.find(function(link){
|
144
|
+
return link.key == id;
|
145
|
+
});
|
146
|
+
});
|
147
|
+
}
|
146
148
|
});
|
147
|
-
Object.Event.extend(Control.Tabs);
|
149
|
+
Object.Event.extend(Control.Tabs);
|