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.
Files changed (67) hide show
  1. data/README +20 -9
  2. data/Rakefile +10 -0
  3. data/bin/refinery +53 -0
  4. data/bin/refinery-update-core +23 -0
  5. data/config/environment.rb +2 -2
  6. data/config/preinitializer.rb +24 -0
  7. data/public/javascripts/application.js +0 -1
  8. data/public/javascripts/jquery/jquery.js +4373 -8
  9. data/public/javascripts/livepipe.js +10 -186
  10. data/public/javascripts/{admin.js → refinery/admin.js} +0 -0
  11. data/public/javascripts/{wymeditor → refinery}/boot_wym.js +0 -0
  12. data/public/javascripts/{dialog.js → refinery/dialog.js} +0 -0
  13. data/public/javascripts/{parse_url.js → refinery/parse_url.js} +0 -0
  14. data/public/javascripts/{prototype.enhancements.js → refinery/prototype.enhancements.js} +0 -0
  15. data/public/javascripts/{tooltips.js → refinery/tooltips.js} +0 -0
  16. data/public/javascripts/tabs.js +135 -133
  17. data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +4 -5
  18. data/public/stylesheets/formatting.css +5 -0
  19. data/public/stylesheets/home.css +5 -0
  20. data/public/stylesheets/{formatting.css.example → refinery/formatting.css} +45 -34
  21. data/public/stylesheets/refinery/home.css +0 -0
  22. data/public/stylesheets/{refinery.css → refinery/refinery.css} +77 -36
  23. data/public/stylesheets/refinery/theme.css +36 -0
  24. data/public/stylesheets/{thickbox.css → refinery/thickbox.css} +0 -0
  25. data/public/stylesheets/{tooltips.css → refinery/tooltips.css} +0 -0
  26. data/public/stylesheets/theme.css +1 -36
  27. data/script/about +3 -0
  28. data/script/console +3 -0
  29. data/script/dbconsole +3 -0
  30. data/script/destroy +3 -0
  31. data/script/generate +3 -0
  32. data/script/performance/profiler +3 -0
  33. data/script/performance/request +3 -0
  34. data/script/plugin +3 -0
  35. data/script/process/inspector +3 -0
  36. data/script/process/reaper +3 -0
  37. data/script/process/spawner +3 -0
  38. data/script/runner +3 -0
  39. data/script/server +3 -0
  40. data/vendor/plugins/authentication/app/views/sessions/new.html.erb +5 -5
  41. data/vendor/plugins/images/app/views/admin/images/index.html.erb +4 -5
  42. data/vendor/plugins/images/app/views/admin/images/insert.html.erb +1 -1
  43. data/vendor/plugins/inquiries/app/views/admin/inquiries/index.html.erb +3 -4
  44. data/vendor/plugins/news/app/views/admin/news_items/index.html.erb +4 -5
  45. data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +3 -4
  46. data/vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb +4 -4
  47. data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +4 -2
  48. data/vendor/plugins/pages/app/views/admin/pages/index.html.erb +4 -5
  49. data/vendor/plugins/refinery/app/views/admin/_head.html.erb +7 -5
  50. data/vendor/plugins/refinery/app/views/admin/_menu.html.erb +2 -2
  51. data/vendor/plugins/refinery/app/views/layouts/admin.html.erb +25 -17
  52. data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +1 -1
  53. data/vendor/plugins/refinery/init.rb +1 -0
  54. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +9 -12
  55. data/vendor/plugins/refinery/lib/refinery/admin_base_controller.rb +2 -3
  56. data/vendor/plugins/refinery_dialogs/app/views/layouts/admin_dialog.html.erb +1 -1
  57. data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +3 -4
  58. metadata +35 -85
  59. data/public/javascripts/jquery/README +0 -67
  60. data/public/javascripts/jquery/jquery.ui.draggable.js +0 -1
  61. data/public/javascripts/jquery/jquery.ui.js +0 -1
  62. data/public/javascripts/jquery/jquery.ui.resizable.js +0 -1
  63. data/public/javascripts/jquery/jquery.ui.sortable.js +0 -1
  64. data/public/javascripts/overlabel.js +0 -66
  65. data/public/stylesheets/application.css.example +0 -76
  66. data/public/stylesheets/home.css.example +0 -27
  67. 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
- if(!delta)
299
- return;
300
- var custom_event = Event.element(event).fire('mouse:wheel',{
301
- delta: delta
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
+ });
@@ -7,141 +7,143 @@
7
7
  * @require prototype.js, livepipe.js
8
8
  */
9
9
 
10
- if(typeof(Prototype) == "undefined")
11
- throw "Control.Tabs requires Prototype to be loaded.";
12
- if(typeof(Object.Event) == "undefined")
13
- throw "Control.Tabs requires Object.Event to be loaded.";
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
- initialize: function(tab_list_container,options){
17
- if(!$(tab_list_container))
18
- throw "Control.Tabs could not find the element: " + tab_list_container;
19
- this.activeContainer = false;
20
- this.activeLink = false;
21
- this.containers = $H({});
22
- this.links = [];
23
- Control.Tabs.instances.push(this);
24
- this.options = {
25
- beforeChange: Prototype.emptyFunction,
26
- afterChange: Prototype.emptyFunction,
27
- hover: false,
28
- linkSelector: 'li a',
29
- setClassOnContainer: false,
30
- activeClassName: 'active',
31
- defaultTab: 'first',
32
- autoLinkExternal: true,
33
- targetRegExp: /#(.+)$/,
34
- showFunction: Element.show,
35
- hideFunction: Element.hide
36
- };
37
- Object.extend(this.options,options || {});
38
- (typeof(this.options.linkSelector == 'string')
39
- ? $(tab_list_container).select(this.options.linkSelector)
40
- : this.options.linkSelector($(tab_list_container))
41
- ).findAll(function(link){
42
- return (/^#/).exec((Prototype.Browser.WebKit ? decodeURIComponent(link.href) : link.href).replace(window.location.href.split('#')[0],''));
43
- }).each(function(link){
44
- this.addTab(link);
45
- }.bind(this));
46
- this.containers.values().each(Element.hide);
47
- if(this.options.defaultTab == 'first')
48
- this.setActiveTab(this.links.first());
49
- else if(this.options.defaultTab == 'last')
50
- this.setActiveTab(this.links.last());
51
- else
52
- this.setActiveTab(this.options.defaultTab);
53
- var targets = this.options.targetRegExp.exec(window.location);
54
- if(targets && targets[1]){
55
- targets[1].split(',').each(function(target){
56
- this.setActiveTab(this.links.find(function(link){
57
- return link.key == target;
58
- }));
59
- }.bind(this));
60
- }
61
- if(this.options.autoLinkExternal){
62
- $A(document.getElementsByTagName('a')).each(function(a){
63
- if(!this.links.include(a)){
64
- var clean_href = a.href.replace(window.location.href.split('#')[0],'');
65
- if(clean_href.substring(0,1) == '#'){
66
- if(this.containers.keys().include(clean_href.substring(1))){
67
- $(a).observe('click',function(event,clean_href){
68
- this.setActiveTab(clean_href.substring(1));
69
- }.bindAsEventListener(this,clean_href));
70
- }
71
- }
72
- }
73
- }.bind(this));
74
- }
75
- },
76
- addTab: function(link){
77
- this.links.push(link);
78
- link.key = link.getAttribute('href').replace(window.location.href.split('#')[0],'').split('/').last().replace(/#/,'');
79
- var container = $(link.key);
80
- if(!container)
81
- throw "Control.Tabs: #" + link.key + " was not found on the page."
82
- this.containers.set(link.key,container);
83
- link[this.options.hover ? 'onmouseover' : 'onclick'] = function(link){
84
- if(window.event)
85
- Event.stop(window.event);
86
- this.setActiveTab(link);
87
- return false;
88
- }.bind(this,link);
89
- },
90
- setActiveTab: function(link){
91
- if(!link && typeof(link) == 'undefined')
92
- return;
93
- if(typeof(link) == 'string'){
94
- this.setActiveTab(this.links.find(function(_link){
95
- return _link.key == link;
96
- }));
97
- }else if(typeof(link) == 'number'){
98
- this.setActiveTab(this.links[link]);
99
- }else{
100
- if(this.notify('beforeChange',this.activeContainer,this.containers.get(link.key)) === false)
101
- return;
102
- if(this.activeContainer)
103
- this.options.hideFunction(this.activeContainer);
104
- this.links.each(function(item){
105
- (this.options.setClassOnContainer ? $(item.parentNode) : item).removeClassName(this.options.activeClassName);
106
- }.bind(this));
107
- (this.options.setClassOnContainer ? $(link.parentNode) : link).addClassName(this.options.activeClassName);
108
- this.activeContainer = this.containers.get(link.key);
109
- this.activeLink = link;
110
- this.options.showFunction(this.containers.get(link.key));
111
- this.notify('afterChange',this.containers.get(link.key));
112
- }
113
- },
114
- next: function(){
115
- this.links.each(function(link,i){
116
- if(this.activeLink == link && this.links[i + 1]){
117
- this.setActiveTab(this.links[i + 1]);
118
- throw $break;
119
- }
120
- }.bind(this));
121
- },
122
- previous: function(){
123
- this.links.each(function(link,i){
124
- if(this.activeLink == link && this.links[i - 1]){
125
- this.setActiveTab(this.links[i - 1]);
126
- throw $break;
127
- }
128
- }.bind(this));
129
- },
130
- first: function(){
131
- this.setActiveTab(this.links.first());
132
- },
133
- last: function(){
134
- this.setActiveTab(this.links.last());
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
- instances: [],
139
- findByTabId: function(id){
140
- return Control.Tabs.instances.find(function(tab){
141
- return tab.links.find(function(link){
142
- return link.key == id;
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);