Ready for 7.10.29 development.
This commit is contained in:
commit
c806f99b7b
4236 changed files with 1217679 additions and 0 deletions
44
www/extras/tinymce-webgui/callbacks.js
Normal file
44
www/extras/tinymce-webgui/callbacks.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// WebGUI Specific javascript functions for TinyMCE
|
||||
|
||||
(function () {
|
||||
var carat = /%5E/g,
|
||||
colon = /%3B/g,
|
||||
leftParen = /%28/g,
|
||||
rightParen = /%29/g,
|
||||
quot = /"/g;
|
||||
|
||||
function convert(url) {
|
||||
return url.replace(carat, '^')
|
||||
.replace(colon, ':')
|
||||
.replace(leftParen, '(')
|
||||
.replace(rightParen, ')');
|
||||
}
|
||||
|
||||
function recurse(el) {
|
||||
var i, nodes = el.childNodes, len = nodes.length;
|
||||
if (el.href) {
|
||||
el.href = convert(el.href);
|
||||
}
|
||||
if (el.src) {
|
||||
el.src = convert(el.src);
|
||||
}
|
||||
for (i = 0; i < len; i += 1) {
|
||||
recurse(nodes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function postproc (pl, o) {
|
||||
recurse(o.node);
|
||||
}
|
||||
|
||||
function cleanup (type, value) {
|
||||
if (type === 'get_from_editor') {
|
||||
value = value.replace(quot, '"');
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
window.tinyMCE_WebGUI_URLConvertor = convert;
|
||||
window.tinyMCE_WebGUI_paste_postprocess = postproc;
|
||||
window.tinyMCE_WebGUI_Cleanup = cleanup;
|
||||
}());
|
||||
6
www/extras/tinymce-webgui/defaultcontent.css
Normal file
6
www/extras/tinymce-webgui/defaultcontent.css
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/* If the site managers don't specify a style sheet to use with the rich editor, we do just to make it readable. */
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
.panel_wrapper div.current {
|
||||
height: 475px;
|
||||
}
|
||||
.panel_wrapper div.current input, .panel_wrapper div.current select {
|
||||
width: 100%;
|
||||
}
|
||||
fieldset.image-manager {
|
||||
height: 316px;
|
||||
}
|
||||
iframe#image-manager {
|
||||
border-style: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
iframe#image-preview {
|
||||
width: 145px;
|
||||
height: 110px;
|
||||
}
|
||||
|
||||
.noselect {
|
||||
color: #888;
|
||||
}
|
||||
.nav {
|
||||
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
.nav a {
|
||||
color: #0f3ccc;
|
||||
text-decoration: none;
|
||||
}
|
||||
.nav a:hover {
|
||||
color: #000080;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.nav ul, .nav li {
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.nav .selectLink {
|
||||
color: #cc7700;
|
||||
}
|
||||
.nav .crumb {
|
||||
color: orange;
|
||||
}
|
||||
.nav .crumbTrail {
|
||||
padding: 3px;
|
||||
background-color: #eeeeee;
|
||||
-moz-border-radius: 10px;
|
||||
}
|
||||
.nav .traverse {
|
||||
font-size: 15px;
|
||||
}
|
||||
div.preview {
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
div.preview img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
(function() {
|
||||
tinymce.PluginManager.requireLangPack('wginsertimage');
|
||||
|
||||
tinymce.create('tinymce.plugins.WGInsertImagePlugin', {
|
||||
init : function(ed, url) {
|
||||
var page_url = document.location.protocol + "//" + document.location.hostname + (document.location.port ? ":" + document.location.port : '') + getWebguiProperty('pageURL');
|
||||
ed.addCommand('wgInsertImage', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/insertimage.htm',
|
||||
width : 500 + ed.getLang('wgpagetree.delta_width', 0),
|
||||
height : 550 + ed.getLang('wgpagetree.delta_height', 0),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url,
|
||||
page_url : page_url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('wginsertimage', {
|
||||
title : 'wginsertimage.desc',
|
||||
cmd : 'wgInsertImage',
|
||||
image : url + '/img/insertimage.gif'
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'WebGUI Image Insert',
|
||||
author : 'Plain Black',
|
||||
authorurl : 'http://www.plainblack.com/',
|
||||
infourl : 'http://www.webgui.org/',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('wginsertimage', tinymce.plugins.WGInsertImagePlugin);
|
||||
})();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 148 B |
|
|
@ -0,0 +1,98 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#wginsertimage.desc}</title>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/insertimage.js"></script>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/utils/form_utils.js"></script>
|
||||
<link href="css/insertimage.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body>
|
||||
<form onsubmit="WGInsertImageDialog.update(this);return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#wginsertimage.desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<fieldset class="image-manager">
|
||||
<legend>{#wginsertimage.manager}</legend>
|
||||
<iframe id="image-manager"></iframe>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{#wginsertimage.selectedproperties}</legend>
|
||||
<table class="image-properties" style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 6.5em;"><label for="image-url">{#wginsertimage.imageurl}</label></td>
|
||||
<td width="100%"><input id="image-url" type="text" name="imageurl" /></td>
|
||||
<td rowspan="3"><iframe id="image-preview"></iframe></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="image-alt">{#wginsertimage.imagealt}</label></td>
|
||||
<td><input id="image-alt" type="text" name="imagealt" /></td>
|
||||
</tr>
|
||||
<tr><td colspan="2">
|
||||
<table style="width: 100%"><tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend>{#wginsertimage.imagelayout}</legend>
|
||||
<table class="image-layout" style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 6em"><label for="image-align">{#wginsertimage.imagealign}</label></td>
|
||||
<td>
|
||||
<select id="image-align" name="imagealign">
|
||||
<option value="" selected="selected">(none)</option>
|
||||
<option value="absbottom">absbottom</option>
|
||||
<option value="absmiddle">absmiddle</option>
|
||||
<option value="baseline">baseline</option>
|
||||
<option value="bottom">bottom</option>
|
||||
<option value="left">left</option>
|
||||
<option value="middle">middle</option>
|
||||
<option value="right">right</option>
|
||||
<option value="texttop">texttop</option>
|
||||
<option value="top">top</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="image-border">{#wginsertimage.imageborder}</label></td>
|
||||
<td><input id="image-border" type="text" name="imageborder" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend>{#wginsertimage.imagespacing}</legend>
|
||||
<table class="image-spacing" style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 6em;"><label for="image-hspace">{#wginsertimage.imagehspace}</label></td>
|
||||
<td><input id="image-hspace" type="text" name="imagehspace" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="image-vspace">{#wginsertimage.imagevspace}</label></td>
|
||||
<td><input id="image-vspace" type="text" name="imagevspace" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
var WGInsertImageDialog = {
|
||||
init : function(ed) {
|
||||
var iframe = document.getElementById('image-manager');
|
||||
window.setTimeout(function() {
|
||||
iframe.src = tinyMCEPopup.getWindowArg('page_url') + '?op=formHelper;class=HTMLArea;sub=imageTree';
|
||||
}, 100);
|
||||
},
|
||||
|
||||
setUrl : function(url, thumburl) {
|
||||
document.getElementById('image-url').value = url;
|
||||
var iframe = document.getElementById('image-preview');
|
||||
iframe.src = thumburl;
|
||||
},
|
||||
|
||||
update : function(form) {
|
||||
if(!form.imageurl.value) {
|
||||
alert("Image URL must be specified.");
|
||||
form.imageurl.focus();
|
||||
return;
|
||||
}
|
||||
if (form.imagehspace.value && !checkNumber(form.imagehspace.value)) {
|
||||
alert("Horizontal spacing must be a number between 0 and 999.");
|
||||
form.imagehspace.focus();
|
||||
return;
|
||||
}
|
||||
if (form.imagevspace.value && !checkNumber(form.imagevspace.value)) {
|
||||
alert("Vertical spacing must be a number between 0 and 999.");
|
||||
form.imagevspace.focus();
|
||||
return;
|
||||
}
|
||||
if(form.imageborder.value && !checkNumber(form.imageborder.value)) {
|
||||
alert("Border thickness must be a number between 0 and 999.");
|
||||
form.imageborder.focus();
|
||||
return;
|
||||
}
|
||||
if(form.imageurl.value.length > 2040) {
|
||||
form.imageurl.value = form.imageurl.value.substring(0,2040);
|
||||
}
|
||||
var img = "<img"
|
||||
+ " src=\"" + form.imageurl.value + '"'
|
||||
+ " alt=\"" + form.imagealt.value + '"';
|
||||
if (form.imagehspace.value != "") {
|
||||
img += ' hspace="' + parseInt(form.imagehspace.value) + '"';
|
||||
}
|
||||
if (form.imagevspace.value != "") {
|
||||
img += ' vspace="' + parseInt(form.imagevspace.value) + '"';
|
||||
}
|
||||
if (form.imageborder.value != "") {
|
||||
img += ' border="' + parseInt(form.imageborder.value) + '"';
|
||||
}
|
||||
if (form.imagealign.value != "") {
|
||||
img += ' align="' + form.imagealign.value + '"';
|
||||
}
|
||||
img += ' />';
|
||||
var ed = tinyMCEPopup.editor;
|
||||
ed.execCommand('mceInsertContent', false, img);
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
function checkNumber(num) {
|
||||
num = parseInt(num);
|
||||
if (isNaN(num) || num < 0 || num > 999) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
tinyMCEPopup.onInit.add(WGInsertImageDialog.init, WGInsertImageDialog);
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
tinyMCE.addI18n('en.wginsertimage',{
|
||||
desc : 'Insert WebGUI Image'
|
||||
});
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
tinyMCE.addI18n('en.wginsertimage',{
|
||||
desc : 'WebGUI Collateral - Insert Image',
|
||||
manager : 'WebGUI Collateral Image Manager',
|
||||
newwindow : 'Open link in new window.',
|
||||
selectedproperties : 'Selected Image',
|
||||
imageurl : 'Image URL:',
|
||||
imagealt : 'Alt Text:',
|
||||
imagelayout : 'Layout',
|
||||
imagealign : 'Alignment:',
|
||||
imageborder : 'Border:',
|
||||
imagespacing : 'Spacing',
|
||||
imagehspace : 'Horizontal:',
|
||||
imagevspace : 'Vertical:'
|
||||
});
|
||||
10
www/extras/tinymce-webgui/plugins/wgmacro/css/macro.css
Normal file
10
www/extras/tinymce-webgui/plugins/wgmacro/css/macro.css
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
select.macro {
|
||||
width: 100%;
|
||||
}
|
||||
.panel_wrapper div.current {
|
||||
height: 48px;
|
||||
}
|
||||
table.macro {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
38
www/extras/tinymce-webgui/plugins/wgmacro/editor_plugin.js
Normal file
38
www/extras/tinymce-webgui/plugins/wgmacro/editor_plugin.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
(function() {
|
||||
tinymce.PluginManager.requireLangPack('wgmacro');
|
||||
|
||||
tinymce.create('tinymce.plugins.WGMacroPlugin', {
|
||||
init : function(ed, url) {
|
||||
ed.addCommand('wgInsertMacro', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/macro.htm',
|
||||
width : 400 + ed.getLang('wgmacro.delta_width', 0),
|
||||
height : 125 + ed.getLang('wgmacro.delta_height', 0),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('wgmacro', {
|
||||
title : 'wgmacro.desc',
|
||||
cmd : 'wgInsertMacro',
|
||||
image : url + '/img/macro.gif'
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'WebGUI Macro Inserter',
|
||||
author : 'Plain Black',
|
||||
authorurl : 'http://www.plainblack.com/',
|
||||
infourl : 'http://www.webgui.org/',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('wgmacro', tinymce.plugins.WGMacroPlugin);
|
||||
})();
|
||||
|
||||
BIN
www/extras/tinymce-webgui/plugins/wgmacro/img/macro.gif
Normal file
BIN
www/extras/tinymce-webgui/plugins/wgmacro/img/macro.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 B |
27
www/extras/tinymce-webgui/plugins/wgmacro/js/macro.js
Normal file
27
www/extras/tinymce-webgui/plugins/wgmacro/js/macro.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
var WGMacroDialog = {
|
||||
init : function(ed) {
|
||||
},
|
||||
|
||||
update : function(form) {
|
||||
var ed = tinyMCEPopup.editor;
|
||||
|
||||
var inputs = form.elements;
|
||||
for (var i = 0; i <= inputs.length; i++) {
|
||||
var input = inputs[i];
|
||||
if (input.name != 'macrolist') {
|
||||
continue;
|
||||
}
|
||||
if (input.value.length > 0) {
|
||||
ed.execCommand("mceInsertContent", false, input.value);
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
tinyMCEPopup.close();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
tinyMCEPopup.onInit.add(WGMacroDialog.init, WGMacroDialog);
|
||||
|
||||
3
www/extras/tinymce-webgui/plugins/wgmacro/langs/en.js
Normal file
3
www/extras/tinymce-webgui/plugins/wgmacro/langs/en.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
tinyMCE.addI18n('en.wgmacro',{
|
||||
desc : 'Insert WebGUI Macro'
|
||||
});
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
tinyMCE.addI18n('en.wgmacro',{
|
||||
desc : 'Insert WebGUI Macro'
|
||||
});
|
||||
105
www/extras/tinymce-webgui/plugins/wgmacro/macro.htm
Normal file
105
www/extras/tinymce-webgui/plugins/wgmacro/macro.htm
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#wgmacro.desc}</title>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/macro.js"></script>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/utils/form_utils.js"></script>
|
||||
<link href="css/macro.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body>
|
||||
<form onsubmit="WGMacroDialog.update(this);return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#wgmacro.desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table border="0" cellpadding="4" cellspacing="0" class="macro">
|
||||
<tr>
|
||||
<td>
|
||||
<select class="macro" name="macrolist" onchange="WGMacroDialog.update(this.form)">
|
||||
<option value=''>Assets...</option>
|
||||
<option value='^AssetProxy(url);'>Asset Proxy</option>
|
||||
<option value='^RandomAssetProxy(url);'>Random Asset Proxy</option>
|
||||
<option value='^FileUrl(assetUrl);'>File URL</option>
|
||||
<option value='^Page(property name);'>Asset Property</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select class="macro" name="macrolist" onchange="WGMacroDialog.update(this.form)">
|
||||
<option value=''>Navigation...</option>
|
||||
<option value='^AssetProxy(crumbtrail);'>Crumb Trail</option>
|
||||
<option value='^AssetProxy(flexmenu);'>FlexMenu</option>
|
||||
<option value='^AssetProxy(dtree);'>Dynamic Tree</option>
|
||||
<option value='^AssetProxy(coolmenu);'>Cool Menu (Horizontal)</option>
|
||||
<option value='^AssetProxy(currentmenuvertical);'>Current Menu (Vertical)</option>
|
||||
<option value='^AssetProxy(currentmenuhorizontal);'>Current Menu (Horizontal)</option>
|
||||
<option value='^AssetProxy(previousmenuvertical);'>Previous Menu (Vertical)</option>
|
||||
<option value='^AssetProxy(previousmenuhorizontal);'>Previous Menu (Horizontal)</option>
|
||||
<option value='^AssetProxy(previousdropmenu);'>Previous Dropdown Menu</option>
|
||||
<option value='^AssetProxy(specificmenuvertical);'>Specific SubMenu (Vertical)</option>
|
||||
<option value='^AssetProxy(specificmenuhorizontal);'>Specific SubMenu (Horizontal)</option>
|
||||
<option value='^AssetProxy(specificdropmenu);'>Specific Dropdown Menu</option>
|
||||
<option value='^AssetProxy(synopsis);'>Synopsis Menu</option>
|
||||
<option value='^AssetProxy(toplevelmenuvertical);'>Top Level Menu (Vertical)</option>
|
||||
<option value='^AssetProxy(topLevelmenuhorizontal);'>Top Level Menu (Horizontal)</option>
|
||||
<option value='^AssetProxy(topdropmenu);'>Top Dropdown Menu</option>
|
||||
<option value='^AssetProxy(roottab);'>Root Tabs Menu</option>
|
||||
<option value='^AssetProxy(rootmenu);'>Root Menu (Horizontal)</option>
|
||||
<option value='^H;'>Home Link</option>
|
||||
<option value='^/;'>System URL</option>
|
||||
<option value='^PageUrl;'>Current Page URL</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<select class="macro" name="macrolist" onchange="WGMacroDialog.update(this.form)">
|
||||
<option value=''>User...</option>
|
||||
<option value='^L;'>Login Form</option>
|
||||
<option value='^a("Account Info");'>My Account Link</option>
|
||||
<option value='^CanEditText("You can edit this page.");'>Can Edit Page Message</option>
|
||||
<option value='^AdminText("You are in admin mode!");'>Admin Mode Message</option>
|
||||
<option value='^GroupAdd("Newsletter","Click here to join our newsletter.");'>Join Group</option>
|
||||
<option value='^GroupDelete("Newsletter","Click here to unsubscribe from our newsletter.");'>Leave Group</option>
|
||||
<option value='^GroupText("Visitors","You need an account to do anything cool on this site!");'>Group Message</option>
|
||||
<option value='^EditableToggle;'>Page Editable Toggle</option>
|
||||
<option value='^AdminToggle;'>Admin Toggle</option>
|
||||
<option value='^LoginToggle;'>Login Toggle</option>
|
||||
<option value='^@;'>Username</option>
|
||||
<option value='^#;'>User ID</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select class="macro" name="macrolist" onchange="WGMacroDialog.update(this.form)">
|
||||
<option value=''>Style...</option>
|
||||
<option value='^Spacer("10","100");'>Spacer</option>
|
||||
<option value='^c;'>Company Name</option>
|
||||
<option value='^u;'>Company URL</option>
|
||||
<option value='^e;'>Company Email Address</option>
|
||||
<option value='^LastModified;'>Last Modified Date</option>
|
||||
<option value='^PageTitle;'>Page Title</option>
|
||||
<option value='^r;'>Make Page Printable</option>
|
||||
<option value='^RootTitle;'>Root Title</option>
|
||||
<option value='^Extras;'>Extras Folder</option>
|
||||
<option value='^AdminBar;'>Admin Bar</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
.panel_wrapper div.current {
|
||||
height: 423px;
|
||||
}
|
||||
.panel_wrapper div.current input, .panel_wrapper div.current select {
|
||||
width: 100%;
|
||||
}
|
||||
fieldset.pages {
|
||||
height: 368px;
|
||||
}
|
||||
iframe.pages {
|
||||
border-style: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
td.label-column {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.nav {
|
||||
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
.nav a {
|
||||
color: #0f3ccc;
|
||||
text-decoration: none;
|
||||
}
|
||||
.nav a:hover {
|
||||
color: #000080;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.nav ul, .nav li {
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.nav .selectLink {
|
||||
color: #cc7700;
|
||||
}
|
||||
.nav .crumb {
|
||||
color: orange;
|
||||
}
|
||||
.nav .crumbTrail {
|
||||
padding: 3px;
|
||||
background-color: #eeeeee;
|
||||
-moz-border-radius: 10px;
|
||||
}
|
||||
.nav .traverse {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
(function() {
|
||||
tinymce.PluginManager.requireLangPack('wgpagetree');
|
||||
|
||||
tinymce.create('tinymce.plugins.WGPageTreePlugin', {
|
||||
init : function(ed, url) {
|
||||
var page_url = document.location.protocol + "//" + document.location.hostname + (document.location.port ? ":" + document.location.port : '') + getWebguiProperty('pageURL');
|
||||
ed.addCommand('wgPageTree', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/pagetree.htm',
|
||||
width : 400 + ed.getLang('wgpagetree.delta_width', 0),
|
||||
height : 500 + ed.getLang('wgpagetree.delta_height', 0),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url,
|
||||
page_url : page_url
|
||||
});
|
||||
});
|
||||
|
||||
ed.addButton('wgpagetree', {
|
||||
title : 'wgpagetree.desc',
|
||||
cmd : 'wgPageTree',
|
||||
image : url + '/img/pagetree.gif'
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'WebGUI Page Tree',
|
||||
author : 'Plain Black',
|
||||
authorurl : 'http://www.plainblack.com/',
|
||||
infourl : 'http://www.webgui.org/',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('wgpagetree', tinymce.plugins.WGPageTreePlugin);
|
||||
})();
|
||||
|
||||
BIN
www/extras/tinymce-webgui/plugins/wgpagetree/img/pagetree.gif
Normal file
BIN
www/extras/tinymce-webgui/plugins/wgpagetree/img/pagetree.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 B |
61
www/extras/tinymce-webgui/plugins/wgpagetree/js/pagetree.js
Normal file
61
www/extras/tinymce-webgui/plugins/wgpagetree/js/pagetree.js
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
var WGPageTreeDialog = {
|
||||
init : function(ed) {
|
||||
var iframe = document.getElementById('page_selecter');
|
||||
window.setTimeout(function() {
|
||||
iframe.src = tinyMCEPopup.getWindowArg('page_url') + '?op=formHelper;class=HTMLArea;sub=pageTree';
|
||||
}, 100);
|
||||
},
|
||||
|
||||
setUrl : function(url) {
|
||||
document.getElementById('link_url').value = url;
|
||||
},
|
||||
|
||||
update : function(form) {
|
||||
if (form.link_url.value == '') {
|
||||
alert('No URL entered!');
|
||||
return;
|
||||
}
|
||||
var ed = tinyMCEPopup.editor;
|
||||
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
var elm = ed.dom.getParent(elm, "A");
|
||||
|
||||
// Create new anchor elements
|
||||
if (elm == null) {
|
||||
tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
|
||||
|
||||
elementArray = tinymce.grep(ed.dom.select("a"), function(n) {return ed.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
||||
for (i=0; i<elementArray.length; i++) {
|
||||
elm = elementArray[i];
|
||||
|
||||
// Move cursor to end
|
||||
try {
|
||||
tinyMCEPopup.editor.selection.collapse(false);
|
||||
} catch (ex) {
|
||||
// Ignore
|
||||
}
|
||||
setAttribs(form, elm);
|
||||
}
|
||||
}
|
||||
else {
|
||||
setAttribs(form, elm);
|
||||
}
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
|
||||
function setAttribs(form, elm) {
|
||||
var href = '^/(' + form.link_url.value + ');';
|
||||
elm.href = href;
|
||||
if (form.link_target.value == '_self') {
|
||||
elm.target = '';
|
||||
}
|
||||
else {
|
||||
elm.target = form.link_target.value;
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
tinyMCEPopup.onInit.add(WGPageTreeDialog.init, WGPageTreeDialog);
|
||||
|
||||
3
www/extras/tinymce-webgui/plugins/wgpagetree/langs/en.js
Normal file
3
www/extras/tinymce-webgui/plugins/wgpagetree/langs/en.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
tinyMCE.addI18n('en.wgpagetree',{
|
||||
desc : 'Link to a page in the WebGUI asset tree'
|
||||
});
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
tinyMCE.addI18n('en.wgpagetree',{
|
||||
desc : 'Insert A Link',
|
||||
linkprops : 'Link Properties',
|
||||
linkurl : 'URL',
|
||||
linktarget : 'Target',
|
||||
samewindow : 'Open link in same window.',
|
||||
newwindow : 'Open link in new window.',
|
||||
pages : 'Pages'
|
||||
});
|
||||
54
www/extras/tinymce-webgui/plugins/wgpagetree/pagetree.htm
Normal file
54
www/extras/tinymce-webgui/plugins/wgpagetree/pagetree.htm
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#wgpagetree.desc}</title>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/pagetree.js"></script>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/utils/form_utils.js"></script>
|
||||
<link href="css/pagetree.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body>
|
||||
<form onsubmit="WGPageTreeDialog.update(this);return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#wgpagetree.desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="label-column"><label for="link_url">{#wgpagetree.linkurl}</label></td>
|
||||
<td><input type="text" name="link_url" value="" id="link_url" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="link_target">{#wgpagetree.linktarget}</label></td>
|
||||
<td>
|
||||
<select type="text" name="link_target" id="link_target">
|
||||
<option value="_self">{#wgpagetree.samewindow}</option>
|
||||
<option value="_blank">{#wgpagetree.newwindow}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<fieldset class="pages">
|
||||
<legend>{#wgpagetree.pages}</legend>
|
||||
<iframe class="pages" id="page_selecter"></iframe>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
diff --git a/editor_plugin_src.js b/editor_plugin_src.js
|
||||
index 4e9ba99..a96e310 100644
|
||||
--- a/editor_plugin_src.js
|
||||
+++ b/editor_plugin_src.js
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
(function() {
|
||||
var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;
|
||||
+ tinymce.PluginManager.requireLangPack('wgspellchecker');
|
||||
|
||||
tinymce.create('tinymce.plugins.SpellcheckerPlugin', {
|
||||
getInfo : function() {
|
||||
@@ -269,6 +270,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
+ m.add({
|
||||
+ title : 'spellchecker.add_word',
|
||||
+ onclick : function() {
|
||||
+ t._sendRPC('addWord', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) {
|
||||
+ t._removeWords(dom.decode(e.target.innerHTML));
|
||||
+ t._checkDone();
|
||||
+ });
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
m.update();
|
||||
});
|
||||
|
||||
@@ -333,5 +344,5 @@
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
- tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);
|
||||
-})();
|
||||
\ No newline at end of file
|
||||
+ tinymce.PluginManager.add('wgspellchecker', tinymce.plugins.SpellcheckerPlugin);
|
||||
+})();
|
||||
diff --git a/dev/null b/langs/en.js
|
||||
new file mode 100644
|
||||
index 0000000..602b23c
|
||||
--- /dev/null
|
||||
+++ b/langs/en.js
|
||||
@@ -0,0 +1,4 @@
|
||||
+tinyMCE.addI18n('en.spellchecker',{
|
||||
+ add_word : 'Add word to dictionary'
|
||||
+});
|
||||
+
|
||||
|
|
@ -0,0 +1 @@
|
|||
.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,348 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;
|
||||
tinymce.PluginManager.requireLangPack('wgspellchecker');
|
||||
|
||||
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(ed, url) {
|
||||
var t = this, cm;
|
||||
|
||||
t.url = url;
|
||||
t.editor = ed;
|
||||
|
||||
// Register commands
|
||||
ed.addCommand('mceSpellCheck', function() {
|
||||
if (!t.active) {
|
||||
ed.setProgressState(1);
|
||||
t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {
|
||||
if (r.length > 0) {
|
||||
t.active = 1;
|
||||
t._markWords(r);
|
||||
ed.setProgressState(0);
|
||||
ed.nodeChanged();
|
||||
} else {
|
||||
ed.setProgressState(0);
|
||||
ed.windowManager.alert('spellchecker.no_mpell');
|
||||
}
|
||||
});
|
||||
} else
|
||||
t._done();
|
||||
});
|
||||
|
||||
ed.onInit.add(function() {
|
||||
ed.dom.loadCSS(url + '/css/content.css');
|
||||
});
|
||||
|
||||
ed.onClick.add(t._showMenu, t);
|
||||
ed.onContextMenu.add(t._showMenu, t);
|
||||
ed.onBeforeGetContent.add(function() {
|
||||
if (t.active)
|
||||
t._removeWords();
|
||||
});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm) {
|
||||
cm.setActive('spellchecker', t.active);
|
||||
});
|
||||
|
||||
ed.onSetContent.add(function() {
|
||||
t._done();
|
||||
});
|
||||
|
||||
ed.onBeforeGetContent.add(function() {
|
||||
t._done();
|
||||
});
|
||||
|
||||
ed.onBeforeExecCommand.add(function(ed, cmd) {
|
||||
if (cmd == 'mceFullScreen')
|
||||
t._done();
|
||||
});
|
||||
|
||||
// Find selected language
|
||||
t.languages = {};
|
||||
each(ed.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(v, k) {
|
||||
if (k.indexOf('+') === 0) {
|
||||
k = k.substring(1);
|
||||
t.selectedLang = v;
|
||||
}
|
||||
|
||||
t.languages[k] = v;
|
||||
});
|
||||
},
|
||||
|
||||
createControl : function(n, cm) {
|
||||
var t = this, c, ed = t.editor;
|
||||
|
||||
if (n == 'spellchecker') {
|
||||
c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});
|
||||
|
||||
c.onRenderMenu.add(function(c, m) {
|
||||
m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||
each(t.languages, function(v, k) {
|
||||
var o = {icon : 1}, mi;
|
||||
|
||||
o.onclick = function() {
|
||||
mi.setSelected(1);
|
||||
t.selectedItem.setSelected(0);
|
||||
t.selectedItem = mi;
|
||||
t.selectedLang = v;
|
||||
};
|
||||
|
||||
o.title = k;
|
||||
mi = m.add(o);
|
||||
mi.setSelected(v == t.selectedLang);
|
||||
|
||||
if (v == t.selectedLang)
|
||||
t.selectedItem = mi;
|
||||
})
|
||||
});
|
||||
|
||||
return c;
|
||||
}
|
||||
},
|
||||
|
||||
// Internal functions
|
||||
|
||||
_walk : function(n, f) {
|
||||
var d = this.editor.getDoc(), w;
|
||||
|
||||
if (d.createTreeWalker) {
|
||||
w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
|
||||
|
||||
while ((n = w.nextNode()) != null)
|
||||
f.call(this, n);
|
||||
} else
|
||||
tinymce.walk(n, f, 'childNodes');
|
||||
},
|
||||
|
||||
_getSeparators : function() {
|
||||
var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');
|
||||
|
||||
// Build word separator regexp
|
||||
for (i=0; i<str.length; i++)
|
||||
re += '\\' + str.charAt(i);
|
||||
|
||||
return re;
|
||||
},
|
||||
|
||||
_getWords : function() {
|
||||
var ed = this.editor, wl = [], tx = '', lo = {};
|
||||
|
||||
// Get area text
|
||||
this._walk(ed.getBody(), function(n) {
|
||||
if (n.nodeType == 3)
|
||||
tx += n.nodeValue + ' ';
|
||||
});
|
||||
|
||||
// Split words by separator
|
||||
tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');
|
||||
tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));
|
||||
|
||||
// Build word array and remove duplicates
|
||||
each(tx.split(' '), function(v) {
|
||||
if (!lo[v]) {
|
||||
wl.push(v);
|
||||
lo[v] = 1;
|
||||
}
|
||||
});
|
||||
|
||||
return wl;
|
||||
},
|
||||
|
||||
_removeWords : function(w) {
|
||||
var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark();
|
||||
|
||||
each(dom.select('span').reverse(), function(n) {
|
||||
if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {
|
||||
if (!w || dom.decode(n.innerHTML) == w)
|
||||
dom.remove(n, 1);
|
||||
}
|
||||
});
|
||||
|
||||
se.moveToBookmark(b);
|
||||
},
|
||||
|
||||
_markWords : function(wl) {
|
||||
var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = [];
|
||||
var se = ed.selection, b = se.getBookmark();
|
||||
|
||||
each(wl, function(v) {
|
||||
w += (w ? '|' : '') + v;
|
||||
});
|
||||
|
||||
r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g');
|
||||
r2 = new RegExp('^(' + w + ')', 'g');
|
||||
r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g');
|
||||
r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g');
|
||||
r5 = new RegExp('(' + w + ')([' + re + '])', 'g');
|
||||
|
||||
// Collect all text nodes
|
||||
this._walk(this.editor.getBody(), function(n) {
|
||||
if (n.nodeType == 3) {
|
||||
nl.push(n);
|
||||
}
|
||||
});
|
||||
|
||||
// Wrap incorrect words in spans
|
||||
each(nl, function(n) {
|
||||
var v;
|
||||
|
||||
if (n.nodeType == 3) {
|
||||
v = n.nodeValue;
|
||||
|
||||
if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) {
|
||||
v = dom.encode(v);
|
||||
v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');
|
||||
v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');
|
||||
|
||||
dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
se.moveToBookmark(b);
|
||||
},
|
||||
|
||||
_showMenu : function(ed, e) {
|
||||
var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin());
|
||||
|
||||
if (!m) {
|
||||
p1 = DOM.getPos(ed.getContentAreaContainer());
|
||||
//p2 = DOM.getPos(ed.getContainer());
|
||||
|
||||
m = ed.controlManager.createDropMenu('spellcheckermenu', {
|
||||
offset_x : p1.x,
|
||||
offset_y : p1.y,
|
||||
'class' : 'noIcons'
|
||||
});
|
||||
|
||||
t._menu = m;
|
||||
}
|
||||
|
||||
if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) {
|
||||
m.removeAll();
|
||||
m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||
|
||||
t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) {
|
||||
m.removeAll();
|
||||
|
||||
if (r.length > 0) {
|
||||
m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||
each(r, function(v) {
|
||||
m.add({title : v, onclick : function() {
|
||||
dom.replace(ed.getDoc().createTextNode(v), e.target);
|
||||
t._checkDone();
|
||||
}});
|
||||
});
|
||||
|
||||
m.addSeparator();
|
||||
} else
|
||||
m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
|
||||
|
||||
m.add({
|
||||
title : 'spellchecker.ignore_word',
|
||||
onclick : function() {
|
||||
dom.remove(e.target, 1);
|
||||
t._checkDone();
|
||||
}
|
||||
});
|
||||
|
||||
m.add({
|
||||
title : 'spellchecker.ignore_words',
|
||||
onclick : function() {
|
||||
t._removeWords(dom.decode(e.target.innerHTML));
|
||||
t._checkDone();
|
||||
}
|
||||
});
|
||||
|
||||
m.add({
|
||||
title : 'spellchecker.add_word',
|
||||
onclick : function() {
|
||||
t._sendRPC('addWord', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) {
|
||||
t._removeWords(dom.decode(e.target.innerHTML));
|
||||
t._checkDone();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
m.update();
|
||||
});
|
||||
|
||||
ed.selection.select(e.target);
|
||||
p1 = dom.getPos(e.target);
|
||||
m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y);
|
||||
|
||||
return tinymce.dom.Event.cancel(e);
|
||||
} else
|
||||
m.hideMenu();
|
||||
},
|
||||
|
||||
_checkDone : function() {
|
||||
var t = this, ed = t.editor, dom = ed.dom, o;
|
||||
|
||||
each(dom.select('span'), function(n) {
|
||||
if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {
|
||||
o = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (!o)
|
||||
t._done();
|
||||
},
|
||||
|
||||
_done : function() {
|
||||
var t = this, la = t.active;
|
||||
|
||||
if (t.active) {
|
||||
t.active = 0;
|
||||
t._removeWords();
|
||||
|
||||
if (t._menu)
|
||||
t._menu.hideMenu();
|
||||
|
||||
if (la)
|
||||
t.editor.nodeChanged();
|
||||
}
|
||||
},
|
||||
|
||||
_sendRPC : function(m, p, cb) {
|
||||
var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}");
|
||||
|
||||
if (url == '{backend}') {
|
||||
t.editor.setProgressState(0);
|
||||
alert('Please specify: spellchecker_rpc_url');
|
||||
return;
|
||||
}
|
||||
|
||||
JSONRequest.sendRPC({
|
||||
url : url,
|
||||
method : m,
|
||||
params : p,
|
||||
success : cb,
|
||||
error : function(e, x) {
|
||||
t.editor.setProgressState(0);
|
||||
t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('wgspellchecker', tinymce.plugins.SpellcheckerPlugin);
|
||||
})();
|
||||
BIN
www/extras/tinymce-webgui/plugins/wgspellchecker/img/wline.gif
Normal file
BIN
www/extras/tinymce-webgui/plugins/wgspellchecker/img/wline.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 B |
|
|
@ -0,0 +1,4 @@
|
|||
tinyMCE.addI18n('en.spellchecker',{
|
||||
add_word : 'Add word to dictionary'
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue