tb_core 0.9.17 → 0.9.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/spud/admin/editor.js +1 -1
- data/lib/spud_core/engine.rb +1 -2
- data/lib/spud_core/version.rb +1 -1
- metadata +2 -36
- 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/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/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/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/stylesheets/spud/admin/settings.css +0 -4
- data/app/assets/stylesheets/spud/admin/users.css +0 -4
@@ -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
|
@@ -1,19 +0,0 @@
|
|
1
|
-
tinyMCEPopup.requireLangPack();
|
2
|
-
|
3
|
-
var ExampleDialog = {
|
4
|
-
init : function() {
|
5
|
-
var f = document.forms[0];
|
6
|
-
|
7
|
-
// Get the selected contents as text and place it in the input
|
8
|
-
f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
|
9
|
-
f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
|
10
|
-
},
|
11
|
-
|
12
|
-
insert : function() {
|
13
|
-
// Insert the contents from the input into the document
|
14
|
-
tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
|
15
|
-
tinyMCEPopup.close();
|
16
|
-
}
|
17
|
-
};
|
18
|
-
|
19
|
-
tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})();
|
@@ -1,50 +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
|
-
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
|
14
|
-
/**
|
15
|
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
16
|
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
17
|
-
* of the editor instance to intercept that event.
|
18
|
-
*
|
19
|
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
20
|
-
* @param {string} url Absolute URL to where the plugin is located.
|
21
|
-
*/
|
22
|
-
init : function(ed, url) {
|
23
|
-
},
|
24
|
-
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Returns information about the plugin as a name/value array.
|
28
|
-
* The current keys are longname, author, authorurl, infourl and version.
|
29
|
-
*
|
30
|
-
* @return {Object} Name/value array containing information about the plugin.
|
31
|
-
*/
|
32
|
-
getInfo : function() {
|
33
|
-
return {
|
34
|
-
longname : 'Example Dependency plugin',
|
35
|
-
author : 'Some author',
|
36
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
37
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
|
38
|
-
version : "1.0"
|
39
|
-
};
|
40
|
-
}
|
41
|
-
});
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
|
45
|
-
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
|
46
|
-
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
|
47
|
-
* with an object which has the url to the plugin and the shortname.
|
48
|
-
*/
|
49
|
-
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
|
50
|
-
})();
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})();
|
@@ -1,54 +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.IESpell', {
|
13
|
-
init : function(ed, url) {
|
14
|
-
var t = this, sp;
|
15
|
-
|
16
|
-
if (!tinymce.isIE)
|
17
|
-
return;
|
18
|
-
|
19
|
-
t.editor = ed;
|
20
|
-
|
21
|
-
// Register commands
|
22
|
-
ed.addCommand('mceIESpell', function() {
|
23
|
-
try {
|
24
|
-
sp = new ActiveXObject("ieSpell.ieSpellExtension");
|
25
|
-
sp.CheckDocumentNode(ed.getDoc().documentElement);
|
26
|
-
} catch (e) {
|
27
|
-
if (e.number == -2146827859) {
|
28
|
-
ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
|
29
|
-
if (s)
|
30
|
-
window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
|
31
|
-
});
|
32
|
-
} else
|
33
|
-
ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
|
34
|
-
}
|
35
|
-
});
|
36
|
-
|
37
|
-
// Register buttons
|
38
|
-
ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
|
39
|
-
},
|
40
|
-
|
41
|
-
getInfo : function() {
|
42
|
-
return {
|
43
|
-
longname : 'IESpell (IE Only)',
|
44
|
-
author : 'Moxiecode Systems AB',
|
45
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
46
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
|
47
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
48
|
-
};
|
49
|
-
}
|
50
|
-
});
|
51
|
-
|
52
|
-
// Register plugin
|
53
|
-
tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
|
54
|
-
})();
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){function a(b){do{if(b.className&&b.className.indexOf("mceItemLayer")!=-1){return b}}while(b=b.parentNode)}tinymce.create("tinymce.plugins.Layer",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceInsertLayer",d._insertLayer,d);b.addCommand("mceMoveForward",function(){d._move(1)});b.addCommand("mceMoveBackward",function(){d._move(-1)});b.addCommand("mceMakeAbsolute",function(){d._toggleAbsolute()});b.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});b.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});b.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});b.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});b.onInit.add(function(){var e=b.dom;if(tinymce.isIE){b.getDoc().execCommand("2D-Position",false,true)}});b.onMouseUp.add(function(f,h){var g=a(h.target);if(g){f.dom.setAttrib(g,"data-mce-style","")}});b.onMouseDown.add(function(f,j){var h=j.target,i=f.getDoc(),g;if(tinymce.isGecko){if(a(h)){if(i.designMode!=="on"){i.designMode="on";h=i.body;g=h.parentNode;g.removeChild(h);g.appendChild(h)}}else{if(i.designMode=="on"){i.designMode="off"}}}});b.onNodeChange.add(d._nodeChange,d);b.onVisualAid.add(d._visualAid,d)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(c,b,f){var d,e;d=this._getParentLayer(f);e=c.dom.getParent(f,"DIV,P,IMG");if(!e){b.setDisabled("absolute",1);b.setDisabled("moveforward",1);b.setDisabled("movebackward",1)}else{b.setDisabled("absolute",0);b.setDisabled("moveforward",!d);b.setDisabled("movebackward",!d);b.setActive("absolute",d&&d.style.position.toLowerCase()=="absolute")}},_visualAid:function(b,d,c){var f=b.dom;tinymce.each(f.select("div,p",d),function(g){if(/^(absolute|relative|fixed)$/i.test(g.style.position)){if(c){f.addClass(g,"mceItemVisualAid")}else{f.removeClass(g,"mceItemVisualAid")}f.addClass(g,"mceItemLayer")}})},_move:function(j){var c=this.editor,g,h=[],f=this._getParentLayer(c.selection.getNode()),e=-1,k=-1,b;b=[];tinymce.walk(c.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){b.push(d)}},"childNodes");for(g=0;g<b.length;g++){h[g]=b[g].style.zIndex?parseInt(b[g].style.zIndex):0;if(e<0&&b[g]==f){e=g}}if(j<0){for(g=0;g<h.length;g++){if(h[g]<h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;g<h.length;g++){if(h[g]>h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
|
@@ -1,262 +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
|
-
function findParentLayer(node) {
|
13
|
-
do {
|
14
|
-
if (node.className && node.className.indexOf('mceItemLayer') != -1) {
|
15
|
-
return node;
|
16
|
-
}
|
17
|
-
} while (node = node.parentNode);
|
18
|
-
};
|
19
|
-
|
20
|
-
tinymce.create('tinymce.plugins.Layer', {
|
21
|
-
init : function(ed, url) {
|
22
|
-
var t = this;
|
23
|
-
|
24
|
-
t.editor = ed;
|
25
|
-
|
26
|
-
// Register commands
|
27
|
-
ed.addCommand('mceInsertLayer', t._insertLayer, t);
|
28
|
-
|
29
|
-
ed.addCommand('mceMoveForward', function() {
|
30
|
-
t._move(1);
|
31
|
-
});
|
32
|
-
|
33
|
-
ed.addCommand('mceMoveBackward', function() {
|
34
|
-
t._move(-1);
|
35
|
-
});
|
36
|
-
|
37
|
-
ed.addCommand('mceMakeAbsolute', function() {
|
38
|
-
t._toggleAbsolute();
|
39
|
-
});
|
40
|
-
|
41
|
-
// Register buttons
|
42
|
-
ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
|
43
|
-
ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
|
44
|
-
ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
|
45
|
-
ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
|
46
|
-
|
47
|
-
ed.onInit.add(function() {
|
48
|
-
var dom = ed.dom;
|
49
|
-
|
50
|
-
if (tinymce.isIE)
|
51
|
-
ed.getDoc().execCommand('2D-Position', false, true);
|
52
|
-
});
|
53
|
-
|
54
|
-
// Remove serialized styles when selecting a layer since it might be changed by a drag operation
|
55
|
-
ed.onMouseUp.add(function(ed, e) {
|
56
|
-
var layer = findParentLayer(e.target);
|
57
|
-
|
58
|
-
if (layer) {
|
59
|
-
ed.dom.setAttrib(layer, 'data-mce-style', '');
|
60
|
-
}
|
61
|
-
});
|
62
|
-
|
63
|
-
// Fixes edit focus issues with layers on Gecko
|
64
|
-
// This will enable designMode while inside a layer and disable it when outside
|
65
|
-
ed.onMouseDown.add(function(ed, e) {
|
66
|
-
var node = e.target, doc = ed.getDoc(), parent;
|
67
|
-
|
68
|
-
if (tinymce.isGecko) {
|
69
|
-
if (findParentLayer(node)) {
|
70
|
-
if (doc.designMode !== 'on') {
|
71
|
-
doc.designMode = 'on';
|
72
|
-
|
73
|
-
// Repaint caret
|
74
|
-
node = doc.body;
|
75
|
-
parent = node.parentNode;
|
76
|
-
parent.removeChild(node);
|
77
|
-
parent.appendChild(node);
|
78
|
-
}
|
79
|
-
} else if (doc.designMode == 'on') {
|
80
|
-
doc.designMode = 'off';
|
81
|
-
}
|
82
|
-
}
|
83
|
-
});
|
84
|
-
|
85
|
-
ed.onNodeChange.add(t._nodeChange, t);
|
86
|
-
ed.onVisualAid.add(t._visualAid, t);
|
87
|
-
},
|
88
|
-
|
89
|
-
getInfo : function() {
|
90
|
-
return {
|
91
|
-
longname : 'Layer',
|
92
|
-
author : 'Moxiecode Systems AB',
|
93
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
94
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
|
95
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
96
|
-
};
|
97
|
-
},
|
98
|
-
|
99
|
-
// Private methods
|
100
|
-
|
101
|
-
_nodeChange : function(ed, cm, n) {
|
102
|
-
var le, p;
|
103
|
-
|
104
|
-
le = this._getParentLayer(n);
|
105
|
-
p = ed.dom.getParent(n, 'DIV,P,IMG');
|
106
|
-
|
107
|
-
if (!p) {
|
108
|
-
cm.setDisabled('absolute', 1);
|
109
|
-
cm.setDisabled('moveforward', 1);
|
110
|
-
cm.setDisabled('movebackward', 1);
|
111
|
-
} else {
|
112
|
-
cm.setDisabled('absolute', 0);
|
113
|
-
cm.setDisabled('moveforward', !le);
|
114
|
-
cm.setDisabled('movebackward', !le);
|
115
|
-
cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
|
116
|
-
}
|
117
|
-
},
|
118
|
-
|
119
|
-
// Private methods
|
120
|
-
|
121
|
-
_visualAid : function(ed, e, s) {
|
122
|
-
var dom = ed.dom;
|
123
|
-
|
124
|
-
tinymce.each(dom.select('div,p', e), function(e) {
|
125
|
-
if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
|
126
|
-
if (s)
|
127
|
-
dom.addClass(e, 'mceItemVisualAid');
|
128
|
-
else
|
129
|
-
dom.removeClass(e, 'mceItemVisualAid');
|
130
|
-
|
131
|
-
dom.addClass(e, 'mceItemLayer');
|
132
|
-
}
|
133
|
-
});
|
134
|
-
},
|
135
|
-
|
136
|
-
_move : function(d) {
|
137
|
-
var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
|
138
|
-
|
139
|
-
nl = [];
|
140
|
-
tinymce.walk(ed.getBody(), function(n) {
|
141
|
-
if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
|
142
|
-
nl.push(n);
|
143
|
-
}, 'childNodes');
|
144
|
-
|
145
|
-
// Find z-indexes
|
146
|
-
for (i=0; i<nl.length; i++) {
|
147
|
-
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
|
148
|
-
|
149
|
-
if (ci < 0 && nl[i] == le)
|
150
|
-
ci = i;
|
151
|
-
}
|
152
|
-
|
153
|
-
if (d < 0) {
|
154
|
-
// Move back
|
155
|
-
|
156
|
-
// Try find a lower one
|
157
|
-
for (i=0; i<z.length; i++) {
|
158
|
-
if (z[i] < z[ci]) {
|
159
|
-
fi = i;
|
160
|
-
break;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
if (fi > -1) {
|
165
|
-
nl[ci].style.zIndex = z[fi];
|
166
|
-
nl[fi].style.zIndex = z[ci];
|
167
|
-
} else {
|
168
|
-
if (z[ci] > 0)
|
169
|
-
nl[ci].style.zIndex = z[ci] - 1;
|
170
|
-
}
|
171
|
-
} else {
|
172
|
-
// Move forward
|
173
|
-
|
174
|
-
// Try find a higher one
|
175
|
-
for (i=0; i<z.length; i++) {
|
176
|
-
if (z[i] > z[ci]) {
|
177
|
-
fi = i;
|
178
|
-
break;
|
179
|
-
}
|
180
|
-
}
|
181
|
-
|
182
|
-
if (fi > -1) {
|
183
|
-
nl[ci].style.zIndex = z[fi];
|
184
|
-
nl[fi].style.zIndex = z[ci];
|
185
|
-
} else
|
186
|
-
nl[ci].style.zIndex = z[ci] + 1;
|
187
|
-
}
|
188
|
-
|
189
|
-
ed.execCommand('mceRepaint');
|
190
|
-
},
|
191
|
-
|
192
|
-
_getParentLayer : function(n) {
|
193
|
-
return this.editor.dom.getParent(n, function(n) {
|
194
|
-
return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
|
195
|
-
});
|
196
|
-
},
|
197
|
-
|
198
|
-
_insertLayer : function() {
|
199
|
-
var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody();
|
200
|
-
|
201
|
-
ed.dom.add(body, 'div', {
|
202
|
-
style : {
|
203
|
-
position : 'absolute',
|
204
|
-
left : p.x,
|
205
|
-
top : (p.y > 20 ? p.y : 20),
|
206
|
-
width : 100,
|
207
|
-
height : 100
|
208
|
-
},
|
209
|
-
'class' : 'mceItemVisualAid mceItemLayer'
|
210
|
-
}, ed.selection.getContent() || ed.getLang('layer.content'));
|
211
|
-
|
212
|
-
// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
|
213
|
-
if (tinymce.isIE)
|
214
|
-
dom.setHTML(body, body.innerHTML);
|
215
|
-
},
|
216
|
-
|
217
|
-
_toggleAbsolute : function() {
|
218
|
-
var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
|
219
|
-
|
220
|
-
if (!le)
|
221
|
-
le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
|
222
|
-
|
223
|
-
if (le) {
|
224
|
-
if (le.style.position.toLowerCase() == "absolute") {
|
225
|
-
ed.dom.setStyles(le, {
|
226
|
-
position : '',
|
227
|
-
left : '',
|
228
|
-
top : '',
|
229
|
-
width : '',
|
230
|
-
height : ''
|
231
|
-
});
|
232
|
-
|
233
|
-
ed.dom.removeClass(le, 'mceItemVisualAid');
|
234
|
-
ed.dom.removeClass(le, 'mceItemLayer');
|
235
|
-
} else {
|
236
|
-
if (le.style.left == "")
|
237
|
-
le.style.left = 20 + 'px';
|
238
|
-
|
239
|
-
if (le.style.top == "")
|
240
|
-
le.style.top = 20 + 'px';
|
241
|
-
|
242
|
-
if (le.style.width == "")
|
243
|
-
le.style.width = le.width ? (le.width + 'px') : '100px';
|
244
|
-
|
245
|
-
if (le.style.height == "")
|
246
|
-
le.style.height = le.height ? (le.height + 'px') : '100px';
|
247
|
-
|
248
|
-
le.style.position = "absolute";
|
249
|
-
|
250
|
-
ed.dom.setAttrib(le, 'data-mce-style', '');
|
251
|
-
ed.addVisual(ed.getBody());
|
252
|
-
}
|
253
|
-
|
254
|
-
ed.execCommand('mceRepaint');
|
255
|
-
ed.nodeChanged();
|
256
|
-
}
|
257
|
-
}
|
258
|
-
});
|
259
|
-
|
260
|
-
// Register plugin
|
261
|
-
tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
|
262
|
-
})();
|
@@ -1 +0,0 @@
|
|
1
|
-
.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}
|
@@ -1 +0,0 @@
|
|
1
|
-
(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBookmark();c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(l){var g=this.editor,f=g.dom,j=g.getDoc(),h=g.selection,i=h.getBookmark(),d=[],k=l.join("|"),m=this._getSeparators(),e=new RegExp("(^|["+m+"])("+k+")(?=["+m+"]|$)","g");this._walk(g.getBody(),function(o){if(o.nodeType==3){d.push(o)}});c(d,function(t){var r,q,o,s,p=t.nodeValue;if(e.test(p)){p=f.encode(p);q=f.create("span",{"class":"mceItemHidden"});if(tinymce.isIE){p=p.replace(e,"$1<mcespell>$2</mcespell>");while((s=p.indexOf("<mcespell>"))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(f.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("</mcespell>");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(f.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(f.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(e,'$1<span class="mceItemHiddenSpellWord">$2</span>')}f.replace(q,t)}});h.moveToBookmark(i)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}if(h.getParam("show_ignore_words",true)){e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}})}if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
|