HTML editing fixes, upgrade to TinyMCE v3.0.6

release-0.6
svncommit 16 years ago
parent d7a411f099
commit d9344fc349

@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
2008/04/15 (estadtherr)
----------
- HTML editing is now working with PHP5 updates and TinyMCE v3.0.6
2008/04/15 (alec)
----------
- Fix remove signature when replying (#1333167)

@ -1897,25 +1897,22 @@ function rcube_webmail()
}
else
{
var eid = tinyMCE.getEditorId('_message');
// editor is a TinyMCE_Control object
var editor = tinyMCE.getInstanceById(eid);
var editor = tinyMCE.get('compose-body');
// if this is null, we should exit
if (editor == null) {
if (editor == null)
{
return false;
}
var msgDoc = editor.getDoc();
var msgBody = msgDoc.body;
}
if (this.env.signatures && this.env.signatures[id])
{
// Append the signature as a span within the body
var sigElem = msgDoc.getElementById("_rc_sig");
var sigElem = editor.dom.get("_rc_sig");
if (!sigElem)
{
sigElem = msgDoc.createElement("span");
sigElem = editor.getDoc().createElement("span");
sigElem.setAttribute("id", "_rc_sig");
msgBody.appendChild(sigElem);
editor.getBody().appendChild(sigElem);
}
if (this.env.signatures[id]['is_html'])
{
@ -3396,16 +3393,16 @@ function rcube_webmail()
};
this.toggle_editor = function(checkbox, textElementName)
this.toggle_editor = function(checkbox, textAreaId)
{
var ischecked = checkbox.checked;
if (ischecked)
{
tinyMCE.execCommand('mceAddControl', true, textElementName);
tinyMCE.execCommand('mceAddControl', true, textAreaId);
}
else
{
tinyMCE.execCommand('mceRemoveControl', true, textElementName);
tinyMCE.execCommand('mceRemoveControl', true, textAreaId);
}
};

@ -17,20 +17,20 @@
function rcmail_editor_init(skin_path)
{
tinyMCE.init({ mode : 'specific_textareas',
tinyMCE.init({ mode : "textareas",
editor_selector : "mce_editor",
accessibility_focus : false,
apply_source_formatting : true,
theme : 'advanced',
plugins : 'emotions,media,nonbreaking,table,searchreplace,spellchecker,visualchars',
theme_advanced_buttons1 : 'bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator,undo,redo,image,media',
theme_advanced_buttons2 : '',
theme_advanced_buttons3 : '',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
extended_valid_elements : 'font[face|size|color|style],span[id|class|align|style]',
content_css : skin_path + '/editor_content.css',
editor_css : skin_path + '/editor_ui.css',
external_image_list_url : 'program/js/editor_images.js'
theme : "advanced",
plugins : "emotions,media,nonbreaking,table,searchreplace,spellchecker,visualchars",
theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,link,unlink,emotions,charmap,code,forecolor,backcolor,fontselect,fontsizeselect, separator,undo,redo,image,media,spellchecker",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
extended_valid_elements : "font[face|size|color|style],span[id|class|align|style]",
content_css : skin_path + "/editor_content.css",
external_image_list_url : "editor_images.js"
});
}
@ -80,16 +80,16 @@ function rcmail_toggle_editor(toggler)
var existingPlainText = composeElement.value;
var htmlText = "<pre>" + existingPlainText + "</pre>";
composeElement.value = htmlText;
tinyMCE.execCommand('mceAddControl', true, '_message');
tinyMCE.execCommand('mceAddControl', true, 'compose-body');
htmlFlag.value = "1";
}
else
{
rcmail.set_busy(true, 'converting');
var thisMCE = tinyMCE.getInstanceById('_message');
var existingHtml = tinyMCE.getContent();
var thisMCE = tinyMCE.get('compose-body');
var existingHtml = thisMCE.getContent();
rcmail_html2plain(existingHtml);
tinyMCE.execCommand('mceRemoveControl', true, '_message');
tinyMCE.execCommand('mceRemoveControl', true, 'compose-body');
htmlFlag.value = "0";
}
}

@ -1,9 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blank_page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="mceContentBody">
</body>
</html>

@ -1,41 +1,154 @@
// UK lang variables
tinyMCE.addToLang('',{
bold_desc : 'Bold (Ctrl+B)',
italic_desc : 'Italic (Ctrl+I)',
underline_desc : 'Underline (Ctrl+U)',
striketrough_desc : 'Strikethrough',
justifyleft_desc : 'Align left',
justifycenter_desc : 'Align center',
justifyright_desc : 'Align right',
justifyfull_desc : 'Align full',
bullist_desc : 'Unordered list',
numlist_desc : 'Ordered list',
outdent_desc : 'Outdent',
indent_desc : 'Indent',
undo_desc : 'Undo (Ctrl+Z)',
redo_desc : 'Redo (Ctrl+Y)',
link_desc : 'Insert/edit link',
unlink_desc : 'Unlink',
image_desc : 'Insert/edit image',
cleanup_desc : 'Cleanup messy code',
focus_alert : 'A editor instance must be focused before using this command.',
edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
insert_link_title : 'Insert/edit link',
insert : 'Insert',
update : 'Update',
cancel : 'Cancel',
insert_link_url : 'Link URL',
insert_link_target : 'Target',
insert_link_target_same : 'Open link in the same window',
insert_link_target_blank : 'Open link in a new window',
insert_image_title : 'Insert/edit image',
insert_image_src : 'Image URL',
insert_image_alt : 'Image description',
help_desc : 'Help',
bold_img : "bold.gif",
italic_img : "italic.gif",
underline_img : "underline.gif",
clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
});
tinyMCE.addI18n({en:{
common:{
edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
apply:"Apply",
insert:"Insert",
update:"Update",
cancel:"Cancel",
close:"Close",
browse:"Browse",
class_name:"Class",
not_set:"-- Not set --",
clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
invalid_data:"Error: Invalid values entered, these are marked in red.",
more_colors:"More colors"
},
contextmenu:{
align:"Alignment",
left:"Left",
center:"Center",
right:"Right",
full:"Full"
},
insertdatetime:{
date_fmt:"%Y-%m-%d",
time_fmt:"%H:%M:%S",
insertdate_desc:"Insert date",
inserttime_desc:"Insert time",
months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
},
print:{
print_desc:"Print"
},
preview:{
preview_desc:"Preview"
},
directionality:{
ltr_desc:"Direction left to right",
rtl_desc:"Direction right to left"
},
layer:{
insertlayer_desc:"Insert new layer",
forward_desc:"Move forward",
backward_desc:"Move backward",
absolute_desc:"Toggle absolute positioning",
content:"New layer..."
},
save:{
save_desc:"Save",
cancel_desc:"Cancel all changes"
},
nonbreaking:{
nonbreaking_desc:"Insert non-breaking space character"
},
iespell:{
iespell_desc:"Run spell checking",
download:"ieSpell not detected. Do you want to install it now?"
},
advhr:{
advhr_desc:"Horizontale rule"
},
emotions:{
emotions_desc:"Emotions"
},
searchreplace:{
search_desc:"Find",
replace_desc:"Find/Replace"
},
advimage:{
image_desc:"Insert/edit image"
},
advlink:{
link_desc:"Insert/edit link"
},
xhtmlxtras:{
cite_desc:"Citation",
abbr_desc:"Abbreviation",
acronym_desc:"Acronym",
del_desc:"Deletion",
ins_desc:"Insertion",
attribs_desc:"Insert/Edit Attributes"
},
style:{
desc:"Edit CSS Style"
},
paste:{
paste_text_desc:"Paste as Plain Text",
paste_word_desc:"Paste from Word",
selectall_desc:"Select All"
},
paste_dlg:{
text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
text_linebreaks:"Keep linebreaks",
word_title:"Use CTRL+V on your keyboard to paste the text into the window."
},
table:{
desc:"Inserts a new table",
row_before_desc:"Insert row before",
row_after_desc:"Insert row after",
delete_row_desc:"Delete row",
col_before_desc:"Insert column before",
col_after_desc:"Insert column after",
delete_col_desc:"Remove column",
split_cells_desc:"Split merged table cells",
merge_cells_desc:"Merge table cells",
row_desc:"Table row properties",
cell_desc:"Table cell properties",
props_desc:"Table properties",
paste_row_before_desc:"Paste table row before",
paste_row_after_desc:"Paste table row after",
cut_row_desc:"Cut table row",
copy_row_desc:"Copy table row",
del:"Delete table",
row:"Row",
col:"Column",
cell:"Cell"
},
autosave:{
unload_msg:"The changes you made will be lost if you navigate away from this page."
},
fullscreen:{
desc:"Toggle fullscreen mode"
},
media:{
desc:"Insert / edit embedded media",
edit:"Edit embedded media"
},
fullpage:{
desc:"Document properties"
},
template:{
desc:"Insert predefined template content"
},
visualchars:{
desc:"Visual control characters on/off."
},
spellchecker:{
desc:"Toggle spellchecker",
menu:"Spellchecker settings",
ignore_word:"Ignore word",
ignore_words:"Ignore all",
langs:"Languages",
wait:"Please wait...",
sug:"Suggestions",
no_sug:"No suggestions",
no_mpell:"No misspellings found."
},
pagebreak:{
desc:"Insert page break."
}}});

@ -1,9 +0,0 @@
Beginning with version 2.0.5 the language packs are no
longer included with the core distribution.
Language packs can be downloaded from the TinyMCE website:
http://tinymce.moxiecode.com/download.php
The language pack codes are based on ISO-639-1:
http://www.loc.gov/standards/iso639-2/englangn.html
Plrease try using entities if possible. Like &aring; etc for non a-z characters.

File diff suppressed because it is too large Load Diff

@ -1,10 +0,0 @@
/**
* $Id: editor_plugin_src.js 162 2007-01-03 16:16:52Z spocke $
*
* Experimental plugin for new Cleanup routine, this logic will be moved into the core ones it's stable enougth.
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
*/
/* Dummy file since cleanup is now moved to core */

@ -1 +0,0 @@
Dummy plugin since cleanup is now moved into core.

File diff suppressed because one or more lines are too long

@ -0,0 +1,613 @@
/**
* $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
tinymce.create('tinymce.plugins.Compat2x', {
getInfo : function() {
return {
longname : 'Compat2x',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
}
});
(function() {
// Extend tinyMCE/EditorManager
tinymce.extend(tinyMCE, {
addToLang : function(p, l) {
each(l, function(v, k) {
tinyMCE.i18n[(tinyMCE.settings.language || 'en') + '.' + (p ? p + '_' : '') + k] = v;
});
},
getInstanceById : function(n) {
return this.get(n);
}
});
})();
(function() {
var EditorManager = tinymce.EditorManager;
tinyMCE.instances = {};
tinyMCE.plugins = {};
tinymce.PluginManager.onAdd.add(function(pm, n, p) {
tinyMCE.plugins[n] = p;
});
tinyMCE.majorVersion = tinymce.majorVersion;
tinyMCE.minorVersion = tinymce.minorVersion;
tinyMCE.releaseDate = tinymce.releaseDate;
tinyMCE.baseURL = tinymce.baseURL;
tinyMCE.isIE = tinyMCE.isMSIE = tinymce.isIE || tinymce.isOpera;
tinyMCE.isMSIE5 = tinymce.isIE;
tinyMCE.isMSIE5_0 = tinymce.isIE;
tinyMCE.isMSIE7 = tinymce.isIE;
tinyMCE.isGecko = tinymce.isGecko;
tinyMCE.isSafari = tinymce.isWebKit;
tinyMCE.isOpera = tinymce.isOpera;
tinyMCE.isMac = false;
tinyMCE.isNS7 = false;
tinyMCE.isNS71 = false;
tinyMCE.compat = true;
// Extend tinyMCE class
TinyMCE_Engine = tinyMCE;
tinymce.extend(tinyMCE, {
getParam : function(n, dv) {
return this.activeEditor.getParam(n, dv);
},
addEvent : function(e, na, f, sc) {
tinymce.dom.Event.add(e, na, f, sc || this);
},
getControlHTML : function(n) {
return EditorManager.activeEditor.controlManager.createControl(n);
},
loadCSS : function(u) {
tinymce.DOM.loadCSS(u);
},
importCSS : function(doc, u) {
if (doc == document)
this.loadCSS(u);
else
new tinymce.dom.DOMUtils(doc).loadCSS(u);
},
log : function() {
console.debug.apply(console, arguments);
},
getLang : function(n, dv) {
var v = EditorManager.activeEditor.getLang(n.replace(/^lang_/g, ''), dv);
// Is number
if (/^[0-9\-.]+$/g.test(v))
return parseInt(v);
return v;
},
isInstance : function(o) {
return o != null && typeof(o) == "object" && o.execCommand;
},
triggerNodeChange : function() {
EditorManager.activeEditor.nodeChanged();
},
regexpReplace : function(in_str, reg_exp, replace_str, opts) {
var re;
if (in_str == null)
return in_str;
if (typeof(opts) == "undefined")
opts = 'g';
re = new RegExp(reg_exp, opts);
return in_str.replace(re, replace_str);
},
trim : function(s) {
return tinymce.trim(s);
},
xmlEncode : function(s) {
return tinymce.DOM.encode(s);
},
explode : function(s, d) {
var o = [];
tinymce.each(s.split(d), function(v) {
if (v != '')
o.push(v);
});
return o;
},
switchClass : function(id, cls) {
var b;
if (/^mceButton/.test(cls)) {
b = EditorManager.activeEditor.controlManager.get(id);
if (!b)
return;
switch (cls) {
case "mceButtonNormal":
b.setDisabled(false);
b.setActive(false);
return;
case "mceButtonDisabled":
b.setDisabled(true);
return;
case "mceButtonSelected":
b.setActive(true);
b.setDisabled(false);
return;
}
}
},
addCSSClass : function(e, n, b) {
return tinymce.DOM.addClass(e, n, b);
},
hasCSSClass : function(e, n) {
return tinymce.DOM.hasClass(e, n);
},
removeCSSClass : function(e, n) {
return tinymce.DOM.removeClass(e, n);
},
getCSSClasses : function() {
var cl = EditorManager.activeEditor.dom.getClasses(), o = [];
each(cl, function(c) {
o.push(c['class']);
});
return o;
},
setWindowArg : function(n, v) {
EditorManager.activeEditor.windowManager.params[n] = v;
},
getWindowArg : function(n, dv) {
var wm = EditorManager.activeEditor.windowManager, v;
v = wm.getParam(n);
if (v === '')
return '';
return v || wm.getFeature(n) || dv;
},
getParentNode : function(n, f) {
return this._getDOM().getParent(n, f);
},
selectElements : function(n, na, f) {
var i, a = [], nl, x;
for (x=0, na = na.split(','); x<na.length; x++)
for (i=0, nl = n.getElementsByTagName(na[x]); i<nl.length; i++)
(!f || f(nl[i])) && a.push(nl[i]);
return a;
},
getNodeTree : function(n, na, t, nn) {
return this.selectNodes(n, function(n) {
return (!t || n.nodeType == t) && (!nn || n.nodeName == nn);
}, na ? na : []);
},
getAttrib : function(e, n, dv) {
return this._getDOM().getAttrib(e, n, dv);
},
setAttrib : function(e, n, v) {
return this._getDOM().setAttrib(e, n, v);
},
getElementsByAttributeValue : function(n, e, a, v) {
var i, nl = n.getElementsByTagName(e), o = [];
for (i=0; i<nl.length; i++) {
if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
o[o.length] = nl[i];
}
return o;
},
selectNodes : function(n, f, a) {
var i;
if (!a)
a = [];
if (f(n))
a[a.length] = n;
if (n.hasChildNodes()) {
for (i=0; i<n.childNodes.length; i++)
tinyMCE.selectNodes(n.childNodes[i], f, a);
}
return a;
},
getContent : function() {
return EditorManager.activeEditor.getContent();
},
getParentElement : function(n, na, f) {
if (na)
na = new RegExp('^(' + na.toUpperCase().replace(/,/g, '|') + ')$', 'g');
return this._getDOM().getParent(n, function(n) {
return n.nodeType == 1 && (!na || na.test(n.nodeName)) && (!f || f(n));
}, this.activeEditor.getBody());
},
importPluginLanguagePack : function(n) {
tinymce.PluginManager.requireLangPack(n);
},
getButtonHTML : function(cn, lang, img, c, u, v) {
var ed = EditorManager.activeEditor;
img = img.replace(/\{\$pluginurl\}/g, tinyMCE.pluginURL);
img = img.replace(/\{\$themeurl\}/g, tinyMCE.themeURL);
lang = lang.replace(/^lang_/g, '');
return ed.controlManager.createButton(cn, {
title : lang,
command : c,
ui : u,
value : v,
scope : this,
'class' : 'compat',
image : img
});
},
addSelectAccessibility : function(e, s, w) {
// Add event handlers
if (!s._isAccessible) {
s.onkeydown = tinyMCE.accessibleEventHandler;
s.onblur = tinyMCE.accessibleEventHandler;
s._isAccessible = true;
s._win = w;
}
return false;
},
accessibleEventHandler : function(e) {
var elm, win = this._win;
e = tinymce.isIE ? win.event : e;
elm = tinymce.isIE ? e.srcElement : e.target;
// Unpiggyback onchange on blur
if (e.type == "blur") {
if (elm.oldonchange) {
elm.onchange = elm.oldonchange;
elm.oldonchange = null;
}
return true;
}
// Piggyback onchange
if (elm.nodeName == "SELECT" && !elm.oldonchange) {
elm.oldonchange = elm.onchange;
elm.onchange = null;
}
// Execute onchange and remove piggyback
if (e.keyCode == 13 || e.keyCode == 32) {
elm.onchange = elm.oldonchange;
elm.onchange();
elm.oldonchange = null;
tinyMCE.cancelEvent(e);
return false;
}
return true;
},
cancelEvent : function(e) {
return tinymce.dom.Event.cancel(e);
},
handleVisualAid : function(e) {
EditorManager.activeEditor.addVisual(e);
},
getAbsPosition : function(n, r) {
return tinymce.DOM.getPos(n, r);
},
cleanupEventStr : function(s) {
s = "" + s;
s = s.replace('function anonymous()\n{\n', '');
s = s.replace('\n}', '');
s = s.replace(/^return true;/gi, ''); // Remove event blocker
return s;
},
getVisualAidClass : function(s) {
// TODO: Implement
return s;
},
parseStyle : function(s) {
return this._getDOM().parseStyle(s);
},
serializeStyle : function(s) {
return this._getDOM().serializeStyle(s);
},
openWindow : function(tpl, args) {
var ed = EditorManager.activeEditor, o = {}, n;
// Convert name/value array to object
for (n in tpl)
o[n] = tpl[n];
tpl = o;
args = args || {};
tpl.url = new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);
tpl.inline = tpl.inline || args.inline;
ed.windowManager.open(tpl, args);
},
closeWindow : function(win) {
EditorManager.activeEditor.windowManager.close(win);
},
getOuterHTML : function(e) {
return tinymce.DOM.getOuterHTML(e);
},
setOuterHTML : function(e, h, d) {
return tinymce.DOM.setOuterHTML(e, h, d);
},
hasPlugin : function(n) {
return tinymce.PluginManager.get(n) != null;
},
_setEventsEnabled : function() {
// Ignore it!!
},
addPlugin : function(pn, f) {
var t = this;
function PluginWrapper(ed) {
tinyMCE.selectedInstance = ed;
ed.onInit.add(function() {
t.settings = ed.settings;
t.settings['base_href'] = tinyMCE.documentBasePath;
tinyMCE.settings = t.settings;
tinyMCE.documentBasePath = ed.documentBasePath;
//ed.formElement = DOM.get(ed.id);
if (f.initInstance)
f.initInstance(ed);
ed.contentDocument = ed.getDoc();
ed.contentWindow = ed.getWin();
ed.undoRedo = ed.undoManager;
ed.startContent = ed.getContent({format : 'raw'});
tinyMCE.instances[ed.id] = ed;
tinyMCE.loadedFiles = [];
});
ed.onActivate.add(function() {
tinyMCE.settings = ed.settings;
tinyMCE.selectedInstance = ed;
});
/* if (f.removeInstance) {
ed.onDestroy.add(function() {
return f.removeInstance(ed.id);
});
}*/
if (f.handleNodeChange) {
ed.onNodeChange.add(function(ed, cm, n) {
f.handleNodeChange(ed.id, n, 0, 0, false, !ed.selection.isCollapsed());
});
}
if (f.onChange) {
ed.onChange.add(function(ed, n) {
return f.onChange(ed);
});
}
if (f.cleanup) {
ed.onGetContent.add(function() {
//f.cleanup(type, content, inst);
});
}
this.getInfo = function() {
return f.getInfo();
};
this.createControl = function(n) {
tinyMCE.pluginURL = tinymce.baseURL + '/plugins/' + pn;
tinyMCE.themeURL = tinymce.baseURL + '/themes/' + tinyMCE.activeEditor.settings.theme;
if (f.getControlHTML)
return f.getControlHTML(n);
return null;
};
this.execCommand = function(cmd, ui, val) {
if (f.execCommand)
return f.execCommand(ed.id, ed.getBody(), cmd, ui, val);
return false;
};
};
tinymce.PluginManager.add(pn, PluginWrapper);
},
_getDOM : function() {
return tinyMCE.activeEditor ? tinyMCE.activeEditor.dom : tinymce.DOM;
},
convertRelativeToAbsoluteURL : function(b, u) {
return new tinymce.util.URI(b).toAbsolute(u);
},
convertAbsoluteURLToRelativeURL : function(b, u) {
return new tinymce.util.URI(b).toRelative(u);
}
});
// Extend Editor class
tinymce.extend(tinymce.Editor.prototype, {
getFocusElement : function() {
return this.selection.getNode();
},
getData : function(n) {
if (!this.data)
this.data = [];
if (!this.data[n])
this.data[n] = [];
return this.data[n];
},
hasPlugin : function(n) {
return this.plugins[n] != null;
},
getContainerWin : function() {
return window;
},
getHTML : function(raw) {
return this.getContent({ format : raw ? 'raw' : 'html'});
},
setHTML : function(h) {
this.setContent(h);
},
getSel : function() {
return this.selection.getSel();
},
getRng : function() {
return this.selection.getRng();
},
isHidden : function() {
var s;
if (!tinymce.isGecko)
return false;
s = this.getSel();
// Weird, wheres that cursor selection?
return (!s || !s.rangeCount || s.rangeCount == 0);
},
translate : function(s) {
var c = this.settings.language, o;
o = tinymce.EditorManager.i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
return tinymce.EditorManager.i18n[c + '.' + b] || '{#' + b + '}';
});
o = o.replace(/{\$lang_([^}]+)\}/g, function(a, b) {
return tinymce.EditorManager.i18n[c + '.' + b] || '{$lang_' + b + '}';
});
return o;
},
repaint : function() {
this.execCommand('mceRepaint');
}
});
// Extend selection
tinymce.extend(tinymce.dom.Selection.prototype, {
getSelectedText : function() {
return this.getContent({format : 'text'});
},
getSelectedHTML : function() {
return this.getContent({format : 'html'});
},
getFocusElement : function() {
return this.getNode();
},
selectNode : function(node, collapse, select_text_node, to_start) {
var t = this;
t.select(node, select_text_node || 0);
if (!is(collapse))
collapse = true;
if (collapse) {
if (!is(to_start))
to_start = true;
t.collapse(to_start);
}
}
});
}).call(this);
// Register plugin
tinymce.PluginManager.add('compat2x', tinymce.plugins.Compat2x);
})();

@ -0,0 +1 @@
(function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){if(!e.ctrlKey){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.add(document,'click',hide);Event.cancel(e);}});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();Event.remove(document,'click',hide);}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);},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(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am,p1,p2;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x,offset_y:p1.y,constrain:1});t._menu=m;m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'advanced.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})();

@ -0,0 +1,97 @@
/**
* $Id: editor_plugin_src.js 755 2008-03-29 19:14:42Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
tinymce.create('tinymce.plugins.ContextMenu', {
init : function(ed) {
var t = this;
t.editor = ed;
t.onContextMenu = new tinymce.util.Dispatcher(this);
ed.onContextMenu.add(function(ed, e) {
if (!e.ctrlKey) {
t._getMenu(ed).showMenu(e.clientX, e.clientY);
Event.add(document, 'click', hide);
Event.cancel(e);
}
});
function hide() {
if (t._menu) {
t._menu.removeAll();
t._menu.destroy();
Event.remove(document, 'click', hide);
}
};
ed.onMouseDown.add(hide);
ed.onKeyDown.add(hide);
},
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(ed) {
var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;
if (m) {
m.removeAll();
m.destroy();
}
p1 = DOM.getPos(ed.getContentAreaContainer());
p2 = DOM.getPos(ed.getContainer());
m = ed.controlManager.createDropMenu('contextmenu', {
offset_x : p1.x,
offset_y : p1.y,
/* vp_offset_x : p2.x,
vp_offset_y : p2.y,*/
constrain : 1
});
t._menu = m;
m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
m.addSeparator();
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
}
m.addSeparator();
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
m.addSeparator();
am = m.addMenu({title : 'contextmenu.align'});
am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
t.onContextMenu.dispatch(t, m, el, col);
return m;
}
});
// Register plugin
tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
})();

@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},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(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})();

@ -0,0 +1,79 @@
/**
* $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
tinymce.create('tinymce.plugins.Directionality', {
init : function(ed, url) {
var t = this;
t.editor = ed;
ed.addCommand('mceDirectionLTR', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "ltr")
ed.dom.setAttrib(e, "dir", "ltr");
else
ed.dom.setAttrib(e, "dir", "");
}
ed.nodeChanged();
});
ed.addCommand('mceDirectionRTL', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "rtl")
ed.dom.setAttrib(e, "dir", "rtl");
else
ed.dom.setAttrib(e, "dir", "");
}
ed.nodeChanged();
});
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
ed.onNodeChange.add(t._nodeChange, t);
},
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
};
},
// Private methods
_nodeChange : function(ed, cm, n) {
var dom = ed.dom, dir;
n = dom.getParent(n, dom.isBlock);
if (!n) {
cm.setDisabled('ltr', 1);
cm.setDisabled('rtl', 1);
return;
}
dir = dom.getAttrib(n, 'dir');
cm.setActive('ltr', dir == "ltr");
cm.setDisabled('ltr', 0);
cm.setActive('rtl', dir == "rtl");
cm.setDisabled('rtl', 0);
}
});
// Register plugin
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
})();

@ -1 +1 @@
tinyMCE.importPluginLanguagePack('emotions');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
(function(){tinymce.create('tinymce.plugins.EmotionsPlugin',{init:function(ed,url){ed.addCommand('mceEmotion',function(){ed.windowManager.open({file:url+'/emotions.htm',width:250+parseInt(ed.getLang('emotions.delta_width',0)),height:160+parseInt(ed.getLang('emotions.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('emotions',{title:'emotions.emotions_desc',cmd:'mceEmotion'});},getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('emotions',tinymce.plugins.EmotionsPlugin);})();

@ -1,63 +1,40 @@
/**
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
* $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('emotions');
// Plucin static class
var TinyMCE_EmotionsPlugin = {
getInfo : function() {
return {
longname : 'Emotions',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
/**
* Returns the HTML contents of the emotions control.
*/
getControlHTML : function(cn) {
switch (cn) {
case "emotions":
return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
}
return "";
},
/**
* Executes the mceEmotion command.
*/
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceEmotion":
var template = new Array();
template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
template['width'] = 250;
template['height'] = 160;
// Language specific width and height addons
template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
return true;
(function() {
tinymce.create('tinymce.plugins.EmotionsPlugin', {
init : function(ed, url) {
// Register commands
ed.addCommand('mceEmotion', function() {
ed.windowManager.open({
file : url + '/emotions.htm',
width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
inline : 1
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
},
getInfo : function() {
return {
longname : 'Emotions',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Pass to next handler in chain
return false;
}
};
// Register plugin
tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);
// Register plugin
tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
})();

@ -1,38 +1,39 @@
<!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>{$lang_emotions_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
<title>{#emotions_dlg.title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/emotions.js"></script>
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
<body style="display: none">
<div align="center">
<div class="title">{$lang_emotions_title}:<br /><br /></div>
<div class="title">{#emotions_dlg.title}:<br /><br /></div>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td><a href="javascript:insertEmotion('smiley-cool.gif','lang_emotions_cool');"><img src="images/smiley-cool.gif" width="18" height="18" border="0" alt="{$lang_emotions_cool}" title="{$lang_emotions_cool}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-cry.gif','lang_emotions_cry');"><img src="images/smiley-cry.gif" width="18" height="18" border="0" alt="{$lang_emotions_cry}" title="{$lang_emotions_cry}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-embarassed.gif','lang_emotions_embarassed');"><img src="images/smiley-embarassed.gif" width="18" height="18" border="0" alt="{$lang_emotions_embarassed}" title="{$lang_emotions_embarassed}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-foot-in-mouth.gif','lang_emotions_foot_in_mouth');"><img src="images/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_foot_in_mouth}" title="{$lang_emotions_foot_in_mouth}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td>
</tr>
<tr>
<td><a href="javascript:insertEmotion('smiley-frown.gif','lang_emotions_frown');"><img src="images/smiley-frown.gif" width="18" height="18" border="0" alt="{$lang_emotions_frown}" title="{$lang_emotions_frown}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-innocent.gif','lang_emotions_innocent');"><img src="images/smiley-innocent.gif" width="18" height="18" border="0" alt="{$lang_emotions_innocent}" title="{$lang_emotions_innocent}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-kiss.gif','lang_emotions_kiss');"><img src="images/smiley-kiss.gif" width="18" height="18" border="0" alt="{$lang_emotions_kiss}" title="{$lang_emotions_kiss}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-laughing.gif','lang_emotions_laughing');"><img src="images/smiley-laughing.gif" width="18" height="18" border="0" alt="{$lang_emotions_laughing}" title="{$lang_emotions_laughing}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td>
</tr>
<tr>
<td><a href="javascript:insertEmotion('smiley-money-mouth.gif','lang_emotions_money_mouth');"><img src="images/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_money_mouth}" title="{$lang_emotions_money_mouth}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-sealed.gif','lang_emotions_sealed');"><img src="images/smiley-sealed.gif" width="18" height="18" border="0" alt="{$lang_emotions_sealed}" title="{$lang_emotions_sealed}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-smile.gif','lang_emotions_smile');"><img src="images/smiley-smile.gif" width="18" height="18" border="0" alt="{$lang_emotions_smile}" title="{$lang_emotions_smile}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-surprised.gif','lang_emotions_surprised');"><img src="images/smiley-surprised.gif" width="18" height="18" border="0" alt="{$lang_emotions_surprised}" title="{$lang_emotions_surprised}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td>
</tr>
<tr>
<td><a href="javascript:insertEmotion('smiley-tongue-out.gif','lang_emotions_tongue_out');"><img src="images/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{$lang_emotions_tongue-out}" title="{$lang_emotions_tongue_out}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-undecided.gif','lang_emotions_undecided');"><img src="images/smiley-undecided.gif" width="18" height="18" border="0" alt="{$lang_emotions_undecided}" title="{$lang_emotions_undecided}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-wink.gif','lang_emotions_wink');"><img src="images/smiley-wink.gif" width="18" height="18" border="0" alt="{$lang_emotions_wink}" title="{$lang_emotions_wink}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-yell.gif','lang_emotions_yell');"><img src="images/smiley-yell.gif" width="18" height="18" border="0" alt="{$lang_emotions_yell}" title="{$lang_emotions_yell}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td>
<td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td>
</tr>
</table>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

@ -1,2 +0,0 @@
These emotions where taken from Mozilla Thunderbird.
I hope they don't get angry if I use them here after all this is a open source project aswell.

@ -0,0 +1,22 @@
tinyMCEPopup.requireLangPack();
var EmotionsDialog = {
init : function(ed) {
tinyMCEPopup.resizeToInnerSize();
},
insert : function(file, title) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
alt : ed.getLang(title),
title : ed.getLang(title),
border : 0
}));
tinyMCEPopup.close();
}
};
tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);

@ -1,21 +0,0 @@
function init() {
tinyMCEPopup.resizeToInnerSize();
}
function insertEmotion(file_name, title) {
title = tinyMCE.getLang(title);
if (title == null)
title = "";
// XML encode
title = title.replace(/&/g, '&amp;');
title = title.replace(/\"/g, '&quot;');
title = title.replace(/</g, '&lt;');
title = title.replace(/>/g, '&gt;');
var html = '<img src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" mce_src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" border="0" alt="' + title + '" title="' + title + '" />';
tinyMCE.execCommand('mceInsertContent', false, html);
tinyMCEPopup.close();
}

@ -1,22 +0,0 @@
// UK lang variables
tinyMCE.addToLang('emotions',{
title : 'Insert emotion',
desc : 'Emotions',
cool : 'Cool',
cry : 'Cry',
embarassed : 'Embarassed',
foot_in_mouth : 'Foot in mouth',
frown : 'Frown',
innocent : 'Innocent',
kiss : 'Kiss',
laughing : 'Laughing',
money_mouth : 'Money mouth',
sealed : 'Sealed',
smile : 'Smile',
surprised : 'Surprised',
tongue_out : 'Tongue out',
undecided : 'Undecided',
wink : 'Wink',
yell : 'Yell'
});

@ -0,0 +1,20 @@
tinyMCE.addI18n('en.emotions_dlg',{
title:"Insert emotion",
desc:"Emotions",
cool:"Cool",
cry:"Cry",
embarassed:"Embarassed",
foot_in_mouth:"Foot in mouth",
frown:"Frown",
innocent:"Innocent",
kiss:"Kiss",
laughing:"Laughing",
money_mouth:"Money mouth",
sealed:"Sealed",
smile:"Smile",
surprised:"Surprised",
tongue_out:"Tongue out",
undecided:"Undecided",
wink:"Wink",
yell:"Yell"
});

@ -1 +0,0 @@
Check the TinyMCE documentation for details on this plugin.

@ -1,26 +1,6 @@
.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {
border: 1px dotted #cc0000;
background-position: center;
background-repeat: no-repeat;
background-color: #ffffcc;
}
.mceItemShockWave {
background-image: url('../images/shockwave.gif');
}
.mceItemFlash {
background-image: url('../images/flash.gif');
}
.mceItemQuickTime {
background-image: url('../images/quicktime.gif');
}
.mceItemWindowsMedia {
background-image: url('../images/windowsmedia.gif');
}
.mceItemRealMedia {
background-image: url('../images/realmedia.gif');
}
.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}
.mceItemShockWave {background-image: url(../img/shockwave.gif);}
.mceItemFlash {background-image:url(../img/flash.gif);}
.mceItemQuickTime {background-image:url(../img/quicktime.gif);}
.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);}
.mceItemRealMedia {background-image:url(../img/realmedia.gif);}

@ -1,68 +1,68 @@
#id, #name, #hspace, #vspace, #class_name, #align {
width: 100px;
}
#hspace, #vspace {
width: 50px;
}
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
width: 100px;
}
#flash_base, #flash_flashvars {
width: 240px;
}
#width, #height {
width: 40px;
}
#src, #media_type {
width: 250px;
}
#class {
width: 120px;
}
#prev {
margin: 0;
border: 1px solid black;
width: 99%;
height: 230px;
overflow: auto;
}
.panel_wrapper div.current {
height: 390px;
overflow: auto;
}
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
display: none;
}
.mceAddSelectValue {
background-color: #DDDDDD;
}
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
width: 70px;
}
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
width: 70px;
}
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
width: 70px;
}
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
width: 90px;
}
#qt_qtsrc {
width: 200px;
}
#id, #name, #hspace, #vspace, #class_name, #align {
width: 100px;
}
#hspace, #vspace {
width: 50px;
}
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
width: 100px;
}
#flash_base, #flash_flashvars {
width: 240px;
}
#width, #height {
width: 40px;
}
#src, #media_type {
width: 250px;
}
#class {
width: 120px;
}
#prev {
margin: 0;
border: 1px solid black;
width: 99%;
height: 230px;
overflow: auto;
}
.panel_wrapper div.current {
height: 390px;
overflow: auto;
}
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
display: none;
}
.mceAddSelectValue {
background-color: #DDDDDD;
}
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
width: 70px;
}
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
width: 70px;
}
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
width: 70px;
}
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
width: 90px;
}
#qt_qtsrc {
width: 200px;
}

File diff suppressed because one or more lines are too long

@ -1,432 +1,359 @@
/**
* $Id: editor_plugin_src.js 296 2007-08-21 10:36:35Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('media');
var TinyMCE_MediaPlugin = {
getInfo : function() {
return {
longname : 'Media',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
initInstance : function(inst) {
// Warn if user has flash plugin and media plugin at the same time
if (inst.hasPlugin('flash') && !tinyMCE.flashWarn) {
alert('Flash plugin is deprecated and should not be used together with the media plugin.');
tinyMCE.flashWarn = true;
}
if (!tinyMCE.settings['media_skip_plugin_css'])
tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/media/css/content.css");
},
getControlHTML : function(cn) {
switch (cn) {
case "media":
return tinyMCE.getButtonHTML(cn, 'lang_media_desc', '{$pluginurl}/images/media.gif', 'mceMedia');
}
return "";
},
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceMedia":
tinyMCE.openWindow({
file : '../../plugins/media/media.htm',
width : 430 + tinyMCE.getLang('lang_media_delta_width', 0),
height : 470 + tinyMCE.getLang('lang_media_delta_height', 0)
}, {
editor_id : editor_id,
inline : "yes"
});
return true;
}
// Pass to next handler in chain
return false;
},
cleanup : function(type, content, inst) {
var nl, img, i, ne, d, s, ci;
switch (type) {
case "insert_to_editor":
img = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
content = content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, '<img class="mceItem$1" title="$2" src="' + img + '" />');
content = content.replace(/<object([^>]*)>/gi, '<div class="mceItemObject" $1>');
content = content.replace(/<embed([^>]*)>/gi, '<div class="mceItemObjectEmbed" $1>');
content = content.replace(/<\/(object|embed)([^>]*)>/gi, '</div>');
content = content.replace(/<param([^>]*)>/gi, '<div $1 class="mceItemParam"></div>');
content = content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>', 'gi'), 'class="mceItemParam"></div>');
break;
case "insert_to_editor_dom":
d = inst.getDoc();
nl = content.getElementsByTagName("img");
for (i=0; i<nl.length; i++) {
if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)) {
nl[i].width = nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g, '$1');
nl[i].height = nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g, '$1');
//nl[i].align = nl[i].title.replace(/.*align:([a-z]+).*/gi, '$1');
}
}
nl = tinyMCE.selectElements(content, 'DIV', function (n) {return tinyMCE.hasCSSClass(n, 'mceItemObject');});
for (i=0; i<nl.length; i++) {
ci = tinyMCE.getAttrib(nl[i], "classid").toLowerCase().replace(/\s+/g, '');
switch (ci) {
case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash', d, nl[i]), nl[i]);
break;
case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave', d, nl[i]), nl[i]);
break;
case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia', d, nl[i]), nl[i]);
break;
case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime', d, nl[i]), nl[i]);
break;
case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia', d, nl[i]), nl[i]);
break;
}
}
// Handle embed (if any)
nl = tinyMCE.selectNodes(content, function (n) {return n.className == 'mceItemObjectEmbed';});
for (i=0; i<nl.length; i++) {
switch (tinyMCE.getAttrib(nl[i], 'type')) {
case 'application/x-shockwave-flash':
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemFlash');
break;
case 'application/x-director':
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemShockWave');
break;
case 'application/x-mplayer2':
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemWindowsMedia');
break;
case 'video/quicktime':
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemQuickTime');
break;
case 'audio/x-pn-realaudio-plugin':
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemRealMedia');
break;
}
}
break;
case "get_from_editor":
var startPos = -1, endPos, attribs, chunkBefore, chunkAfter, embedHTML, at, pl, cb, mt, ex;
while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
endPos = content.indexOf('/>', startPos);
attribs = TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos + 4, endPos));
// Is not flash, skip it
if (!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))
continue;
endPos += 2;
// Parse attributes
at = attribs['title'];
if (at) {
at = at.replace(/&(#39|apos);/g, "'");
at = at.replace(/&#quot;/g, '"');
try {
pl = eval('x={' + at + '};');
} catch (ex) {
pl = {};
}
}
// Use object/embed
if (!tinyMCE.getParam('media_use_script', false)) {
switch (attribs['class']) {
case 'mceItemFlash':
ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
mt = 'application/x-shockwave-flash';
break;
case 'mceItemShockWave':
ci = '166B1BCA-3F9C-11CF-8075-444553540000';
cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
mt = 'application/x-director';
break;
case 'mceItemWindowsMedia':
ci = tinyMCE.getParam('media_wmp6_compatible') ? '05589FA1-C356-11CE-BF01-00AA0055595A' : '6BF52A52-394A-11D3-B153-00C04F79FAA6';
cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
mt = 'application/x-mplayer2';
break;
case 'mceItemQuickTime':
ci = '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
mt = 'video/quicktime';
break;
case 'mceItemRealMedia':
ci = 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
mt = 'audio/x-pn-realaudio-plugin';
break;
}
// Convert the URL
pl.src = tinyMCE.convertURL(pl.src, null, true);
embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs);
} else {
// Use script version
switch (attribs['class']) {
case 'mceItemFlash':
s = 'writeFlash';
break;
case 'mceItemShockWave':
s = 'writeShockWave';
break;
case 'mceItemWindowsMedia':
s = 'writeWindowsMedia';
break;
case 'mceItemQuickTime':
s = 'writeQuickTime';
break;
case 'mceItemRealMedia':
s = 'writeRealMedia';
break;
}
if (attribs.width)
at = at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g, "width:'" + attribs.width + "'");
if (attribs.height)
at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'");
// Force absolute URL
pl.src = tinyMCE.convertURL(pl.src, null, true);
at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'");
embedHTML = '<script type="text/javascript">' + s + '({' + at + '});</script>';
}
// Insert embed/object chunk
chunkBefore = content.substring(0, startPos);
chunkAfter = content.substring(endPos);
content = chunkBefore + embedHTML + chunkAfter;
}
break;
}
return content;
},
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
if (node == null)
return;
do {
if (node.nodeName == "IMG" && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node, 'class'))) {
tinyMCE.switchClass(editor_id + '_media', 'mceButtonSelected');
return true;
}
} while ((node = node.parentNode));
tinyMCE.switchClass(editor_id + '_media', 'mceButtonNormal');
return true;
},
_createImgFromEmbed : function(n, d, cl) {
var ne, at, i, ti = '', an;
ne = d.createElement('img');
ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
ne.width = tinyMCE.getAttrib(n, 'width');
ne.height = tinyMCE.getAttrib(n, 'height');
ne.className = cl;
at = n.attributes;
for (i=0; i<at.length; i++) {
if (at[i].specified && at[i].nodeValue) {
an = at[i].nodeName.toLowerCase();
if (an == 'src')
continue;
if (an == 'mce_src')
an = 'src';
if (an.indexOf('mce_') == -1 && !new RegExp('^(class|type)$').test(an))
ti += an.toLowerCase() + ':\'' + at[i].nodeValue + "',";
}
}
ti = ti.length > 0 ? ti.substring(0, ti.length - 1) : ti;
ne.title = ti;
n.parentNode.replaceChild(ne, n);
},
_createImg : function(cl, d, n) {
var i, nl, ti = "", an, av, al = new Array();
ne = d.createElement('img');
ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
ne.width = tinyMCE.getAttrib(n, 'width');
ne.height = tinyMCE.getAttrib(n, 'height');
ne.className = cl;
al.id = tinyMCE.getAttrib(n, 'id');
al.name = tinyMCE.getAttrib(n, 'name');
al.width = tinyMCE.getAttrib(n, 'width');
al.height = tinyMCE.getAttrib(n, 'height');
al.bgcolor = tinyMCE.getAttrib(n, 'bgcolor');
al.align = tinyMCE.getAttrib(n, 'align');
al.class_name = tinyMCE.getAttrib(n, 'mce_class');
nl = n.getElementsByTagName('div');
for (i=0; i<nl.length; i++) {
av = tinyMCE.getAttrib(nl[i], 'value');
av = av.replace(new RegExp('\\\\', 'g'), '\\\\');
av = av.replace(new RegExp('"', 'g'), '\\"');
av = av.replace(new RegExp("'", 'g'), "\\'");
an = tinyMCE.getAttrib(nl[i], 'name');
al[an] = av;
}
if (al.movie) {
al.src = al.movie;
al.movie = null;
}
for (an in al) {
if (al[an] != null && typeof(al[an]) != "function" && al[an] != '')
ti += an.toLowerCase() + ':\'' + al[an] + "',";
}
ti = ti.length > 0 ? ti.substring(0, ti.length - 1) : ti;
ne.title = ti;
return ne;
},
_getEmbed : function(cls, cb, mt, p, at) {
var h = '', n;
p.width = at.width ? at.width : p.width;
p.height = at.height ? at.height : p.height;
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
h += typeof(p.id) != "undefined" ? ' id="' + p.id + '"' : '';
h += typeof(p.name) != "undefined" ? ' name="' + p.name + '"' : '';
h += typeof(p.width) != "undefined" ? ' width="' + p.width + '"' : '';
h += typeof(p.height) != "undefined" ? ' height="' + p.height + '"' : '';
h += typeof(p.align) != "undefined" ? ' align="' + p.align + '"' : '';
h += '>';
for (n in p) {
if (typeof(p[n]) != "undefined" && typeof(p[n]) != "function") {
h += '<param name="' + n + '" value="' + p[n] + '" />';
// Add extra url parameter if it's an absolute URL on WMP
if (n == 'src' && p[n].indexOf('://') != -1 && mt == 'application/x-mplayer2')
h += '<param name="url" value="' + p[n] + '" />';
}
}
h += '<embed type="' + mt + '"';
for (n in p) {
if (typeof(p[n]) == "function")
continue;
// Skip url parameter for embed tag on WMP
if (!(n == 'url' && mt == 'application/x-mplayer2'))
h += ' ' + n + '="' + p[n] + '"';
}
h += '></embed></object>';
return h;
},
_parseAttributes : function(attribute_string) {
var attributeName = "", endChr = '"';
var attributeValue = "";
var withInName;
var withInValue;
var attributes = new Array();
var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
if (attribute_string == null || attribute_string.length < 2)
return null;
withInName = withInValue = false;
for (var i=0; i<attribute_string.length; i++) {
var chr = attribute_string.charAt(i);
if ((chr == '"' || chr == "'") && !withInValue) {
withInValue = true;
endChr = chr;
} else if (chr == endChr && withInValue) {
withInValue = false;
var pos = attributeName.lastIndexOf(' ');
if (pos != -1)
attributeName = attributeName.substring(pos+1);
attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
attributeName = "";
attributeValue = "";
} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
withInName = true;
if (chr == '=' && withInName)
withInName = false;
if (withInName)
attributeName += chr;
if (withInValue)
attributeValue += chr;
}
return attributes;
}
};
tinyMCE.addPlugin("media", TinyMCE_MediaPlugin);
/**
* $Id: editor_plugin_src.js 763 2008-04-03 13:25:45Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
var each = tinymce.each;
tinymce.create('tinymce.plugins.MediaPlugin', {
init : function(ed, url) {
var t = this;
t.editor = ed;
t.url = url;
function isMediaElm(n) {
return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);
};
// Register commands
ed.addCommand('mceMedia', function() {
ed.windowManager.open({
file : url + '/media.htm',
width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
height : 470 + parseInt(ed.getLang('media.delta_height', 0)),
inline : 1
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n));
});
ed.onInit.add(function() {
var lo = {
mceItemFlash : 'flash',
mceItemShockWave : 'shockwave',
mceItemWindowsMedia : 'windowsmedia',
mceItemQuickTime : 'quicktime',
mceItemRealMedia : 'realmedia'
};
if (ed.settings.content_css !== false)
ed.dom.loadCSS(url + "/css/content.css");
if (ed.theme.onResolveName) {
ed.theme.onResolveName.add(function(th, o) {
if (o.name == 'img') {
each(lo, function(v, k) {
if (ed.dom.hasClass(o.node, k)) {
o.name = v;
o.title = ed.dom.getAttrib(o.node, 'title');
return false;
}
});
}
});
}
if (ed && ed.plugins.contextmenu) {
ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) {
m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
}
});
}
});
ed.onBeforeSetContent.add(function(ed, o) {
var h = o.content;
h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {
var o = t._parse(c);
return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'
});
h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');
h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');
h = h.replace(/<\/(object|embed)([^>]*)>/gi, '</span>');
h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_value=') + ' class="mceItemParam"></span>'});
h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');
o.content = h;
});
ed.onSetContent.add(function() {
t._spansToImgs(ed.getBody());
});
ed.onPreProcess.add(function(ed, o) {
var dom = ed.dom;
if (o.set) {
t._spansToImgs(o.node);
each(dom.select('IMG', o.node), function(n) {
var p;
if (isMediaElm(n)) {
p = t._parse(n.title);
dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100));
dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100));
}
});
}
if (o.get) {
each(dom.select('IMG', o.node), function(n) {
var ci, cb, mt;
if (ed.getParam('media_use_script')) {
if (isMediaElm(n))
n.className = n.className.replace(/mceItem/g, 'mceTemp');
return;
}
switch (n.className) {
case 'mceItemFlash':
ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
mt = 'application/x-shockwave-flash';
break;
case 'mceItemShockWave':
ci = '166b1bca-3f9c-11cf-8075-444553540000';
cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
mt = 'application/x-director';
break;
case 'mceItemWindowsMedia':
ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6';
cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
mt = 'application/x-mplayer2';
break;
case 'mceItemQuickTime':
ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b';
cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
mt = 'video/quicktime';
break;
case 'mceItemRealMedia':
ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa';
cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
mt = 'audio/x-pn-realaudio-plugin';
break;
}
if (ci) {
dom.replace(t._buildObj({
classid : ci,
codebase : cb,
type : mt
}, n), n);
}
});
}
});
ed.onPostProcess.add(function(ed, o) {
o.content = o.content.replace(/_value=/g, 'value=');
});
if (ed.getParam('media_use_script')) {
function getAttr(s, n) {
n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
return n ? ed.dom.decode(n[1]) : '';
};
ed.onPostProcess.add(function(ed, o) {
o.content = o.content.replace(/<img[^>]+>/g, function(im) {
var cl = getAttr(im, 'class');
if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) {
at = t._parse(getAttr(im, 'title'));
at.width = getAttr(im, 'width');
at.height = getAttr(im, 'height');
im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>';
}
return im;
});
});
}
},
getInfo : function() {
return {
longname : 'Media',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
_buildObj : function(o, n) {
var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title);
p.width = o.width = dom.getAttrib(n, 'width') || 100;
p.height = o.height = dom.getAttrib(n, 'height') || 100;
ob = dom.create('span', {
mce_name : 'object',
classid : "clsid:" + o.classid,
codebase : o.codebase,
width : o.width,
height : o.height
});
if (p.src)
p.src = ed.convertURL(p.src, 'src', n);
each (p, function(v, k) {
if (!/^(width|height|codebase|classid)$/.test(k)) {
// Use url instead of src in IE for Windows media
if (o.type == 'application/x-mplayer2' && k == 'src')
k = 'url';
dom.add(ob, 'span', {mce_name : 'param', name : k, '_value' : v});
}
});
dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type}, p));
return ob;
},
_spansToImgs : function(p) {
var t = this, dom = t.editor.dom, im, ci;
each(dom.select('span', p), function(n) {
// Convert object into image
if (dom.getAttrib(n, 'class') == 'mceItemObject') {
ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, '');
switch (ci) {
case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
dom.replace(t._createImg('mceItemFlash', n), n);
break;
case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
dom.replace(t._createImg('mceItemShockWave', n), n);
break;
case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
dom.replace(t._createImg('mceItemWindowsMedia', n), n);
break;
case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
dom.replace(t._createImg('mceItemQuickTime', n), n);
break;
case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
dom.replace(t._createImg('mceItemRealMedia', n), n);
break;
default:
dom.replace(t._createImg('mceItemFlash', n), n);
}
return;
}
// Convert embed into image
if (dom.getAttrib(n, 'class') == 'mceItemEmbed') {
switch (dom.getAttrib(n, 'type')) {
case 'application/x-shockwave-flash':
dom.replace(t._createImg('mceItemFlash', n), n);
break;
case 'application/x-director':
dom.replace(t._createImg('mceItemShockWave', n), n);
break;
case 'application/x-mplayer2':
dom.replace(t._createImg('mceItemWindowsMedia', n), n);
break;
case 'video/quicktime':
dom.replace(t._createImg('mceItemQuickTime', n), n);
break;
case 'audio/x-pn-realaudio-plugin':
dom.replace(t._createImg('mceItemRealMedia', n), n);
break;
default:
dom.replace(t._createImg('mceItemFlash', n), n);
}
}
});
},
_createImg : function(cl, n) {
var im, dom = this.editor.dom, pa = {}, ti = '';
// Create image
im = dom.create('img', {
src : this.url + '/img/trans.gif',
width : dom.getAttrib(n, 'width') || 100,
height : dom.getAttrib(n, 'height') || 100,
'class' : cl
});
// Setup base parameters
each(['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode'], function(na) {
var v = dom.getAttrib(n, na);
if (v)
pa[na] = v;
});
// Add optional parameters
each(dom.select('span', n), function(n) {
if (dom.hasClass(n, 'mceItemParam'))
pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_value');
});
// Use src not movie
if (pa.movie) {
pa.src = pa.movie;
delete pa.movie;
}
delete pa.width;
delete pa.height;
im.title = this._serialize(pa);
return im;
},
_parse : function(s) {
return tinymce.util.JSON.parse('{' + s + '}');
},
_serialize : function(o) {
return tinymce.util.JSON.serialize(o).replace(/[{}]/g, '');
}
});
// Register plugin
tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 241 B

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

Before

Width:  |  Height:  |  Size: 439 B

After

Width:  |  Height:  |  Size: 439 B

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 387 B

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

@ -1,73 +1,73 @@
/**
* This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
*/
function writeFlash(p) {
writeEmbed(
'D27CDB6E-AE6D-11cf-96B8-444553540000',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
'application/x-shockwave-flash',
p
);
}
function writeShockWave(p) {
writeEmbed(
'166B1BCA-3F9C-11CF-8075-444553540000',
'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
'application/x-director',
p
);
}
function writeQuickTime(p) {
writeEmbed(
'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
'video/quicktime',
p
);
}
function writeRealMedia(p) {
writeEmbed(
'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
'audio/x-pn-realaudio-plugin',
p
);
}
function writeWindowsMedia(p) {
p.url = p.src;
writeEmbed(
'6BF52A52-394A-11D3-B153-00C04F79FAA6',
'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
'application/x-mplayer2',
p
);
}
function writeEmbed(cls, cb, mt, p) {
var h = '', n;
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
h += '>';
for (n in p)
h += '<param name="' + n + '" value="' + p[n] + '">';
h += '<embed type="' + mt + '"';
for (n in p)
h += n + '="' + p[n] + '" ';
h += '></embed></object>';
document.write(h);
}
/**
* This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
*/
function writeFlash(p) {
writeEmbed(
'D27CDB6E-AE6D-11cf-96B8-444553540000',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
'application/x-shockwave-flash',
p
);
}
function writeShockWave(p) {
writeEmbed(
'166B1BCA-3F9C-11CF-8075-444553540000',
'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
'application/x-director',
p
);
}
function writeQuickTime(p) {
writeEmbed(
'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
'video/quicktime',
p
);
}
function writeRealMedia(p) {
writeEmbed(
'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
'audio/x-pn-realaudio-plugin',
p
);
}
function writeWindowsMedia(p) {
p.url = p.src;
writeEmbed(
'6BF52A52-394A-11D3-B153-00C04F79FAA6',
'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
'application/x-mplayer2',
p
);
}
function writeEmbed(cls, cb, mt, p) {
var h = '', n;
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
h += '>';
for (n in p)
h += '<param name="' + n + '" value="' + p[n] + '">';
h += '<embed type="' + mt + '"';
for (n in p)
h += n + '="' + p[n] + '" ';
h += '></embed></object>';
document.write(h);
}

@ -1,94 +0,0 @@
// UK lang variables
tinyMCE.addToLang('media',{
title : 'Insert / edit embedded media',
desc : 'Insert / edit embedded media',
general : 'General',
advanced : 'Advanced',
file : 'File/URL',
list : 'List',
size : 'Dimensions',
preview : 'Preview',
constrain_proportions : 'Constrain proportions',
type : 'Type',
id : 'Id',
name : 'Name',
class_name : 'Class',
vspace : 'V-Space',
hspace : 'H-Space',
play : 'Auto play',
loop : 'Loop',
menu : 'Show menu',
quality : 'Quality',
scale : 'Scale',
align : 'Align',
salign : 'SAlign',
wmode : 'WMode',
bgcolor : 'Background',
base : 'Base',
flashvars : 'Flashvars',
liveconnect : 'SWLiveConnect',
autohref : 'AutoHREF',
cache : 'Cache',
hidden : 'Hidden',
controller : 'Controller',
kioskmode : 'Kiosk mode',
playeveryframe : 'Play every frame',
targetcache : 'Target cache',
correction : 'No correction',
enablejavascript : 'Enable JavaScript',
starttime : 'Start time',
endtime : 'End time',
href : 'Href',
qtsrcchokespeed : 'Choke speed',
target : 'Target',
volume : 'Volume',
autostart : 'Auto start',
enabled : 'Enabled',
fullscreen : 'Fullscreen',
invokeurls : 'Invoke URLs',
mute : 'Mute',
stretchtofit : 'Stretch to fit',
windowlessvideo : 'Windowless video',
balance : 'Balance',
baseurl : 'Base URL',
captioningid : 'Captioning id',
currentmarker : 'Current marker',
currentposition : 'Current position',
defaultframe : 'Default frame',
playcount : 'Play count',
rate : 'Rate',
uimode : 'UI Mode',
flash_options : 'Flash options',
qt_options : 'Quicktime options',
wmp_options : 'Windows media player options',
rmp_options : 'Real media player options',
shockwave_options : 'Shockwave options',
autogotourl : 'Auto goto URL',
center : 'Center',
imagestatus : 'Image status',
maintainaspect : 'Maintain aspect',
nojava : 'No java',
prefetch : 'Prefetch',
shuffle : 'Shuffle',
console : 'Console',
numloop : 'Num loops',
controls : 'Controls',
scriptcallbacks : 'Script callbacks',
swstretchstyle : 'Stretch style',
swstretchhalign : 'Stretch H-Align',
swstretchvalign : 'Stretch V-Align',
sound : 'Sound',
progress : 'Progress',
qtsrc : 'QT Src',
qt_stream_warn : 'Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..',
align_top : 'Top',
align_right : 'Right',
align_bottom : 'Bottom',
align_left : 'Left',
align_center : 'Center',
align_top_left : 'Top left',
align_top_right : 'Top right',
align_bottom_left : 'Bottom left',
align_bottom_right : 'Bottom right'
});

@ -0,0 +1,103 @@
tinyMCE.addI18n('en.media_dlg',{
title:"Insert / edit embedded media",
general:"General",
advanced:"Advanced",
file:"File/URL",
list:"List",
size:"Dimensions",
preview:"Preview",
constrain_proportions:"Constrain proportions",
type:"Type",
id:"Id",
name:"Name",
class_name:"Class",
vspace:"V-Space",
hspace:"H-Space",
play:"Auto play",
loop:"Loop",
menu:"Show menu",
quality:"Quality",
scale:"Scale",
align:"Align",
salign:"SAlign",
wmode:"WMode",
bgcolor:"Background",
base:"Base",
flashvars:"Flashvars",
liveconnect:"SWLiveConnect",
autohref:"AutoHREF",
cache:"Cache",
hidden:"Hidden",
controller:"Controller",
kioskmode:"Kiosk mode",
playeveryframe:"Play every frame",
targetcache:"Target cache",
correction:"No correction",
enablejavascript:"Enable JavaScript",
starttime:"Start time",
endtime:"End time",
href:"Href",
qtsrcchokespeed:"Choke speed",
target:"Target",
volume:"Volume",
autostart:"Auto start",
enabled:"Enabled",
fullscreen:"Fullscreen",
invokeurls:"Invoke URLs",
mute:"Mute",
stretchtofit:"Stretch to fit",
windowlessvideo:"Windowless video",
balance:"Balance",
baseurl:"Base URL",
captioningid:"Captioning id",
currentmarker:"Current marker",
currentposition:"Current position",
defaultframe:"Default frame",
playcount:"Play count",
rate:"Rate",
uimode:"UI Mode",
flash_options:"Flash options",
qt_options:"Quicktime options",
wmp_options:"Windows media player options",
rmp_options:"Real media player options",
shockwave_options:"Shockwave options",
autogotourl:"Auto goto URL",
center:"Center",
imagestatus:"Image status",
maintainaspect:"Maintain aspect",
nojava:"No java",
prefetch:"Prefetch",
shuffle:"Shuffle",
console:"Console",
numloop:"Num loops",
controls:"Controls",
scriptcallbacks:"Script callbacks",
swstretchstyle:"Stretch style",
swstretchhalign:"Stretch H-Align",
swstretchvalign:"Stretch V-Align",
sound:"Sound",
progress:"Progress",
qtsrc:"QT Src",
qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",
align_top:"Top",
align_right:"Right",
align_bottom:"Bottom",
align_left:"Left",
align_center:"Center",
align_top_left:"Top left",
align_top_right:"Top right",
align_bottom_left:"Bottom left",
align_bottom_right:"Bottom right",
flv_options:"Flash video options",
flv_scalemode:"Scale mode",
flv_buffer:"Buffer",
flv_startimage:"Start image",
flv_starttime:"Start time",
flv_defaultvolume:"Default volumne",
flv_hiddengui:"Hidden GUI",
flv_autostart:"Auto start",
flv_loop:"Loop",
flv_showscalemodes:"Show scale modes",
flv_smoothvideo:"Smooth video",
flv_jscallback:"JS Callback"
});

@ -1,35 +1,37 @@
<!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>{$lang_media_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/media.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
<title>{#media_dlg.title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/media.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
<link href="css/media.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
<body style="display: none">
<form onsubmit="insertMedia();return false;" action="#">
<div class="tabs">
<ul>
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{$lang_media_general}</a></span></li>
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_media_advanced}</a></span></li>
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<div id="general_panel" class="panel current">
<fieldset>
<legend>{$lang_media_general}</legend>
<legend>{#media_dlg.general}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="media_type">{$lang_media_type}</label></td>
<td><label for="media_type">{#media_dlg.type}</label></td>
<td>
<select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
<option value="flash">Flash</option>
<!-- <option value="flv">Flash video (FLV)</option> -->
<option value="qt">Quicktime</option>
<option value="shockwave">Shockwave</option>
<option value="wmp">Windows Media</option>
@ -38,65 +40,66 @@
</td>
</tr>
<tr>
<td><label for="src">{$lang_media_file}</label></td>
<td><label for="src">{#media_dlg.file}</label></td>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="src" name="src" type="text" value="" onchange="switchType(this.value);generatePreview();" /></td>
<td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td>
<td id="filebrowsercontainer">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr id="linklistrow">
<td><label for="linklist">{$lang_media_list}</label></td>
<td><label for="linklist">{#media_dlg.list}</label></td>
<td id="linklistcontainer">&nbsp;</td>
</tr>
<tr>
<td><label for="width">{$lang_media_size}</label></td>
<td><label for="width">{#media_dlg.size}</label></td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
<td>&nbsp;&nbsp;<input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
<td><label id="constrainlabel" for="constrain">{$lang_media_constrain_proportions}</label></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
<td>&nbsp;&nbsp;<input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
<td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>{$lang_media_preview}</legend>
<legend>{#media_dlg.preview}</legend>
<div id="prev"></div>
</fieldset>
</div>
<div id="advanced_panel" class="panel">
<fieldset>
<legend>{$lang_media_advanced}</legend>
<legend>{#media_dlg.advanced}</legend>
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td><label for="id">{$lang_media_id}</label></td>
<td><label for="id">{#media_dlg.id}</label></td>
<td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
<td><label for="name">{$lang_media_name}</label></td>
<td><label for="name">{#media_dlg.name}</label></td>
<td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="align">{$lang_media_align}</label></td>
<td><label for="align">{#media_dlg.align}</label></td>
<td>
<select id="align" name="align" onchange="generatePreview();">
<option value="">{$lang_not_set}</option>
<option value="top">{$lang_media_align_top}</option>
<option value="right">{$lang_media_align_right}</option>
<option value="bottom">{$lang_media_align_bottom}</option>
<option value="left">{$lang_media_align_left}</option>
<option value="">{#not_set}</option>
<option value="top">{#media_dlg.align_top}</option>
<option value="right">{#media_dlg.align_right}</option>
<option value="bottom">{#media_dlg.align_bottom}</option>
<option value="left">{#media_dlg.align_left}</option>
</select>
</td>
<td><label for="bgcolor">{$lang_media_bgcolor}</label></td>
<td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
@ -108,23 +111,23 @@
</tr>
<tr>
<td><label for="vspace">{$lang_media_vspace}</label></td>
<td><label for="vspace">{#media_dlg.vspace}</label></td>
<td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
<td><label for="hspace">{$lang_media_hspace}</label></td>
<td><label for="hspace">{#media_dlg.hspace}</label></td>
<td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
</tr>
</table>
</fieldset>
<fieldset id="flash_options">
<legend>{$lang_media_flash_options}</legend>
<legend>{#media_dlg.flash_options}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="flash_quality">{$lang_media_quality}</label></td>
<td><label for="flash_quality">{#media_dlg.quality}</label></td>
<td>
<select id="flash_quality" name="flash_quality" onchange="generatePreview();">
<option value="">{$lang_not_set}</option>
<option value="">{#not_set}</option>
<option value="high">high</option>
<option value="low">low</option>
<option value="autolow">autolow</option>
@ -133,40 +136,41 @@
</select>
</td>
<td><label for="flash_scale">{$lang_media_scale}</label></td>
<td><label for="flash_scale">{#media_dlg.scale}</label></td>
<td>
<select id="flash_scale" name="flash_scale" onchange="generatePreview();">
<option value="">{$lang_not_set}</option>
<option value="">{#not_set}</option>
<option value="showall">showall</option>
<option value="noborder">noborder</option>
<option value="exactfit">exactfit</option>
<option value="noscale">noscale</option>
</select>
</td>
</tr>
<tr>
<td><label for="flash_wmode">{$lang_media_wmode}</label></td>
<td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
<td>
<select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
<option value="">{$lang_not_set}</option>
<option value="">{#not_set}</option>
<option value="window">window</option>
<option value="opaque">opaque</option>
<option value="transparent">transparent</option>
</select>
</td>
<td><label for="flash_salign">{$lang_media_salign}</label></td>
<td><label for="flash_salign">{#media_dlg.salign}</label></td>
<td>
<select id="flash_salign" name="flash_salign" onchange="generatePreview();">
<option value="">{$lang_not_set}</option>
<option value="l">{$lang_media_align_left}</option>
<option value="t">{$lang_media_align_top}</option>
<option value="r">{$lang_media_align_right}</option>
<option value="b">{$lang_media_align_bottom}</option>
<option value="tl">{$lang_media_align_top_left}</option>
<option value="tr">{$lang_media_align_top_right}</option>
<option value="bl">{$lang_media_align_bottom_left}</option>
<option value="br">{$lang_media_align_bottom_right}</option>
<option value="">{#not_set}</option>
<option value="l">{#media_dlg.align_left}</option>
<option value="t">{#media_dlg.align_top}</option>
<option value="r">{#media_dlg.align_right}</option>
<option value="b">{#media_dlg.align_bottom}</option>
<option value="tl">{#media_dlg.align_top_left}</option>
<option value="tr">{#media_dlg.align_top_right}</option>
<option value="bl">{#media_dlg.align_bottom_left}</option>
<option value="br">{#media_dlg.align_bottom_right}</option>
</select>
</td>
</tr>
@ -176,7 +180,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flash_play">{$lang_media_play}</label></td>
<td><label for="flash_play">{#media_dlg.play}</label></td>
</tr>
</table>
</td>
@ -185,7 +189,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flash_loop">{$lang_media_loop}</label></td>
<td><label for="flash_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
@ -196,7 +200,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flash_menu">{$lang_media_menu}</label></td>
<td><label for="flash_menu">{#media_dlg.menu}</label></td>
</tr>
</table>
</td>
@ -205,7 +209,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
<td><label for="flash_swliveconnect">{$lang_media_liveconnect}</label></td>
<td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
</tr>
</table>
</td>
@ -214,19 +218,116 @@
<table>
<tr>
<td><label for="flash_base">{$lang_media_base}</label></td>
<td><label for="flash_base">{#media_dlg.base}</label></td>
<td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="flash_flashvars">{$lang_media_flashvars}</label></td>
<td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
<td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
</tr>
</table>
</fieldset>
<fieldset id="flv_options">
<legend>{#media_dlg.flv_options}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>
<td>
<select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">
<option value="">{#not_set}</option>
<option value="none">none</option>
<option value="double">double</option>
<option value="full">full</option>
</select>
</td>
<td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>
<td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>
<td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>
<td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
<td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>
<td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>
<td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
<td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>
</tr>
</table>
</td>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>
</tr>
</table>
</td>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>
<td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>
<td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>
</tr>
</table>
</td>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>
<td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<fieldset id="qt_options">
<legend>{$lang_media_qt_options}</legend>
<legend>{#media_dlg.qt_options}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
@ -234,7 +335,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
<td><label for="qt_loop">{$lang_media_loop}</label></td>
<td><label for="qt_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
@ -243,7 +344,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>
<td><label for="qt_autoplay">{$lang_media_play}</label></td>
<td><label for="qt_autoplay">{#media_dlg.play}</label></td>
</tr>
</table>
</td>
@ -254,7 +355,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
<td><label for="qt_cache">{$lang_media_cache}</label></td>
<td><label for="qt_cache">{#media_dlg.cache}</label></td>
</tr>
</table>
</td>
@ -263,7 +364,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
<td><label for="qt_controller">{$lang_media_controller}</label></td>
<td><label for="qt_controller">{#media_dlg.controller}</label></td>
</tr>
</table>
</td>
@ -274,7 +375,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
<td><label for="qt_correction">{$lang_media_correction}</label></td>
<td><label for="qt_correction">{#media_dlg.correction}</label></td>
</tr>
</table>
</td>
@ -283,7 +384,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
<td><label for="qt_enablejavascript">{$lang_media_enablejavascript}</label></td>
<td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>
</tr>
</table>
</td>
@ -294,7 +395,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
<td><label for="qt_kioskmode">{$lang_media_kioskmode}</label></td>
<td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>
</tr>
</table>
</td>
@ -303,7 +404,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
<td><label for="qt_autohref">{$lang_media_autohref}</label></td>
<td><label for="qt_autohref">{#media_dlg.autohref}</label></td>
</tr>
</table>
</td>
@ -314,7 +415,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
<td><label for="qt_playeveryframe">{$lang_media_playeveryframe}</label></td>
<td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>
</tr>
</table>
</td>
@ -323,16 +424,16 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
<td><label for="qt_targetcache">{$lang_media_targetcache}</label></td>
<td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="qt_scale">{$lang_media_scale}</label></td>
<td><label for="qt_scale">{#media_dlg.scale}</label></td>
<td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
<option value="">{$lang_not_set}</option>
<option value="">{#not_set}</option>
<option value="tofit">tofit</option>
<option value="aspect">aspect</option>
</select>
@ -342,31 +443,31 @@
</tr>
<tr>
<td><label for="qt_starttime">{$lang_media_starttime}</label></td>
<td><label for="qt_starttime">{#media_dlg.starttime}</label></td>
<td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
<td><label for="qt_endtime">{$lang_media_endtime}</label></td>
<td><label for="qt_endtime">{#media_dlg.endtime}</label></td>
<td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="qt_target">{$lang_media_target}</label></td>
<td><label for="qt_target">{#media_dlg.target}</label></td>
<td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
<td><label for="qt_href">{$lang_media_href}</label></td>
<td><label for="qt_href">{#media_dlg.href}</label></td>
<td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="qt_qtsrcchokespeed">{$lang_media_qtsrcchokespeed}</label></td>
<td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
<td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
<td><label for="qt_volume">{$lang_media_volume}</label></td>
<td><label for="qt_volume">{#media_dlg.volume}</label></td>
<td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="qt_qtsrc">{$lang_media_qtsrc}</label></td>
<td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>
<td colspan="4">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
@ -380,7 +481,7 @@
</fieldset>
<fieldset id="wmp_options">
<legend>{$lang_media_wmp_options}</legend>
<legend>{#media_dlg.wmp_options}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
@ -388,7 +489,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
<td><label for="wmp_autostart">{$lang_media_autostart}</label></td>
<td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>
</tr>
</table>
</td>
@ -397,7 +498,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
<td><label for="wmp_enabled">{$lang_media_enabled}</label></td>
<td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>
</tr>
</table>
</td>
@ -408,7 +509,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
<td><label for="wmp_enablecontextmenu">{$lang_media_menu}</label></td>
<td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>
</tr>
</table>
</td>
@ -417,7 +518,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
<td><label for="wmp_fullscreen">{$lang_media_fullscreen}</label></td>
<td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>
</tr>
</table>
</td>
@ -428,7 +529,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
<td><label for="wmp_invokeurls">{$lang_media_invokeurls}</label></td>
<td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>
</tr>
</table>
</td>
@ -437,7 +538,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
<td><label for="wmp_mute">{$lang_media_mute}</label></td>
<td><label for="wmp_mute">{#media_dlg.mute}</label></td>
</tr>
</table>
</td>
@ -448,7 +549,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
<td><label for="wmp_stretchtofit">{$lang_media_stretchtofit}</label></td>
<td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>
</tr>
</table>
</td>
@ -457,49 +558,49 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
<td><label for="wmp_windowlessvideo">{$lang_media_windowlessvideo}</label></td>
<td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="wmp_balance">{$lang_media_balance}</label></td>
<td><label for="wmp_balance">{#media_dlg.balance}</label></td>
<td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
<td><label for="wmp_baseurl">{$lang_media_baseurl}</label></td>
<td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>
<td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="wmp_captioningid">{$lang_media_captioningid}</label></td>
<td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>
<td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
<td><label for="wmp_currentmarker">{$lang_media_currentmarker}</label></td>
<td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>
<td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="wmp_currentposition">{$lang_media_currentposition}</label></td>
<td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>
<td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
<td><label for="wmp_defaultframe">{$lang_media_defaultframe}</label></td>
<td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>
<td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="wmp_playcount">{$lang_media_playcount}</label></td>
<td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>
<td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
<td><label for="wmp_rate">{$lang_media_rate}</label></td>
<td><label for="wmp_rate">{#media_dlg.rate}</label></td>
<td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="wmp_uimode">{$lang_media_uimode}</label></td>
<td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>
<td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
<td><label for="wmp_volume">{$lang_media_volume}</label></td>
<td><label for="wmp_volume">{#media_dlg.volume}</label></td>
<td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
</tr>
@ -507,7 +608,7 @@
</fieldset>
<fieldset id="rmp_options">
<legend>{$lang_media_rmp_options}</legend>
<legend>{#media_dlg.rmp_options}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
@ -515,7 +616,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
<td><label for="rmp_autostart">{$lang_media_autostart}</label></td>
<td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>
</tr>
</table>
</td>
@ -524,7 +625,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
<td><label for="rmp_loop">{$lang_media_loop}</label></td>
<td><label for="rmp_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
@ -535,7 +636,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
<td><label for="rmp_autogotourl">{$lang_media_autogotourl}</label></td>
<td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>
</tr>
</table>
</td>
@ -544,7 +645,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
<td><label for="rmp_center">{$lang_media_center}</label></td>
<td><label for="rmp_center">{#media_dlg.center}</label></td>
</tr>
</table>
</td>
@ -555,7 +656,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
<td><label for="rmp_imagestatus">{$lang_media_imagestatus}</label></td>
<td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>
</tr>
</table>
</td>
@ -564,7 +665,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
<td><label for="rmp_maintainaspect">{$lang_media_maintainaspect}</label></td>
<td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>
</tr>
</table>
</td>
@ -575,7 +676,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
<td><label for="rmp_nojava">{$lang_media_nojava}</label></td>
<td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>
</tr>
</table>
</td>
@ -584,7 +685,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
<td><label for="rmp_prefetch">{$lang_media_prefetch}</label></td>
<td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>
</tr>
</table>
</td>
@ -595,7 +696,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
<td><label for="rmp_shuffle">{$lang_media_shuffle}</label></td>
<td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>
</tr>
</table>
</td>
@ -606,57 +707,57 @@
</tr>
<tr>
<td><label for="rmp_console">{$lang_media_console}</label></td>
<td><label for="rmp_console">{#media_dlg.console}</label></td>
<td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
<td><label for="rmp_controls">{$lang_media_controls}</label></td>
<td><label for="rmp_controls">{#media_dlg.controls}</label></td>
<td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="rmp_numloop">{$lang_media_numloop}</label></td>
<td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>
<td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
<td><label for="rmp_scriptcallbacks">{$lang_media_scriptcallbacks}</label></td>
<td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
<td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
</tr>
</table>
</fieldset>
<fieldset id="shockwave_options">
<legend>{$lang_media_shockwave_options}</legend>
<legend>{#media_dlg.shockwave_options}</legend>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="shockwave_swstretchstyle">{$lang_media_swstretchstyle}</label></td>
<td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
<td>
<select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
<option value="none">{$lang_not_set}</option>
<option value="none">{#not_set}</option>
<option value="meet">Meet</option>
<option value="fill">Fill</option>
<option value="stage">Stage</option>
</select>
</td>
<td><label for="shockwave_swvolume">{$lang_media_volume}</label></td>
<td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
<td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
</tr>
<tr>
<td><label for="shockwave_swstretchhalign">{$lang_media_swstretchhalign}</label></td>
<td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
<td>
<select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
<option value="none">{$lang_not_set}</option>
<option value="left">{$lang_media_align_left}</option>
<option value="center">{$lang_media_align_center}</option>
<option value="right">{$lang_media_align_right}</option>
<option value="none">{#not_set}</option>
<option value="left">{#media_dlg.align_left}</option>
<option value="center">{#media_dlg.align_center}</option>
<option value="right">{#media_dlg.align_right}</option>
</select>
</td>
<td><label for="shockwave_swstretchvalign">{$lang_media_swstretchvalign}</label></td>
<td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
<td>
<select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
<option value="none">{$lang_not_set}</option>
<option value="none">{#not_set}</option>
<option value="meet">Meet</option>
<option value="fill">Fill</option>
<option value="stage">Stage</option>
@ -669,7 +770,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
<td><label for="shockwave_autostart">{$lang_media_autostart}</label></td>
<td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
</tr>
</table>
</td>
@ -678,7 +779,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
<td><label for="shockwave_sound">{$lang_media_sound}</label></td>
<td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
</tr>
</table>
</td>
@ -690,7 +791,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
<td><label for="shockwave_swliveconnect">{$lang_media_liveconnect}</label></td>
<td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
</tr>
</table>
</td>
@ -699,7 +800,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
<td><label for="shockwave_progress">{$lang_media_progress}</label></td>
<td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
</tr>
</table>
</td>
@ -711,11 +812,11 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertMedia();" />
<input type="submit" id="insert" name="insert" value="{#insert}" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>

@ -1 +1 @@
tinyMCE.importPluginLanguagePack('nonbreaking');var TinyMCE_NonBreakingPlugin={getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"nonbreaking":return tinyMCE.getButtonHTML(cn,'lang_nonbreaking_desc','{$pluginurl}/images/nonbreaking.gif','mceNonBreaking',false)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),h;switch(command){case"mceNonBreaking":h=(inst.visualChars&&inst.visualChars.state)?'<span class="mceItemHiddenVisualChar">&middot;</span>':'&nbsp;';tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,h);return true}return false},handleEvent:function(e){var inst,h;if(!tinyMCE.isOpera&&e.type=='keydown'&&e.keyCode==9&&tinyMCE.getParam('nonbreaking_force_tab',false)){inst=tinyMCE.selectedInstance;h=(inst.visualChars&&inst.visualChars.state)?'<span class="mceItemHiddenVisualChar">&middot;&middot;&middot;</span>':'&nbsp;&nbsp;&nbsp;';tinyMCE.execInstanceCommand(inst.editorId,'mceInsertContent',false,h);tinyMCE.cancelEvent(e);return false}return true}};tinyMCE.addPlugin("nonbreaking",TinyMCE_NonBreakingPlugin);
(function(){tinymce.create('tinymce.plugins.Nonbreaking',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceNonBreaking',function(){ed.execCommand('mceInsertContent',false,(ed.plugins.visualchars&&ed.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':'&nbsp;');});ed.addButton('nonbreaking',{title:'nonbreaking.nonbreaking_desc',cmd:'mceNonBreaking'});if(ed.getParam('nonbreaking_force_tab')){ed.onKeyDown.add(function(ed,e){if(tinymce.isIE&&e.keyCode==9){ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');tinymce.dom.Event.cancel(e);}});}},getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('nonbreaking',tinymce.plugins.Nonbreaking);})();

@ -1,62 +1,50 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('nonbreaking');
var TinyMCE_NonBreakingPlugin = {
getInfo : function() {
return {
longname : 'Nonbreaking space',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
getControlHTML : function(cn) {
switch (cn) {
case "nonbreaking":
return tinyMCE.getButtonHTML(cn, 'lang_nonbreaking_desc', '{$pluginurl}/images/nonbreaking.gif', 'mceNonBreaking', false);
(function() {
tinymce.create('tinymce.plugins.Nonbreaking', {
init : function(ed, url) {
var t = this;
t.editor = ed;
// Register commands
ed.addCommand('mceNonBreaking', function() {
ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">&middot;</span>' : '&nbsp;');
});
// Register buttons
ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
if (ed.getParam('nonbreaking_force_tab')) {
ed.onKeyDown.add(function(ed, e) {
if (tinymce.isIE && e.keyCode == 9) {
ed.execCommand('mceNonBreaking');
ed.execCommand('mceNonBreaking');
ed.execCommand('mceNonBreaking');
tinymce.dom.Event.cancel(e);
}
});
}
},
getInfo : function() {
return {
longname : 'Nonbreaking space',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
return "";
},
// Private methods
});
execCommand : function(editor_id, element, command, user_interface, value) {
var inst = tinyMCE.getInstanceById(editor_id), h;
switch (command) {
case "mceNonBreaking":
h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;</span>' : '&nbsp;';
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, h);
return true;
}
return false;
},
handleEvent : function(e) {
var inst, h;
if (!tinyMCE.isOpera && e.type == 'keydown' && e.keyCode == 9 && tinyMCE.getParam('nonbreaking_force_tab', false)) {
inst = tinyMCE.selectedInstance;
h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;&middot;&middot;</span>' : '&nbsp;&nbsp;&nbsp;';
tinyMCE.execInstanceCommand(inst.editorId, 'mceInsertContent', false, h);
tinyMCE.cancelEvent(e);
return false;
}
return true;
}
};
tinyMCE.addPlugin("nonbreaking", TinyMCE_NonBreakingPlugin);
// Register plugin
tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

@ -1,5 +0,0 @@
// UK lang variables
tinyMCE.addToLang('nonbreaking',{
desc : 'Insert non-breaking space character'
});

@ -0,0 +1,22 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blank_page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/blank.css" rel="stylesheet" type="text/css" />
<base target="_self" />
<script type="text/javascript">
function init() {
if (parent.tinymce.isIE)
document.body.contentEditable = true;
else
document.designMode = 'on';
parent.initIframe(document);
window.focus();
}
</script>
</head>
<body onload="init();">
</body>
</html>

@ -0,0 +1,14 @@
html, body {height:98%}
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}

@ -0,0 +1,3 @@
.sourceIframe {
border: 1px solid #808080;
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,387 @@
/**
* $Id: editor_plugin_src.js 738 2008-03-20 20:00:48Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
var Event = tinymce.dom.Event;
tinymce.create('tinymce.plugins.PastePlugin', {
init : function(ed, url) {
var t = this;
t.editor = ed;
// Register commands
ed.addCommand('mcePasteText', function(ui, v) {
if (ui) {
if ((ed.getParam('paste_use_dialog', true)) || (!tinymce.isIE)) {
ed.windowManager.open({
file : url + '/pastetext.htm',
width : 450,
height : 400,
inline : 1
}, {
plugin_url : url
});
} else
t._insertText(clipboardData.getData("Text"), true);
} else
t._insertText(v.html, v.linebreaks);
});
ed.addCommand('mcePasteWord', function(ui, v) {
if (ui) {
if ((ed.getParam('paste_use_dialog', true)) || (!tinymce.isIE)) {
ed.windowManager.open({
file : url + '/pasteword.htm',
width : 450,
height : 400,
inline : 1
}, {
plugin_url : url
});
} else
t._insertText(t._clipboardHTML());
} else
t._insertWordContent(v);
});
ed.addCommand('mceSelectAll', function() {
ed.execCommand('selectall');
});
// Register buttons
ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText', ui : true});
ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord', ui : true});
ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'mceSelectAll'});
if (ed.getParam("paste_auto_cleanup_on_paste", false)) {
ed.onPaste.add(function(ed, e) {
return t._handlePasteEvent(e)
});
}
if (!tinymce.isIE && ed.getParam("paste_auto_cleanup_on_paste", false)) {
// Force paste dialog if non IE browser
ed.onKeyDown.add(function(ed, e) {
if (e.ctrlKey && e.keyCode == 86) {
window.setTimeout(function() {
ed.execCommand("mcePasteText", true);
}, 1);
Event.cancel(e);
}
});
}
},
getInfo : function() {
return {
longname : 'Paste text/word',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
_handlePasteEvent : function(e) {
var html = this._clipboardHTML(), ed = this.editor, sel = ed.selection, r;
// Removes italic, strong etc, the if was needed due to bug #1437114
if (ed && (r = sel.getRng()) && r.text.length > 0)
ed.execCommand('delete');
if (html && html.length > 0)
ed.execCommand('mcePasteWord', false, html);
return Event.cancel(e);
},
_insertText : function(content, bLinebreaks) {
if (content && content.length > 0) {
if (bLinebreaks) {
// Special paragraph treatment
if (this.editor.getParam("paste_create_paragraphs", true)) {
var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
for (var i=0; i<rl.length; i+=2)
content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
content = content.replace(/\r\n\r\n/g, '</p><p>');
content = content.replace(/\r\r/g, '</p><p>');
content = content.replace(/\n\n/g, '</p><p>');
// Has paragraphs
if ((pos = content.indexOf('</p><p>')) != -1) {
this.editor.execCommand("Delete");
var node = this.editor.selection.getNode();
// Get list of elements to break
var breakElms = [];
do {
if (node.nodeType == 1) {
// Don't break tables and break at body
if (node.nodeName == "TD" || node.nodeName == "BODY")
break;
breakElms[breakElms.length] = node;
}
} while(node = node.parentNode);
var before = "", after = "</p>";
before += content.substring(0, pos);
for (var i=0; i<breakElms.length; i++) {
before += "</" + breakElms[i].nodeName + ">";
after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
}
before += "<p>";
content = before + content.substring(pos+7) + after;
}
}
if (this.editor.getParam("paste_create_linebreaks", true)) {
content = content.replace(/\r\n/g, '<br />');
content = content.replace(/\r/g, '<br />');
content = content.replace(/\n/g, '<br />');
}
}
this.editor.execCommand("mceInsertRawHTML", false, content);
}
},
_insertWordContent : function(content) {
var t = this, ed = t.editor;
if (content && content.length > 0) {
// Cleanup Word content
var bull = String.fromCharCode(8226);
var middot = String.fromCharCode(183);
if (ed.getParam('paste_insert_word_content_callback'))
content = ed.execCallback('paste_insert_word_content_callback', 'before', content);
var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
for (var i=0; i<rl.length; i+=2)
content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>');
}
content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>");
content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list
content = content.replace(/<o:p><\/o:p>/gi, "");
content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks
content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); // Word comments
if (this.editor.getParam("paste_remove_spans", true))
content = content.replace(/<\/?span[^>]*>/gi, "");
if (this.editor.getParam("paste_remove_styles", true))
content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
content = content.replace(/<\/?font[^>]*>/gi, "");
// Strips class attributes.
switch (this.editor.getParam("paste_strip_class_attributes", "all")) {
case "all":
content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
break;
case "mso":
content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
break;
}
content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI());
content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<\\?\?xml[^>]*>/gi, "");
content = content.replace(/<\/?\w+:[^>]*>/gi, "");
content = content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi, ""); // Remove pagebreaks
content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
// content = content.replace(/\/?&nbsp;*/gi, ""); &nbsp;
// content = content.replace(/<p>&nbsp;<\/p>/gi, '');
if (!this.editor.getParam('force_p_newlines')) {
content = content.replace('', '' ,'gi');
content = content.replace('</p>', '<br /><br />' ,'gi');
}
if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) {
content = content.replace(/<\/?p[^>]*>/gi, "");
}
content = content.replace(/<\/?div[^>]*>/gi, "");
// Convert all middlot lists to UL lists
if (this.editor.getParam("paste_convert_middot_lists", true)) {
var div = ed.dom.create("div", null, content);
// Convert all middot paragraphs to li elements
var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList");
while (this._convertMiddots(div, "--list--")) ; // bull
while (this._convertMiddots(div, middot, className)) ; // Middot
while (this._convertMiddots(div, bull)) ; // bull
content = div.innerHTML;
}
// Replace all headers with strong and fix some other issues
if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
content = content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi, '<p>&nbsp;&nbsp;</p>');
content = content.replace(/<h[1-6]>/gi, '<p><b>');
content = content.replace(/<\/h[1-6]>/gi, '</b></p>');
content = content.replace(/<b>&nbsp;<\/b>/gi, '<b>&nbsp;&nbsp;</b>');
content = content.replace(/^(&nbsp;)*/gi, '');
}
content = content.replace(/--list--/gi, ""); // Remove --list--
if (ed.getParam('paste_insert_word_content_callback'))
content = ed.execCallback('paste_insert_word_content_callback', 'after', content);
// Insert cleaned content
this.editor.execCommand("mceInsertContent", false, content);
if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) {
var ed = this.editor;
window.setTimeout(function() {
ed.execCommand("mceCleanup");
}, 1); // Do normal cleanup detached from this thread
}
}
},
_reEscape : function(s) {
var l = "?.\\*[](){}+^$:";
var o = "";
for (var i=0; i<s.length; i++) {
var c = s.charAt(i);
if (l.indexOf(c) != -1)
o += '\\' + c;
else
o += c;
}
return o;
},
_convertMiddots : function(div, search, class_name) {
var ed = this.editor, mdot = String.fromCharCode(183), bull = String.fromCharCode(8226);
var nodes, prevul, i, p, ul, li, np, cp, li;
nodes = div.getElementsByTagName("p");
for (i=0; i<nodes.length; i++) {
p = nodes[i];
// Is middot
if (p.innerHTML.indexOf(search) == 0) {
ul = ed.dom.create("ul");
if (class_name)
ul.className = class_name;
// Add the first one
li = ed.dom.create("li");
li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
ul.appendChild(li);
// Add the rest
np = p.nextSibling;
while (np) {
// If the node is whitespace, then
// ignore it and continue on.
if (np.nodeType == 3 && new RegExp('^\\s$', 'm').test(np.nodeValue)) {
np = np.nextSibling;
continue;
}
if (search == mdot) {
if (np.nodeType == 1 && new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)) {
// Second level of nesting
if (!prevul) {
prevul = ul;
ul = ed.dom.create("ul");
prevul.appendChild(ul);
}
np.innerHTML = np.innerHTML.replace(/^o/, '');
} else {
// Pop the stack if we're going back up to the first level
if (prevul) {
ul = prevul;
prevul = null;
}
// Not element or middot paragraph
if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
break;
}
} else {
// Not element or middot paragraph
if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
break;
}
cp = np.nextSibling;
li = ed.dom.create("li");
li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
np.parentNode.removeChild(np);
ul.appendChild(li);
np = cp;
}
p.parentNode.replaceChild(ul, p);
return true;
}
}
return false;
},
_clipboardHTML : function() {
var div = document.getElementById('_TinyMCE_clipboardHTML');
if (!div) {
var div = document.createElement('DIV');
div.id = '_TinyMCE_clipboardHTML';
with (div.style) {
visibility = 'hidden';
overflow = 'hidden';
position = 'absolute';
width = 1;
height = 1;
}
document.body.appendChild(div);
}
div.innerHTML = '';
var rng = document.body.createTextRange();
rng.moveToElementText(div);
rng.execCommand('Paste');
var html = div.innerHTML;
div.innerHTML = '';
return html;
}
});
// Register plugin
tinymce.PluginManager.add('paste', tinymce.plugins.PastePlugin);
})();

@ -0,0 +1,42 @@
tinyMCEPopup.requireLangPack();
function saveContent() {
if (document.forms[0].htmlSource.value == '') {
tinyMCEPopup.close();
return false;
}
tinyMCEPopup.execCommand('mcePasteText', false, {
html : document.forms[0].htmlSource.value,
linebreaks : document.forms[0].linebreaks.checked
});
tinyMCEPopup.close();
}
function onLoadInit() {
tinyMCEPopup.resizeToInnerSize();
// Remove Gecko spellchecking
if (tinymce.isGecko)
document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
resizeInputs();
}
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function resizeInputs() {
if (!tinymce.isIE) {
wHeight = self.innerHeight-80;
wWidth = self.innerWidth-17;
} else {
wHeight = document.body.clientHeight-80;
wWidth = document.body.clientWidth-17;
}
document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
}
tinyMCEPopup.onInit.add(onLoadInit);

@ -0,0 +1,56 @@
tinyMCEPopup.requireLangPack();
function saveContent() {
var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
if (html == ''){
tinyMCEPopup.close();
return false;
}
tinyMCEPopup.execCommand('mcePasteWord', false, html);
tinyMCEPopup.close();
}
function onLoadInit() {
tinyMCEPopup.resizeToInnerSize();
// Fix for endless reloading in FF
window.setTimeout(createIFrame, 10);
}
function createIFrame() {
document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
}
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function initIframe(doc) {
var dir = tinyMCEPopup.editor.settings.directionality;
doc.body.dir = dir;
// Remove Gecko spellchecking
if (tinymce.isGecko)
doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
resizeInputs();
}
function resizeInputs() {
if (!tinymce.isIE) {
wHeight = self.innerHeight - 80;
wWidth = self.innerWidth - 18;
} else {
wHeight = document.body.clientHeight - 80;
wWidth = document.body.clientWidth - 18;
}
var elm = document.getElementById('frmData');
if (elm) {
elm.style.height = Math.abs(wHeight) + 'px';
elm.style.width = Math.abs(wWidth) + 'px';
}
}
tinyMCEPopup.onInit.add(onLoadInit);

@ -0,0 +1,5 @@
tinyMCE.addI18n('en.paste_dlg',{
text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
text_linebreaks:"Keep linebreaks",
word_title:"Use CTRL+V on your keyboard to paste the text into the window."
});

@ -0,0 +1,34 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#paste.paste_text_desc}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/pastetext.js"></script>
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();return false;" action="#">
<div style="float: left" class="title">{#paste.paste_text_desc}</div>
<div style="float: right">
<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
</div>
<br style="clear: both" />
<div>{#paste_dlg.text_title}</div>
<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
<div class="mceActionPanel">
<div style="float: left">
<input type="submit" name="insert" value="{#insert}" id="insert" />
</div>
<div style="float: right">
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
</div>
</div>
</form>
</body>
</html>

@ -0,0 +1,29 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#paste.paste_word_desc}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/pasteword.js"></script>
<link href="css/pasteword.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();" action="#">
<div class="title">{#paste.paste_word_desc}</div>
<div>{#paste_dlg.word_title}</div>
<div id="iframecontainer"></div>
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>
</body>
</html>

@ -1 +0,0 @@
This is the location you place TinyMCE plugins.

@ -1,20 +1,6 @@
/* stylesheet for advsearchreplace plugin*/
.panel_wrapper {height:85px;}
.panel_wrapper div.current {height:85px;}
.panel_wrapper { height: 85px; }
.panel_wrapper div.current { height: 85px; }
/* MS IE only styles */
* html .panel_wrapper { height: 100px; }
* html .panel_wrapper div.current { height: 100px; }
#replaceBtn, #replaceAllBtn {
padding-bottom: 2px;
font-weight: bold;
width: 90px;
height: 21px;
border: 0;
cursor: pointer;
}
#replaceBtn { background: url(../images/replace_button_bg.gif); }
#replaceAllBtn { background: url(../images/replace_all_button_bg.gif); }
/* IE */
* html .panel_wrapper {height:100px;}
* html .panel_wrapper div.current {height:100px;}

@ -1 +1 @@
tinyMCE.importPluginLanguagePack('searchreplace');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),selectedText=inst.selection.getSelectedText(),rng;function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key]}function replaceSel(search_str,str,back){if(!inst.selection.isCollapsed()){if(tinyMCE.isRealIE)inst.selection.getRng().duplicate().pasteHTML(str);else inst.execCommand('mceInsertContent',false,str)}}if(!value)value=[];defValue("editor_id",editor_id);defValue("searchstring",selectedText);defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");defValue("resizable","no");switch(command){case"mceSearch":if(user_interface){var template=new Array();template['file']='../../plugins/searchreplace/searchreplace.htm';template['width']=380;template['height']=155+(tinyMCE.isNS7?20:0)+(tinyMCE.isMSIE?15:0);template['width']+=tinyMCE.getLang('lang_searchreplace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_delta_height',0);inst.selection.collapse(true);tinyMCE.openWindow(template,value)}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;var awin=value.win,found;if(body.innerHTML==""){awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";}inst.selection.collapse(value['backwards']);if(tinyMCE.isMSIE){var rng=inst.selection.getRng();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){awin.alert('This operation is currently not supported by this browser.');return true}if(value['replacemode']=="all"){found=false;while(rng.findText(value['string'],value['backwards']?-1:1,flags)){found=true;rng.scrollIntoView();rng.select();replaceSel(value['string'],value['replacestring'],value['backwards'])}if(found)awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select()}else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'))}else{if(value['replacemode']=="all"){found=false;while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false)){found=true;replaceSel(value['string'],value['replacestring'],value['backwards'])}if(found)awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'))}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}return false}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})();

@ -1,173 +1,54 @@
/**
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
* $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
tinyMCE.importPluginLanguagePack('searchreplace');
var TinyMCE_SearchReplacePlugin = {
getInfo : function() {
return {
longname : 'Search/Replace',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
initInstance : function (inst) {
inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
// No CTRL+R for "replace" because browsers will reload page instead of executing plugin
},
getControlHTML : function (cn) {
switch (cn) {
case "search" :
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif','mceSearch', true);
case "replace" :
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
}
return "";
},
execCommand : function (editor_id, element, command, user_interface, value) {
var inst = tinyMCE.getInstanceById(editor_id), selectedText = inst.selection.getSelectedText(), rng;
function defValue(key, default_value) {
value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
}
function replaceSel(search_str, str, back) {
if (!inst.selection.isCollapsed()) {
if (tinyMCE.isRealIE)
inst.selection.getRng().duplicate().pasteHTML(str); // Needs to be duplicated due to selection bug in IE
else
inst.execCommand('mceInsertContent', false, str);
}
(function() {
tinymce.create('tinymce.plugins.SearchReplacePlugin', {
init : function(ed, url) {
function open(m) {
ed.windowManager.open({
file : url + '/searchreplace.htm',
width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
inline : 1,
auto_focus : 0
}, {
mode : m,
search_string : ed.selection.getContent({format : 'text'}),
plugin_url : url
});
};
// Register commands
ed.addCommand('mceSearch', function() {
open('search');
});
ed.addCommand('mceReplace', function() {
open('replace');
});
// Register buttons
ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
},
getInfo : function() {
return {
longname : 'Search/Replace',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
if (!value)
value = [];
defValue("editor_id", editor_id);
defValue("searchstring", selectedText);
defValue("replacestring", null);
defValue("replacemode", "none");
defValue("casesensitive", false);
defValue("backwards", false);
defValue("wrap", false);
defValue("wholeword", false);
defValue("inline", "yes");
defValue("resizable", "no");
switch (command) {
case "mceSearch" :
if (user_interface) {
var template = new Array();
template['file'] = '../../plugins/searchreplace/searchreplace.htm';
template['width'] = 380;
template['height'] = 155 + (tinyMCE.isNS7 ? 20 : 0) + (tinyMCE.isMSIE ? 15 : 0);
template['width'] += tinyMCE.getLang('lang_searchreplace_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_searchreplace_delta_height', 0);
inst.selection.collapse(true);
tinyMCE.openWindow(template, value);
} else {
var win = tinyMCE.getInstanceById(editor_id).contentWindow;
var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
var awin = value.win, found;
if (body.innerHTML == "") {
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
return true;
}
if (value['replacemode'] == "current") {
replaceSel(value['string'], value['replacestring'], value['backwards']);
value['replacemode'] = "none";
//tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value);
//return true;
}
inst.selection.collapse(value['backwards']);
if (tinyMCE.isMSIE) {
var rng = inst.selection.getRng();
var flags = 0;
if (value['wholeword'])
flags = flags | 2;
if (value['casesensitive'])
flags = flags | 4;
if (!rng.findText) {
awin.alert('This operation is currently not supported by this browser.');
return true;
}
if (value['replacemode'] == "all") {
found = false;
while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
found = true;
rng.scrollIntoView();
rng.select();
replaceSel(value['string'], value['replacestring'], value['backwards']);
}
if (found)
awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
else
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
return true;
}
if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
rng.scrollIntoView();
rng.select();
} else
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
} else {
if (value['replacemode'] == "all") {
found = false;
while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) {
found = true;
replaceSel(value['string'], value['replacestring'], value['backwards']);
}
if (found)
awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
else
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
return true;
}
if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
}
}
return true;
case "mceSearchReplace" :
value['replacestring'] = "";
tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
return true;
}
return false;
}
};
tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);
// Register plugin
tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

@ -0,0 +1,117 @@
tinyMCEPopup.requireLangPack();
var SearchReplaceDialog = {
init : function(ed) {
var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
this.switchMode(m);
f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
// Focus input field
f[m + '_panel_searchstring'].focus();
},
switchMode : function(m) {
var f, lm = this.lastMode;
if (lm != m) {
f = document.forms[0];
if (lm) {
f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
}
mcTabs.displayTab(m + '_tab', m + '_panel');
document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
this.lastMode = m;
}
},
searchNext : function(a) {
var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
// Get input
f = document.forms[0];
s = f[m + '_panel_searchstring'].value;
b = f[m + '_panel_backwardsu'].checked;
ca = f[m + '_panel_casesensitivebox'].checked;
rs = f['replace_panel_replacestring'].value;
function fix() {
// Correct Firefox graphics glitches
r = se.getRng().cloneRange();
ed.getDoc().execCommand('SelectAll', false, null);
se.setRng(r);
};
function replace() {
if (tinymce.isIE)
ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
else
ed.getDoc().execCommand('InsertHTML', false, rs);
};
// IE flags
if (ca)
fl = fl | 4;
switch (a) {
case 'all':
if (tinymce.isIE) {
while (r.findText(s, b ? -1 : 1, fl)) {
r.scrollIntoView();
r.select();
replace();
fo = 1;
}
tinyMCEPopup.storeSelection();
} else {
while (w.find(s, ca, b, false, false, false, false)) {
replace();
fo = 1;
}
}
if (fo)
wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
else
wm.alert(ed.getLang('searchreplace_dlg.notfound'));
return;
case 'current':
replace();
break;
}
se.collapse(b);
r = se.getRng();
// Whats the point
if (!s)
return;
if (tinymce.isIE) {
if (r.findText(s, b ? -1 : 1, fl)) {
r.scrollIntoView();
r.select();
} else
wm.alert(ed.getLang('searchreplace_dlg.notfound'));
tinyMCEPopup.storeSelection();
} else {
if (!w.find(s, ca, b, false, false, false, false))
wm.alert(ed.getLang('searchreplace_dlg.notfound'));
else
fix();
}
}
};
tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);

@ -1,86 +0,0 @@
function init() {
tinyMCEPopup.resizeToInnerSize();
// start with appropiate tab
var task = (tinyMCE.getWindowArg("replacestring") != null) ? "replace" : "search";
mcTabs.displayTab(task + '_tab', task +'_panel');
manageReplaceButtons();
var formObj = document.forms[0];
formObj[task + "_panel_searchstring"].value = tinyMCE.getWindowArg("searchstring");
formObj["replace_panel_replacestring"].value = (tinyMCE.getWindowArg("replacestring") != null) ? tinyMCE.getWindowArg("replacestring") : "";
formObj[task + "_panel_casesensitivebox"].checked = tinyMCE.getWindowArg("casesensitive");
formObj[task + "_panel_backwardsu"].checked = tinyMCE.getWindowArg("backwards");
formObj[task + "_panel_backwardsd"].checked = !tinyMCE.getWindowArg("backwards");
}
function searchNext(replacemode) {
// "search" or "replace" mode of operation?
var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
var formObj = document.forms[0];
if (task == "replace") {
// Whats the point?
if (formObj[task + "_panel_searchstring"].value == "" || formObj[task + "_panel_searchstring"].value == formObj[task + "_panel_replacestring"].value)
return false;
}
// Do search
tinyMCEPopup.execCommand('mceSearch', false, {
string : formObj[task + "_panel_searchstring"].value,
replacestring : formObj["replace_panel_replacestring"].value,
replacemode : replacemode,
casesensitive : formObj[task + "_panel_casesensitivebox"].checked,
backwards : formObj[task + "_panel_backwardsu"].checked,
win : window
}, false);
window.focus();
return false;
}
function cancelAction() {
tinyMCEPopup.close();
}
function manageReplaceButtons() {
// "search" or "replace" mode of operation?
var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
document.getElementById("replace_buttons").style.visibility = (task == "replace") ? "visible" : "hidden";
}
function copyValues(link) {
// check if tab is already active
var tab = link;
while (tab.tagName && tab.tagName.toLowerCase() != "li") tab = tab.parentNode;
if (tab.className) return false; // tab is already active -> no need to copy any values!
// copy values from one panel to the other (if they exist there)
var from_panel_name = tab.id.match(/^search/i) ? "replace_panel" : "search_panel";
var to_panel_name = (from_panel_name == "search_panel") ? "replace_panel" : "search_panel";
// find all elements with IDs to copy their values
var elms = document.getElementById(from_panel_name).getElementsByTagName("*");
for (var i = 0; i < elms.length; i++) {
if (elms[i].id && elms[i].id != "") {
var checked = "undefined";
if (elms[i].type.toLowerCase() == "checkbox" || elms[i].type.toLowerCase() == "radio")
checked = elms[i].checked;
// copy values if element exists in other panel
var to_elm_name = to_panel_name + elms[i].id.substring(from_panel_name.length, elms[i].id.length);
var to_elm = document.getElementById(to_elm_name);
if (to_elm) {
if (checked != "undefined")
to_elm.checked = checked;
else
to_elm.value = elms[i].value;
}
}
}
return false;
}

@ -1,21 +0,0 @@
// UK lang variables
tinyMCE.addToLang('',{
searchreplace_search_desc : 'Find',
searchreplace_searchnext_desc : 'Find again',
searchreplace_replace_desc : 'Find/Replace',
searchreplace_notfound : 'The search has been completed. The search string could not be found.',
searchreplace_search_title : 'Find',
searchreplace_replace_title : 'Find/Replace',
searchreplace_allreplaced : 'All occurrences of the search string were replaced.',
searchreplace_findwhat : 'Find what',
searchreplace_replacewith : 'Replace with',
searchreplace_direction : 'Direction',
searchreplace_up : 'Up',
searchreplace_down : 'Down',
searchreplace_case : 'Match case',
searchreplace_findnext : 'Find&nbsp;next',
searchreplace_replace : 'Replace',
searchreplace_replaceall : 'Replace&nbsp;all',
searchreplace_cancel : 'Cancel'
});

@ -0,0 +1,16 @@
tinyMCE.addI18n('en.searchreplace_dlg',{
searchnext_desc:"Find again",
notfound:"The search has been completed. The search string could not be found.",
search_title:"Find",
replace_title:"Find/Replace",
allreplaced:"All occurrences of the search string were replaced.",
findwhat:"Find what",
replacewith:"Replace with",
direction:"Direction",
up:"Up",
down:"Down",
mcase:"Match case",
findnext:"Find next",
replace:"Replace",
replaceall:"Replace all"
});

@ -1 +0,0 @@
Check the TinyMCE documentation for details on this plugin.

@ -1,39 +1,39 @@
<!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>{$lang_searchreplace_replace_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/searchreplace.js"></script>
<title>{#searchreplace_dlg.replace_title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="js/searchreplace.js"></script>
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
<form onsubmit="return false;" action="#">
<body style="display:none;">
<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
<div class="tabs">
<ul>
<li id="search_tab"><span><a href="javascript:mcTabs.displayTab('search_tab','search_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_search_desc}</a></span></li>
<li id="replace_tab"><span><a href="javascript:mcTabs.displayTab('replace_tab','replace_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_replace}</a></span></li>
<li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
<li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<div id="search_panel" class="panel">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><label for="search_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
<td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" class="direction">
<tr>
<td><label>{$lang_searchreplace_direction}</label></td>
<td><label>{#searchreplace_dlg.direction}</label></td>
<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
<td><label for="search_panel_backwardsu">{$lang_searchreplace_up}</label></td>
<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" /></td>
<td><label for="search_panel_backwardsd">{$lang_searchreplace_down}</label></td>
<td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
<td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
</tr>
</table>
</td>
@ -43,7 +43,7 @@
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
<td><label for="search_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
<td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
</tr>
</table>
</td>
@ -54,22 +54,22 @@
<div id="replace_panel" class="panel">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><label for="replace_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
<td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
</tr>
<tr>
<td><label for="replace_panel_replacestring">{$lang_searchreplace_replacewith}</label></td>
<td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" class="direction">
<tr>
<td><label>{$lang_searchreplace_direction}</label></td>
<td><label>{#searchreplace_dlg.direction}</label></td>
<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
<td><label for="replace_panel_backwardsu">{$lang_searchreplace_up}</label></td>
<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" /></td>
<td><label for="replace_panel_backwardsd">{$lang_searchreplace_down}</label></td>
<td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
<td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
</tr>
</table>
</td>
@ -79,7 +79,7 @@
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
<td><label for="replace_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
<td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
</tr>
</table>
</td>
@ -91,15 +91,13 @@
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" />
<span id="replace_buttons">
<input type="button" id="replaceBtn" name="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" />
<input type="button" id="replaceAllBtn" name="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');;" />
</span>
<input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{$lang_searchreplace_cancel}" onclick="tinyMCEPopup.close();" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>

@ -1,11 +0,0 @@
Version 1.0.2 (2006-08-02)
Added new spellchecker_report_mispellings option, contributed by Jeremy B.
Fixed various regexp bugs and issues. Some where contributed by Jeremy B.
Fixed the Google speller class so it uses curl, patch contributed by Yuriy Kramar.
Fixed encoding issues with language specific characters, patch contributed by codepit.
Fixed bug where the spellchecker wasn't working in MSIE if the editor was placed in a P tag.
Version 1.0.1 (2006-05-05)
Since sourceforge has a serious bug when it comes to replacing files with the same name this release was necessary.
Goggle spellchecker class was added.
Version 1.0 (2006-05-03)
Official first release.

@ -1,107 +0,0 @@
<?php
/* *
* Tiny Spelling Interface for TinyMCE Spell Checking.
*
* Copyright © 2006 Moxiecode Systems AB
*/
class TinyGoogleSpell {
var $lang;
var $spellurl;
function TinyGoogleSpell(& $config, $lang, $mode, $spelling, $jargon, $encoding) {
$this->lang = $lang;
$this->spellurl = $config['googlespell.url'];
}
// Returns array with bad words or false if failed.
function checkWords($word_array) {
$words = array ();
$wordstr = implode(' ', $word_array);
$matches = $this->_getMatches($wordstr);
for ($i = 0; $i < count($matches); $i++)
$words[] = $this->unhtmlentities(mb_substr($wordstr, $matches[$i][1], $matches[$i][2], "UTF-8"));
return $words;
}
function unhtmlentities($string) {
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}
// Returns array with suggestions or false if failed.
function getSuggestion($word) {
$sug = array ();
$matches = $this->_getMatches($word);
if (count($matches) > 0)
$sug = explode("\t", utf8_encode($this->unhtmlentities($matches[0][4])));
return $sug;
}
function _xmlChars($string) {
$trans = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
foreach ($trans as $k => $v)
$trans[$k] = "&#" . ord($k) . ";";
return strtr($string, $trans);
}
function _getMatches($word_list) {
$url = $this->spellurl . "&" . $this->lang;
$path = preg_replace("/^https?:\/\//i", "", $url);
// Setup XML request
$xml = '<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>' . $word_list . '</text></spellrequest>';
$header = "POST " . $path . " HTTP/1.0 \r\n";
$header .= "MIME-Version: 1.0 \r\n";
$header .= "Content-type: application/PTI26 \r\n";
$header .= "Content-length: " . strlen($xml) . " \r\n";
$header .= "Content-transfer-encoding: text \r\n";
$header .= "Request-number: 1 \r\n";
$header .= "Document-type: Request \r\n";
$header .= "Interface-Version: Test 1.4 \r\n";
$header .= "Connection: close \r\n\r\n";
$header .= $xml;
//$this->_debugData($xml);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$xml = curl_exec($ch);
curl_close($ch);
//$this->_debugData($xml);
// Grab and parse content
preg_match_all('/<c o="([^"]*)" l="([^"]*)" s="([^"]*)">([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER);
return $matches;
}
function _debugData($data) {
$fh = @ fopen("debug.log", 'a+');
@ fwrite($fh, $data);
@ fclose($fh);
}
}
// Setup classname, should be the same as the name of the spellchecker class
$spellCheckerConfig['class'] = "TinyGoogleSpell";
?>

@ -1,64 +0,0 @@
<?php
/* *
* Tiny Spelling Interface for TinyMCE Spell Checking.
*
* Copyright © 2006 Moxiecode Systems AB
*
*/
class TinyPSpell {
var $lang;
var $mode;
var $string;
var $plink;
var $errorMsg;
var $jargon;
var $spelling;
var $encoding;
function TinyPSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
$this->lang = $lang;
$this->mode = $mode;
$this->plink = false;
$this->errorMsg = array();
if (!function_exists("pspell_new")) {
$this->errorMsg[] = "PSpell not found.";
return;
}
$this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode);
}
// Returns array with bad words or false if failed.
function checkWords($wordArray) {
if (!$this->plink) {
$this->errorMsg[] = "No PSpell link found for checkWords.";
return array();
}
$wordError = array();
foreach($wordArray as $word) {
if(!pspell_check($this->plink, trim($word)))
$wordError[] = $word;
}
return $wordError;
}
// Returns array with suggestions or false if failed.
function getSuggestion($word) {
if (!$this->plink) {
$this->errorMsg[] = "No PSpell link found for getSuggestion.";
return array();
}
return pspell_suggest($this->plink, $word);
}
}
// Setup classname, should be the same as the name of the spellchecker class
$spellCheckerConfig['class'] = "TinyPspell";
?>

@ -1,121 +0,0 @@
<?php
/* *
* Tiny Spelling Interface for TinyMCE Spell Checking.
*
* Copyright © 2006 Moxiecode Systems AB
*
*/
class TinyPspellShell {
var $lang;
var $mode;
var $string;
var $error;
var $errorMsg;
var $cmd;
var $tmpfile;
var $jargon;
var $spelling;
var $encoding;
function TinyPspellShell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
$this->lang = $lang;
$this->mode = $mode;
$this->error = false;
$this->errorMsg = array();
$this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell");
if(preg_match("#win#i",php_uname()))
$this->cmd = $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang." --encoding=utf-8 -H < $this->tmpfile 2>&1";
else
$this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --encoding=utf-8 -H --lang=". $this->lang;
}
// Returns array with bad words or false if failed.
function checkWords($wordArray) {
if ($fh = fopen($this->tmpfile, "w")) {
fwrite($fh, "!\n");
foreach($wordArray as $key => $value)
fwrite($fh, "^" . $value . "\n");
fclose($fh);
} else {
$this->errorMsg[] = "PSpell not found.";
return array();
}
$data = shell_exec($this->cmd);
@unlink($this->tmpfile);
$returnData = array();
$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
foreach($dataArr as $dstr) {
$matches = array();
// Skip this line.
if (strpos($dstr, "@") === 0)
continue;
preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches);
if (!empty($matches[1]))
$returnData[] = $matches[1];
}
return $returnData;
}
// Returns array with suggestions or false if failed.
function getSuggestion($word) {
if (function_exists("mb_convert_encoding"))
$word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8"));
else
$word = utf8_encode($word);
if ($fh = fopen($this->tmpfile, "w")) {
fwrite($fh, "!\n");
fwrite($fh, "^$word\n");
fclose($fh);
} else
die("Error opening tmp file.");
$data = shell_exec($this->cmd);
@unlink($this->tmpfile);
$returnData = array();
$dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
foreach($dataArr as $dstr) {
$matches = array();
// Skip this line.
if (strpos($dstr, "@") === 0)
continue;
preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches);
if (!empty($matches[1])) {
// For some reason, the exec version seems to add commas?
$returnData[] = str_replace(",", "", $matches[1]);
}
}
return $returnData;
}
function _debugData($data) {
$fh = @fopen("debug.log", 'a+');
@fwrite($fh, $data);
@fclose($fh);
}
}
// Setup classname, should be the same as the name of the spellchecker class
$spellCheckerConfig['class'] = "TinyPspellShell";
?>

@ -1,26 +0,0 @@
<?php
$spellCheckerConfig = array();
// Spellchecker class use
// require_once("classes/TinyPspellShell.class.php"); // Command line pspell
require_once("classes/TinyGoogleSpell.class.php"); // Google web service
// require_once("classes/TinyPspell.class.php"); // Internal PHP version
// General settings
$spellCheckerConfig['enabled'] = true;
// Default settings
$spellCheckerConfig['default.language'] = 'en';
$spellCheckerConfig['default.mode'] = PSPELL_FAST;
// Normaly not required to configure
$spellCheckerConfig['default.spelling'] = "";
$spellCheckerConfig['default.jargon'] = "";
$spellCheckerConfig['default.encoding'] = "";
// Pspell shell specific settings
$spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell';
$spellCheckerConfig['tinypspellshell.tmp'] = '/tmp';
$spellCheckerConfig['googlespell.url'] = 'https://www.google.com/tbproxy/spell?hl=en'
?>

@ -1,5 +1 @@
.mceItemHiddenSpellWord {
background: url('../images/wline.gif') repeat-x bottom left;
bo2rder-bottom: 1px dashed red;
cursor: default;
}
.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}

@ -1,34 +0,0 @@
.mceMsgBox {
border: 1px solid gray;
padding: 8px;
}
.mceMsgBox span {
vertical-align: top;
color: #555555;
}
/* Misc */
.mceBlockBox {
display: none;
position: absolute;
left: 0;
top: 0;
z-index: 100;
filter:progid:DXImageTransform.Microsoft.Alpha(style=0, opacity=60);
-moz-opacity:0.6;
opacity: 0.6;
background-color: white;
}
.mceMsgBox {
display: none;
z-index: 101;
position: absolute;
left: 0;
top: 0;
font-family: Arial, Verdana, Tahoma, Helvetica;
font-weight: bold;
font-size: 11px;
}

File diff suppressed because one or more lines are too long

@ -1,588 +1,338 @@
/**
* $Id: editor_plugin_src.js 28 2006-08-01 16:02:56Z spocke $
* $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
tinyMCE.importPluginLanguagePack('spellchecker', 'en,fr,sv,nn,nb');
// Plucin static class
var TinyMCE_SpellCheckerPlugin = {
_contextMenu : new TinyMCE_Menu(),
_menu : new TinyMCE_Menu(),
_counter : 0,
_ajaxPage : '/tinyspell.php',
getInfo : function() {
return {
longname : 'Spellchecker',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_spellchecker.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
handleEvent : function(e) {
var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
var inst = tinyMCE.selectedInstance, args = '';
var self = TinyMCE_SpellCheckerPlugin;
var cm = self._contextMenu;
var p, p2, x, y, sx, sy, h, elm;
// Handle click on word
if ((e.type == "click" || e.type == "contextmenu") && elm) {
do {
if (tinyMCE.getAttrib(elm, 'class') == "mceItemHiddenSpellWord") {
inst.spellCheckerElm = elm;
// Setup arguments
args += 'id=' + inst.editorId + "|" + (++self._counter);
args += '&cmd=suggest&check=' + encodeURIComponent(elm.innerHTML);
args += '&lang=' + escape(inst.spellCheckerLang);
elm = inst.spellCheckerElm;
p = tinyMCE.getAbsPosition(inst.iframeElement);
p2 = tinyMCE.getAbsPosition(elm);
h = parseInt(elm.offsetHeight);
sx = inst.getBody().scrollLeft;
sy = inst.getBody().scrollTop;
x = p.absLeft + p2.absLeft - sx;
y = p.absTop + p2.absTop - sy + h;
cm.clear();
cm.addTitle(tinyMCE.getLang('lang_spellchecker_wait', '', true));
cm.show();
cm.moveTo(x, y);
inst.selection.selectNode(elm, false, false);
self._sendAjax(self.baseURL + self._ajaxPage, self._ajaxResponse, 'post', args);
tinyMCE.cancelEvent(e);
return false;
(function() {
var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = 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(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() {
if (ed.settings.content_css !== false)
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;
}
} while ((elm = elm.parentNode));
}
return true;
},
initInstance : function(inst) {
var self = TinyMCE_SpellCheckerPlugin, m = self._menu, cm = self._contextMenu, e;
tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/spellchecker/css/content.css");
if (!tinyMCE.hasMenu('spellcheckercontextmenu')) {
tinyMCE.importCSS(document, tinyMCE.baseURL + "/plugins/spellchecker/css/spellchecker.css");
cm.init({drop_menu : false});
tinyMCE.addMenu('spellcheckercontextmenu', cm);
}
if (!tinyMCE.hasMenu('spellcheckermenu')) {
m.init({});
tinyMCE.addMenu('spellcheckermenu', m);
}
inst.spellCheckerLang = 'en';
self._buildSettingsMenu(inst, null);
e = self._getBlockBoxLayer(inst).create('div', 'mceBlockBox', document.getElementById(inst.editorId + '_parent'));
self._getMsgBoxLayer(inst).create('div', 'mceMsgBox', document.getElementById(inst.editorId + '_parent'));
},
_getMsgBoxLayer : function(inst) {
if (!inst.spellCheckerMsgBoxL)
inst.spellCheckerMsgBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerMsgBox', false);
return inst.spellCheckerMsgBoxL;
},
t.languages[k] = v;
});
},
_getBlockBoxLayer : function(inst) {
if (!inst.spellCheckerBoxL)
inst.spellCheckerBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerBlockBox', false);
createControl : function(n, cm) {
var t = this, c, ed = t.editor;
return inst.spellCheckerBoxL;
},
if (n == 'spellchecker') {
c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});
_buildSettingsMenu : function(inst, lang) {
var i, ar = tinyMCE.getParam('spellchecker_languages', '+English=en').split(','), p;
var self = TinyMCE_SpellCheckerPlugin, m = self._menu, c;
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;
m.clear();
m.addTitle(tinyMCE.getLang('lang_spellchecker_langs', '', true));
o.onclick = function() {
mi.setSelected(1);
t.selectedItem.setSelected(0);
t.selectedItem = mi;
t.selectedLang = v;
};
for (i=0; i<ar.length; i++) {
if (ar[i] != '') {
p = ar[i].split('=');
c = 'mceMenuCheckItem';
o.title = k;
mi = m.add(o);
mi.setSelected(v == t.selectedLang);
if (p[0].charAt(0) == '+') {
p[0] = p[0].substring(1);
if (v == t.selectedLang)
t.selectedItem = mi;
})
});
if (lang == null) {
c = 'mceMenuSelectedItem';
inst.spellCheckerLang = p[1];
}
}
if (lang == p[1])
c = 'mceMenuSelectedItem';
m.add({text : p[0], js : "tinyMCE.execInstanceCommand('" + inst.editorId + "','mceSpellCheckerSetLang',false,'" + p[1] + "');", class_name : c});
return c;
}
}
},
setupContent : function(editor_id, body, doc) {
TinyMCE_SpellCheckerPlugin._removeWords(doc);
},
getControlHTML : function(cn) {
switch (cn) {
case "spellchecker":
return TinyMCE_SpellCheckerPlugin._getMenuButtonHTML(cn, 'lang_spellchecker_desc', '{$pluginurl}/images/spellchecker.gif', 'lang_spellchecker_desc', 'mceSpellCheckerMenu', 'mceSpellCheck');
}
return "";
},
/**
* Returns the HTML code for a normal button control.
*
* @param {string} id Button control id, this will be the suffix for the element id, the prefix is the editor id.
* @param {string} lang Language variable key name to insert as the title/alt of the button image.
* @param {string} img Image URL to insert, {$themeurl} and {$pluginurl} will be replaced.
* @param {string} mlang Language variable key name to insert as the title/alt of the menu button image.
* @param {string} mid Menu by id to display when the menu button is pressed.
* @param {string} cmd Command to execute when the user clicks the button.
* @param {string} ui Optional user interface boolean for command.
* @param {string} val Optional value for command.
* @return HTML code for a normal button based in input information.
* @type string
*/
_getMenuButtonHTML : function(id, lang, img, mlang, mid, cmd, ui, val) {
var h = '', m, x;
cmd = 'tinyMCE.hideMenus();tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\'';
if (typeof(ui) != "undefined" && ui != null)
cmd += ',' + ui;
if (typeof(val) != "undefined" && val != null)
cmd += ",'" + val + "'";
cmd += ');';
// Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled
if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isMSIE || tinyMCE.isOpera) && (m = tinyMCE.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) {
// Tiled button
x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20);
h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceTiledButton mceButtonNormal" target="_self">';
h += '<img src="{$themeurl}/images/spacer.gif" style="background-position: ' + x + 'px 0" title="{$' + lang + '}" />';
h += '<img src="{$themeurl}/images/button_menu.gif" title="{$' + lang + '}" class="mceMenuButton" onclick="' + mcmd + 'return false;" />';
h += '</a>';
} else {
if (tinyMCE.isMSIE && !tinyMCE.isOpera)
h += '<span id="{$editor_id}_' + id + '" class="mceMenuButton" onmouseover="tinyMCE.plugins.spellchecker._menuButtonEvent(\'over\',this);" onmouseout="tinyMCE.plugins.spellchecker._menuButtonEvent(\'out\',this);">';
else
h += '<span id="{$editor_id}_' + id + '" class="mceMenuButton">';
h += '<a href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceMenuButtonNormal" target="_self">';
h += '<img src="' + img + '" title="{$' + lang + '}" /></a>';
h += '<a href="#" onclick="tinyMCE.plugins.spellchecker._toggleMenu(\'{$editor_id}\',\'' + mid + '\');return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$' + lang + '}" class="mceMenuButton" />';
h += '</a></span>';
}
return h;
},
_menuButtonEvent : function(e, o) {
if (o.className == 'mceMenuButtonFocus')
return;
if (e == 'over')
o.className = o.className + ' mceMenuHover';
else
o.className = o.className.replace(/\s.*$/, '');
},
},
_toggleMenu : function(editor_id, id) {
var self = TinyMCE_SpellCheckerPlugin;
var e = document.getElementById(editor_id + '_spellchecker');
var inst = tinyMCE.getInstanceById(editor_id);
// Internal functions
if (self._menu.isVisible()) {
tinyMCE.hideMenus();
return;
}
tinyMCE.lastMenuBtnClass = e.className.replace(/\s.*$/, '');
tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonFocus');
self._menu.moveRelativeTo(e, 'bl');
self._menu.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? 0 : 1, -1);
if (tinyMCE.isOpera)
self._menu.moveBy(0, -2);
self._onMenuEvent(inst, self._menu, 'show');
self._menu.show();
tinyMCE.lastSelectedMenuBtn = editor_id + '_spellchecker';
},
_walk : function(n, f) {
var d = this.editor.getDoc(), w;
_onMenuEvent : function(inst, m, n) {
TinyMCE_SpellCheckerPlugin._buildSettingsMenu(inst, inst.spellCheckerLang);
},
if (d.createTreeWalker) {
w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
execCommand : function(editor_id, element, command, user_interface, value) {
var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_SpellCheckerPlugin, args = '', co, bb, mb, nl, i, e;
while ((n = w.nextNode()) != null)
f.call(this, n);
} else
tinymce.walk(n, f, 'childNodes');
},
// Handle commands
switch (command) {
case "mceSpellCheck":
if (!inst.spellcheckerOn) {
inst.spellCheckerBookmark = inst.selection.getBookmark();
_getSeparators : function() {
var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');
// Setup arguments
args += 'id=' + inst.editorId + "|" + (++self._counter);
args += '&cmd=spell&check=' + encodeURIComponent(self._getWordList(inst.getBody())).replace( /\'/g, '%27' );
args += '&lang=' + escape(inst.spellCheckerLang);
// Build word separator regexp
for (i=0; i<str.length; i++)
re += '\\' + str.charAt(i);
co = document.getElementById(inst.editorId + '_parent').firstChild;
bb = self._getBlockBoxLayer(inst);
bb.moveRelativeTo(co, 'tl');
bb.resizeTo(co.offsetWidth, co.offsetHeight);
bb.show();
return re;
},
// Setup message box
mb = self._getMsgBoxLayer(inst);
e = mb.getElement();
e.innerHTML = '<span>' + tinyMCE.getLang('lang_spellchecker_swait', '', true) + '</span>';
mb.show();
mb.moveRelativeTo(co, 'cc');
_getWords : function() {
var ed = this.editor, wl = [], tx = '', lo = {};
if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
nl = co.getElementsByTagName('select');
for (i=0; i<nl.length; i++)
nl[i].disabled = true;
}
// Get area text
this._walk(ed.getBody(), function(n) {
if (n.nodeType == 3)
tx += n.nodeValue + ' ';
});
inst.spellcheckerOn = true;
tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonSelected');
// Split words by separator
tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');
tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));
self._sendAjax(self.baseURL + self._ajaxPage, self._ajaxResponse, 'post', args);
} else {
self._removeWords(inst.getDoc());
inst.spellcheckerOn = false;
tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButton');
// Build word array and remove duplicates
each(tx.split(' '), function(v) {
if (!lo[v]) {
wl.push(v);
lo[v] = 1;
}
});
return true;
case "mceSpellCheckReplace":
if (inst.spellCheckerElm)
tinyMCE.setOuterHTML(inst.spellCheckerElm, value);
self._checkDone(inst);
self._contextMenu.hide();
self._menu.hide();
return true;
case "mceSpellCheckIgnore":
if (inst.spellCheckerElm)
self._removeWord(inst.spellCheckerElm);
self._checkDone(inst);
self._contextMenu.hide();
self._menu.hide();
return true;
case "mceSpellCheckIgnoreAll":
if (inst.spellCheckerElm)
self._removeWords(inst.getDoc(), inst.spellCheckerElm.innerHTML);
self._checkDone(inst);
self._contextMenu.hide();
self._menu.hide();
return true;
case "mceSpellCheckerSetLang":
tinyMCE.hideMenus();
inst.spellCheckerLang = value;
self._removeWords(inst.getDoc());
inst.spellcheckerOn = false;
tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButton');
return true;
}
// Pass to next handler in chain
return false;
},
cleanup : function(type, content, inst) {
switch (type) {
case "get_from_editor_dom":
TinyMCE_SpellCheckerPlugin._removeWords(content);
inst.spellcheckerOn = false;
break;
}
return content;
},
// Private plugin specific methods
_displayUI : function(inst) {
var self = TinyMCE_SpellCheckerPlugin;
var bb = self._getBlockBoxLayer(inst);
var mb = self._getMsgBoxLayer(inst);
var nl, i;
var co = document.getElementById(inst.editorId + '_parent').firstChild;
if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
nl = co.getElementsByTagName('select');
for (i=0; i<nl.length; i++)
nl[i].disabled = false;
}
bb.hide();
mb.hide();
},
_ajaxResponse : function(xml) {
var el = xml ? xml.documentElement : null;
var inst = tinyMCE.selectedInstance, self = TinyMCE_SpellCheckerPlugin;
var cmd = el ? el.getAttribute("cmd") : null, err, id = el ? el.getAttribute("id") : null;
return wl;
},
if (id)
inst = tinyMCE.getInstanceById(id.substring(0, id.indexOf('|')));
_removeWords : function(w) {
var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark();
self._displayUI(inst);
// Ignore suggestions for other ajax responses
if (cmd == "suggest" && id != inst.editorId + "|" + self._counter)
return;
if (!el) {
inst.spellcheckerOn = false;
tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton');
alert("Could not execute AJAX call, server didn't return valid a XML.");
return;
}
err = el.getAttribute("error");
if (err == "true") {
inst.spellcheckerOn = false;
tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton');
alert(el.getAttribute("msg"));
return;
}
switch (cmd) {
case "spell":
if (xml.documentElement.firstChild) {
self._markWords(inst.getDoc(), inst.getBody(), decodeURIComponent(el.firstChild.nodeValue).split('+'));
inst.selection.moveToBookmark(inst.spellCheckerBookmark);
if(tinyMCE.getParam('spellchecker_report_mispellings', false))
alert(tinyMCE.getLang('lang_spellchecker_mpell_found', '', true, {words : self._countWords(inst)}));
} else
alert(tinyMCE.getLang('lang_spellchecker_no_mpell', '', true));
self._checkDone(inst);
break;
case "suggest":
self._buildMenu(el.firstChild ? decodeURIComponent(el.firstChild.nodeValue).split('+') : null, 10);
self._contextMenu.show();
break;
}
},
_getWordSeparators : function() {
var i, re = '', ch = tinyMCE.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');
for (i=0; i<ch.length; i++)
re += '\\' + ch.charAt(i);
return re;
},
_getWordList : function(n) {
var i, x, s, nv = '', nl = tinyMCE.getNodeTree(n, new Array(), 3), wl = new Array();
var re = TinyMCE_SpellCheckerPlugin._getWordSeparators();
for (i=0; i<nl.length; i++) {
if (!new RegExp('/SCRIPT|STYLE/').test(nl[i].parentNode.nodeName))
nv += nl[i].nodeValue + " ";
}
nv = nv.replace(new RegExp('([0-9]|[' + re + '])', 'g'), ' ');
nv = tinyMCE.trim(nv.replace(/(\s+)/g, ' '));
nl = nv.split(/\s+/);
for (i=0; i<nl.length; i++) {
s = false;
for (x=0; x<wl.length; x++) {
if (wl[x] == nl[i]) {
s = true;
break;
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);
}
}
if (!s && nl[i].length > 0)
wl[wl.length] = nl[i];
}
});
return wl.join(' ');
},
se.moveToBookmark(b);
},
_removeWords : function(doc, word) {
var i, c, nl = doc.getElementsByTagName("span");
var self = TinyMCE_SpellCheckerPlugin;
var inst = tinyMCE.selectedInstance, b = inst ? inst.selection.getBookmark() : null;
_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();
word = typeof(word) == 'undefined' ? null : word;
for (i=nl.length-1; i>=0; i--) {
c = tinyMCE.getAttrib(nl[i], 'class');
if ((c == 'mceItemHiddenSpellWord' || c == 'mceItemHidden') && (word == null || nl[i].innerHTML == word))
self._removeWord(nl[i]);
}
each(wl, function(v) {
w += (w ? '|' : '') + v;
});
if (b)
inst.selection.moveToBookmark(b);
},
_checkDone : function(inst) {
var self = TinyMCE_SpellCheckerPlugin;
var w = self._countWords(inst);
if (w == 0) {
self._removeWords(inst.getDoc());
inst.spellcheckerOn = false;
tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton');
}
},
_countWords : function(inst) {
var i, w = 0, nl = inst.getDoc().getElementsByTagName("span"), c;
var self = TinyMCE_SpellCheckerPlugin;
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');
for (i=nl.length-1; i>=0; i--) {
c = tinyMCE.getAttrib(nl[i], 'class');
// Collect all text nodes
this._walk(this.editor.getBody(), function(n) {
if (n.nodeType == 3) {
nl.push(n);
}
});
if (c == 'mceItemHiddenSpellWord')
w++;
}
// Wrap incorrect words in spans
each(nl, function(n) {
var v;
return w;
},
if (n.nodeType == 3) {
v = n.nodeValue;
_removeWord : function(e) {
if (e != null)
tinyMCE.setOuterHTML(e, e.innerHTML);
},
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');
_markWords : function(doc, n, wl) {
var i, nv, nn, nl = tinyMCE.getNodeTree(n, new Array(), 3);
var r1, r2, r3, r4, r5, w = '';
var re = TinyMCE_SpellCheckerPlugin._getWordSeparators();
dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n);
}
}
});
for (i=0; i<wl.length; i++) {
if (wl[i].length > 0)
w += wl[i] + ((i == wl.length-1) ? '' : '|');
}
se.moveToBookmark(b);
},
for (i=0; i<nl.length; i++) {
nv = nl[i].nodeValue;
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');
_showMenu : function(ed, e) {
var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin());
if (r1.test(nv) || r2.test(nv) || r3.test(nv) || r4.test(nv)) {
nv = tinyMCE.xmlEncode(nv);
nv = nv.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');
nv = nv.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');
if (!m) {
p1 = DOM.getPos(ed.getContentAreaContainer());
//p2 = DOM.getPos(ed.getContainer());
nn = doc.createElement('span');
nn.className = "mceItemHidden";
nn.innerHTML = nv;
m = ed.controlManager.createDropMenu('spellcheckermenu', {
offset_x : p1.x,
offset_y : p1.y,
'class' : 'mceNoIcons'
});
// Remove old text node
nl[i].parentNode.replaceChild(nn, nl[i]);
t._menu = m;
}
}
},
_buildMenu : function(sg, max) {
var i, self = TinyMCE_SpellCheckerPlugin, cm = self._contextMenu;
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.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;
}
});
cm.clear();
if (!o)
t._done();
},
if (sg != null) {
cm.addTitle(tinyMCE.getLang('lang_spellchecker_sug', '', true));
_done : function() {
var t = this, la = t.active;
for (i=0; i<sg.length && i<max; i++)
cm.addItem(sg[i], 'tinyMCE.execCommand("mceSpellCheckReplace",false,"' + sg[i] + '");');
if (t.active) {
t.active = 0;
t._removeWords();
cm.addSeparator();
} else
cm.addTitle(tinyMCE.getLang('lang_spellchecker_no_sug', '', true));
if (t._menu)
t._menu.hideMenu();
cm.addItem(tinyMCE.getLang('lang_spellchecker_ignore_word', '', true), 'tinyMCE.execCommand(\'mceSpellCheckIgnore\');');
cm.addItem(tinyMCE.getLang('lang_spellchecker_ignore_words', '', true), 'tinyMCE.execCommand(\'mceSpellCheckIgnoreAll\');');
if (la)
t.editor.nodeChanged();
}
},
cm.update();
},
_sendRPC : function(m, p, cb) {
var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}");
_getAjaxHTTP : function() {
try {
return new ActiveXObject('Msxml2.XMLHTTP')
} catch (e) {
try {
return new ActiveXObject('Microsoft.XMLHTTP')
} catch (e) {
return new XMLHttpRequest();
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));
}
});
}
},
/**
* Perform AJAX call.
*
* @param {string} u URL of AJAX service.
* @param {function} f Function to call when response arrives.
* @param {string} m Request method post or get.
* @param {Array} a Array with arguments to send.
*/
_sendAjax : function(u, f, m, a) {
var x = TinyMCE_SpellCheckerPlugin._getAjaxHTTP();
x.open(m, u, true);
x.onreadystatechange = function() {
if (x.readyState == 4)
f(x.responseXML);
};
if (m == 'post')
x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
x.send(a);
}
};
// Register plugin
tinyMCE.addPlugin('spellchecker', TinyMCE_SpellCheckerPlugin);
});
// Register plugin
tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

@ -1,15 +0,0 @@
// UK lang variables
tinyMCE.addToLang('spellchecker',{
desc : 'Toggle spellchecker',
menu : 'Spellchecker settings',
ignore_word : 'Ignore word',
ignore_words : 'Ignore all',
langs : 'Languages',
wait : 'Please wait...',
swait : 'Spellchecking, please wait...',
sug : 'Suggestions',
no_sug : 'No suggestions',
no_mpell : 'No misspellings found.',
mpell_found : 'Found {$words} misspellings.'
});

@ -1,142 +0,0 @@
<?php
/**
* $RCSfile: tinyspell.php,v $
* $Revision: 1.1 $
* $Date: 2006/03/14 17:33:47 $
*
* @author Moxiecode
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
// Ignore the Notice errors for now.
error_reporting(E_ALL ^ E_NOTICE);
require_once("config.php");
$id = sanitize($_POST['id'], "loose");
if (!$spellCheckerConfig['enabled']) {
header('Content-type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8" ?><res id="' . $id . '" error="true" msg="You must enable the spellchecker by modifying the config.php file." />';
die;
}
// Basic config
$defaultLanguage = $spellCheckerConfig['default.language'];
$defaultMode = $spellCheckerConfig['default.mode'];
// Normaly not required to configure
$defaultSpelling = $spellCheckerConfig['default.spelling'];
$defaultJargon = $spellCheckerConfig['default.jargon'];
$defaultEncoding = $spellCheckerConfig['default.encoding'];
$outputType = "xml"; // Do not change
// Get input parameters.
$check = urldecode($_REQUEST['check']);
$cmd = sanitize($_REQUEST['cmd']);
$lang = sanitize($_REQUEST['lang'], "strict");
$mode = sanitize($_REQUEST['mode'], "strict");
$spelling = sanitize($_REQUEST['spelling'], "strict");
$jargon = sanitize($_REQUEST['jargon'], "strict");
$encoding = sanitize($_REQUEST['encoding'], "strict");
$sg = sanitize($_REQUEST['sg'], "bool");
$words = array();
$validRequest = true;
if (empty($check))
$validRequest = false;
if (empty($lang))
$lang = $defaultLanguage;
if (empty($mode))
$mode = $defaultMode;
if (empty($spelling))
$spelling = $defaultSpelling;
if (empty($jargon))
$jargon = $defaultJargon;
if (empty($encoding))
$encoding = $defaultEncoding;
function sanitize($str, $type="strict") {
switch ($type) {
case "strict":
$str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str);
break;
case "loose":
$str = preg_replace("/</i", "&gt;", $str);
$str = preg_replace("/>/i", "&lt;", $str);
break;
case "bool":
if ($str == "true" || $str == true)
$str = true;
else
$str = false;
break;
}
return $str;
}
$result = array();
$tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding);
if (count($tinyspell->errorMsg) == 0) {
switch($cmd) {
case "spell":
// Space for non-exec version and \n for the exec version.
$words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY);
$result = $tinyspell->checkWords($words);
break;
case "suggest":
$result = $tinyspell->getSuggestion($check);
break;
default:
// Just use this for now.
$tinyspell->errorMsg[] = "No command.";
$outputType = $outputType . "error";
break;
}
} else
$outputType = $outputType . "error";
if (!$result)
$result = array();
// Output data
switch($outputType) {
case "xml":
header('Content-type: text/xml; charset=utf-8');
$body = '<?xml version="1.0" encoding="utf-8" ?>';
$body .= "\n";
if (count($result) == 0)
$body .= '<res id="' . $id . '" cmd="'. $cmd .'" />';
else
$body .= '<res id="' . $id . '" cmd="'. $cmd .'">'. urlencode(implode(" ", $result)) .'</res>';
echo $body;
break;
case "xmlerror";
header('Content-type: text/xml; charset=utf-8');
$body = '<?xml version="1.0" encoding="utf-8" ?>';
$body .= "\n";
$body .= '<res id="' . $id . '" cmd="'. $cmd .'" error="true" msg="'. implode(" ", $tinyspell->errorMsg) .'" />';
echo $body;
break;
case "html":
var_dump($result);
break;
case "htmlerror":
echo "Error";
break;
}
?>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save