Commit 055e9a80 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files
parents 89b5df05 ac6d1aca
// Expects strings array
function get_string(s) {
// @todo Still need to sprintf these strings.
var flatargs = flattenArguments(arguments);
if (arguments.length > 1) {
argstr = '(' + flatargs.slice(1).join(',') + ')';
} else {
argstr = '';
}
if (typeof(strings) == 'undefined' || typeof(strings[s]) == 'undefined') {
return '[[[' + s + argstr + ']]]';
}
return strings[s] + argstr;
}
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode: "textareas",
theme: "advanced",
plugins: "table,emotions,iespell,inlinepopups",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,fontselect,fontsizeselect,separator,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "link,unlink,separator,tablecontrols,separator,hr,emotions,iespell,cleanup,separator,cut,copy,paste",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"
});
</script>
\ No newline at end of file
function displayMessage(m) {
var color = 'red';
if (m.type == 'ok') {
color = 'green';
}
else if (m.type == 'info') {
color = '#aa6;';
}
var elemid = 'messages';
if (arguments.length > 1 && typeof(arguments[1]) == 'string') {
elemid = arguments[1];
}
$(elemid).appendChild(DIV({'style':'color:'+color+';'},m.message));
}
<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>
// 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.'
});
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.
This diff is collapsed.
input.radio {
border: 1px none #000000;
background-color: transparent;
vertical-align: middle;
}
.panel_wrapper div.current {
height: 80px;
}
#width {
width: 50px;
vertical-align: middle;
}
#width2 {
width: 50px;
vertical-align: middle;
}
#size {
width: 100px;
}
tinyMCE.importPluginLanguagePack('advhr');var TinyMCE_AdvancedHRPlugin={getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"advhr":return tinyMCE.getButtonHTML(cn,'lang_insert_advhr_desc','{$pluginurl}/images/advhr.gif','mceAdvancedHr')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvancedHr":var template=new Array();template['file']='../../plugins/advhr/rule.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_advhr_delta_width',0);template['height']+=tinyMCE.getLang('lang_advhr_delta_height',0);var size="",width="",noshade="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="hr"){tinyMCE.hrElement=tinyMCE.selectedElement;if(tinyMCE.hrElement){size=tinyMCE.hrElement.getAttribute('size')?tinyMCE.hrElement.getAttribute('size'):"";width=tinyMCE.hrElement.getAttribute('width')?tinyMCE.hrElement.getAttribute('width'):"";noshade=tinyMCE.hrElement.getAttribute('noshade')?tinyMCE.hrElement.getAttribute('noshade'):""}tinyMCE.openWindow(template,{editor_id:editor_id,size:size,width:width,noshade:noshade,mceDo:'update'})}else{if(tinyMCE.isMSIE){tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,'<hr />')}else{tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",size:size,width:width,noshade:noshade,mceDo:'insert'})}}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="HR"){tinyMCE.switchClass(editor_id+'_advhr','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advhr','mceButtonNormal');return true}};tinyMCE.addPlugin("advhr",TinyMCE_AdvancedHRPlugin);
\ No newline at end of file
/**
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('advhr');
var TinyMCE_AdvancedHRPlugin = {
getInfo : function() {
return {
longname : 'Advanced HR',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
}
},
getControlHTML : function(cn) {
switch (cn) {
case "advhr":
return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');
}
return "";
},
/**
* Executes the mceAdvanceHr command.
*/
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceAdvancedHr":
var template = new Array();
template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
template['width'] = 250;
template['height'] = 160;
template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
var size = "", width = "", noshade = "";
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {
tinyMCE.hrElement = tinyMCE.selectedElement;
if (tinyMCE.hrElement) {
size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
}
tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
} else {
if (tinyMCE.isMSIE) {
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
} else {
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
}
}
return true;
}
// Pass to next handler in chain
return false;
},
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
if (node == null)
return;
do {
if (node.nodeName == "HR") {
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');
return true;
}
} while ((node = node.parentNode));
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');
return true;
}
};
tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);
function init() {
tinyMCEPopup.resizeToInnerSize();
var formObj = document.forms[0];
formObj.width.value = tinyMCE.getWindowArg('width');
formObj.size.value = tinyMCE.getWindowArg('size');
formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true);
if (tinyMCE.getWindowArg('noshade')) {
formObj.noshade.checked = true;
}
if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
formObj.width2.value = "%";
formObj.width.value = formObj.width.value.substring(0,formObj.width.value.length-1);
}
}
function insertHR() {
var formObj = document.forms[0];
var width = formObj.width.value;
var size = formObj.size.value;
var html = '<hr';
if (size!='' && size!=0) {
html += ' size="' + size + '"';
}
if (width!='' && width!=0) {
html += ' width="' + width;
if (formObj.width2.value=='%') {
html += '%';
}
html += '"';
}
if (formObj.noshade.checked==true) {
html += ' noshade="noshade"';
}
html += ' />';
tinyMCEPopup.execCommand("mceInsertContent", true, html);
tinyMCEPopup.close();
}
function cancelAction() {
tinyMCEPopup.close();
}
// UK lang variables
tinyMCE.addToLang('',{
insert_advhr_desc : 'Horizontale rule',
insert_advhr_width : 'Width',
insert_advhr_size : 'Height',
insert_advhr_noshade : 'No shadow'
});
Check the TinyMCE documentation for details on this plugin.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_insert_advhr_desc}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/rule.js"></script>
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');">
<form onsubmit="insertHR();return false;" action="#">
<div class="tabs">
<ul>
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_advhr_desc}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
<div id="general_panel" class="panel current">
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td><label for="width">{$lang_insert_advhr_width}</label></td>
<td nowrap="nowrap">
<input id="width" name="width" type="text" value="" />
<select name="width2" id="width2">
<option value="">px</option>
<option value="%">%</option>
</select>
</td>
</tr>
<tr>
<td><label for="size">{$lang_insert_advhr_size}</label></td>
<td><select id="size" name="size">
<option value="">Normal</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td>
</tr>
<tr>
<td><label for="noshade">{$lang_insert_advhr_noshade}</label></td>
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
</tr>
</table>
</div>
</div>
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertHR();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>
</body>
</html>
/* CSS file for advimage plugin popup */
.mceImageList {
width: 280px;
}
.mceActionPanel {
margin-top: 7px;
}
.alignPreview {
border: 1px solid black;
width: 140px;
height: 140px;
overflow: hidden;
padding: 5px;
}
.checkbox {
border: 0;
}
.panel_wrapper div.current {
height: 305px;
}
#prev {
margin: 0;
border: 1px
solid black;
width: 99%;
height: 150px;
overflow: auto;
}
#align, #classlist {
width: 150px;
}
#width, #height {
vertical-align: middle;
width: 50px;
text-align: center;
}
#vspace, #hspace, #border {
vertical-align: middle;
width: 30px;
text-align: center;
}
#classlist {
width: 180px;
}
input {
width: 280px;
}
#constrain, #onmousemovecheck {
width: auto;
}
#id, #dir, #lang, #usemap, #longdesc {
width: 200px;
}
tinyMCE.importPluginLanguagePack('advimage');var TinyMCE_AdvancedImagePlugin={getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advimage.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"image":return tinyMCE.getButtonHTML(cn,'lang_image_desc','{$themeurl}/images/image.gif','mceAdvImage')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvImage":var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_advimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_advimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1)return true;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":var imgs=content.getElementsByTagName("img"),src,i;for(i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseover',"this.src='"+src+"';")}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseout',"this.src='"+src+"';")}}break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseover',"this.src='"+src+"';")}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseout',"this.src='"+src+"';")}}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"&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_advimage','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advimage','mceButtonNormal');return true},_getImageSrc:function(s){var sr,p=-1;if(!s)return"";if((p=s.indexOf('this.src='))!=-1){sr=s.substring(p+10);sr=sr.substring(0,sr.indexOf('\''));return sr}return""}};tinyMCE.addPlugin("advimage",TinyMCE_AdvancedImagePlugin);
\ No newline at end of file
/**
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
*
* @author Moxiecode
* @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('advimage');
var TinyMCE_AdvancedImagePlugin = {
getInfo : function() {
return {
longname : 'Advanced image',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advimage.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
getControlHTML : function(cn) {
switch (cn) {
case "image":
return tinyMCE.getButtonHTML(cn, 'lang_image_desc', '{$themeurl}/images/image.gif', 'mceAdvImage');
}
return "";
},
execCommand : function(editor_id, element, command, user_interface, value) {
switch (command) {
case "mceAdvImage":
var template = new Array();
template['file'] = '../../plugins/advimage/image.htm';
template['width'] = 480;
template['height'] = 380;
// Language specific width and height addons
template['width'] += tinyMCE.getLang('lang_advimage_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0);
var inst = tinyMCE.getInstanceById(editor_id);
var elm = inst.getFocusElement();
if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
return true;
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
return true;
}
return false;
},
cleanup : function(type, content) {
switch (type) {
case "insert_to_editor_dom":
var imgs = content.getElementsByTagName("img"), src, i;
for (i=0; i<imgs.length; i++) {
var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
if ((src = this._getImageSrc(onmouseover)) != "") {
if (tinyMCE.getParam('convert_urls'))
src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
}
if ((src = this._getImageSrc(onmouseout)) != "") {
if (tinyMCE.getParam('convert_urls'))
src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
}
}
break;
case "get_from_editor_dom":
var imgs = content.getElementsByTagName("img");
for (var i=0; i<imgs.length; i++) {
var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
if ((src = this._getImageSrc(onmouseover)) != "") {
if (tinyMCE.getParam('convert_urls'))
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
}
if ((src = this._getImageSrc(onmouseout)) != "") {
if (tinyMCE.getParam('convert_urls'))
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
}
}
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" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonSelected');
return true;
}
} while ((node = node.parentNode));
tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonNormal');
return true;
},
/**
* Returns the image src from a scripted mouse over image str.
*
* @param {string} s String to get real src from.
* @return Image src from a scripted mouse over image str.
* @type string
*/
_getImageSrc : function(s) {
var sr, p = -1;
if (!s)
return "";
if ((p = s.indexOf('this.src=')) != -1) {
sr = s.substring(p + 10);
sr = sr.substring(0, sr.indexOf('\''));
return sr;
}
return "";
}
};
tinyMCE.addPlugin("advimage", TinyMCE_AdvancedImagePlugin);
<html xmlns="http://www.w3.org/1999/xhtml">
<head>