refinerycms-core 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/shared/admin/_resource_picker.html.erb +22 -13
- data/config/locales/bg.yml +3 -0
- data/config/locales/cs.yml +3 -0
- data/config/locales/da.yml +3 -0
- data/config/locales/de.yml +3 -0
- data/config/locales/el.yml +3 -0
- data/config/locales/en.yml +4 -0
- data/config/locales/es.yml +3 -0
- data/config/locales/fi.yml +3 -0
- data/config/locales/fr.yml +3 -0
- data/config/locales/it.yml +3 -0
- data/config/locales/jp.yml +3 -0
- data/config/locales/lolcat.yml +3 -0
- data/config/locales/lt.yml +3 -0
- data/config/locales/lv.yml +3 -0
- data/config/locales/nb.yml +3 -0
- data/config/locales/nl.yml +3 -0
- data/config/locales/pl.yml +3 -0
- data/config/locales/pt-BR.yml +3 -0
- data/config/locales/rs.yml +3 -0
- data/config/locales/ru.yml +3 -0
- data/config/locales/sk.yml +3 -0
- data/config/locales/sl.yml +3 -0
- data/config/locales/sv.yml +3 -0
- data/config/locales/vi.yml +3 -0
- data/config/locales/zh-CN.yml +3 -0
- data/config/locales/zh-TW.yml +3 -0
- data/lib/gemspec.rb +1 -1
- data/lib/refinery/helpers/menu_helper.rb +1 -0
- data/lib/refinery/plugin.rb +1 -1
- data/lib/refinerycms-core.rb +0 -5
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +89 -73
- data/public/stylesheets/refinery/refinery.css +25 -0
- data/refinerycms-core.gemspec +5 -5
- data/spec/lib/refinery/plugins_spec.rb +1 -1
- metadata +18 -14
@@ -1,6 +1,18 @@
|
|
1
1
|
<%
|
2
2
|
conditions ||= nil
|
3
|
-
|
3
|
+
if resource.present?
|
4
|
+
display_when_present = ""
|
5
|
+
hide_when_present = "display:none;"
|
6
|
+
file_title = "#{resource.title} (#{resource.file_name})"
|
7
|
+
resource_url = resource.url
|
8
|
+
else
|
9
|
+
display_when_present = "display:none;"
|
10
|
+
hide_when_present = ""
|
11
|
+
file_title = ""
|
12
|
+
resource_url = ""
|
13
|
+
end
|
14
|
+
|
15
|
+
insert_text = "<span id='no_resource_selected_#{field}' class='nothing_selected' style='#{hide_when_present}'>
|
4
16
|
#{t('.no_resource_selected')}
|
5
17
|
</span>".html_safe
|
6
18
|
insert_link = insert_admin_resources_path({
|
@@ -9,32 +21,29 @@
|
|
9
21
|
:update_text => "current_resource_text_#{field}",
|
10
22
|
:callback => "resource_changed_#{field}",
|
11
23
|
:field => [f.object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, ""), field].join('_'),
|
12
|
-
:current_link =>
|
24
|
+
:current_link => resource_url,
|
13
25
|
:height => 480,
|
14
26
|
:conditions => conditions
|
15
27
|
})
|
16
|
-
|
28
|
+
|
29
|
+
linked_html = "#{refinery_icon_tag('page_white_put.png')} " + content_tag(:span, file_title, :id => "current_resource_text_#{field}")
|
30
|
+
%>
|
31
|
+
|
17
32
|
<%= f.hidden_field field %>
|
18
33
|
<div>
|
19
34
|
<%= link_to insert_text, insert_link,
|
20
35
|
:name => t('.name'),
|
21
36
|
:id => "current_resource_link_#{field}"
|
22
37
|
%>
|
23
|
-
<div id='current_resource_container_<%= field %>' style='margin-top: 10px
|
24
|
-
<%= link_to
|
25
|
-
content_tag(
|
26
|
-
:span,
|
27
|
-
"#{resource.title} (#{resource.file_name})",
|
28
|
-
:id => "current_resource_text_#{field}"
|
29
|
-
),
|
30
|
-
resource.url,
|
38
|
+
<div id='current_resource_container_<%= field %>' style='margin-top: 10px;<%= display_when_present %>'>
|
39
|
+
<%= link_to linked_html.html_safe, resource_url,
|
31
40
|
:id => "current_resource_#{field}",
|
32
|
-
:target => "_blank"
|
41
|
+
:target => "_blank" %>
|
33
42
|
</div>
|
34
43
|
<br/>
|
35
44
|
<%= link_to t('.remove_current'), "",
|
36
45
|
:id => "remove_resource_#{field}",
|
37
|
-
:style =>
|
46
|
+
:style => display_when_present %>
|
38
47
|
</div>
|
39
48
|
|
40
49
|
<% content_for :javascripts do %>
|
data/config/locales/bg.yml
CHANGED
data/config/locales/cs.yml
CHANGED
data/config/locales/da.yml
CHANGED
data/config/locales/de.yml
CHANGED
data/config/locales/el.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
en:
|
2
|
+
will_paginate:
|
3
|
+
previous_label: "«"
|
4
|
+
next_label: "»"
|
2
5
|
js:
|
3
6
|
admin:
|
4
7
|
confirm_changes: Any changes you've made will be lost. Are you sure you want to continue without saving?
|
@@ -76,3 +79,4 @@ en:
|
|
76
79
|
time:
|
77
80
|
formats:
|
78
81
|
short: "%A, %d %B %Y"
|
82
|
+
|
data/config/locales/es.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/jp.yml
CHANGED
data/config/locales/lolcat.yml
CHANGED
data/config/locales/lt.yml
CHANGED
data/config/locales/lv.yml
CHANGED
data/config/locales/nb.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/rs.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
data/lib/gemspec.rb
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_dependency 'refinerycms-generators', '~> 1.0'
|
27
27
|
s.add_dependency 'acts_as_indexed', '~> 0.7'
|
28
28
|
s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
|
29
|
-
s.add_dependency 'globalize3', '~> 0.
|
29
|
+
s.add_dependency 'globalize3', '~> 0.2.0.beta4'
|
30
30
|
s.add_dependency 'awesome_nested_set', '~> 2.0'
|
31
31
|
s.add_dependency 'rails', '~> 3.0.10'
|
32
32
|
s.add_dependency 'truncate_html', '~> 0.5'
|
@@ -86,6 +86,7 @@ module Refinery
|
|
86
86
|
url = [page.url]
|
87
87
|
url << ['', page.url[:path]].compact.flatten.join('/') if page.url.respond_to?(:keys)
|
88
88
|
url = url.detect{|u| u.is_a?(String)}
|
89
|
+
url.chomp!('/') if url.size > 1
|
89
90
|
|
90
91
|
# Now use all possible vectors to try to find a valid match,
|
91
92
|
# finally passing to rails' "current_page?" method.
|
data/lib/refinery/plugin.rb
CHANGED
data/lib/refinerycms-core.rb
CHANGED
@@ -161,11 +161,6 @@ module Refinery
|
|
161
161
|
end if ::Rack.version <= '1.2.1'
|
162
162
|
end
|
163
163
|
|
164
|
-
initializer 'set will_paginate link labels' do |app|
|
165
|
-
WillPaginate::ViewHelpers.pagination_options[:previous_label] = "«".html_safe
|
166
|
-
WillPaginate::ViewHelpers.pagination_options[:next_label] = "»".html_safe
|
167
|
-
end
|
168
|
-
|
169
164
|
initializer 'ensure devise is initialised' do |app|
|
170
165
|
unless Rails.root.join('config', 'initializers', 'devise.rb').file?
|
171
166
|
load Refinery.roots('core').join(*%w(lib generators templates config initializers devise.rb))
|
@@ -1182,11 +1182,14 @@ WYMeditor.editor.prototype.switchTo = function(selectionOrNode,sType) {
|
|
1182
1182
|
// we have a node.
|
1183
1183
|
var html = $(selectionOrNode).html();
|
1184
1184
|
var newNode = this._doc.createElement(sType);
|
1185
|
+
var klass = $(selectionOrNode).attr('class');
|
1185
1186
|
|
1186
1187
|
// copy across the css class names.
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1188
|
+
if(typeof klass !== 'undefined'){
|
1189
|
+
$.each($(selectionOrNode).attr('class').split(" "), function(index, className) {
|
1190
|
+
$(newNode).addClass(className);
|
1191
|
+
});
|
1192
|
+
}
|
1190
1193
|
|
1191
1194
|
selectionOrNode.parentNode.replaceChild(newNode,selectionOrNode);
|
1192
1195
|
|
@@ -1278,7 +1281,7 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
|
|
1278
1281
|
var wym = this;
|
1279
1282
|
|
1280
1283
|
wym.update();
|
1281
|
-
var path = this._wym._options.dialogPath + dialogType + '?wymeditor=true';
|
1284
|
+
var path = this._wym._options.dialogPath + dialogType + '?wymeditor=true&' + window.location.href.match(/switch_locale=[a-z]{2}/);
|
1282
1285
|
|
1283
1286
|
wym._current_unique_stamp = wym.uniqueStamp();
|
1284
1287
|
// change undo or redo on cancel to true to have this happen when a user closes (cancels) a dialogue
|
@@ -1394,6 +1397,7 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
|
|
1394
1397
|
if (!wym._selected_image) {
|
1395
1398
|
parent_node._id_before_replaceable = parent_node.id;
|
1396
1399
|
parent_node.id = '' + this._current_unique_stamp;
|
1400
|
+
$(parent_node).attr("_id_before_replaceable", parent_node._id_before_replaceable);
|
1397
1401
|
}
|
1398
1402
|
|
1399
1403
|
if (dialogType != WYMeditor.DIALOG_PASTE && dialogType != WYMeditor.DIALOG_TABLE) {
|
@@ -1770,7 +1774,7 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
|
|
1770
1774
|
|
1771
1775
|
var selected = selected || wym.selected();
|
1772
1776
|
var dialog = $("#"+wym._options.dialogId);
|
1773
|
-
var doc = $(
|
1777
|
+
var doc = $(dialog.find('iframe').contents());
|
1774
1778
|
var dialogType = dialog.find('#wym_dialog_type').val();
|
1775
1779
|
if (wym._selected_image) {
|
1776
1780
|
var replaceable = $(wym._selected_image);
|
@@ -1866,7 +1870,7 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
|
|
1866
1870
|
(image = $(wym._doc.createElement("IMG")))
|
1867
1871
|
.attr(WYMeditor.SRC, url)
|
1868
1872
|
.attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
|
1869
|
-
.attr(WYMeditor.ALT, form.find(wym._options.
|
1873
|
+
.attr(WYMeditor.ALT, form.find(wym._options.altSelector).val())
|
1870
1874
|
.attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val())
|
1871
1875
|
.load(function(e){
|
1872
1876
|
$(this).attr({
|
@@ -1938,9 +1942,12 @@ WYMeditor.editor.prototype.close_dialog = function(e, cancelled) {
|
|
1938
1942
|
if ((span = $(this._doc.body).find('span#' + this._current_unique_stamp)).length > 0) {
|
1939
1943
|
span.parent().html(span.parent().html().replace(new RegExp(["<span(.+?)", span.attr('id'), "(.+?)<\/span>"].join("")), span.html()));
|
1940
1944
|
}
|
1941
|
-
|
1942
|
-
|
1943
|
-
.
|
1945
|
+
// https://github.com/resolve/refinerycms/issues/888
|
1946
|
+
if (node = $(this._doc.body).find('#' + this._current_unique_stamp)) {
|
1947
|
+
node.attr("id", (node.attr('_id_before_replaceable') || ""));
|
1948
|
+
node.removeAttr("_id_before_replaceable");
|
1949
|
+
}
|
1950
|
+
|
1944
1951
|
if (this._undo_on_cancel == true) {
|
1945
1952
|
this._exec("undo");
|
1946
1953
|
}
|
@@ -2295,7 +2302,7 @@ WYMeditor.XhtmlValidator = {
|
|
2295
2302
|
"2":"href",
|
2296
2303
|
"3":"hreflang",
|
2297
2304
|
"4":"name",
|
2298
|
-
"rel":/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon|moodalbox)+$/,
|
2305
|
+
"rel":/^(alternate|designates|stylesheet|start|next|nofollow|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon|moodalbox)+$/,
|
2299
2306
|
"rev":/^(alternate|designates|stylesheet|start|next|prev|contents|index|glossary|copyright|chapter|section|subsection|appendix|help|bookmark| |shortcut|icon|moodalbox)+$/,
|
2300
2307
|
"shape":/^(rect|rectangle|circ|circle|poly|polygon)$/,
|
2301
2308
|
"5":"type",
|
@@ -2484,7 +2491,7 @@ WYMeditor.XhtmlValidator = {
|
|
2484
2491
|
"readonly":/^(readonly)$/,
|
2485
2492
|
"size":/^(\d)+$/,
|
2486
2493
|
"3":"src",
|
2487
|
-
"type":/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text|tel|search|url|email|datetime|date|month|week|time|datetime-local|number|range|color)$/,
|
2494
|
+
"type":/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text|tel|search|url|email|datetime|date|month|week|time|datetime-local|number|range|color|placeholder)$/,
|
2488
2495
|
"4":"value"
|
2489
2496
|
},
|
2490
2497
|
"inside":"form"
|
@@ -2517,7 +2524,7 @@ WYMeditor.XhtmlValidator = {
|
|
2517
2524
|
"media":/^(all|braille|print|projection|screen|speech|,|;| )+$/i,
|
2518
2525
|
//next comment line required by Opera!
|
2519
2526
|
/*"rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,*/
|
2520
|
-
"rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,
|
2527
|
+
"rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|nofollow|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,
|
2521
2528
|
"rev":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,
|
2522
2529
|
"3":"type"
|
2523
2530
|
},
|
@@ -4341,30 +4348,28 @@ function titleize(words) {
|
|
4341
4348
|
*/
|
4342
4349
|
|
4343
4350
|
WYMeditor.WymClassExplorer = function(wym) {
|
4344
|
-
|
4345
4351
|
this._wym = wym;
|
4346
4352
|
this._class = "className";
|
4347
4353
|
this._newLine = "\r\n";
|
4348
|
-
|
4349
4354
|
};
|
4350
4355
|
|
4351
4356
|
WYMeditor.WymClassExplorer.prototype.format_block = function(selected) {
|
4352
4357
|
|
4353
|
-
|
4354
|
-
|
4355
|
-
|
4356
|
-
|
4358
|
+
//'this' should be the wymeditor instance.
|
4359
|
+
var wym = this;
|
4360
|
+
var container = selected || wym.selected() || $(wym._iframe).contents().find('body').get(0);
|
4361
|
+
var name = container.tagName.toLowerCase();
|
4357
4362
|
|
4358
|
-
|
4359
|
-
|
4360
|
-
|
4361
|
-
|
4363
|
+
//fix forbidden main containers
|
4364
|
+
if($.inArray(name, ['strong', 'b', 'em', 'i', 'sub', 'sup', 'a']) > -1) {
|
4365
|
+
name = container.parentNode.tagName.toLowerCase();
|
4366
|
+
}
|
4362
4367
|
|
4363
|
-
|
4364
|
-
|
4365
|
-
|
4366
|
-
|
4367
|
-
|
4368
|
+
if(name == WYMeditor.BODY) {
|
4369
|
+
wym._selected_image = null;
|
4370
|
+
$(wym._iframe).contents().find('.selected_by_wym').removeClass('selected_by_wym');
|
4371
|
+
wym._exec(WYMeditor.FORMAT_BLOCK, "<" + WYMeditor.P + ">");
|
4372
|
+
}
|
4368
4373
|
};
|
4369
4374
|
|
4370
4375
|
WYMeditor.WymClassExplorer.prototype.initIframe = function(iframe) {
|
@@ -4444,48 +4449,46 @@ WYMeditor.WymClassExplorer.prototype.initIframe = function(iframe) {
|
|
4444
4449
|
|
4445
4450
|
WYMeditor.WymClassExplorer.prototype._exec = function(cmd,param) {
|
4446
4451
|
|
4447
|
-
|
4452
|
+
var wym = this;
|
4448
4453
|
|
4454
|
+
switch(cmd) {
|
4449
4455
|
case WYMeditor.INDENT: case WYMeditor.OUTDENT:
|
4450
|
-
|
4451
|
-
|
4452
|
-
|
4453
|
-
|
4454
|
-
|
4455
|
-
|| ancestor.tagName.toLowerCase() == WYMeditor.OL
|
4456
|
-
|| ancestor.tagName.toLowerCase() == WYMeditor.UL)
|
4457
|
-
this._doc.execCommand(cmd);
|
4456
|
+
var container = wym.findUp(wym.container(), WYMeditor.LI);
|
4457
|
+
if(container) {
|
4458
|
+
var ancestor = container.parentNode.parentNode;
|
4459
|
+
if(container.parentNode.childNodes.length > 1 || $.inArray(ancestor.tagName.toLowerCase(), [WYMeditor.OL, WYMeditor.UL]) > -1) {
|
4460
|
+
wym._doc.execCommand(cmd);
|
4458
4461
|
}
|
4459
|
-
|
4462
|
+
}
|
4463
|
+
break;
|
4460
4464
|
default:
|
4461
|
-
|
4462
|
-
|
4463
|
-
|
4465
|
+
if(param) {
|
4466
|
+
wym._doc.execCommand(cmd,false,param);
|
4467
|
+
}
|
4468
|
+
else {
|
4469
|
+
wym._doc.execCommand(cmd);
|
4470
|
+
}
|
4471
|
+
break;
|
4464
4472
|
}
|
4465
4473
|
|
4466
4474
|
};
|
4467
4475
|
|
4468
4476
|
WYMeditor.WymClassExplorer.prototype.selected = function() {
|
4469
|
-
|
4470
4477
|
var caretPos = this._iframe.contentWindow.document.caretPos;
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
}
|
4478
|
+
if(caretPos != null && caretPos.parentElement != undefined) {
|
4479
|
+
return(caretPos.parentElement());
|
4480
|
+
}
|
4475
4481
|
};
|
4476
4482
|
|
4477
4483
|
WYMeditor.WymClassExplorer.prototype.saveCaret = function() {
|
4478
|
-
|
4479
4484
|
this._doc.caretPos = this._doc.selection.createRange();
|
4480
4485
|
};
|
4481
4486
|
|
4482
4487
|
WYMeditor.WymClassExplorer.prototype.addCssRule = function(styles, oCss) {
|
4483
|
-
|
4484
4488
|
styles.addRule(oCss.name, oCss.css);
|
4485
4489
|
};
|
4486
4490
|
|
4487
4491
|
WYMeditor.WymClassExplorer.prototype.insert = function(html) {
|
4488
|
-
|
4489
4492
|
// Get the current selection
|
4490
4493
|
var range = this._doc.selection.createRange();
|
4491
4494
|
|
@@ -4657,7 +4660,9 @@ WYMeditor.WymClassMozilla.prototype.html = function(html) {
|
|
4657
4660
|
//re-init designMode
|
4658
4661
|
this.enableDesignMode();
|
4659
4662
|
}
|
4660
|
-
else
|
4663
|
+
else {
|
4664
|
+
return($(this._doc.body).html());
|
4665
|
+
}
|
4661
4666
|
};
|
4662
4667
|
|
4663
4668
|
WYMeditor.WymClassMozilla.prototype._exec = function(cmd,param) {
|
@@ -4670,7 +4675,9 @@ WYMeditor.WymClassMozilla.prototype._exec = function(cmd,param) {
|
|
4670
4675
|
var focusNode = this.selected();
|
4671
4676
|
var sel = this._iframe.contentWindow.getSelection();
|
4672
4677
|
var anchorNode = sel.anchorNode;
|
4673
|
-
if(anchorNode.nodeName == "#text")
|
4678
|
+
if(anchorNode.nodeName == "#text") {
|
4679
|
+
anchorNode = anchorNode.parentNode;
|
4680
|
+
}
|
4674
4681
|
|
4675
4682
|
focusNode = this.findUp(focusNode, WYMeditor.BLOCKS);
|
4676
4683
|
anchorNode = this.findUp(anchorNode, WYMeditor.BLOCKS);
|
@@ -4678,10 +4685,9 @@ WYMeditor.WymClassMozilla.prototype._exec = function(cmd,param) {
|
|
4678
4685
|
if(focusNode && focusNode == anchorNode && focusNode.tagName.toLowerCase() == WYMeditor.LI) {
|
4679
4686
|
var ancestor = focusNode.parentNode.parentNode;
|
4680
4687
|
|
4681
|
-
if(focusNode.parentNode.childNodes.length>1
|
4682
|
-
|
4683
|
-
|
4684
|
-
this._doc.execCommand(cmd,'',null);
|
4688
|
+
if(focusNode.parentNode.childNodes.length > 1 || $.inArray(ancestor.tagName.toLowerCase(), [WYMeditor.OL, WYMeditor.UL]) > -1) {
|
4689
|
+
this._doc.execCommand(cmd,'',null);
|
4690
|
+
}
|
4685
4691
|
}
|
4686
4692
|
break;
|
4687
4693
|
|
@@ -4692,8 +4698,9 @@ WYMeditor.WymClassMozilla.prototype._exec = function(cmd,param) {
|
|
4692
4698
|
|
4693
4699
|
//set to P if parent = BODY
|
4694
4700
|
var container = this.selected();
|
4695
|
-
if(container.tagName.toLowerCase() == WYMeditor.BODY)
|
4701
|
+
if(container.tagName.toLowerCase() == WYMeditor.BODY) {
|
4696
4702
|
this._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P);
|
4703
|
+
}
|
4697
4704
|
};
|
4698
4705
|
|
4699
4706
|
|
@@ -4730,9 +4737,13 @@ WYMeditor.WymClassMozilla.prototype.selected = function(upgrade_text_nodes) {
|
|
4730
4737
|
return node.parentNode;
|
4731
4738
|
}
|
4732
4739
|
}
|
4733
|
-
else
|
4740
|
+
else {
|
4741
|
+
return(node);
|
4742
|
+
}
|
4743
|
+
}
|
4744
|
+
else {
|
4745
|
+
return(null);
|
4734
4746
|
}
|
4735
|
-
else return(null);
|
4736
4747
|
};
|
4737
4748
|
|
4738
4749
|
WYMeditor.WymClassMozilla.prototype.addCssRule = function(styles, oCss) {
|
@@ -4914,8 +4925,12 @@ WYMeditor.WymClassOpera.prototype.selected = function() {
|
|
4914
4925
|
var sel=this._iframe.contentWindow.getSelection();
|
4915
4926
|
var node=sel.focusNode;
|
4916
4927
|
if(node) {
|
4917
|
-
if(node.nodeName=="#text")
|
4918
|
-
|
4928
|
+
if(node.nodeName=="#text") {
|
4929
|
+
return(node.parentNode);
|
4930
|
+
}
|
4931
|
+
else {
|
4932
|
+
return(node);
|
4933
|
+
}
|
4919
4934
|
} else {
|
4920
4935
|
return(null);
|
4921
4936
|
}
|
@@ -5029,29 +5044,33 @@ WYMeditor.WymClassSafari.prototype.initIframe = function(iframe) {
|
|
5029
5044
|
|
5030
5045
|
WYMeditor.WymClassSafari.prototype._exec = function(cmd,param) {
|
5031
5046
|
|
5032
|
-
|
5047
|
+
var wym = this;
|
5048
|
+
if(!wym.selected()) {
|
5049
|
+
return(false);
|
5050
|
+
}
|
5033
5051
|
|
5034
5052
|
switch(cmd) {
|
5035
5053
|
|
5036
5054
|
case WYMeditor.INDENT: case WYMeditor.OUTDENT:
|
5037
5055
|
|
5038
|
-
var focusNode =
|
5039
|
-
var sel =
|
5056
|
+
var focusNode = wym.selected();
|
5057
|
+
var sel = wym._iframe.contentWindow.getSelection();
|
5040
5058
|
var anchorNode = sel.anchorNode;
|
5041
|
-
if(anchorNode.nodeName == "#text")
|
5059
|
+
if(anchorNode.nodeName == "#text") {
|
5060
|
+
anchorNode = anchorNode.parentNode;
|
5061
|
+
}
|
5042
5062
|
|
5043
|
-
focusNode =
|
5044
|
-
anchorNode =
|
5063
|
+
focusNode = wym.findUp(focusNode, WYMeditor.BLOCKS);
|
5064
|
+
anchorNode = wym.findUp(anchorNode, WYMeditor.BLOCKS);
|
5045
5065
|
|
5046
5066
|
if(focusNode && focusNode == anchorNode
|
5047
5067
|
&& focusNode.tagName.toLowerCase() == WYMeditor.LI) {
|
5048
5068
|
|
5049
5069
|
var ancestor = focusNode.parentNode.parentNode;
|
5050
5070
|
|
5051
|
-
if(focusNode.parentNode.childNodes.length>1
|
5052
|
-
|
5053
|
-
|
5054
|
-
this._doc.execCommand(cmd,'',null);
|
5071
|
+
if(focusNode.parentNode.childNodes.length > 1 || $.inArray(ancestor.tagName.toLowerCase(), [WYMeditor.OL, WYMeditor.UL]) > -1) {
|
5072
|
+
wym._doc.execCommand(cmd,'',null);
|
5073
|
+
}
|
5055
5074
|
}
|
5056
5075
|
|
5057
5076
|
break;
|
@@ -5073,9 +5092,6 @@ WYMeditor.WymClassSafari.prototype._exec = function(cmd,param) {
|
|
5073
5092
|
else this._doc.execCommand(cmd,'',null);
|
5074
5093
|
}
|
5075
5094
|
|
5076
|
-
//set to P if parent = BODY
|
5077
|
-
this.format_block();
|
5078
|
-
|
5079
5095
|
};
|
5080
5096
|
|
5081
5097
|
/* @name selected
|
@@ -5199,7 +5215,7 @@ WYMeditor.WymClassSafari.prototype.keyup = function(e) {
|
|
5199
5215
|
name = container.parentNode.tagName.toLowerCase();
|
5200
5216
|
}
|
5201
5217
|
|
5202
|
-
if(name
|
5218
|
+
if($.inArray(name, [WYMeditor.BODY, WYMeditor.DIV]) > -1) {
|
5203
5219
|
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P); //fix #110 for DIV
|
5204
5220
|
}
|
5205
5221
|
}
|
@@ -1551,6 +1551,31 @@ a.information:hover {
|
|
1551
1551
|
-webkit-border-radius: 6px;
|
1552
1552
|
}
|
1553
1553
|
|
1554
|
+
.label {
|
1555
|
+
padding: 1px 3px 2px;
|
1556
|
+
font-size: 9.75px;
|
1557
|
+
font-weight: bold;
|
1558
|
+
color: #ffffff;
|
1559
|
+
text-transform: uppercase;
|
1560
|
+
white-space: nowrap;
|
1561
|
+
background-color: #bfbfbf;
|
1562
|
+
-webkit-border-radius: 3px;
|
1563
|
+
-moz-border-radius: 3px;
|
1564
|
+
border-radius: 3px;
|
1565
|
+
}
|
1566
|
+
.label.important {
|
1567
|
+
background-color: #c43c35;
|
1568
|
+
}
|
1569
|
+
.label.warning {
|
1570
|
+
background-color: #f89406;
|
1571
|
+
}
|
1572
|
+
.label.success {
|
1573
|
+
background-color: #46a546;
|
1574
|
+
}
|
1575
|
+
.label.notice {
|
1576
|
+
background-color: #62cffc;
|
1577
|
+
}
|
1578
|
+
|
1554
1579
|
/* Internet Explorer to follow: */
|
1555
1580
|
/* IE 7 */
|
1556
1581
|
.ie7 #content .form-actions .form-actions-left a.button {
|
data/refinerycms-core.gemspec
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = %q{refinerycms-core}
|
6
|
-
s.version = %q{1.0.
|
6
|
+
s.version = %q{1.0.10}
|
7
7
|
s.summary = %q{Core engine for Refinery CMS}
|
8
8
|
s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
|
9
|
-
s.date = %q{
|
9
|
+
s.date = %q{2012-03-06}
|
10
10
|
s.email = %q{info@refinerycms.com}
|
11
11
|
s.homepage = %q{http://refinerycms.com}
|
12
12
|
s.rubyforge_project = %q{refinerycms}
|
@@ -15,12 +15,12 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.require_paths = %w(lib)
|
16
16
|
s.executables = %w()
|
17
17
|
|
18
|
-
s.add_dependency 'refinerycms-base', '= 1.0.
|
19
|
-
s.add_dependency 'refinerycms-settings', '= 1.0.
|
18
|
+
s.add_dependency 'refinerycms-base', '= 1.0.10'
|
19
|
+
s.add_dependency 'refinerycms-settings', '= 1.0.10'
|
20
20
|
s.add_dependency 'refinerycms-generators', '~> 1.0'
|
21
21
|
s.add_dependency 'acts_as_indexed', '~> 0.7'
|
22
22
|
s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
|
23
|
-
s.add_dependency 'globalize3', '~> 0.
|
23
|
+
s.add_dependency 'globalize3', '~> 0.2.0.beta4'
|
24
24
|
s.add_dependency 'awesome_nested_set', '~> 2.0'
|
25
25
|
s.add_dependency 'rails', '~> 3.0.10'
|
26
26
|
s.add_dependency 'truncate_html', '~> 0.5'
|
@@ -97,7 +97,7 @@ module Refinery
|
|
97
97
|
it 'identifies as Refinery::Plugins' do
|
98
98
|
subject.class.active.class.should == subject.class
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
it 'only contains items that are registered' do
|
102
102
|
subject.class.set_active(%w(my_plugin))
|
103
103
|
subject.class.active.any?.should be_true
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 10
|
10
|
+
version: 1.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Resolve Digital
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date:
|
22
|
+
date: 2012-03-06 00:00:00 Z
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: refinerycms-base
|
@@ -29,12 +29,12 @@ dependencies:
|
|
29
29
|
requirements:
|
30
30
|
- - "="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
hash:
|
32
|
+
hash: 3
|
33
33
|
segments:
|
34
34
|
- 1
|
35
35
|
- 0
|
36
|
-
-
|
37
|
-
version: 1.0.
|
36
|
+
- 10
|
37
|
+
version: 1.0.10
|
38
38
|
type: :runtime
|
39
39
|
version_requirements: *id001
|
40
40
|
- !ruby/object:Gem::Dependency
|
@@ -45,12 +45,12 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
hash:
|
48
|
+
hash: 3
|
49
49
|
segments:
|
50
50
|
- 1
|
51
51
|
- 0
|
52
|
-
-
|
53
|
-
version: 1.0.
|
52
|
+
- 10
|
53
|
+
version: 1.0.10
|
54
54
|
type: :runtime
|
55
55
|
version_requirements: *id002
|
56
56
|
- !ruby/object:Gem::Dependency
|
@@ -107,11 +107,14 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
hash:
|
110
|
+
hash: -38949664
|
111
111
|
segments:
|
112
112
|
- 0
|
113
|
-
-
|
114
|
-
|
113
|
+
- 2
|
114
|
+
- 0
|
115
|
+
- beta
|
116
|
+
- 4
|
117
|
+
version: 0.2.0.beta4
|
115
118
|
type: :runtime
|
116
119
|
version_requirements: *id006
|
117
120
|
- !ruby/object:Gem::Dependency
|
@@ -559,9 +562,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
559
562
|
requirements: []
|
560
563
|
|
561
564
|
rubyforge_project: refinerycms
|
562
|
-
rubygems_version: 1.8.
|
565
|
+
rubygems_version: 1.8.17
|
563
566
|
signing_key:
|
564
567
|
specification_version: 3
|
565
568
|
summary: Core engine for Refinery CMS
|
566
569
|
test_files: []
|
567
570
|
|
571
|
+
has_rdoc:
|