noodall-ui 0.0.7 → 0.0.8
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.
- data/Gemfile.lock +1 -1
- data/app/models/asset.rb +1 -0
- data/app/views/noodall/admin/assets/tags.js.erb +1 -1
- data/app/views/noodall/admin/nodes/index.html.erb +7 -6
- data/app/views/noodall/admin/nodes/show.html.erb +1 -1
- data/lib/noodall/ui/version.rb +1 -1
- data/public/javascripts/admin/tiny_mce_config.js +11 -10
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/app/models/asset.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
$('#asset-browser').html( "<%= escape_javascript(%{<h2 class="title">#{page_title}</h2> #{render( 'tags' )}}) %>" )
|
|
1
|
+
$('#asset-browser').html( "<%= escape_javascript(%{<h2 class="title">#{page_title}</h2> #{render( 'tags' )}}.html_safe) %>" )
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
<ul class="choices">
|
|
4
4
|
|
|
5
|
-
<% if
|
|
6
|
-
<li><%= link_to 'New', new_noodall_admin_node_node_path(@parent), :class => 'button', :title => "Add content under #{@parent.title}" %></li>
|
|
7
|
-
<% else %>
|
|
5
|
+
<% if @parent.nil? -%>
|
|
8
6
|
<li><%= link_to 'New', new_noodall_admin_node_path, :class => 'button', :title => "Add new" %></li>
|
|
7
|
+
<% else %>
|
|
8
|
+
<li><%= link_to 'New', new_noodall_admin_node_node_path(@parent), :class => 'button', :title => "Add content under #{@parent.title}" %></li>
|
|
9
9
|
<% end -%>
|
|
10
10
|
|
|
11
|
-
<% if !@parent.nil? and
|
|
12
|
-
<li><%= link_to "Top Level", noodall_admin_nodes_path, :class => "top button" %></li>
|
|
13
|
-
<% elsif !@parent.nil? %>
|
|
11
|
+
<% if !@parent.nil? and !@parent.parent.nil? %>
|
|
14
12
|
<li><%= link_to "Up to #{@parent.parent.title}", noodall_admin_node_nodes_path(@parent.parent), :class => "up button" %></li>
|
|
15
13
|
<% end %>
|
|
16
14
|
|
|
15
|
+
<% if !@parent.nil? %>
|
|
16
|
+
<li><%= link_to "Top Level", noodall_admin_nodes_path, :class => "top button" %></li>
|
|
17
|
+
<% end %>
|
|
17
18
|
|
|
18
19
|
</ul>
|
|
19
20
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div id="buttons">
|
|
47
47
|
<%= f.submit 'Publish', :class => 'publish', :name => 'node[publish]' if can_publish?(@node) %>
|
|
48
48
|
<%= f.submit 'Draft', :name => 'node[hide]', :class => 'draft' %>
|
|
49
|
-
<%= link_to 'Cancel', noodall_admin_nodes_path, :class => 'cancel' %>
|
|
49
|
+
<%= link_to 'Cancel', @node.root? ? noodall_admin_nodes_path : noodall_admin_node_nodes_path(@node.parent), :class => 'cancel' %>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
<% if can_publish?(@node) %>
|
data/lib/noodall/ui/version.rb
CHANGED
|
@@ -34,7 +34,7 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
|
|
|
34
34
|
editor_selector : "editor",
|
|
35
35
|
theme_advanced_buttons1 : "bold,italic,underline,|,formatselect,removeformat ,|,bullist,numlist,|,link,unlink,anchor,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull",
|
|
36
36
|
theme_advanced_buttons2 : "table,delete_table,col_before,col_after,row_before,row_after,delete_col,delete_row,|,code,attribs,image,media, assetbrowser,nodebrowser",
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
setup : function(ed) {
|
|
39
39
|
// Add a custom button
|
|
40
40
|
ed.addButton('assetbrowser', {
|
|
@@ -54,10 +54,11 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
|
|
|
54
54
|
}
|
|
55
55
|
return false;
|
|
56
56
|
};
|
|
57
|
+
Browser.after_close = $.fancybox.close;
|
|
57
58
|
Browser.open();
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
|
-
|
|
61
|
+
|
|
61
62
|
ed.addButton('nodebrowser', {
|
|
62
63
|
title : 'Insert an internal link',
|
|
63
64
|
image : '/images/admin/top-level_small.png',
|
|
@@ -75,35 +76,35 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
|
|
|
75
76
|
'script');
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
ed.onPostProcess.add(function(ed, o) {
|
|
80
81
|
if(o.save){
|
|
81
82
|
// remove mce empty spans
|
|
82
83
|
o.content = o.content.replace(/<span id=._mce_start. .*?><\/span>/ig, '');
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
|
-
|
|
86
|
+
|
|
86
87
|
// wow what a hack: insert a containing span for the page name if nothing is selected,
|
|
87
88
|
// then insert the link, then remove containing span after all is good
|
|
88
89
|
$('#tree-browser.tinymce li a').live('click', function(event) {
|
|
89
90
|
add_url = $(this).attr('href').split('?')[0];
|
|
90
|
-
|
|
91
|
+
|
|
91
92
|
if(tinyMCE.activeEditor.selection.getContent().length === 0){
|
|
92
93
|
tinyMCE.execInstanceCommand(tinyMCE.activeEditor.id, 'mceInsertRawHTML', false, '<span class="tmp_tag">' + $(this).text() + '</span>');
|
|
93
94
|
spans = tinyMCE.activeEditor.dom.select('span');
|
|
94
|
-
|
|
95
|
+
|
|
95
96
|
$.each(spans, function(i, span){
|
|
96
97
|
if($(span).hasClass('tmp_tag')) {
|
|
97
98
|
tinyMCE.activeEditor.selection.select(span);
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
|
-
|
|
102
|
+
|
|
102
103
|
tinyMCE.execInstanceCommand(tinyMCE.activeEditor.id, 'mceInsertLink', false, add_url, true);
|
|
103
104
|
$.fancybox.close();
|
|
104
|
-
|
|
105
|
+
|
|
105
106
|
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent().replace(/<span class="tmp_tag">(.*?)<\/span>/i, "$1"));
|
|
106
|
-
|
|
107
|
+
|
|
107
108
|
event.stopImmediatePropagation();
|
|
108
109
|
return false;
|
|
109
110
|
});
|
|
@@ -112,7 +113,7 @@ $.extend(tiny_mce_config, lite_tiny_mce_config, {
|
|
|
112
113
|
});
|
|
113
114
|
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
|
|
116
117
|
$(function() {
|
|
117
118
|
$('textarea.editor').tinymce(tiny_mce_config);
|
|
118
119
|
});
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: noodall-ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 15
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 8
|
|
10
|
+
version: 0.0.8
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Steve England
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-11-
|
|
18
|
+
date: 2010-11-12 00:00:00 +00:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|