spud_core 0.9.22 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/images/glyphicons-halflings-regular.svg +229 -0
- data/app/assets/images/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/images/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/javascripts/spud/admin/application.js +5 -2
- data/app/assets/javascripts/spud/admin/editor.js +55 -21
- data/app/assets/javascripts/spud/admin/preinit.js +1 -1
- data/app/assets/libs/bootstrap3/css/bootstrap-theme.css +397 -0
- data/app/assets/libs/bootstrap3/css/bootstrap-theme.min.css +7 -0
- data/app/assets/libs/bootstrap3/css/bootstrap.css.erb +7118 -0
- data/app/assets/libs/bootstrap3/css/bootstrap.min.css +7 -0
- data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.svg +229 -0
- data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/libs/bootstrap3/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/libs/bootstrap3/js/bootstrap.js +2006 -0
- data/app/assets/libs/bootstrap3/js/bootstrap.min.js +7 -0
- data/app/assets/stylesheets/spud/admin/{application.css → application.css.erb} +4 -4
- data/app/assets/stylesheets/spud/admin/navbar.css +31 -0
- data/app/controllers/spud/admin/users_controller.rb +6 -2
- data/app/controllers/spud/application_controller.rb +0 -1
- data/app/controllers/spud/sitemaps_controller.rb +1 -1
- data/app/controllers/spud/users_controller.rb +10 -4
- data/app/models/spud_admin_permission.rb +0 -2
- data/app/models/spud_user.rb +0 -2
- data/app/views/spud/admin/users/index.html.erb +1 -1
- data/config/routes.rb +1 -0
- data/lib/spud_core/configuration.rb +13 -3
- data/lib/spud_core/engine.rb +3 -7
- data/lib/spud_core/version.rb +1 -1
- data/spec/controllers/spud/sitemap_controllers_spec.rb +6 -5
- data/spec/dummy/config/environments/development.rb +1 -5
- data/spec/dummy/config/environments/production.rb +2 -0
- data/spec/dummy/config/environments/test.rb +1 -5
- metadata +104 -190
- data/app/assets/libs/tiny_mce/jquery.tinymce.js +0 -1
- data/app/assets/libs/tiny_mce/langs/en.js +0 -1
- data/app/assets/libs/tiny_mce/license.txt +0 -504
- data/app/assets/libs/tiny_mce/plugins/advhr/css/advhr.css +0 -5
- data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advhr/editor_plugin_src.js +0 -57
- data/app/assets/libs/tiny_mce/plugins/advhr/js/rule.js +0 -43
- data/app/assets/libs/tiny_mce/plugins/advhr/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advhr/rule.htm +0 -58
- data/app/assets/libs/tiny_mce/plugins/advimage/css/advimage.css +0 -13
- data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advimage/editor_plugin_src.js +0 -50
- data/app/assets/libs/tiny_mce/plugins/advimage/image.htm +0 -235
- data/app/assets/libs/tiny_mce/plugins/advimage/img/sample.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/advimage/js/image.js +0 -462
- data/app/assets/libs/tiny_mce/plugins/advimage/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlink/css/advlink.css +0 -8
- data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlink/editor_plugin_src.js +0 -61
- data/app/assets/libs/tiny_mce/plugins/advlink/js/advlink.js +0 -539
- data/app/assets/libs/tiny_mce/plugins/advlink/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlink/link.htm +0 -338
- data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/advlist/editor_plugin_src.js +0 -176
- data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/autolink/editor_plugin_src.js +0 -174
- data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/autoresize/editor_plugin_src.js +0 -119
- data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/contextmenu/editor_plugin_src.js +0 -161
- data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/directionality/editor_plugin_src.js +0 -82
- data/app/assets/libs/tiny_mce/plugins/example/dialog.htm +0 -22
- data/app/assets/libs/tiny_mce/plugins/example/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/example/editor_plugin_src.js +0 -84
- data/app/assets/libs/tiny_mce/plugins/example/img/example.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/example/js/dialog.js +0 -19
- data/app/assets/libs/tiny_mce/plugins/example/langs/en.js +0 -3
- data/app/assets/libs/tiny_mce/plugins/example/langs/en_dlg.js +0 -3
- data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/example_dependency/editor_plugin_src.js +0 -50
- data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/iespell/editor_plugin_src.js +0 -54
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +0 -699
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
- data/app/assets/libs/tiny_mce/plugins/inlinepopups/template.htm +0 -387
- data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/layer/editor_plugin_src.js +0 -262
- data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/lists/editor_plugin_src.js +0 -951
- data/app/assets/libs/tiny_mce/plugins/media/css/media.css +0 -17
- data/app/assets/libs/tiny_mce/plugins/media/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/media/editor_plugin_src.js +0 -890
- data/app/assets/libs/tiny_mce/plugins/media/js/embed.js +0 -73
- data/app/assets/libs/tiny_mce/plugins/media/js/media.js +0 -470
- data/app/assets/libs/tiny_mce/plugins/media/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/media/media.htm +0 -922
- data/app/assets/libs/tiny_mce/plugins/media/moxieplayer.swf +0 -0
- data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/paste/editor_plugin_src.js +0 -871
- data/app/assets/libs/tiny_mce/plugins/paste/js/pastetext.js +0 -36
- data/app/assets/libs/tiny_mce/plugins/paste/js/pasteword.js +0 -51
- data/app/assets/libs/tiny_mce/plugins/paste/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/paste/pastetext.htm +0 -27
- data/app/assets/libs/tiny_mce/plugins/paste/pasteword.htm +0 -21
- data/app/assets/libs/tiny_mce/plugins/spellchecker/css/content.css +0 -1
- data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/spellchecker/editor_plugin_src.js +0 -436
- data/app/assets/libs/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
- data/app/assets/libs/tiny_mce/plugins/style/css/props.css +0 -14
- data/app/assets/libs/tiny_mce/plugins/style/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/style/editor_plugin_src.js +0 -71
- data/app/assets/libs/tiny_mce/plugins/style/js/props.js +0 -709
- data/app/assets/libs/tiny_mce/plugins/style/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/style/props.htm +0 -845
- data/app/assets/libs/tiny_mce/plugins/style/readme.txt +0 -19
- data/app/assets/libs/tiny_mce/plugins/table/cell.htm +0 -180
- data/app/assets/libs/tiny_mce/plugins/table/css/cell.css +0 -17
- data/app/assets/libs/tiny_mce/plugins/table/css/row.css +0 -25
- data/app/assets/libs/tiny_mce/plugins/table/css/table.css +0 -13
- data/app/assets/libs/tiny_mce/plugins/table/editor_plugin.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/table/editor_plugin_src.js +0 -1428
- data/app/assets/libs/tiny_mce/plugins/table/js/cell.js +0 -319
- data/app/assets/libs/tiny_mce/plugins/table/js/merge_cells.js +0 -27
- data/app/assets/libs/tiny_mce/plugins/table/js/row.js +0 -237
- data/app/assets/libs/tiny_mce/plugins/table/js/table.js +0 -489
- data/app/assets/libs/tiny_mce/plugins/table/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/plugins/table/merge_cells.htm +0 -32
- data/app/assets/libs/tiny_mce/plugins/table/row.htm +0 -158
- data/app/assets/libs/tiny_mce/plugins/table/table.htm +0 -188
- data/app/assets/libs/tiny_mce/themes/advanced/about.htm +0 -52
- data/app/assets/libs/tiny_mce/themes/advanced/anchor.htm +0 -26
- data/app/assets/libs/tiny_mce/themes/advanced/charmap.htm +0 -55
- data/app/assets/libs/tiny_mce/themes/advanced/color_picker.htm +0 -70
- data/app/assets/libs/tiny_mce/themes/advanced/editor_template.js +0 -1
- data/app/assets/libs/tiny_mce/themes/advanced/editor_template_src.js +0 -1467
- data/app/assets/libs/tiny_mce/themes/advanced/image.htm +0 -80
- data/app/assets/libs/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/iframe.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/trans.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/video.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/js/about.js +0 -73
- data/app/assets/libs/tiny_mce/themes/advanced/js/anchor.js +0 -44
- data/app/assets/libs/tiny_mce/themes/advanced/js/charmap.js +0 -363
- data/app/assets/libs/tiny_mce/themes/advanced/js/color_picker.js +0 -345
- data/app/assets/libs/tiny_mce/themes/advanced/js/image.js +0 -251
- data/app/assets/libs/tiny_mce/themes/advanced/js/link.js +0 -153
- data/app/assets/libs/tiny_mce/themes/advanced/js/source_editor.js +0 -78
- data/app/assets/libs/tiny_mce/themes/advanced/langs/en.js +0 -1
- data/app/assets/libs/tiny_mce/themes/advanced/langs/en_dlg.js +0 -1
- data/app/assets/libs/tiny_mce/themes/advanced/link.htm +0 -57
- data/app/assets/libs/tiny_mce/themes/advanced/shortcuts.htm +0 -47
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/content.css +0 -51
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/dialog.css +0 -118
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/default/ui.css +0 -215
- data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/content.css +0 -25
- data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +0 -106
- data/app/assets/libs/tiny_mce/themes/advanced/skins/highcontrast/ui.css +0 -102
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/content.css +0 -49
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/dialog.css +0 -118
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui.css +0 -218
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +0 -8
- data/app/assets/libs/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
- data/app/assets/libs/tiny_mce/themes/advanced/source_editor.htm +0 -25
- data/app/assets/libs/tiny_mce/themes/simple/editor_template.js +0 -1
- data/app/assets/libs/tiny_mce/themes/simple/editor_template_src.js +0 -84
- data/app/assets/libs/tiny_mce/themes/simple/img/icons.gif +0 -0
- data/app/assets/libs/tiny_mce/themes/simple/langs/en.js +0 -1
- data/app/assets/libs/tiny_mce/themes/simple/skins/default/content.css +0 -25
- data/app/assets/libs/tiny_mce/themes/simple/skins/default/ui.css +0 -32
- data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/content.css +0 -17
- data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/app/assets/libs/tiny_mce/themes/simple/skins/o2k7/ui.css +0 -35
- data/app/assets/libs/tiny_mce/tiny_mce.js +0 -1
- data/app/assets/libs/tiny_mce/tiny_mce_popup.js +0 -5
- data/app/assets/libs/tiny_mce/tiny_mce_src.js +0 -16753
- data/app/assets/libs/tiny_mce/utils/editable_selects.js +0 -70
- data/app/assets/libs/tiny_mce/utils/form_utils.js +0 -210
- data/app/assets/libs/tiny_mce/utils/mctabs.js +0 -162
- data/app/assets/libs/tiny_mce/utils/validate.js +0 -252
- data/app/assets/stylesheets/spud/admin/settings.css +0 -4
- data/app/assets/stylesheets/spud/admin/users.css +0 -4
- data/app/assets/stylesheets/spud/password_resets.css +0 -4
- data/app/assets/stylesheets/spud/setup.css +0 -4
- data/app/assets/stylesheets/spud/sitemaps.css +0 -4
- data/app/assets/stylesheets/spud/user_sessions.css +0 -4
- data/app/assets/stylesheets/spud/users.css +0 -4
- /data/app/assets/{libs/tiny_mce → javascripts/tinymce}/plugins/tableDropdown/editor_plugin.js +0 -0
@@ -1,174 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_plugin_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2011, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function() {
|
12
|
-
tinymce.create('tinymce.plugins.AutolinkPlugin', {
|
13
|
-
/**
|
14
|
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
15
|
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
16
|
-
* of the editor instance to intercept that event.
|
17
|
-
*
|
18
|
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
19
|
-
* @param {string} url Absolute URL to where the plugin is located.
|
20
|
-
*/
|
21
|
-
|
22
|
-
init : function(ed, url) {
|
23
|
-
var t = this;
|
24
|
-
|
25
|
-
// Internet Explorer has built-in automatic linking
|
26
|
-
if (tinyMCE.isIE)
|
27
|
-
return;
|
28
|
-
|
29
|
-
// Add a key down handler
|
30
|
-
ed.onKeyDown.add(function(ed, e) {
|
31
|
-
if (e.keyCode == 13)
|
32
|
-
return t.handleEnter(ed);
|
33
|
-
});
|
34
|
-
|
35
|
-
ed.onKeyPress.add(function(ed, e) {
|
36
|
-
if (e.which == 41)
|
37
|
-
return t.handleEclipse(ed);
|
38
|
-
});
|
39
|
-
|
40
|
-
// Add a key up handler
|
41
|
-
ed.onKeyUp.add(function(ed, e) {
|
42
|
-
if (e.keyCode == 32)
|
43
|
-
return t.handleSpacebar(ed);
|
44
|
-
});
|
45
|
-
},
|
46
|
-
|
47
|
-
handleEclipse : function(ed) {
|
48
|
-
this.parseCurrentLine(ed, -1, '(', true);
|
49
|
-
},
|
50
|
-
|
51
|
-
handleSpacebar : function(ed) {
|
52
|
-
this.parseCurrentLine(ed, 0, '', true);
|
53
|
-
},
|
54
|
-
|
55
|
-
handleEnter : function(ed) {
|
56
|
-
this.parseCurrentLine(ed, -1, '', false);
|
57
|
-
},
|
58
|
-
|
59
|
-
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
|
60
|
-
var r, end, start, endContainer, bookmark, text, matches, prev, len;
|
61
|
-
|
62
|
-
// We need at least five characters to form a URL,
|
63
|
-
// hence, at minimum, five characters from the beginning of the line.
|
64
|
-
r = ed.selection.getRng().cloneRange();
|
65
|
-
if (r.startOffset < 5) {
|
66
|
-
// During testing, the caret is placed inbetween two text nodes.
|
67
|
-
// The previous text node contains the URL.
|
68
|
-
prev = r.endContainer.previousSibling;
|
69
|
-
if (prev == null) {
|
70
|
-
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
|
71
|
-
return;
|
72
|
-
|
73
|
-
prev = r.endContainer.firstChild.nextSibling;
|
74
|
-
}
|
75
|
-
len = prev.length;
|
76
|
-
r.setStart(prev, len);
|
77
|
-
r.setEnd(prev, len);
|
78
|
-
|
79
|
-
if (r.endOffset < 5)
|
80
|
-
return;
|
81
|
-
|
82
|
-
end = r.endOffset;
|
83
|
-
endContainer = prev;
|
84
|
-
} else {
|
85
|
-
endContainer = r.endContainer;
|
86
|
-
|
87
|
-
// Get a text node
|
88
|
-
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
89
|
-
while (endContainer.nodeType != 3 && endContainer.firstChild)
|
90
|
-
endContainer = endContainer.firstChild;
|
91
|
-
|
92
|
-
r.setStart(endContainer, 0);
|
93
|
-
r.setEnd(endContainer, endContainer.nodeValue.length);
|
94
|
-
}
|
95
|
-
|
96
|
-
if (r.endOffset == 1)
|
97
|
-
end = 2;
|
98
|
-
else
|
99
|
-
end = r.endOffset - 1 - end_offset;
|
100
|
-
}
|
101
|
-
|
102
|
-
start = end;
|
103
|
-
|
104
|
-
do
|
105
|
-
{
|
106
|
-
// Move the selection one character backwards.
|
107
|
-
r.setStart(endContainer, end - 2);
|
108
|
-
r.setEnd(endContainer, end - 1);
|
109
|
-
end -= 1;
|
110
|
-
|
111
|
-
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
112
|
-
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
|
113
|
-
|
114
|
-
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
|
115
|
-
r.setStart(endContainer, end);
|
116
|
-
r.setEnd(endContainer, start);
|
117
|
-
end += 1;
|
118
|
-
} else if (r.startOffset == 0) {
|
119
|
-
r.setStart(endContainer, 0);
|
120
|
-
r.setEnd(endContainer, start);
|
121
|
-
}
|
122
|
-
else {
|
123
|
-
r.setStart(endContainer, end);
|
124
|
-
r.setEnd(endContainer, start);
|
125
|
-
}
|
126
|
-
|
127
|
-
text = r.toString();
|
128
|
-
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);
|
129
|
-
|
130
|
-
if (matches) {
|
131
|
-
if (matches[1] == 'www.') {
|
132
|
-
matches[1] = 'http://www.';
|
133
|
-
} else if (/@$/.test(matches[1])) {
|
134
|
-
matches[1] = 'mailto:' + matches[1];
|
135
|
-
}
|
136
|
-
|
137
|
-
bookmark = ed.selection.getBookmark();
|
138
|
-
|
139
|
-
ed.selection.setRng(r);
|
140
|
-
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
|
141
|
-
ed.selection.moveToBookmark(bookmark);
|
142
|
-
|
143
|
-
// TODO: Determine if this is still needed.
|
144
|
-
if (tinyMCE.isWebKit) {
|
145
|
-
// move the caret to its original position
|
146
|
-
ed.selection.collapse(false);
|
147
|
-
var max = Math.min(endContainer.length, start + 1);
|
148
|
-
r.setStart(endContainer, max);
|
149
|
-
r.setEnd(endContainer, max);
|
150
|
-
ed.selection.setRng(r);
|
151
|
-
}
|
152
|
-
}
|
153
|
-
},
|
154
|
-
|
155
|
-
/**
|
156
|
-
* Returns information about the plugin as a name/value array.
|
157
|
-
* The current keys are longname, author, authorurl, infourl and version.
|
158
|
-
*
|
159
|
-
* @return {Object} Name/value array containing information about the plugin.
|
160
|
-
*/
|
161
|
-
getInfo : function() {
|
162
|
-
return {
|
163
|
-
longname : 'Autolink',
|
164
|
-
author : 'Moxiecode Systems AB',
|
165
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
166
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
|
167
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
168
|
-
};
|
169
|
-
}
|
170
|
-
});
|
171
|
-
|
172
|
-
// Register plugin
|
173
|
-
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
|
174
|
-
})();
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
|
@@ -1,119 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_plugin_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2009, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function() {
|
12
|
-
/**
|
13
|
-
* Auto Resize
|
14
|
-
*
|
15
|
-
* This plugin automatically resizes the content area to fit its content height.
|
16
|
-
* It will retain a minimum height, which is the height of the content area when
|
17
|
-
* it's initialized.
|
18
|
-
*/
|
19
|
-
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
20
|
-
/**
|
21
|
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
22
|
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
23
|
-
* of the editor instance to intercept that event.
|
24
|
-
*
|
25
|
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
26
|
-
* @param {string} url Absolute URL to where the plugin is located.
|
27
|
-
*/
|
28
|
-
init : function(ed, url) {
|
29
|
-
var t = this, oldSize = 0;
|
30
|
-
|
31
|
-
if (ed.getParam('fullscreen_is_enabled'))
|
32
|
-
return;
|
33
|
-
|
34
|
-
/**
|
35
|
-
* This method gets executed each time the editor needs to resize.
|
36
|
-
*/
|
37
|
-
function resize() {
|
38
|
-
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
39
|
-
|
40
|
-
// Get height differently depending on the browser used
|
41
|
-
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
42
|
-
|
43
|
-
// Don't make it smaller than the minimum height
|
44
|
-
if (myHeight > t.autoresize_min_height)
|
45
|
-
resizeHeight = myHeight;
|
46
|
-
|
47
|
-
// If a maximum height has been defined don't exceed this height
|
48
|
-
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
49
|
-
resizeHeight = t.autoresize_max_height;
|
50
|
-
body.style.overflowY = "auto";
|
51
|
-
de.style.overflowY = "auto"; // Old IE
|
52
|
-
} else {
|
53
|
-
body.style.overflowY = "hidden";
|
54
|
-
de.style.overflowY = "hidden"; // Old IE
|
55
|
-
body.scrollTop = 0;
|
56
|
-
}
|
57
|
-
|
58
|
-
// Resize content element
|
59
|
-
if (resizeHeight !== oldSize) {
|
60
|
-
deltaSize = resizeHeight - oldSize;
|
61
|
-
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
62
|
-
oldSize = resizeHeight;
|
63
|
-
|
64
|
-
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
65
|
-
// So we need to continue to resize the iframe down until the size gets fixed
|
66
|
-
if (tinymce.isWebKit && deltaSize < 0)
|
67
|
-
resize();
|
68
|
-
}
|
69
|
-
};
|
70
|
-
|
71
|
-
t.editor = ed;
|
72
|
-
|
73
|
-
// Define minimum height
|
74
|
-
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
75
|
-
|
76
|
-
// Define maximum height
|
77
|
-
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
78
|
-
|
79
|
-
// Add padding at the bottom for better UX
|
80
|
-
ed.onInit.add(function(ed){
|
81
|
-
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
82
|
-
});
|
83
|
-
|
84
|
-
// Add appropriate listeners for resizing content area
|
85
|
-
ed.onChange.add(resize);
|
86
|
-
ed.onSetContent.add(resize);
|
87
|
-
ed.onPaste.add(resize);
|
88
|
-
ed.onKeyUp.add(resize);
|
89
|
-
ed.onPostRender.add(resize);
|
90
|
-
|
91
|
-
if (ed.getParam('autoresize_on_init', true)) {
|
92
|
-
ed.onLoad.add(resize);
|
93
|
-
ed.onLoadContent.add(resize);
|
94
|
-
}
|
95
|
-
|
96
|
-
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
97
|
-
ed.addCommand('mceAutoResize', resize);
|
98
|
-
},
|
99
|
-
|
100
|
-
/**
|
101
|
-
* Returns information about the plugin as a name/value array.
|
102
|
-
* The current keys are longname, author, authorurl, infourl and version.
|
103
|
-
*
|
104
|
-
* @return {Object} Name/value array containing information about the plugin.
|
105
|
-
*/
|
106
|
-
getInfo : function() {
|
107
|
-
return {
|
108
|
-
longname : 'Auto Resize',
|
109
|
-
author : 'Moxiecode Systems AB',
|
110
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
111
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
112
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
113
|
-
};
|
114
|
-
}
|
115
|
-
});
|
116
|
-
|
117
|
-
// Register plugin
|
118
|
-
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
119
|
-
})();
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g);h._menu=null}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
|
@@ -1,161 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_plugin_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2009, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function() {
|
12
|
-
var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
|
13
|
-
|
14
|
-
/**
|
15
|
-
* This plugin a context menu to TinyMCE editor instances.
|
16
|
-
*
|
17
|
-
* @class tinymce.plugins.ContextMenu
|
18
|
-
*/
|
19
|
-
tinymce.create('tinymce.plugins.ContextMenu', {
|
20
|
-
/**
|
21
|
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
22
|
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
23
|
-
* of the editor instance to intercept that event.
|
24
|
-
*
|
25
|
-
* @method init
|
26
|
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
27
|
-
* @param {string} url Absolute URL to where the plugin is located.
|
28
|
-
*/
|
29
|
-
init : function(ed) {
|
30
|
-
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey;
|
31
|
-
|
32
|
-
t.editor = ed;
|
33
|
-
|
34
|
-
contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native;
|
35
|
-
|
36
|
-
/**
|
37
|
-
* This event gets fired when the context menu is shown.
|
38
|
-
*
|
39
|
-
* @event onContextMenu
|
40
|
-
* @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
|
41
|
-
* @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
|
42
|
-
*/
|
43
|
-
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
44
|
-
|
45
|
-
showMenu = ed.onContextMenu.add(function(ed, e) {
|
46
|
-
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
47
|
-
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
48
|
-
return;
|
49
|
-
|
50
|
-
Event.cancel(e);
|
51
|
-
|
52
|
-
// Select the image if it's clicked. WebKit would other wise expand the selection
|
53
|
-
if (e.target.nodeName == 'IMG')
|
54
|
-
ed.selection.select(e.target);
|
55
|
-
|
56
|
-
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
57
|
-
Event.add(ed.getDoc(), 'click', function(e) {
|
58
|
-
hide(ed, e);
|
59
|
-
});
|
60
|
-
|
61
|
-
ed.nodeChanged();
|
62
|
-
});
|
63
|
-
|
64
|
-
ed.onRemove.add(function() {
|
65
|
-
if (t._menu)
|
66
|
-
t._menu.removeAll();
|
67
|
-
});
|
68
|
-
|
69
|
-
function hide(ed, e) {
|
70
|
-
realCtrlKey = 0;
|
71
|
-
|
72
|
-
// Since the contextmenu event moves
|
73
|
-
// the selection we need to store it away
|
74
|
-
if (e && e.button == 2) {
|
75
|
-
realCtrlKey = e.ctrlKey;
|
76
|
-
return;
|
77
|
-
}
|
78
|
-
|
79
|
-
if (t._menu) {
|
80
|
-
t._menu.removeAll();
|
81
|
-
t._menu.destroy();
|
82
|
-
Event.remove(ed.getDoc(), 'click', hide);
|
83
|
-
t._menu = null;
|
84
|
-
}
|
85
|
-
};
|
86
|
-
|
87
|
-
ed.onMouseDown.add(hide);
|
88
|
-
ed.onKeyDown.add(hide);
|
89
|
-
ed.onKeyDown.add(function(ed, e) {
|
90
|
-
if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) {
|
91
|
-
Event.cancel(e);
|
92
|
-
showMenu(ed, e);
|
93
|
-
}
|
94
|
-
});
|
95
|
-
},
|
96
|
-
|
97
|
-
/**
|
98
|
-
* Returns information about the plugin as a name/value array.
|
99
|
-
* The current keys are longname, author, authorurl, infourl and version.
|
100
|
-
*
|
101
|
-
* @method getInfo
|
102
|
-
* @return {Object} Name/value array containing information about the plugin.
|
103
|
-
*/
|
104
|
-
getInfo : function() {
|
105
|
-
return {
|
106
|
-
longname : 'Contextmenu',
|
107
|
-
author : 'Moxiecode Systems AB',
|
108
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
109
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
|
110
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
111
|
-
};
|
112
|
-
},
|
113
|
-
|
114
|
-
_getMenu : function(ed) {
|
115
|
-
var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p;
|
116
|
-
|
117
|
-
if (m) {
|
118
|
-
m.removeAll();
|
119
|
-
m.destroy();
|
120
|
-
}
|
121
|
-
|
122
|
-
p = DOM.getPos(ed.getContentAreaContainer());
|
123
|
-
|
124
|
-
m = ed.controlManager.createDropMenu('contextmenu', {
|
125
|
-
offset_x : p.x + ed.getParam('contextmenu_offset_x', 0),
|
126
|
-
offset_y : p.y + ed.getParam('contextmenu_offset_y', 0),
|
127
|
-
constrain : 1,
|
128
|
-
keyboard_focus: true
|
129
|
-
});
|
130
|
-
|
131
|
-
t._menu = m;
|
132
|
-
|
133
|
-
m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
|
134
|
-
m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
|
135
|
-
m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
|
136
|
-
|
137
|
-
if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
|
138
|
-
m.addSeparator();
|
139
|
-
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
|
140
|
-
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
|
141
|
-
}
|
142
|
-
|
143
|
-
m.addSeparator();
|
144
|
-
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
|
145
|
-
|
146
|
-
m.addSeparator();
|
147
|
-
am = m.addMenu({title : 'contextmenu.align'});
|
148
|
-
am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
|
149
|
-
am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
|
150
|
-
am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
|
151
|
-
am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
|
152
|
-
|
153
|
-
t.onContextMenu.dispatch(t, m, el, col);
|
154
|
-
|
155
|
-
return m;
|
156
|
-
}
|
157
|
-
});
|
158
|
-
|
159
|
-
// Register plugin
|
160
|
-
tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
|
161
|
-
})();
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
@@ -1,82 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_plugin_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2009, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function() {
|
12
|
-
tinymce.create('tinymce.plugins.Directionality', {
|
13
|
-
init : function(ed, url) {
|
14
|
-
var t = this;
|
15
|
-
|
16
|
-
t.editor = ed;
|
17
|
-
|
18
|
-
ed.addCommand('mceDirectionLTR', function() {
|
19
|
-
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
|
20
|
-
|
21
|
-
if (e) {
|
22
|
-
if (ed.dom.getAttrib(e, "dir") != "ltr")
|
23
|
-
ed.dom.setAttrib(e, "dir", "ltr");
|
24
|
-
else
|
25
|
-
ed.dom.setAttrib(e, "dir", "");
|
26
|
-
}
|
27
|
-
|
28
|
-
ed.nodeChanged();
|
29
|
-
});
|
30
|
-
|
31
|
-
ed.addCommand('mceDirectionRTL', function() {
|
32
|
-
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
|
33
|
-
|
34
|
-
if (e) {
|
35
|
-
if (ed.dom.getAttrib(e, "dir") != "rtl")
|
36
|
-
ed.dom.setAttrib(e, "dir", "rtl");
|
37
|
-
else
|
38
|
-
ed.dom.setAttrib(e, "dir", "");
|
39
|
-
}
|
40
|
-
|
41
|
-
ed.nodeChanged();
|
42
|
-
});
|
43
|
-
|
44
|
-
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
|
45
|
-
ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
|
46
|
-
|
47
|
-
ed.onNodeChange.add(t._nodeChange, t);
|
48
|
-
},
|
49
|
-
|
50
|
-
getInfo : function() {
|
51
|
-
return {
|
52
|
-
longname : 'Directionality',
|
53
|
-
author : 'Moxiecode Systems AB',
|
54
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
55
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
|
56
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
57
|
-
};
|
58
|
-
},
|
59
|
-
|
60
|
-
// Private methods
|
61
|
-
|
62
|
-
_nodeChange : function(ed, cm, n) {
|
63
|
-
var dom = ed.dom, dir;
|
64
|
-
|
65
|
-
n = dom.getParent(n, dom.isBlock);
|
66
|
-
if (!n) {
|
67
|
-
cm.setDisabled('ltr', 1);
|
68
|
-
cm.setDisabled('rtl', 1);
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
|
72
|
-
dir = dom.getAttrib(n, 'dir');
|
73
|
-
cm.setActive('ltr', dir == "ltr");
|
74
|
-
cm.setDisabled('ltr', 0);
|
75
|
-
cm.setActive('rtl', dir == "rtl");
|
76
|
-
cm.setDisabled('rtl', 0);
|
77
|
-
}
|
78
|
-
});
|
79
|
-
|
80
|
-
// Register plugin
|
81
|
-
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
|
82
|
-
})();
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<title>{#example_dlg.title}</title>
|
5
|
-
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6
|
-
<script type="text/javascript" src="js/dialog.js"></script>
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
|
10
|
-
<form onsubmit="ExampleDialog.insert();return false;" action="#">
|
11
|
-
<p>Here is a example dialog.</p>
|
12
|
-
<p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>
|
13
|
-
<p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>
|
14
|
-
|
15
|
-
<div class="mceActionPanel">
|
16
|
-
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
|
17
|
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
18
|
-
</div>
|
19
|
-
</form>
|
20
|
-
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
|
@@ -1,84 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* editor_plugin_src.js
|
3
|
-
*
|
4
|
-
* Copyright 2009, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://tinymce.moxiecode.com/license
|
8
|
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function() {
|
12
|
-
// Load plugin specific language pack
|
13
|
-
tinymce.PluginManager.requireLangPack('example');
|
14
|
-
|
15
|
-
tinymce.create('tinymce.plugins.ExamplePlugin', {
|
16
|
-
/**
|
17
|
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
18
|
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
19
|
-
* of the editor instance to intercept that event.
|
20
|
-
*
|
21
|
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
22
|
-
* @param {string} url Absolute URL to where the plugin is located.
|
23
|
-
*/
|
24
|
-
init : function(ed, url) {
|
25
|
-
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
26
|
-
ed.addCommand('mceExample', function() {
|
27
|
-
ed.windowManager.open({
|
28
|
-
file : url + '/dialog.htm',
|
29
|
-
width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
|
30
|
-
height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
|
31
|
-
inline : 1
|
32
|
-
}, {
|
33
|
-
plugin_url : url, // Plugin absolute URL
|
34
|
-
some_custom_arg : 'custom arg' // Custom argument
|
35
|
-
});
|
36
|
-
});
|
37
|
-
|
38
|
-
// Register example button
|
39
|
-
ed.addButton('example', {
|
40
|
-
title : 'example.desc',
|
41
|
-
cmd : 'mceExample',
|
42
|
-
image : url + '/img/example.gif'
|
43
|
-
});
|
44
|
-
|
45
|
-
// Add a node change handler, selects the button in the UI when a image is selected
|
46
|
-
ed.onNodeChange.add(function(ed, cm, n) {
|
47
|
-
cm.setActive('example', n.nodeName == 'IMG');
|
48
|
-
});
|
49
|
-
},
|
50
|
-
|
51
|
-
/**
|
52
|
-
* Creates control instances based in the incomming name. This method is normally not
|
53
|
-
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
54
|
-
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
55
|
-
* method can be used to create those.
|
56
|
-
*
|
57
|
-
* @param {String} n Name of the control to create.
|
58
|
-
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
59
|
-
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
60
|
-
*/
|
61
|
-
createControl : function(n, cm) {
|
62
|
-
return null;
|
63
|
-
},
|
64
|
-
|
65
|
-
/**
|
66
|
-
* Returns information about the plugin as a name/value array.
|
67
|
-
* The current keys are longname, author, authorurl, infourl and version.
|
68
|
-
*
|
69
|
-
* @return {Object} Name/value array containing information about the plugin.
|
70
|
-
*/
|
71
|
-
getInfo : function() {
|
72
|
-
return {
|
73
|
-
longname : 'Example plugin',
|
74
|
-
author : 'Some author',
|
75
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
76
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
|
77
|
-
version : "1.0"
|
78
|
-
};
|
79
|
-
}
|
80
|
-
});
|
81
|
-
|
82
|
-
// Register plugin
|
83
|
-
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
|
84
|
-
})();
|
Binary file
|