Feature #43259 » 0001-Convert-jstoolbar-to-ES-Module.patch
| app/assets/javascripts/jstoolbar/common_mark.js | ||
|---|---|---|
|
/**
|
||
|
* This file is part of DotClear.
|
||
|
* Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All rights reserved.
|
||
|
* This code is released under the GNU General Public License.
|
||
|
*
|
||
|
* Modified by JP LANG for common_mark formatting
|
||
|
*/
|
||
|
// strong
|
||
|
jsToolBar.prototype.elements.strong = {
|
||
|
type: 'button',
|
||
|
title: 'Strong',
|
||
|
shortcut: 'b',
|
||
|
fn: {
|
||
|
wiki: function() { this.singleTag('**') }
|
||
|
}
|
||
|
}
|
||
|
// em
|
||
|
jsToolBar.prototype.elements.em = {
|
||
|
type: 'button',
|
||
|
title: 'Italic',
|
||
|
shortcut: 'i',
|
||
|
fn: {
|
||
|
wiki: function() { this.singleTag("*") }
|
||
|
}
|
||
|
}
|
||
|
// u
|
||
|
jsToolBar.prototype.elements.ins = {
|
||
|
type: 'button',
|
||
|
title: 'Underline',
|
||
|
shortcut: 'u',
|
||
|
fn: {
|
||
|
wiki: function() { this.singleTag('<u>', '</u>') }
|
||
|
}
|
||
|
}
|
||
|
// del
|
||
|
jsToolBar.prototype.elements.del = {
|
||
|
type: 'button',
|
||
|
title: 'Deleted',
|
||
|
fn: {
|
||
|
wiki: function() { this.singleTag('~~') }
|
||
|
}
|
||
|
}
|
||
|
// code
|
||
|
jsToolBar.prototype.elements.code = {
|
||
|
type: 'button',
|
||
|
title: 'Code',
|
||
|
fn: {
|
||
|
wiki: function() { this.singleTag('`') }
|
||
|
}
|
||
|
}
|
||
|
// spacer
|
||
|
jsToolBar.prototype.elements.space1 = {type: 'space'}
|
||
|
// headings
|
||
|
jsToolBar.prototype.elements.h1 = {
|
||
|
type: 'button',
|
||
|
title: 'Heading 1',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('# ', '',function(str) {
|
||
|
str = str.replace(/^#+\s+/, '')
|
||
|
return str;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
jsToolBar.prototype.elements.h2 = {
|
||
|
type: 'button',
|
||
|
title: 'Heading 2',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('## ', '',function(str) {
|
||
|
str = str.replace(/^#+\s+/, '')
|
||
|
return str;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
jsToolBar.prototype.elements.h3 = {
|
||
|
type: 'button',
|
||
|
title: 'Heading 3',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('### ', '',function(str) {
|
||
|
str = str.replace(/^#+\s+/, '')
|
||
|
return str;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// spacer
|
||
|
jsToolBar.prototype.elements.space2 = {type: 'space'}
|
||
|
// ul
|
||
|
jsToolBar.prototype.elements.ul = {
|
||
|
type: 'button',
|
||
|
title: 'Unordered list',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('','',function(str) {
|
||
|
str = str.replace(/\r/g,'');
|
||
|
return str.replace(/(\n|^)[#-]?\s*/g,"$1* ");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// ol
|
||
|
jsToolBar.prototype.elements.ol = {
|
||
|
type: 'button',
|
||
|
title: 'Ordered list',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('','',function(str) {
|
||
|
str = str.replace(/\r/g,'');
|
||
|
return str.replace(/(\n|^)[*-]?\s*/g,"$11. ");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// tl
|
||
|
jsToolBar.prototype.elements.tl = {
|
||
|
type: 'button',
|
||
|
title: 'Task list',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('','',function(str) {
|
||
|
str = str.replace(/\r/g,'');
|
||
|
return str.replace(/(\n|^)[*-]?\s*/g,"$1* [ ] ");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// spacer
|
||
|
jsToolBar.prototype.elements.space3 = {type: 'space'}
|
||
|
// bq
|
||
|
jsToolBar.prototype.elements.bq = {
|
||
|
type: 'button',
|
||
|
title: 'Quote',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('','',function(str) {
|
||
|
str = str.replace(/\r/g,'');
|
||
|
return str.replace(/(\n|^)( *)([^\n]*)/g,"$1> $2$3");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// unbq
|
||
|
jsToolBar.prototype.elements.unbq = {
|
||
|
type: 'button',
|
||
|
title: 'Unquote',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
this.encloseLineSelection('','',function(str) {
|
||
|
str = str.replace(/\r/g,'');
|
||
|
return str.replace(/(\n|^) *(> ?)?( *)([^\n]*)/g,"$1$3$4");
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// table
|
||
|
jsToolBar.prototype.elements.table = {
|
||
|
type: 'button',
|
||
|
title: 'Table',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
var This = this;
|
||
|
this.tableMenu(function(cols, rowCount){
|
||
|
This.encloseLineSelection(
|
||
|
'|'+cols.join(' |')+' |\n' + // header
|
||
|
Array(cols.length+1).join('|--')+'|\n' + // second line
|
||
|
Array(rowCount+1).join(Array(cols.length+1).join('| ')+'|\n') // cells
|
||
|
);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// pre
|
||
|
jsToolBar.prototype.elements.pre = {
|
||
|
type: 'button',
|
||
|
title: 'Preformatted text',
|
||
|
fn: {
|
||
|
wiki: function() { this.encloseLineSelection('```\n', '\n```') }
|
||
|
}
|
||
|
}
|
||
|
// Code highlighting
|
||
|
jsToolBar.prototype.elements.precode = {
|
||
|
type: 'button',
|
||
|
title: 'Highlighted code',
|
||
|
fn: {
|
||
|
wiki: function() {
|
||
|
var This = this;
|
||
|
this.precodeMenu(function(lang){
|
||
|
This.encloseLineSelection('``` ' + lang + '\n', '\n```\n');
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// spacer
|
||
|
jsToolBar.prototype.elements.space4 = {type: 'space'}
|
||
|
// wiki page
|
||
|
jsToolBar.prototype.elements.link = {
|
||
|
type: 'button',
|
||
|
title: 'Wiki link',
|
||
|
fn: {
|
||
|
wiki: function() { this.encloseSelection("[[", "]]") }
|
||
|
}
|
||
|
}
|
||
|
// image
|
||
|
jsToolBar.prototype.elements.img = {
|
||
|
type: 'button',
|
||
|
title: 'Image',
|
||
|
fn: {
|
||
|
wiki: function() { this.encloseSelection("") }
|
||
|
}
|
||
|
}
|
||
|
// spacer
|
||
|
jsToolBar.prototype.elements.space5 = {type: 'space'}
|
||
|
// help
|
||
|
jsToolBar.prototype.elements.help = {
|
||
|
type: 'button',
|
||
|
title: 'Help',
|
||
|
fn: {
|
||
|
wiki: function() { window.open(this.help_link, '', 'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes') }
|
||
|
}
|
||
|
}
|
||
| app/assets/javascripts/jstoolbar/jstoolbar.js | ||
|---|---|---|
|
/**
|
||
|
* This file is part of DotClear.
|
||
|
* Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All rights reserved.
|
||
|
* This code is released under the GNU General Public License.
|
||
|
*
|
||
|
* Modified by JP LANG for multiple text formatting
|
||
|
*/
|
||
|
let lastJstPreviewed = null;
|
||
|
const isMac = Boolean(navigator.platform.toLowerCase().match(/mac/));
|
||
|
function jsToolBar(textarea) {
|
||
|
if (!document.createElement) { return; }
|
||
|
if (!textarea) { return; }
|
||
|
if ((typeof(document["selection"]) == "undefined")
|
||
|
&& (typeof(textarea["setSelectionRange"]) == "undefined")) {
|
||
|
return;
|
||
|
}
|
||
|
this.textarea = textarea;
|
||
|
this.toolbarBlock = document.createElement('div');
|
||
|
this.toolbarBlock.className = 'jstBlock';
|
||
|
this.textarea.parentNode.insertBefore(this.toolbarBlock, this.textarea);
|
||
|
this.editor = document.createElement('div');
|
||
|
this.editor.className = 'jstEditor';
|
||
|
this.preview = document.createElement('div');
|
||
|
this.preview.className = 'wiki wiki-preview hidden';
|
||
|
this.preview.setAttribute('id', 'preview_' + textarea.getAttribute('id'));
|
||
|
this.editor.appendChild(this.textarea);
|
||
|
this.editor.appendChild(this.preview);
|
||
|
this.tabsBlock = document.createElement('div');
|
||
|
this.tabsBlock.className = 'jstTabs tabs';
|
||
|
var This = this;
|
||
|
this.textarea.onkeydown = function(event) { This.keyboardShortcuts.call(This, event); };
|
||
|
this.editTab = new jsTab('Edit', true);
|
||
|
this.editTab.onclick = function(event) { This.hidePreview.call(This, event); return false; };
|
||
|
this.previewTab = new jsTab('Preview');
|
||
|
this.previewTab.onclick = function(event) { This.showPreview.call(This, event); return false; };
|
||
|
var elementsTab = document.createElement('li');
|
||
|
elementsTab.classList = 'tab-elements';
|
||
|
var tabs = document.createElement('ul');
|
||
|
tabs.appendChild(this.editTab);
|
||
|
tabs.appendChild(this.previewTab);
|
||
|
tabs.appendChild(elementsTab);
|
||
|
this.tabsBlock.appendChild(tabs);
|
||
|
this.toolbar = document.createElement("div");
|
||
|
this.toolbar.className = 'jstElements';
|
||
|
elementsTab.appendChild(this.toolbar);
|
||
|
this.toolbarBlock.appendChild(this.tabsBlock);
|
||
|
this.toolbarBlock.appendChild(this.editor);
|
||
|
// Dragable resizing
|
||
|
if (this.editor.addEventListener && navigator.appVersion.match(/\bMSIE\b/))
|
||
|
{
|
||
|
this.handle = document.createElement('div');
|
||
|
this.handle.className = 'jstHandle';
|
||
|
var dragStart = this.resizeDragStart;
|
||
|
var This = this;
|
||
|
this.handle.addEventListener('mousedown',function(event) { dragStart.call(This,event); },false);
|
||
|
// fix memory leak in Firefox (bug #241518)
|
||
|
window.addEventListener('unload',function() {
|
||
|
var del = This.handle.parentNode.removeChild(This.handle);
|
||
|
delete(This.handle);
|
||
|
},false);
|
||
|
this.editor.parentNode.insertBefore(this.handle,this.editor.nextSibling);
|
||
|
}
|
||
|
this.context = null;
|
||
|
this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni
|
||
|
// de raccourcis vers les éléments DOM correspondants aux outils.
|
||
|
}
|
||
|
function jsTab(name, selected) {
|
||
|
selected = selected || false;
|
||
|
if(typeof jsToolBar.strings == 'undefined') {
|
||
|
var tabName = name || null;
|
||
|
} else {
|
||
|
var tabName = jsToolBar.strings[name] || name || null;
|
||
|
}
|
||
|
var tab = document.createElement('li');
|
||
|
var link = document.createElement('a');
|
||
|
link.setAttribute('href', '#');
|
||
|
link.innerText = tabName;
|
||
|
link.className = 'tab-' + name.toLowerCase();
|
||
|
if (selected == true) {
|
||
|
link.classList.add('selected');
|
||
|
}
|
||
|
tab.appendChild(link)
|
||
|
return tab;
|
||
|
}
|
||
|
function jsButton(title, fn, scope, className) {
|
||
|
if(typeof jsToolBar.strings == 'undefined') {
|
||
|
this.title = title || null;
|
||
|
} else {
|
||
|
this.title = jsToolBar.strings[title] || title || null;
|
||
|
}
|
||
|
this.fn = fn || function(){};
|
||
|
this.scope = scope || null;
|
||
|
this.className = className || null;
|
||
|
}
|
||
|
jsButton.prototype.draw = function() {
|
||
|
if (!this.scope) return null;
|
||
|
var button = document.createElement('button');
|
||
|
button.setAttribute('type','button');
|
||
|
button.tabIndex = 200;
|
||
|
if (this.className) button.className = this.className;
|
||
|
button.title = this.title;
|
||
|
var span = document.createElement('span');
|
||
|
span.appendChild(document.createTextNode(this.title));
|
||
|
button.appendChild(span);
|
||
|
if (this.icon != undefined) {
|
||
|
button.style.backgroundImage = 'url('+this.icon+')';
|
||
|
}
|
||
|
if (typeof(this.fn) == 'function') {
|
||
|
var This = this;
|
||
|
button.onclick = function() { try { This.fn.apply(This.scope, arguments) } catch (e) {} return false; };
|
||
|
}
|
||
|
return button;
|
||
|
}
|
||
|
function jsSpace(className) {
|
||
|
this.className = className || null;
|
||
|
this.width = null;
|
||
|
}
|
||
|
jsSpace.prototype.draw = function() {
|
||
|
var span = document.createElement('span');
|
||
|
span.appendChild(document.createTextNode(String.fromCharCode(160)));
|
||
|
span.className = 'jstSpacer' + (this.className ? ' ' + this.className : '');
|
||
|
if (this.width) span.style.marginRight = this.width+'px';
|
||
|
return span;
|
||
|
}
|
||
|
function jsCombo(title, options, scope, fn, className) {
|
||
|
this.title = title || null;
|
||
|
this.options = options || null;
|
||
|
this.scope = scope || null;
|
||
|
this.fn = fn || function(){};
|
||
|
this.className = className || null;
|
||
|
}
|
||
|
jsCombo.prototype.draw = function() {
|
||
|
if (!this.scope || !this.options) return null;
|
||
|
var select = document.createElement('select');
|
||
|
if (this.className) select.className = className;
|
||
|
select.title = this.title;
|
||
|
for (var o in this.options) {
|
||
|
//var opt = this.options[o];
|
||
|
var option = document.createElement('option');
|
||
|
option.value = o;
|
||
|
option.appendChild(document.createTextNode(this.options[o]));
|
||
|
select.appendChild(option);
|
||
|
}
|
||
|
var This = this;
|
||
|
select.onchange = function() {
|
||
|
try {
|
||
|
This.fn.call(This.scope, this.value);
|
||
|
} catch (e) { alert(e); }
|
||
|
return false;
|
||
|
}
|
||
|
return select;
|
||
|
}
|
||
|
jsToolBar.prototype = {
|
||
|
base_url: '',
|
||
|
mode: 'wiki',
|
||
|
elements: {},
|
||
|
help_link: '',
|
||
|
shortcuts: {},
|
||
|
getMode: function() {
|
||
|
return this.mode;
|
||
|
},
|
||
|
setMode: function(mode) {
|
||
|
this.mode = mode || 'wiki';
|
||
|
},
|
||
|
switchMode: function(mode) {
|
||
|
mode = mode || 'wiki';
|
||
|
this.draw(mode);
|
||
|
},
|
||
|
setHelpLink: function(link) {
|
||
|
this.help_link = link;
|
||
|
},
|
||
|
setPreviewUrl: function(url) {
|
||
|
this.previewTab.firstChild.setAttribute('data-url', url);
|
||
|
},
|
||
|
button: function(toolName) {
|
||
|
var tool = this.elements[toolName];
|
||
|
if (typeof tool.fn[this.mode] != 'function') return null;
|
||
|
const className = 'jstb_' + toolName;
|
||
|
let title = tool.title
|
||
|
if (tool.hasOwnProperty('shortcut')) {
|
||
|
this.shortcuts[tool.shortcut] = className;
|
||
|
title = this.buttonTitleWithShortcut(tool.title, tool.shortcut)
|
||
|
}
|
||
|
var b = new jsButton(title, tool.fn[this.mode], this, className);
|
||
|
if (tool.icon != undefined) b.icon = tool.icon;
|
||
|
return b;
|
||
|
},
|
||
|
buttonTitleWithShortcut: function(title, shortcutKey) {
|
||
|
if(typeof jsToolBar.strings == 'undefined') {
|
||
|
var i18nTitle = title || null;
|
||
|
} else {
|
||
|
var i18nTitle = jsToolBar.strings[title] || title || null;
|
||
|
}
|
||
|
if (isMac) {
|
||
|
return i18nTitle + " (⌘" + shortcutKey.toUpperCase() + ")";
|
||
|
} else {
|
||
|
return i18nTitle + " (Ctrl+" + shortcutKey.toUpperCase() + ")";
|
||
|
}
|
||
|
},
|
||
|
space: function(toolName) {
|
||
|
var tool = new jsSpace(toolName)
|
||
|
if (this.elements[toolName].width !== undefined)
|
||
|
tool.width = this.elements[toolName].width;
|
||
|
return tool;
|
||
|
},
|
||
|
combo: function(toolName) {
|
||
|
var tool = this.elements[toolName];
|
||
|
var length = tool[this.mode].list.length;
|
||
|
if (typeof tool[this.mode].fn != 'function' || length == 0) {
|
||
|
return null;
|
||
|
} else {
|
||
|
var options = {};
|
||
|
for (var i=0; i < length; i++) {
|
||
|
var opt = tool[this.mode].list[i];
|
||
|
options[opt] = tool.options[opt];
|
||
|
}
|
||
|
return new jsCombo(tool.title, options, this, tool[this.mode].fn);
|
||
|
}
|
||
|
},
|
||
|
draw: function(mode) {
|
||
|
this.setMode(mode);
|
||
|
// Empty toolbar
|
||
|
while (this.toolbar.hasChildNodes()) {
|
||
|
this.toolbar.removeChild(this.toolbar.firstChild)
|
||
|
}
|
||
|
this.toolNodes = {}; // vide les raccourcis DOM/**/
|
||
|
// Draw toolbar elements
|
||
|
var b, tool, newTool;
|
||
|
for (var i in this.elements) {
|
||
|
b = this.elements[i];
|
||
|
var disabled =
|
||
|
b.type == undefined || b.type == ''
|
||
|
|| (b.disabled != undefined && b.disabled)
|
||
|
|| (b.context != undefined && b.context != null && b.context != this.context);
|
||
|
if (!disabled && typeof this[b.type] == 'function') {
|
||
|
tool = this[b.type](i);
|
||
|
if (tool) newTool = tool.draw();
|
||
|
if (newTool) {
|
||
|
this.toolNodes[i] = newTool; //mémorise l'accès DOM pour usage éventuel ultérieur
|
||
|
this.toolbar.appendChild(newTool);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
singleTag: function(stag,etag) {
|
||
|
stag = stag || null;
|
||
|
etag = etag || stag;
|
||
|
if (!stag || !etag) { return; }
|
||
|
this.encloseSelection(stag,etag);
|
||
|
},
|
||
|
encloseLineSelection: function(prefix, suffix, fn) {
|
||
|
this.textarea.focus();
|
||
|
prefix = prefix || '';
|
||
|
suffix = suffix || '';
|
||
|
var start, end, sel, scrollPos, subst, res;
|
||
|
if (typeof(document["selection"]) != "undefined") {
|
||
|
sel = document.selection.createRange().text;
|
||
|
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
|
||
|
start = this.textarea.selectionStart;
|
||
|
end = this.textarea.selectionEnd;
|
||
|
scrollPos = this.textarea.scrollTop;
|
||
|
// go to the start of the line
|
||
|
start = this.textarea.value.substring(0, start).replace(/[^\r\n]*$/g,'').length;
|
||
|
// go to the end of the line
|
||
|
end = this.textarea.value.length - this.textarea.value.substring(end, this.textarea.value.length).replace(/^[^\r\n]*/, '').length;
|
||
|
sel = this.textarea.value.substring(start, end);
|
||
|
}
|
||
|
if (sel.match(/ $/)) { // exclude ending space char, if any
|
||
|
sel = sel.substring(0, sel.length - 1);
|
||
|
suffix = suffix + " ";
|
||
|
}
|
||
|
if (typeof(fn) == 'function') {
|
||
|
res = (sel) ? fn.call(this,sel) : fn('');
|
||
|
} else {
|
||
|
res = (sel) ? sel : '';
|
||
|
}
|
||
|
subst = prefix + res + suffix;
|
||
|
if (typeof(document["selection"]) != "undefined") {
|
||
|
document.selection.createRange().text = subst;
|
||
|
var range = this.textarea.createTextRange();
|
||
|
range.collapse(false);
|
||
|
range.move('character', -suffix.length);
|
||
|
range.select();
|
||
|
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
|
||
|
this.textarea.value = this.textarea.value.substring(0, start) + subst +
|
||
|
this.textarea.value.substring(end);
|
||
|
if (sel || (!prefix && start === end)) {
|
||
|
this.textarea.setSelectionRange(start + subst.length, start + subst.length);
|
||
|
} else {
|
||
|
this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);
|
||
|
}
|
||
|
this.textarea.scrollTop = scrollPos;
|
||
|
}
|
||
|
},
|
||
|
encloseSelection: function(prefix, suffix, fn) {
|
||
|
this.textarea.focus();
|
||
|
prefix = prefix || '';
|
||
|
suffix = suffix || '';
|
||
|
var start, end, sel, scrollPos, subst, res;
|
||
|
if (typeof(document["selection"]) != "undefined") {
|
||
|
sel = document.selection.createRange().text;
|
||
|
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
|
||
|
start = this.textarea.selectionStart;
|
||
|
end = this.textarea.selectionEnd;
|
||
|
scrollPos = this.textarea.scrollTop;
|
||
|
sel = this.textarea.value.substring(start, end);
|
||
|
if (start > 0 && this.textarea.value.substr(start-1, 1).match(/\S/)) {
|
||
|
prefix = ' ' + prefix;
|
||
|
}
|
||
|
if (this.textarea.value.substr(end, 1).match(/\S/)) {
|
||
|
suffix = suffix + ' ';
|
||
|
}
|
||
|
}
|
||
|
if (sel.match(/ $/)) { // exclude ending space char, if any
|
||
|
sel = sel.substring(0, sel.length - 1);
|
||
|
suffix = suffix + " ";
|
||
|
}
|
||
|
if (typeof(fn) == 'function') {
|
||
|
res = (sel) ? fn.call(this,sel) : fn('');
|
||
|
} else {
|
||
|
res = (sel) ? sel : '';
|
||
|
}
|
||
|
subst = prefix + res + suffix;
|
||
|
if (typeof(document["selection"]) != "undefined") {
|
||
|
document.selection.createRange().text = subst;
|
||
|
var range = this.textarea.createTextRange();
|
||
|
range.collapse(false);
|
||
|
range.move('character', -suffix.length);
|
||
|
range.select();
|
||
|
// this.textarea.caretPos -= suffix.length;
|
||
|
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
|
||
|
this.textarea.value = this.textarea.value.substring(0, start) + subst +
|
||
|
this.textarea.value.substring(end);
|
||
|
if (sel) {
|
||
|
this.textarea.setSelectionRange(start + subst.length, start + subst.length);
|
||
|
} else {
|
||
|
this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);
|
||
|
}
|
||
|
this.textarea.scrollTop = scrollPos;
|
||
|
}
|
||
|
},
|
||
|
showPreview: function(event) {
|
||
|
if (event.target.classList.contains('selected')) { return; }
|
||
|
lastJstPreviewed = this.toolbarBlock;
|
||
|
this.preview.setAttribute('style', 'min-height: ' + this.textarea.clientHeight + 'px;')
|
||
|
this.toolbar.classList.add('hidden');
|
||
|
this.textarea.classList.add('hidden');
|
||
|
this.preview.classList.remove('hidden');
|
||
|
this.tabsBlock.querySelector('.tab-edit').classList.remove('selected');
|
||
|
event.target.classList.add('selected');
|
||
|
},
|
||
|
hidePreview: function(event) {
|
||
|
if (event.target.classList.contains('selected')) { return; }
|
||
|
this.toolbar.classList.remove('hidden');
|
||
|
this.textarea.classList.remove('hidden');
|
||
|
this.textarea.focus();
|
||
|
this.preview.classList.add('hidden');
|
||
|
this.tabsBlock.querySelector('.tab-preview').classList.remove('selected');
|
||
|
event.target.classList.add('selected');
|
||
|
},
|
||
|
keyboardShortcuts: function(e) {
|
||
|
let stop = false;
|
||
|
if (isToogleEditPreviewShortcut(e)) {
|
||
|
// Switch to preview only if Edit tab is selected when the event triggers.
|
||
|
if (this.tabsBlock.querySelector('.tab-edit.selected')) {
|
||
|
stop = true
|
||
|
this.tabsBlock.querySelector('.tab-preview').click();
|
||
|
}
|
||
|
}
|
||
|
if (isModifierKey(e) && this.shortcuts.hasOwnProperty(e.key.toLowerCase())) {
|
||
|
stop = true
|
||
|
this.toolbar.querySelector("." + this.shortcuts[e.key.toLowerCase()]).click();
|
||
|
}
|
||
|
if (stop) {
|
||
|
e.stopPropagation();
|
||
|
e.preventDefault();
|
||
|
}
|
||
|
},
|
||
|
stripBaseURL: function(url) {
|
||
|
if (this.base_url != '') {
|
||
|
var pos = url.indexOf(this.base_url);
|
||
|
if (pos == 0) {
|
||
|
url = url.substr(this.base_url.length);
|
||
|
}
|
||
|
}
|
||
|
return url;
|
||
|
}
|
||
|
};
|
||
|
/** Resizer
|
||
|
-------------------------------------------------------- */
|
||
|
jsToolBar.prototype.resizeSetStartH = function() {
|
||
|
this.dragStartH = this.textarea.offsetHeight + 0;
|
||
|
};
|
||
|
jsToolBar.prototype.resizeDragStart = function(event) {
|
||
|
var This = this;
|
||
|
this.dragStartY = event.clientY;
|
||
|
this.resizeSetStartH();
|
||
|
document.addEventListener('mousemove', this.dragMoveHdlr=function(event){This.resizeDragMove(event);}, false);
|
||
|
document.addEventListener('mouseup', this.dragStopHdlr=function(event){This.resizeDragStop(event);}, false);
|
||
|
};
|
||
|
jsToolBar.prototype.resizeDragMove = function(event) {
|
||
|
this.textarea.style.height = (this.dragStartH+event.clientY-this.dragStartY)+'px';
|
||
|
};
|
||
|
jsToolBar.prototype.resizeDragStop = function(event) {
|
||
|
document.removeEventListener('mousemove', this.dragMoveHdlr, false);
|
||
|
document.removeEventListener('mouseup', this.dragStopHdlr, false);
|
||
|
};
|
||
|
/* Code highlighting menu */
|
||
|
jsToolBar.prototype.precodeMenu = function(fn){
|
||
|
var hlLanguages = window.userHlLanguages;
|
||
|
var menu = $("<ul style='position:absolute;'></ul>");
|
||
|
for (var i = 0; i < hlLanguages.length; i++) {
|
||
|
var langItem = $('<div></div>').text(hlLanguages[i]);
|
||
|
$("<li></li>").html(langItem).appendTo(menu).mousedown(function(){
|
||
|
fn($(this).text());
|
||
|
});
|
||
|
}
|
||
|
$("body").append(menu);
|
||
|
menu.menu().width(150).position({
|
||
|
my: "left top",
|
||
|
at: "left bottom",
|
||
|
of: this.toolNodes['precode']
|
||
|
});
|
||
|
$(document).on("mousedown", function() {
|
||
|
menu.remove();
|
||
|
});
|
||
|
return false;
|
||
|
};
|
||
|
/* Table generator */
|
||
|
jsToolBar.prototype.tableMenu = function(fn){
|
||
|
var alphabets = "ABCDEFGHIJ".split('');
|
||
|
var menu = $("<table class='table-generator'></table>");
|
||
|
for (var r = 1; r <= 5; r++) {
|
||
|
var row = $("<tr></tr>").appendTo(menu);
|
||
|
for (var c = 1; c <= 10; c++) {
|
||
|
$("<td data-row="+r+" data-col="+c+" title="+(c)+'×'+(r)+"></td>").mousedown(function(){
|
||
|
fn(alphabets.slice(0, $(this).data('col')), $(this).data('row'));
|
||
|
}).hover(function(){
|
||
|
var hoverRow = $(this).data('row');
|
||
|
var hoverCol = $(this).data('col');
|
||
|
$(this).closest('table').find('td').each(function(_index, element){
|
||
|
if ($(element).data('row') <= hoverRow && $(element).data('col') <= hoverCol){
|
||
|
$(element).addClass('selected-cell');
|
||
|
} else {
|
||
|
$(element).removeClass('selected-cell');
|
||
|
}
|
||
|
});
|
||
|
}).appendTo(row);
|
||
|
}
|
||
|
}
|
||
|
$("body").append(menu);
|
||
|
menu.position({
|
||
|
my: "left top",
|
||
|
at: "left bottom",
|
||
|
of: this.toolNodes['table']
|
||
|
});
|
||
|
$(document).on("mousedown", function() {
|
||
|
menu.remove();
|
||
|
});
|
||
|
return false;
|
||
|
};
|
||
|
$(document).keydown(function(e) {
|
||
|
if (isToogleEditPreviewShortcut(e)) {
|
||
|
if (lastJstPreviewed !== null) {
|
||
|
e.preventDefault();
|
||
|
e.stopPropagation();
|
||
|
lastJstPreviewed.querySelector('.tab-edit').click();
|
||
|
lastJstPreviewed = null;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
function isToogleEditPreviewShortcut(e) {
|
||
|
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'p') {
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
function isModifierKey(e) {
|
||
|
if (isMac && e.metaKey) {
|
||
|
return true;
|
||
|
} else if (!isMac && e.ctrlKey) {
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-ar.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'قوي';
|
||
|
jsToolBar.strings['Italic'] = 'مائل';
|
||
|
jsToolBar.strings['Underline'] = 'تسطير';
|
||
|
jsToolBar.strings['Deleted'] = 'محذوف';
|
||
|
jsToolBar.strings['Code'] = 'رمز ضمني';
|
||
|
jsToolBar.strings['Heading 1'] = 'عنوان 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'عنوان 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'عنوان 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'قائمة غير مرتبة';
|
||
|
jsToolBar.strings['Ordered list'] = 'قائمة مرتبة';
|
||
|
jsToolBar.strings['Quote'] = 'اقتباس';
|
||
|
jsToolBar.strings['Unquote'] = 'إزالة الاقتباس';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'نص مسبق التنسيق';
|
||
|
jsToolBar.strings['Wiki link'] = 'رابط الى صفحة ويكي';
|
||
|
jsToolBar.strings['Image'] = 'صورة';
|
||
|
jsToolBar.strings['Edit'] = 'تعديل';
|
||
|
jsToolBar.strings['Preview'] = 'معاينة';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-az.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Strong';
|
||
|
jsToolBar.strings['Italic'] = 'Italic';
|
||
|
jsToolBar.strings['Underline'] = 'Underline';
|
||
|
jsToolBar.strings['Deleted'] = 'Deleted';
|
||
|
jsToolBar.strings['Code'] = 'Inline Code';
|
||
|
jsToolBar.strings['Heading 1'] = 'Heading 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Heading 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Heading 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Unordered list';
|
||
|
jsToolBar.strings['Ordered list'] = 'Ordered list';
|
||
|
jsToolBar.strings['Quote'] = 'Quote';
|
||
|
jsToolBar.strings['Unquote'] = 'Remove Quote';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Preformatted text';
|
||
|
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page';
|
||
|
jsToolBar.strings['Image'] = 'Image';
|
||
|
jsToolBar.strings['Edit'] = 'Redaktə etmək';
|
||
|
jsToolBar.strings['Preview'] = 'İlkin baxış';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-bg.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Получер';
|
||
|
jsToolBar.strings['Italic'] = 'Курсив';
|
||
|
jsToolBar.strings['Underline'] = 'Подчертан';
|
||
|
jsToolBar.strings['Deleted'] = 'Изтрит';
|
||
|
jsToolBar.strings['Code'] = 'Вграден код';
|
||
|
jsToolBar.strings['Heading 1'] = 'Заглавие 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Заглавие 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Заглавие 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Вграден код';
|
||
|
jsToolBar.strings['Unordered list'] = 'Неподреден списък';
|
||
|
jsToolBar.strings['Ordered list'] = 'Подреден списък';
|
||
|
jsToolBar.strings['Quote'] = 'Цитат';
|
||
|
jsToolBar.strings['Unquote'] = 'Премахване на цитат';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Форматиран текст';
|
||
|
jsToolBar.strings['Wiki link'] = 'Връзка до Wiki страница';
|
||
|
jsToolBar.strings['Image'] = 'Изображение';
|
||
|
jsToolBar.strings['Edit'] = 'Редакция';
|
||
|
jsToolBar.strings['Preview'] = 'Преглед';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-bs.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Strong';
|
||
|
jsToolBar.strings['Italic'] = 'Italic';
|
||
|
jsToolBar.strings['Underline'] = 'Underline';
|
||
|
jsToolBar.strings['Deleted'] = 'Deleted';
|
||
|
jsToolBar.strings['Code'] = 'Inline Code';
|
||
|
jsToolBar.strings['Heading 1'] = 'Heading 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Heading 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Heading 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Unordered list';
|
||
|
jsToolBar.strings['Ordered list'] = 'Ordered list';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Preformatted text';
|
||
|
jsToolBar.strings['Wiki link'] = 'Link na Wiki stranicu';
|
||
|
jsToolBar.strings['Image'] = 'Slika';
|
||
|
jsToolBar.strings['Edit'] = 'Ispravka';
|
||
|
jsToolBar.strings['Preview'] = 'Pregled';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-ca.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Negreta';
|
||
|
jsToolBar.strings['Italic'] = 'Cursiva';
|
||
|
jsToolBar.strings['Underline'] = 'Subratllat';
|
||
|
jsToolBar.strings['Deleted'] = 'Barrat';
|
||
|
jsToolBar.strings['Code'] = 'Codi en línia';
|
||
|
jsToolBar.strings['Heading 1'] = 'Encapçalament 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Encapçalament 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Encapçalament 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Llista sense ordre';
|
||
|
jsToolBar.strings['Ordered list'] = 'Llista ordenada';
|
||
|
jsToolBar.strings['Quote'] = 'Cometes';
|
||
|
jsToolBar.strings['Unquote'] = 'Sense cometes';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Text formatat';
|
||
|
jsToolBar.strings['Wiki link'] = 'Enllaça a una pàgina Wiki';
|
||
|
jsToolBar.strings['Image'] = 'Imatge';
|
||
|
jsToolBar.strings['Edit'] = 'Editar';
|
||
|
jsToolBar.strings['Preview'] = 'Previsualitzar';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-cs.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Tučné';
|
||
|
jsToolBar.strings['Italic'] = 'Kurzíva';
|
||
|
jsToolBar.strings['Underline'] = 'Podtržené';
|
||
|
jsToolBar.strings['Deleted'] = 'Přeškrtnuté ';
|
||
|
jsToolBar.strings['Code'] = 'Vnořený kód';
|
||
|
jsToolBar.strings['Heading 1'] = 'Nadpis 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Nadpis 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Nadpis 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Zvýrazněný kód';
|
||
|
jsToolBar.strings['Unordered list'] = 'Seznam';
|
||
|
jsToolBar.strings['Ordered list'] = 'Uspořádaný seznam';
|
||
|
jsToolBar.strings['Quote'] = 'Citace';
|
||
|
jsToolBar.strings['Unquote'] = 'Odstranit citaci';
|
||
|
jsToolBar.strings['Table'] = 'Tabulka';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Předformátovaný text';
|
||
|
jsToolBar.strings['Wiki link'] = 'Vložit odkaz na Wiki stránku';
|
||
|
jsToolBar.strings['Image'] = 'Vložit obrázek';
|
||
|
jsToolBar.strings['Edit'] = 'Upravit';
|
||
|
jsToolBar.strings['Preview'] = 'Náhled';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-da.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Fed';
|
||
|
jsToolBar.strings['Italic'] = 'Kursiv';
|
||
|
jsToolBar.strings['Underline'] = 'Understreget';
|
||
|
jsToolBar.strings['Deleted'] = 'Slettet';
|
||
|
jsToolBar.strings['Code'] = 'Inline-kode';
|
||
|
jsToolBar.strings['Heading 1'] = 'Overskrift 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Overskrift 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Overskrift 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Unummereret liste';
|
||
|
jsToolBar.strings['Ordered list'] = 'Nummereret liste';
|
||
|
jsToolBar.strings['Quote'] = 'Citér';
|
||
|
jsToolBar.strings['Unquote'] = 'Fjern citér';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Præformateret tekst';
|
||
|
jsToolBar.strings['Wiki link'] = 'Link til en wiki-side';
|
||
|
jsToolBar.strings['Image'] = 'Billede';
|
||
|
jsToolBar.strings['Edit'] = 'Ret';
|
||
|
jsToolBar.strings['Preview'] = 'Forhåndsvisning';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-de.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Fett';
|
||
|
jsToolBar.strings['Italic'] = 'Kursiv';
|
||
|
jsToolBar.strings['Underline'] = 'Unterstrichen';
|
||
|
jsToolBar.strings['Deleted'] = 'Durchgestrichen';
|
||
|
jsToolBar.strings['Code'] = 'Quelltext';
|
||
|
jsToolBar.strings['Heading 1'] = 'Überschrift 1. Ordnung';
|
||
|
jsToolBar.strings['Heading 2'] = 'Überschrift 2. Ordnung';
|
||
|
jsToolBar.strings['Heading 3'] = 'Überschrift 3. Ordnung';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Aufzählungsliste';
|
||
|
jsToolBar.strings['Ordered list'] = 'Nummerierte Liste';
|
||
|
jsToolBar.strings['Quote'] = 'Zitat';
|
||
|
jsToolBar.strings['Unquote'] = 'Zitat entfernen';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Präformatierter Text';
|
||
|
jsToolBar.strings['Wiki link'] = 'Verweis (Link) zu einer Wiki-Seite';
|
||
|
jsToolBar.strings['Image'] = 'Grafik';
|
||
|
jsToolBar.strings['Edit'] = 'Bearbeiten';
|
||
|
jsToolBar.strings['Preview'] = 'Vorschau';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-en-gb.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Strong';
|
||
|
jsToolBar.strings['Italic'] = 'Italic';
|
||
|
jsToolBar.strings['Underline'] = 'Underline';
|
||
|
jsToolBar.strings['Deleted'] = 'Deleted';
|
||
|
jsToolBar.strings['Code'] = 'Inline Code';
|
||
|
jsToolBar.strings['Heading 1'] = 'Heading 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Heading 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Heading 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Unordered list';
|
||
|
jsToolBar.strings['Ordered list'] = 'Ordered list';
|
||
|
jsToolBar.strings['Quote'] = 'Quote';
|
||
|
jsToolBar.strings['Unquote'] = 'Remove Quote';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Preformatted text';
|
||
|
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page';
|
||
|
jsToolBar.strings['Image'] = 'Image';
|
||
|
jsToolBar.strings['Edit'] = 'Edit';
|
||
|
jsToolBar.strings['Preview'] = 'Preview';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-en.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Strong';
|
||
|
jsToolBar.strings['Italic'] = 'Italic';
|
||
|
jsToolBar.strings['Underline'] = 'Underline';
|
||
|
jsToolBar.strings['Deleted'] = 'Deleted';
|
||
|
jsToolBar.strings['Code'] = 'Inline Code';
|
||
|
jsToolBar.strings['Heading 1'] = 'Heading 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Heading 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Heading 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Unordered list';
|
||
|
jsToolBar.strings['Ordered list'] = 'Ordered list';
|
||
|
jsToolBar.strings['Quote'] = 'Quote';
|
||
|
jsToolBar.strings['Unquote'] = 'Remove Quote';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Preformatted text';
|
||
|
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page';
|
||
|
jsToolBar.strings['Image'] = 'Image';
|
||
|
jsToolBar.strings['Edit'] = 'Edit';
|
||
|
jsToolBar.strings['Preview'] = 'Preview';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-es-pa.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Negrita';
|
||
|
jsToolBar.strings['Italic'] = 'Itálica';
|
||
|
jsToolBar.strings['Underline'] = 'Subrayado';
|
||
|
jsToolBar.strings['Deleted'] = 'Tachado';
|
||
|
jsToolBar.strings['Code'] = 'Código fuente';
|
||
|
jsToolBar.strings['Heading 1'] = 'Encabezado 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Encabezado 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Encabezado 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Código resaltado';
|
||
|
jsToolBar.strings['Unordered list'] = 'Lista sin ordenar';
|
||
|
jsToolBar.strings['Ordered list'] = 'Lista ordenada';
|
||
|
jsToolBar.strings['Quote'] = 'Citar';
|
||
|
jsToolBar.strings['Unquote'] = 'Quitar cita';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Texto con formato';
|
||
|
jsToolBar.strings['Wiki link'] = 'Enlace a página Wiki';
|
||
|
jsToolBar.strings['Image'] = 'Imagen';
|
||
|
jsToolBar.strings['Edit'] = 'Modificar';
|
||
|
jsToolBar.strings['Preview'] = 'Previsualizar';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-es.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Negrita';
|
||
|
jsToolBar.strings['Italic'] = 'Itálica';
|
||
|
jsToolBar.strings['Underline'] = 'Subrayado';
|
||
|
jsToolBar.strings['Deleted'] = 'Tachado';
|
||
|
jsToolBar.strings['Code'] = 'Código fuente';
|
||
|
jsToolBar.strings['Heading 1'] = 'Encabezado 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Encabezado 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Encabezado 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Código resaltado';
|
||
|
jsToolBar.strings['Unordered list'] = 'Lista sin ordenar';
|
||
|
jsToolBar.strings['Ordered list'] = 'Lista ordenada';
|
||
|
jsToolBar.strings['Quote'] = 'Citar';
|
||
|
jsToolBar.strings['Unquote'] = 'Quitar cita';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Texto con formato';
|
||
|
jsToolBar.strings['Wiki link'] = 'Enlace a página Wiki';
|
||
|
jsToolBar.strings['Image'] = 'Imagen';
|
||
|
jsToolBar.strings['Edit'] = 'Modificar';
|
||
|
jsToolBar.strings['Preview'] = 'Previsualizar';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-et.js | ||
|---|---|---|
|
/*
|
||
|
Copyright (C) 2012 Kaitseministeerium
|
||
|
This program is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU General Public License
|
||
|
as published by the Free Software Foundation; either version 2
|
||
|
of the License, or (at your option) any later version.
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Rõhutatult';
|
||
|
jsToolBar.strings['Italic'] = 'Kaldkirjas';
|
||
|
jsToolBar.strings['Underline'] = 'Allakriipsutatult';
|
||
|
jsToolBar.strings['Deleted'] = 'Läbikriipsutatult';
|
||
|
jsToolBar.strings['Code'] = 'Koodiblokk';
|
||
|
jsToolBar.strings['Heading 1'] = '1. taseme pealkiri';
|
||
|
jsToolBar.strings['Heading 2'] = '2. taseme pealkiri';
|
||
|
jsToolBar.strings['Heading 3'] = '3. taseme pealkiri';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Täpitud nimekiri';
|
||
|
jsToolBar.strings['Ordered list'] = 'Nummerdatud nimekiri';
|
||
|
jsToolBar.strings['Quote'] = 'Tsitaat: aste juurde';
|
||
|
jsToolBar.strings['Unquote'] = 'Tsitaat: aste madalamaks';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Eelvormindatud tekst';
|
||
|
jsToolBar.strings['Wiki link'] = 'Vikilehe link';
|
||
|
jsToolBar.strings['Image'] = 'Pilt';
|
||
|
jsToolBar.strings['Edit'] = 'Muuda';
|
||
|
jsToolBar.strings['Preview'] = 'Eelvaade';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-eu.js | ||
|---|---|---|
|
// jsToolBar EU language
|
||
|
// Author: Ales Zabala Alava (Shagi), <shagi@gisa-elkartea.org>
|
||
|
// 2010-01-25
|
||
|
// Distributed under the same terms as the jsToolBar itself.
|
||
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Lodia';
|
||
|
jsToolBar.strings['Italic'] = 'Etzana';
|
||
|
jsToolBar.strings['Underline'] = 'Azpimarra';
|
||
|
jsToolBar.strings['Deleted'] = 'Ezabatuta';
|
||
|
jsToolBar.strings['Code'] = 'Inline Code';
|
||
|
jsToolBar.strings['Heading 1'] = '1 Goiburua';
|
||
|
jsToolBar.strings['Heading 2'] = '2 Goiburua';
|
||
|
jsToolBar.strings['Heading 3'] = '3 Goiburua';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Ordenatu gabeko zerrenda';
|
||
|
jsToolBar.strings['Ordered list'] = 'Ordenatutako zerrenda';
|
||
|
jsToolBar.strings['Quote'] = 'Aipamena';
|
||
|
jsToolBar.strings['Unquote'] = 'Aipamena kendu';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Aurrez formateatutako testua';
|
||
|
jsToolBar.strings['Wiki link'] = 'Wiki orri baterako esteka';
|
||
|
jsToolBar.strings['Image'] = 'Irudia';
|
||
|
jsToolBar.strings['Edit'] = 'Editatu';
|
||
|
jsToolBar.strings['Preview'] = 'Aurreikusi';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-fa.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'پررنگ';
|
||
|
jsToolBar.strings['Italic'] = 'کج';
|
||
|
jsToolBar.strings['Underline'] = 'زیرخط';
|
||
|
jsToolBar.strings['Deleted'] = 'برداشته شده';
|
||
|
jsToolBar.strings['Code'] = 'کد درون خطی';
|
||
|
jsToolBar.strings['Heading 1'] = 'سربرگ ۱';
|
||
|
jsToolBar.strings['Heading 2'] = 'سربرگ ۲';
|
||
|
jsToolBar.strings['Heading 3'] = 'سربرگ ۳';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'فهرست بدون شماره';
|
||
|
jsToolBar.strings['Ordered list'] = 'فهرست با شماره';
|
||
|
jsToolBar.strings['Quote'] = 'تو بردن';
|
||
|
jsToolBar.strings['Unquote'] = 'بیرون آوردن';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'نوشته قالب بندی شده';
|
||
|
jsToolBar.strings['Wiki link'] = 'پیوند به برگ ویکی';
|
||
|
jsToolBar.strings['Image'] = 'عکس';
|
||
|
jsToolBar.strings['Edit'] = 'ویرایش';
|
||
|
jsToolBar.strings['Preview'] = 'پیشنمایش';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-fi.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Lihavoitu';
|
||
|
jsToolBar.strings['Italic'] = 'Kursivoitu';
|
||
|
jsToolBar.strings['Underline'] = 'Alleviivattu';
|
||
|
jsToolBar.strings['Deleted'] = 'Yliviivattu';
|
||
|
jsToolBar.strings['Code'] = 'Koodi näkymä';
|
||
|
jsToolBar.strings['Heading 1'] = 'Otsikko 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Otsikko 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Otsikko 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Highlighted code';
|
||
|
jsToolBar.strings['Unordered list'] = 'Järjestämätön lista';
|
||
|
jsToolBar.strings['Ordered list'] = 'Järjestetty lista';
|
||
|
jsToolBar.strings['Quote'] = 'Quote';
|
||
|
jsToolBar.strings['Unquote'] = 'Remove Quote';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Ennaltamuotoiltu teksti';
|
||
|
jsToolBar.strings['Wiki link'] = 'Linkki Wiki sivulle';
|
||
|
jsToolBar.strings['Image'] = 'Kuva';
|
||
|
jsToolBar.strings['Edit'] = 'Muokkaa';
|
||
|
jsToolBar.strings['Preview'] = 'Esikatselu';
|
||
| app/assets/javascripts/jstoolbar/lang/jstoolbar-fr.js | ||
|---|---|---|
|
jsToolBar.strings = {};
|
||
|
jsToolBar.strings['Strong'] = 'Gras';
|
||
|
jsToolBar.strings['Italic'] = 'Italique';
|
||
|
jsToolBar.strings['Underline'] = 'Souligné';
|
||
|
jsToolBar.strings['Deleted'] = 'Rayé';
|
||
|
jsToolBar.strings['Code'] = 'Code en ligne';
|
||
|
jsToolBar.strings['Heading 1'] = 'Titre niveau 1';
|
||
|
jsToolBar.strings['Heading 2'] = 'Titre niveau 2';
|
||
|
jsToolBar.strings['Heading 3'] = 'Titre niveau 3';
|
||
|
jsToolBar.strings['Highlighted code'] = 'Code colorisé';
|
||
|
jsToolBar.strings['Unordered list'] = 'Liste à puces';
|
||
|
jsToolBar.strings['Ordered list'] = 'Liste numérotée';
|
||
|
jsToolBar.strings['Quote'] = 'Indenté';
|
||
|
jsToolBar.strings['Unquote'] = 'Supprimer indentation';
|
||
|
jsToolBar.strings['Table'] = 'Table';
|
||
|
jsToolBar.strings['Preformatted text'] = 'Texte préformaté';
|
||
|
jsToolBar.strings['Wiki link'] = 'Lien vers une page Wiki';
|
||
|
jsToolBar.strings['Image'] = 'Image';
|
||
|
jsToolBar.strings['Edit'] = 'Modifier';
|
||
|
jsToolBar.strings['Preview'] = 'Prévisualiser';
|
||