rich_cms 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. data/CHANGELOG +4 -0
  2. data/README.textile +29 -7
  3. data/Rakefile +2 -2
  4. data/VERSION +1 -1
  5. data/lib/app/controllers/rich/._cms_controller.rb +0 -0
  6. data/lib/app/controllers/rich/cms_controller.rb +10 -14
  7. data/lib/app/views/._rich_cms.html.erb +0 -0
  8. data/lib/app/views/rich/cms/_dock.html.erb +8 -0
  9. data/lib/app/views/rich/cms/dock/.__menu.html.erb +0 -0
  10. data/lib/app/views/rich/cms/dock/.__panel.html.erb +0 -0
  11. data/lib/app/views/rich/cms/dock/_menu.html.erb +23 -0
  12. data/lib/app/views/rich/cms/dock/_panel.html.erb +3 -0
  13. data/lib/app/views/rich/cms/dock/panel/.__login.html.erb +0 -0
  14. data/lib/app/views/rich/cms/{bar → dock}/panel/_edit.html.erb +1 -1
  15. data/lib/app/views/rich/cms/{bar → dock}/panel/_login.html.erb +8 -4
  16. data/lib/app/views/rich_cms.html.erb +7 -2
  17. data/lib/assets/jzip/jquery/core.jz +159 -0
  18. data/lib/assets/jzip/jquery/extensions/browser_detect.js +8 -0
  19. data/lib/assets/jzip/jquery/extensions/modules.js +11 -1
  20. data/lib/assets/jzip/jquery/raccoon_tip.js +191 -0
  21. data/lib/assets/jzip/jquery/ui/components/core.js +18 -0
  22. data/lib/assets/jzip/jquery/ui/components/draggable.js +797 -0
  23. data/lib/assets/jzip/jquery/ui/components/mouse.js +151 -0
  24. data/lib/assets/jzip/jquery/ui/components/widget.js +237 -0
  25. data/lib/assets/jzip/jquery/ui/rich_cms/core.jz +5 -0
  26. data/lib/assets/jzip/jquery/ui/rich_cms/draggable.jz +2 -0
  27. data/lib/assets/jzip/jquery/ui/rich_cms/mouse.jz +3 -0
  28. data/lib/assets/jzip/jquery/ui/rich_cms/widget.jz +4 -0
  29. data/lib/assets/jzip/rich/cms/dock.js +61 -0
  30. data/lib/assets/jzip/rich/cms/editor.js +29 -31
  31. data/lib/assets/jzip/rich/cms/menu.js +19 -0
  32. data/lib/assets/jzip/rich/cms.js +19 -0
  33. data/lib/assets/jzip/rich.js +4 -27
  34. data/lib/assets/jzip/rich_cms.jz +7 -2
  35. data/lib/assets/sass/rich_cms/_content.sass +13 -0
  36. data/lib/assets/sass/rich_cms/_dock.sass +44 -0
  37. data/lib/assets/sass/rich_cms/_menu.sass +38 -0
  38. data/lib/assets/sass/rich_cms/_panel.sass +24 -0
  39. data/lib/assets/sass/rich_cms.sass +6 -3
  40. data/lib/assets/sass/tools/_css3.sass +18 -0
  41. data/lib/config/routes.rb +7 -5
  42. data/lib/rich/cms/actionpack/action_controller/._base.rb +0 -0
  43. data/lib/rich/cms/actionpack/action_controller/base.rb +11 -10
  44. data/lib/rich/cms/actionpack/action_view/._base.rb +0 -0
  45. data/lib/rich/cms/actionpack/action_view/base.rb +9 -1
  46. data/lib/rich/cms/content/item.rb +16 -12
  47. data/lib/rich/cms/engine.rb +11 -8
  48. data/lib/rich_cms.rb +3 -1
  49. data/rich_cms.gemspec +39 -19
  50. metadata +43 -19
  51. data/lib/app/views/rich/cms/_bar.html.erb +0 -4
  52. data/lib/app/views/rich/cms/_config.html.erb +0 -5
  53. data/lib/app/views/rich/cms/bar/_menu.html.erb +0 -16
  54. data/lib/app/views/rich/cms/bar/_panel.html.erb +0 -3
  55. data/lib/assets/jzip/jquery/core.js +0 -168
  56. data/lib/assets/jzip/rich/cms/login.js +0 -12
  57. data/lib/assets/sass/_bar.sass +0 -45
  58. data/lib/assets/sass/_editables.sass +0 -6
  59. /data/lib/assets/sass/{_mixins.sass → tools/_mixins.sass} +0 -0
@@ -0,0 +1,151 @@
1
+ /*!
2
+ * jQuery UI Mouse 1.8.4
3
+ *
4
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Mouse
9
+ *
10
+ * Depends:
11
+ * jquery.ui.widget.js
12
+ */
13
+ (function( $, undefined ) {
14
+
15
+ $.widget("ui.mouse", {
16
+ options: {
17
+ cancel: ':input,option',
18
+ distance: 1,
19
+ delay: 0
20
+ },
21
+ _mouseInit: function() {
22
+ var self = this;
23
+
24
+ this.element
25
+ .bind('mousedown.'+this.widgetName, function(event) {
26
+ return self._mouseDown(event);
27
+ })
28
+ .bind('click.'+this.widgetName, function(event) {
29
+ if(self._preventClickEvent) {
30
+ self._preventClickEvent = false;
31
+ event.stopImmediatePropagation();
32
+ return false;
33
+ }
34
+ });
35
+
36
+ this.started = false;
37
+ },
38
+
39
+ // TODO: make sure destroying one instance of mouse doesn't mess with
40
+ // other instances of mouse
41
+ _mouseDestroy: function() {
42
+ this.element.unbind('.'+this.widgetName);
43
+ },
44
+
45
+ _mouseDown: function(event) {
46
+ // don't let more than one widget handle mouseStart
47
+ // TODO: figure out why we have to use originalEvent
48
+ event.originalEvent = event.originalEvent || {};
49
+ if (event.originalEvent.mouseHandled) { return; }
50
+
51
+ // we may have missed mouseup (out of window)
52
+ (this._mouseStarted && this._mouseUp(event));
53
+
54
+ this._mouseDownEvent = event;
55
+
56
+ var self = this,
57
+ btnIsLeft = (event.which == 1),
58
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
59
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
60
+ return true;
61
+ }
62
+
63
+ this.mouseDelayMet = !this.options.delay;
64
+ if (!this.mouseDelayMet) {
65
+ this._mouseDelayTimer = setTimeout(function() {
66
+ self.mouseDelayMet = true;
67
+ }, this.options.delay);
68
+ }
69
+
70
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
71
+ this._mouseStarted = (this._mouseStart(event) !== false);
72
+ if (!this._mouseStarted) {
73
+ event.preventDefault();
74
+ return true;
75
+ }
76
+ }
77
+
78
+ // these delegates are required to keep context
79
+ this._mouseMoveDelegate = function(event) {
80
+ return self._mouseMove(event);
81
+ };
82
+ this._mouseUpDelegate = function(event) {
83
+ return self._mouseUp(event);
84
+ };
85
+ $(document)
86
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
87
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
88
+
89
+ // preventDefault() is used to prevent the selection of text here -
90
+ // however, in Safari, this causes select boxes not to be selectable
91
+ // anymore, so this fix is needed
92
+ ($.browser.safari || event.preventDefault());
93
+
94
+ event.originalEvent.mouseHandled = true;
95
+ return true;
96
+ },
97
+
98
+ _mouseMove: function(event) {
99
+ // IE mouseup check - mouseup happened when mouse was out of window
100
+ if ($.browser.msie && !event.button) {
101
+ return this._mouseUp(event);
102
+ }
103
+
104
+ if (this._mouseStarted) {
105
+ this._mouseDrag(event);
106
+ return event.preventDefault();
107
+ }
108
+
109
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
110
+ this._mouseStarted =
111
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
112
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
113
+ }
114
+
115
+ return !this._mouseStarted;
116
+ },
117
+
118
+ _mouseUp: function(event) {
119
+ $(document)
120
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
121
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
122
+
123
+ if (this._mouseStarted) {
124
+ this._mouseStarted = false;
125
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
126
+ this._mouseStop(event);
127
+ }
128
+
129
+ return false;
130
+ },
131
+
132
+ _mouseDistanceMet: function(event) {
133
+ return (Math.max(
134
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
135
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
136
+ ) >= this.options.distance
137
+ );
138
+ },
139
+
140
+ _mouseDelayMet: function(event) {
141
+ return this.mouseDelayMet;
142
+ },
143
+
144
+ // These are placeholder methods, to be overriden by extending plugin
145
+ _mouseStart: function(event) {},
146
+ _mouseDrag: function(event) {},
147
+ _mouseStop: function(event) {},
148
+ _mouseCapture: function(event) { return true; }
149
+ });
150
+
151
+ })(jQuery);
@@ -0,0 +1,237 @@
1
+ /*!
2
+ * jQuery UI Widget 1.8.4
3
+ *
4
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Widget
9
+ */
10
+ (function( $, undefined ) {
11
+
12
+ var _remove = $.fn.remove;
13
+
14
+ $.fn.remove = function( selector, keepData ) {
15
+ return this.each(function() {
16
+ if ( !keepData ) {
17
+ if ( !selector || $.filter( selector, [ this ] ).length ) {
18
+ $( "*", this ).add( [ this ] ).each(function() {
19
+ $( this ).triggerHandler( "remove" );
20
+ });
21
+ }
22
+ }
23
+ return _remove.call( $(this), selector, keepData );
24
+ });
25
+ };
26
+
27
+ $.widget = function( name, base, prototype ) {
28
+ var namespace = name.split( "." )[ 0 ],
29
+ fullName;
30
+ name = name.split( "." )[ 1 ];
31
+ fullName = namespace + "-" + name;
32
+
33
+ if ( !prototype ) {
34
+ prototype = base;
35
+ base = $.Widget;
36
+ }
37
+
38
+ // create selector for plugin
39
+ $.expr[ ":" ][ fullName ] = function( elem ) {
40
+ return !!$.data( elem, name );
41
+ };
42
+
43
+ $[ namespace ] = $[ namespace ] || {};
44
+ $[ namespace ][ name ] = function( options, element ) {
45
+ // allow instantiation without initializing for simple inheritance
46
+ if ( arguments.length ) {
47
+ this._createWidget( options, element );
48
+ }
49
+ };
50
+
51
+ var basePrototype = new base();
52
+ // we need to make the options hash a property directly on the new instance
53
+ // otherwise we'll modify the options hash on the prototype that we're
54
+ // inheriting from
55
+ // $.each( basePrototype, function( key, val ) {
56
+ // if ( $.isPlainObject(val) ) {
57
+ // basePrototype[ key ] = $.extend( {}, val );
58
+ // }
59
+ // });
60
+ basePrototype.options = $.extend( true, {}, basePrototype.options );
61
+ $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
62
+ namespace: namespace,
63
+ widgetName: name,
64
+ widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
65
+ widgetBaseClass: fullName
66
+ }, prototype );
67
+
68
+ $.widget.bridge( name, $[ namespace ][ name ] );
69
+ };
70
+
71
+ $.widget.bridge = function( name, object ) {
72
+ $.fn[ name ] = function( options ) {
73
+ var isMethodCall = typeof options === "string",
74
+ args = Array.prototype.slice.call( arguments, 1 ),
75
+ returnValue = this;
76
+
77
+ // allow multiple hashes to be passed on init
78
+ options = !isMethodCall && args.length ?
79
+ $.extend.apply( null, [ true, options ].concat(args) ) :
80
+ options;
81
+
82
+ // prevent calls to internal methods
83
+ if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
84
+ return returnValue;
85
+ }
86
+
87
+ if ( isMethodCall ) {
88
+ this.each(function() {
89
+ var instance = $.data( this, name ),
90
+ methodValue = instance && $.isFunction( instance[options] ) ?
91
+ instance[ options ].apply( instance, args ) :
92
+ instance;
93
+ if ( methodValue !== instance && methodValue !== undefined ) {
94
+ returnValue = methodValue;
95
+ return false;
96
+ }
97
+ });
98
+ } else {
99
+ this.each(function() {
100
+ var instance = $.data( this, name );
101
+ if ( instance ) {
102
+ if ( options ) {
103
+ instance.option( options );
104
+ }
105
+ instance._init();
106
+ } else {
107
+ $.data( this, name, new object( options, this ) );
108
+ }
109
+ });
110
+ }
111
+
112
+ return returnValue;
113
+ };
114
+ };
115
+
116
+ $.Widget = function( options, element ) {
117
+ // allow instantiation without initializing for simple inheritance
118
+ if ( arguments.length ) {
119
+ this._createWidget( options, element );
120
+ }
121
+ };
122
+
123
+ $.Widget.prototype = {
124
+ widgetName: "widget",
125
+ widgetEventPrefix: "",
126
+ options: {
127
+ disabled: false
128
+ },
129
+ _createWidget: function( options, element ) {
130
+ // $.widget.bridge stores the plugin instance, but we do it anyway
131
+ // so that it's stored even before the _create function runs
132
+ $.data( element, this.widgetName, this );
133
+ this.element = $( element );
134
+ this.options = $.extend( true, {},
135
+ this.options,
136
+ $.metadata && $.metadata.get( element )[ this.widgetName ],
137
+ options );
138
+
139
+ var self = this;
140
+ this.element.bind( "remove." + this.widgetName, function() {
141
+ self.destroy();
142
+ });
143
+
144
+ this._create();
145
+ this._init();
146
+ },
147
+ _create: function() {},
148
+ _init: function() {},
149
+
150
+ destroy: function() {
151
+ this.element
152
+ .unbind( "." + this.widgetName )
153
+ .removeData( this.widgetName );
154
+ this.widget()
155
+ .unbind( "." + this.widgetName )
156
+ .removeAttr( "aria-disabled" )
157
+ .removeClass(
158
+ this.widgetBaseClass + "-disabled " +
159
+ "ui-state-disabled" );
160
+ },
161
+
162
+ widget: function() {
163
+ return this.element;
164
+ },
165
+
166
+ option: function( key, value ) {
167
+ var options = key,
168
+ self = this;
169
+
170
+ if ( arguments.length === 0 ) {
171
+ // don't return a reference to the internal hash
172
+ return $.extend( {}, self.options );
173
+ }
174
+
175
+ if (typeof key === "string" ) {
176
+ if ( value === undefined ) {
177
+ return this.options[ key ];
178
+ }
179
+ options = {};
180
+ options[ key ] = value;
181
+ }
182
+
183
+ $.each( options, function( key, value ) {
184
+ self._setOption( key, value );
185
+ });
186
+
187
+ return self;
188
+ },
189
+ _setOption: function( key, value ) {
190
+ this.options[ key ] = value;
191
+
192
+ if ( key === "disabled" ) {
193
+ this.widget()
194
+ [ value ? "addClass" : "removeClass"](
195
+ this.widgetBaseClass + "-disabled" + " " +
196
+ "ui-state-disabled" )
197
+ .attr( "aria-disabled", value );
198
+ }
199
+
200
+ return this;
201
+ },
202
+
203
+ enable: function() {
204
+ return this._setOption( "disabled", false );
205
+ },
206
+ disable: function() {
207
+ return this._setOption( "disabled", true );
208
+ },
209
+
210
+ _trigger: function( type, event, data ) {
211
+ var callback = this.options[ type ];
212
+
213
+ event = $.Event( event );
214
+ event.type = ( type === this.widgetEventPrefix ?
215
+ type :
216
+ this.widgetEventPrefix + type ).toLowerCase();
217
+ data = data || {};
218
+
219
+ // copy original event properties over to the new event
220
+ // this would happen if we could call $.event.fix instead of $.Event
221
+ // but we don't have a way to force an event to be fixed multiple times
222
+ if ( event.originalEvent ) {
223
+ for ( var i = $.event.props.length, prop; i; ) {
224
+ prop = $.event.props[ --i ];
225
+ event[ prop ] = event.originalEvent[ prop ];
226
+ }
227
+ }
228
+
229
+ this.element.trigger( event, data );
230
+
231
+ return !( $.isFunction(callback) &&
232
+ callback.call( this.element[0], event, data ) === false ||
233
+ event.isDefaultPrevented() );
234
+ }
235
+ };
236
+
237
+ })( jQuery );
@@ -0,0 +1,5 @@
1
+
2
+ //= require ../components/core
3
+ //= require ../components/widget
4
+ //= require ../components/mouse
5
+ //= require ../components/draggable
@@ -0,0 +1,2 @@
1
+
2
+ //= require ../components/draggable
@@ -0,0 +1,3 @@
1
+
2
+ //= require ../components/mouse
3
+ //= require ../components/draggable
@@ -0,0 +1,4 @@
1
+
2
+ //= require ../components/widget
3
+ //= require ../components/mouse
4
+ //= require ../components/draggable
@@ -0,0 +1,61 @@
1
+
2
+ Rich.Cms.Dock = (function() {
3
+ var bind = function() {
4
+ if (!$.ie6) {
5
+ makeDraggable();
6
+ }
7
+ };
8
+
9
+ var makeDraggable = function() {
10
+ $("#rich_cms_dock").draggable({
11
+ helper: "clone",
12
+ handle: "#rich_cms_menu li:first",
13
+ start: function(event, ui) {
14
+ $("#x1,#x2,#y1,#x,#y").addClass("display");
15
+ },
16
+ drag: function(event, ui) {
17
+ var x = event.pageX;
18
+ var y = event.pageY;
19
+ var x_div = $(window).width() / 3;
20
+ var y_div = $(window).height() / 2;
21
+
22
+ $("#x" ).css({left: x });
23
+ $("#y" ).css({top : y });
24
+ $("#x1").css({left: x_div });
25
+ $("#x2").css({left: x_div * 2});
26
+ $("#y1").css({top : y_div });
27
+
28
+ if (x < x_div) {
29
+ $("#rich_cms_dock") .addClass("left").removeClass("middle").removeClass("right");
30
+ } else if (x > (x_div * 2)) {
31
+ $("#rich_cms_dock").removeClass("left").removeClass("middle") .addClass("right");
32
+ } else {
33
+ $("#rich_cms_dock").removeClass("left"). addClass("middle").removeClass("right");
34
+ }
35
+
36
+ if (y < y_div) {
37
+ $("#rich_cms_dock") .addClass("top").removeClass("bottom");
38
+ } else {
39
+ $("#rich_cms_dock").removeClass("top").addClass("bottom");
40
+ }
41
+ },
42
+ stop: function(event, ui) {
43
+ $("#x1,#x2,#y1,#x,#y").removeClass("display");
44
+ $.ajax({
45
+ url: "/cms/position",
46
+ data: {
47
+ position: $.grep(($("#rich_cms_dock").attr("class") || "").split(" "), function(c) {
48
+ return $.inArray(c, ["top", "bottom", "left", "middle", "right"]);
49
+ }).join(" ")
50
+ }
51
+ });
52
+ }
53
+ });
54
+ };
55
+
56
+ return {
57
+ init: function() {
58
+ bind();
59
+ }
60
+ };
61
+ }());
@@ -1,32 +1,34 @@
1
1
 
2
2
  Rich.Cms.Editor = (function() {
3
- var edit_panel = "#rich_cms_bar .panel .edit",
4
- content_class = "rich_cms_content",
5
- mark_class = "marked",
6
- editable_content = {},
7
- content_items = "";
3
+ var content_class = "rich_cms_content", mark_class = "marked", edit_panel = "#rich_cms_panel",
4
+ editable_content = {}, content_items = "";
8
5
 
9
6
  var register = function(hash) {
10
7
  $.extend(editable_content, hash);
11
8
  content_items = $.keys(editable_content).join(",");
12
9
  };
13
10
 
14
- var editHandler = function(event) {
15
- edit($(this));
16
- event.preventDefault();
17
- };
18
-
19
11
  var bind = function() {
20
- $("#rich_cms_bar .menu a.mark" ).bind("click", mark );
21
- $(edit_panel + " a.close" ).bind("click", function() { $(edit_panel).hide(); });
22
- $("." + content_class + "." + mark_class).live("click", editHandler );
12
+ $("#rich_cms_panel .edit a.close").bind("click", function(event) {
13
+ event.preventDefault();
14
+ RaccoonTip.close();
15
+ });
16
+
17
+ RaccoonTip.register("." + content_class + "." + mark_class, "#rich_cms_panel", {beforeShow: edit, afterHide : function(content) { content.hide(); }});
18
+ bindSeatHolders();
19
+
20
+ $.registerAjaxFormHandler({
21
+ "rich_cms_content": afterUpdate
22
+ });
23
23
  };
24
24
 
25
25
  var bindSeatHolders = function() {
26
- $(content_items + "." + mark_class + ".sh_hint").bind("focus", editHandler);
26
+ RaccoonTip.register("." + content_class + "." + mark_class + ".sh_hint", "#rich_cms_panel", {event: "focus", beforeShow: edit, afterHide : function(content) { content.hide(); }});
27
27
  };
28
28
 
29
29
  var mark = function(event) {
30
+ event.preventDefault();
31
+
30
32
  $(content_items).addClass(content_class).toggleClass(mark_class);
31
33
 
32
34
  var markedContentItems = $(content_items + "." + mark_class);
@@ -42,22 +44,20 @@ Rich.Cms.Editor = (function() {
42
44
  $(content_items + ".block").removeClass("block");
43
45
  $(edit_panel).hide();
44
46
  }
45
-
46
- event.preventDefault();
47
47
  };
48
48
 
49
- var edit = function(content_item) {
50
- var label = $("#rich_cms_bar .edit label");
51
- var inputs = $("#rich_cms_bar .edit form fieldset.inputs");
49
+ var edit = function() {
50
+ var content_item = $(this);
51
+ var label = $("#rich_cms_panel .edit form fieldset.inputs label");
52
+ var inputs = $("#rich_cms_panel .edit form fieldset.inputs");
53
+
54
+ var text = content_item.is("textarea") || content_item.hasClass("block");
55
+ var attrs = content_item.get(0).attributes;
52
56
 
53
- var text = content_item.is("textarea") || content_item.hasClass("block");
54
- var attrs = content_item.get(0).attributes;
55
-
56
- var match = $.grep($.makeArray(editable_content), function(hash) {
57
- return content_item.is($.keys(hash)[0]);
58
- })[0];
59
- var selector = $.keys(match)[0];
60
- var specs = $.values(match)[0];
57
+ var selector = $.grep($.keys(editable_content), function(s) {
58
+ return content_item.is(s);
59
+ })[0];
60
+ var specs = editable_content[selector];
61
61
 
62
62
  label.html($.map(specs.keys, function(key) { return content_item.attr(key); }).join(", "));
63
63
 
@@ -109,10 +109,8 @@ Rich.Cms.Editor = (function() {
109
109
  return {
110
110
  init: function() {
111
111
  bind();
112
- $.registerAjaxFormHandler({
113
- "rich_cms_content": afterUpdate
114
- });
115
112
  },
116
- register: register
113
+ register: register,
114
+ mark: mark
117
115
  };
118
116
  }());
@@ -0,0 +1,19 @@
1
+
2
+ Rich.Cms.Menu = (function() {
3
+ var bind = function() {
4
+ $("#rich_cms_menu a.mark").bind("click", Rich.Cms.Editor.mark);
5
+ };
6
+
7
+ var register = function() {
8
+ RaccoonTip.register("#rich_cms_menu a.login", "#rich_cms_panel",
9
+ {beforeShow: function(content) { content.show(); },
10
+ afterHide : function(content) { content.hide(); }});
11
+ };
12
+
13
+ return {
14
+ init: function() {
15
+ bind();
16
+ register();
17
+ }
18
+ };
19
+ }());
@@ -1,2 +1,21 @@
1
1
 
2
2
  Rich.Cms = {};
3
+
4
+ (function requireMissingLibs() {
5
+ var id = "rc_dummy_script";
6
+ document.write('<script id="' + id + '"></script>');
7
+
8
+ var dummy_script = document.getElementById(id);
9
+ var element = dummy_script.previousSibling;
10
+ while (element && (element.tagName.toLowerCase() != "script" || element.getAttribute("src").indexOf("rich_cms") == -1)) {
11
+ element = element.previousSibling;
12
+ }
13
+ dummy_script.parentNode.removeChild(dummy_script);
14
+
15
+ var libs_file = ["core", "widget", "mouse", "draggable"][$.inArray("undefined", [typeof($.ui), typeof($.widget), typeof(($.ui || {}).mouse), typeof(($.ui || {}).draggable)])];
16
+
17
+ if (libs_file) {
18
+ var src = element.getAttribute("src").replace(/(development\/)?(\w+)(\-min)?\.js.*$/, "jquery/ui/rich_cms/" + libs_file + ".js");
19
+ document.write('<script src="' + src + '" type="text/javascript"></script>');
20
+ }
21
+ }());
@@ -1,28 +1,5 @@
1
- if (typeof(Rich) == "undefined") {
2
-
3
- Rich = (function() {
4
- var initModules = function() {
5
- $.each($.modules(Rich), function(i, module) {
6
- initSubModules(module);
7
- });
8
- };
9
-
10
- var initSubModules = function(mod) {
11
- if (mod.init) {
12
- mod.init();
13
- }
14
- $.each($.modules(mod), function(i, m) {
15
- initSubModules(m);
16
- });
17
- };
18
-
19
- return {
20
- init: function() {
21
- initModules();
22
- }
23
- };
24
- }());
25
1
 
26
- $(Rich.init);
27
-
28
- }
2
+ if (typeof(Rich) == "undefined") {
3
+ Rich = {};
4
+ $.initModules(Rich);
5
+ }
@@ -1,10 +1,15 @@
1
1
 
2
- //= require jquery/core
2
+ var onRaccoonTipReady = function() {
3
3
  //= require jquery/extensions/ajaxify
4
4
  //= require jquery/extensions/modules
5
5
  //= require jquery/extensions/object
6
+ //= require jquery/extensions/browser_detect
6
7
 
7
8
  //= require rich
8
9
  //= require rich/cms
9
- //= require rich/cms/login
10
10
  //= require rich/cms/editor
11
+ //= require rich/cms/dock
12
+ //= require rich/cms/menu
13
+ };
14
+
15
+ //= require jquery/raccoon_tip
@@ -0,0 +1,13 @@
1
+
2
+ .rich_cms_content
3
+ &.marked
4
+ color: black
5
+ cursor: pointer
6
+ *border: 1px solid #777
7
+ background: #F1EB00
8
+ +border_radius(2px)
9
+ +box_shadow(rgba(0, 0, 0, 0.5), 0, 1px, 3px)
10
+ +text-shadow(transparent, 0, 0)
11
+
12
+ &.block
13
+ display: block