Patch #43259 » 0001-Convert-jstoolbar-to-ES-Module.patch
app/assets/javascripts/jstoolbar/common_mark.js | ||
---|---|---|
1 |
/** |
|
2 |
* This file is part of DotClear. |
|
3 |
* Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All rights reserved. |
|
4 |
* This code is released under the GNU General Public License. |
|
5 |
* |
|
6 |
* Modified by JP LANG for common_mark formatting |
|
7 |
*/ |
|
8 | ||
9 |
// strong |
|
10 |
jsToolBar.prototype.elements.strong = { |
|
11 |
type: 'button', |
|
12 |
title: 'Strong', |
|
13 |
shortcut: 'b', |
|
14 |
fn: { |
|
15 |
wiki: function() { this.singleTag('**') } |
|
16 |
} |
|
17 |
} |
|
18 | ||
19 |
// em |
|
20 |
jsToolBar.prototype.elements.em = { |
|
21 |
type: 'button', |
|
22 |
title: 'Italic', |
|
23 |
shortcut: 'i', |
|
24 |
fn: { |
|
25 |
wiki: function() { this.singleTag("*") } |
|
26 |
} |
|
27 |
} |
|
28 | ||
29 |
// u |
|
30 |
jsToolBar.prototype.elements.ins = { |
|
31 |
type: 'button', |
|
32 |
title: 'Underline', |
|
33 |
shortcut: 'u', |
|
34 |
fn: { |
|
35 |
wiki: function() { this.singleTag('<u>', '</u>') } |
|
36 |
} |
|
37 |
} |
|
38 | ||
39 |
// del |
|
40 |
jsToolBar.prototype.elements.del = { |
|
41 |
type: 'button', |
|
42 |
title: 'Deleted', |
|
43 |
fn: { |
|
44 |
wiki: function() { this.singleTag('~~') } |
|
45 |
} |
|
46 |
} |
|
47 | ||
48 |
// code |
|
49 |
jsToolBar.prototype.elements.code = { |
|
50 |
type: 'button', |
|
51 |
title: 'Code', |
|
52 |
fn: { |
|
53 |
wiki: function() { this.singleTag('`') } |
|
54 |
} |
|
55 |
} |
|
56 | ||
57 |
// spacer |
|
58 |
jsToolBar.prototype.elements.space1 = {type: 'space'} |
|
59 | ||
60 |
// headings |
|
61 |
jsToolBar.prototype.elements.h1 = { |
|
62 |
type: 'button', |
|
63 |
title: 'Heading 1', |
|
64 |
fn: { |
|
65 |
wiki: function() { |
|
66 |
this.encloseLineSelection('# ', '',function(str) { |
|
67 |
str = str.replace(/^#+\s+/, '') |
|
68 |
return str; |
|
69 |
}); |
|
70 |
} |
|
71 |
} |
|
72 |
} |
|
73 |
jsToolBar.prototype.elements.h2 = { |
|
74 |
type: 'button', |
|
75 |
title: 'Heading 2', |
|
76 |
fn: { |
|
77 |
wiki: function() { |
|
78 |
this.encloseLineSelection('## ', '',function(str) { |
|
79 |
str = str.replace(/^#+\s+/, '') |
|
80 |
return str; |
|
81 |
}); |
|
82 |
} |
|
83 |
} |
|
84 |
} |
|
85 |
jsToolBar.prototype.elements.h3 = { |
|
86 |
type: 'button', |
|
87 |
title: 'Heading 3', |
|
88 |
fn: { |
|
89 |
wiki: function() { |
|
90 |
this.encloseLineSelection('### ', '',function(str) { |
|
91 |
str = str.replace(/^#+\s+/, '') |
|
92 |
return str; |
|
93 |
}); |
|
94 |
} |
|
95 |
} |
|
96 |
} |
|
97 | ||
98 |
// spacer |
|
99 |
jsToolBar.prototype.elements.space2 = {type: 'space'} |
|
100 | ||
101 |
// ul |
|
102 |
jsToolBar.prototype.elements.ul = { |
|
103 |
type: 'button', |
|
104 |
title: 'Unordered list', |
|
105 |
fn: { |
|
106 |
wiki: function() { |
|
107 |
this.encloseLineSelection('','',function(str) { |
|
108 |
str = str.replace(/\r/g,''); |
|
109 |
return str.replace(/(\n|^)[#-]?\s*/g,"$1* "); |
|
110 |
}); |
|
111 |
} |
|
112 |
} |
|
113 |
} |
|
114 | ||
115 |
// ol |
|
116 |
jsToolBar.prototype.elements.ol = { |
|
117 |
type: 'button', |
|
118 |
title: 'Ordered list', |
|
119 |
fn: { |
|
120 |
wiki: function() { |
|
121 |
this.encloseLineSelection('','',function(str) { |
|
122 |
str = str.replace(/\r/g,''); |
|
123 |
return str.replace(/(\n|^)[*-]?\s*/g,"$11. "); |
|
124 |
}); |
|
125 |
} |
|
126 |
} |
|
127 |
} |
|
128 | ||
129 |
// tl |
|
130 |
jsToolBar.prototype.elements.tl = { |
|
131 |
type: 'button', |
|
132 |
title: 'Task list', |
|
133 |
fn: { |
|
134 |
wiki: function() { |
|
135 |
this.encloseLineSelection('','',function(str) { |
|
136 |
str = str.replace(/\r/g,''); |
|
137 |
return str.replace(/(\n|^)[*-]?\s*/g,"$1* [ ] "); |
|
138 |
}); |
|
139 |
} |
|
140 |
} |
|
141 |
} |
|
142 | ||
143 |
// spacer |
|
144 |
jsToolBar.prototype.elements.space3 = {type: 'space'} |
|
145 | ||
146 |
// bq |
|
147 |
jsToolBar.prototype.elements.bq = { |
|
148 |
type: 'button', |
|
149 |
title: 'Quote', |
|
150 |
fn: { |
|
151 |
wiki: function() { |
|
152 |
this.encloseLineSelection('','',function(str) { |
|
153 |
str = str.replace(/\r/g,''); |
|
154 |
return str.replace(/(\n|^)( *)([^\n]*)/g,"$1> $2$3"); |
|
155 |
}); |
|
156 |
} |
|
157 |
} |
|
158 |
} |
|
159 | ||
160 |
// unbq |
|
161 |
jsToolBar.prototype.elements.unbq = { |
|
162 |
type: 'button', |
|
163 |
title: 'Unquote', |
|
164 |
fn: { |
|
165 |
wiki: function() { |
|
166 |
this.encloseLineSelection('','',function(str) { |
|
167 |
str = str.replace(/\r/g,''); |
|
168 |
return str.replace(/(\n|^) *(> ?)?( *)([^\n]*)/g,"$1$3$4"); |
|
169 |
}); |
|
170 |
} |
|
171 |
} |
|
172 |
} |
|
173 | ||
174 |
// table |
|
175 |
jsToolBar.prototype.elements.table = { |
|
176 |
type: 'button', |
|
177 |
title: 'Table', |
|
178 |
fn: { |
|
179 |
wiki: function() { |
|
180 |
var This = this; |
|
181 |
this.tableMenu(function(cols, rowCount){ |
|
182 |
This.encloseLineSelection( |
|
183 |
'|'+cols.join(' |')+' |\n' + // header |
|
184 |
Array(cols.length+1).join('|--')+'|\n' + // second line |
|
185 |
Array(rowCount+1).join(Array(cols.length+1).join('| ')+'|\n') // cells |
|
186 |
); |
|
187 |
}); |
|
188 |
} |
|
189 |
} |
|
190 |
} |
|
191 | ||
192 |
// pre |
|
193 |
jsToolBar.prototype.elements.pre = { |
|
194 |
type: 'button', |
|
195 |
title: 'Preformatted text', |
|
196 |
fn: { |
|
197 |
wiki: function() { this.encloseLineSelection('```\n', '\n```') } |
|
198 |
} |
|
199 |
} |
|
200 | ||
201 |
// Code highlighting |
|
202 |
jsToolBar.prototype.elements.precode = { |
|
203 |
type: 'button', |
|
204 |
title: 'Highlighted code', |
|
205 |
fn: { |
|
206 |
wiki: function() { |
|
207 |
var This = this; |
|
208 |
this.precodeMenu(function(lang){ |
|
209 |
This.encloseLineSelection('``` ' + lang + '\n', '\n```\n'); |
|
210 |
}); |
|
211 |
} |
|
212 |
} |
|
213 |
} |
|
214 | ||
215 |
// spacer |
|
216 |
jsToolBar.prototype.elements.space4 = {type: 'space'} |
|
217 | ||
218 |
// wiki page |
|
219 |
jsToolBar.prototype.elements.link = { |
|
220 |
type: 'button', |
|
221 |
title: 'Wiki link', |
|
222 |
fn: { |
|
223 |
wiki: function() { this.encloseSelection("[[", "]]") } |
|
224 |
} |
|
225 |
} |
|
226 |
// image |
|
227 |
jsToolBar.prototype.elements.img = { |
|
228 |
type: 'button', |
|
229 |
title: 'Image', |
|
230 |
fn: { |
|
231 |
wiki: function() { this.encloseSelection("") } |
|
232 |
} |
|
233 |
} |
|
234 | ||
235 |
// spacer |
|
236 |
jsToolBar.prototype.elements.space5 = {type: 'space'} |
|
237 |
// help |
|
238 |
jsToolBar.prototype.elements.help = { |
|
239 |
type: 'button', |
|
240 |
title: 'Help', |
|
241 |
fn: { |
|
242 |
wiki: function() { window.open(this.help_link, '', 'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes') } |
|
243 |
} |
|
244 |
} |
app/assets/javascripts/jstoolbar/jstoolbar.js | ||
---|---|---|
1 |
/** |
|
2 |
* This file is part of DotClear. |
|
3 |
* Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All rights reserved. |
|
4 |
* This code is released under the GNU General Public License. |
|
5 |
* |
|
6 |
* Modified by JP LANG for multiple text formatting |
|
7 |
*/ |
|
8 | ||
9 |
let lastJstPreviewed = null; |
|
10 |
const isMac = Boolean(navigator.platform.toLowerCase().match(/mac/)); |
|
11 | ||
12 |
function jsToolBar(textarea) { |
|
13 |
if (!document.createElement) { return; } |
|
14 | ||
15 |
if (!textarea) { return; } |
|
16 | ||
17 |
if ((typeof(document["selection"]) == "undefined") |
|
18 |
&& (typeof(textarea["setSelectionRange"]) == "undefined")) { |
|
19 |
return; |
|
20 |
} |
|
21 | ||
22 |
this.textarea = textarea; |
|
23 | ||
24 |
this.toolbarBlock = document.createElement('div'); |
|
25 |
this.toolbarBlock.className = 'jstBlock'; |
|
26 |
this.textarea.parentNode.insertBefore(this.toolbarBlock, this.textarea); |
|
27 | ||
28 |
this.editor = document.createElement('div'); |
|
29 |
this.editor.className = 'jstEditor'; |
|
30 | ||
31 |
this.preview = document.createElement('div'); |
|
32 |
this.preview.className = 'wiki wiki-preview hidden'; |
|
33 |
this.preview.setAttribute('id', 'preview_' + textarea.getAttribute('id')); |
|
34 | ||
35 |
this.editor.appendChild(this.textarea); |
|
36 |
this.editor.appendChild(this.preview); |
|
37 | ||
38 |
this.tabsBlock = document.createElement('div'); |
|
39 |
this.tabsBlock.className = 'jstTabs tabs'; |
|
40 | ||
41 |
var This = this; |
|
42 | ||
43 |
this.textarea.onkeydown = function(event) { This.keyboardShortcuts.call(This, event); }; |
|
44 | ||
45 |
this.editTab = new jsTab('Edit', true); |
|
46 |
this.editTab.onclick = function(event) { This.hidePreview.call(This, event); return false; }; |
|
47 | ||
48 |
this.previewTab = new jsTab('Preview'); |
|
49 |
this.previewTab.onclick = function(event) { This.showPreview.call(This, event); return false; }; |
|
50 | ||
51 |
var elementsTab = document.createElement('li'); |
|
52 |
elementsTab.classList = 'tab-elements'; |
|
53 | ||
54 |
var tabs = document.createElement('ul'); |
|
55 |
tabs.appendChild(this.editTab); |
|
56 |
tabs.appendChild(this.previewTab); |
|
57 |
tabs.appendChild(elementsTab); |
|
58 |
this.tabsBlock.appendChild(tabs); |
|
59 | ||
60 |
this.toolbar = document.createElement("div"); |
|
61 |
this.toolbar.className = 'jstElements'; |
|
62 |
elementsTab.appendChild(this.toolbar); |
|
63 | ||
64 |
this.toolbarBlock.appendChild(this.tabsBlock); |
|
65 |
this.toolbarBlock.appendChild(this.editor); |
|
66 | ||
67 |
// Dragable resizing |
|
68 |
if (this.editor.addEventListener && navigator.appVersion.match(/\bMSIE\b/)) |
|
69 |
{ |
|
70 |
this.handle = document.createElement('div'); |
|
71 |
this.handle.className = 'jstHandle'; |
|
72 |
var dragStart = this.resizeDragStart; |
|
73 |
var This = this; |
|
74 |
this.handle.addEventListener('mousedown',function(event) { dragStart.call(This,event); },false); |
|
75 |
// fix memory leak in Firefox (bug #241518) |
|
76 |
window.addEventListener('unload',function() { |
|
77 |
var del = This.handle.parentNode.removeChild(This.handle); |
|
78 |
delete(This.handle); |
|
79 |
},false); |
|
80 | ||
81 |
this.editor.parentNode.insertBefore(this.handle,this.editor.nextSibling); |
|
82 |
} |
|
83 | ||
84 |
this.context = null; |
|
85 |
this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni |
|
86 |
// de raccourcis vers les éléments DOM correspondants aux outils. |
|
87 |
} |
|
88 | ||
89 |
function jsTab(name, selected) { |
|
90 |
selected = selected || false; |
|
91 |
if(typeof jsToolBar.strings == 'undefined') { |
|
92 |
var tabName = name || null; |
|
93 |
} else { |
|
94 |
var tabName = jsToolBar.strings[name] || name || null; |
|
95 |
} |
|
96 | ||
97 |
var tab = document.createElement('li'); |
|
98 |
var link = document.createElement('a'); |
|
99 |
link.setAttribute('href', '#'); |
|
100 |
link.innerText = tabName; |
|
101 |
link.className = 'tab-' + name.toLowerCase(); |
|
102 | ||
103 |
if (selected == true) { |
|
104 |
link.classList.add('selected'); |
|
105 |
} |
|
106 |
tab.appendChild(link) |
|
107 | ||
108 |
return tab; |
|
109 |
} |
|
110 |
function jsButton(title, fn, scope, className) { |
|
111 |
if(typeof jsToolBar.strings == 'undefined') { |
|
112 |
this.title = title || null; |
|
113 |
} else { |
|
114 |
this.title = jsToolBar.strings[title] || title || null; |
|
115 |
} |
|
116 |
this.fn = fn || function(){}; |
|
117 |
this.scope = scope || null; |
|
118 |
this.className = className || null; |
|
119 |
} |
|
120 |
jsButton.prototype.draw = function() { |
|
121 |
if (!this.scope) return null; |
|
122 | ||
123 |
var button = document.createElement('button'); |
|
124 |
button.setAttribute('type','button'); |
|
125 |
button.tabIndex = 200; |
|
126 |
if (this.className) button.className = this.className; |
|
127 |
button.title = this.title; |
|
128 |
var span = document.createElement('span'); |
|
129 |
span.appendChild(document.createTextNode(this.title)); |
|
130 |
button.appendChild(span); |
|
131 | ||
132 |
if (this.icon != undefined) { |
|
133 |
button.style.backgroundImage = 'url('+this.icon+')'; |
|
134 |
} |
|
135 | ||
136 |
if (typeof(this.fn) == 'function') { |
|
137 |
var This = this; |
|
138 |
button.onclick = function() { try { This.fn.apply(This.scope, arguments) } catch (e) {} return false; }; |
|
139 |
} |
|
140 |
return button; |
|
141 |
} |
|
142 | ||
143 |
function jsSpace(className) { |
|
144 |
this.className = className || null; |
|
145 |
this.width = null; |
|
146 |
} |
|
147 |
jsSpace.prototype.draw = function() { |
|
148 |
var span = document.createElement('span'); |
|
149 |
span.appendChild(document.createTextNode(String.fromCharCode(160))); |
|
150 |
span.className = 'jstSpacer' + (this.className ? ' ' + this.className : ''); |
|
151 |
if (this.width) span.style.marginRight = this.width+'px'; |
|
152 | ||
153 |
return span; |
|
154 |
} |
|
155 | ||
156 |
function jsCombo(title, options, scope, fn, className) { |
|
157 |
this.title = title || null; |
|
158 |
this.options = options || null; |
|
159 |
this.scope = scope || null; |
|
160 |
this.fn = fn || function(){}; |
|
161 |
this.className = className || null; |
|
162 |
} |
|
163 |
jsCombo.prototype.draw = function() { |
|
164 |
if (!this.scope || !this.options) return null; |
|
165 | ||
166 |
var select = document.createElement('select'); |
|
167 |
if (this.className) select.className = className; |
|
168 |
select.title = this.title; |
|
169 | ||
170 |
for (var o in this.options) { |
|
171 |
//var opt = this.options[o]; |
|
172 |
var option = document.createElement('option'); |
|
173 |
option.value = o; |
|
174 |
option.appendChild(document.createTextNode(this.options[o])); |
|
175 |
select.appendChild(option); |
|
176 |
} |
|
177 | ||
178 |
var This = this; |
|
179 |
select.onchange = function() { |
|
180 |
try { |
|
181 |
This.fn.call(This.scope, this.value); |
|
182 |
} catch (e) { alert(e); } |
|
183 | ||
184 |
return false; |
|
185 |
} |
|
186 | ||
187 |
return select; |
|
188 |
} |
|
189 | ||
190 | ||
191 |
jsToolBar.prototype = { |
|
192 |
base_url: '', |
|
193 |
mode: 'wiki', |
|
194 |
elements: {}, |
|
195 |
help_link: '', |
|
196 |
shortcuts: {}, |
|
197 | ||
198 |
getMode: function() { |
|
199 |
return this.mode; |
|
200 |
}, |
|
201 | ||
202 |
setMode: function(mode) { |
|
203 |
this.mode = mode || 'wiki'; |
|
204 |
}, |
|
205 | ||
206 |
switchMode: function(mode) { |
|
207 |
mode = mode || 'wiki'; |
|
208 |
this.draw(mode); |
|
209 |
}, |
|
210 | ||
211 |
setHelpLink: function(link) { |
|
212 |
this.help_link = link; |
|
213 |
}, |
|
214 | ||
215 |
setPreviewUrl: function(url) { |
|
216 |
this.previewTab.firstChild.setAttribute('data-url', url); |
|
217 |
}, |
|
218 | ||
219 |
button: function(toolName) { |
|
220 |
var tool = this.elements[toolName]; |
|
221 |
if (typeof tool.fn[this.mode] != 'function') return null; |
|
222 | ||
223 |
const className = 'jstb_' + toolName; |
|
224 |
let title = tool.title |
|
225 | ||
226 |
if (tool.hasOwnProperty('shortcut')) { |
|
227 |
this.shortcuts[tool.shortcut] = className; |
|
228 |
title = this.buttonTitleWithShortcut(tool.title, tool.shortcut) |
|
229 |
} |
|
230 | ||
231 |
var b = new jsButton(title, tool.fn[this.mode], this, className); |
|
232 |
if (tool.icon != undefined) b.icon = tool.icon; |
|
233 | ||
234 |
return b; |
|
235 |
}, |
|
236 |
buttonTitleWithShortcut: function(title, shortcutKey) { |
|
237 |
if(typeof jsToolBar.strings == 'undefined') { |
|
238 |
var i18nTitle = title || null; |
|
239 |
} else { |
|
240 |
var i18nTitle = jsToolBar.strings[title] || title || null; |
|
241 |
} |
|
242 | ||
243 |
if (isMac) { |
|
244 |
return i18nTitle + " (⌘" + shortcutKey.toUpperCase() + ")"; |
|
245 |
} else { |
|
246 |
return i18nTitle + " (Ctrl+" + shortcutKey.toUpperCase() + ")"; |
|
247 |
} |
|
248 |
}, |
|
249 |
space: function(toolName) { |
|
250 |
var tool = new jsSpace(toolName) |
|
251 |
if (this.elements[toolName].width !== undefined) |
|
252 |
tool.width = this.elements[toolName].width; |
|
253 |
return tool; |
|
254 |
}, |
|
255 |
combo: function(toolName) { |
|
256 |
var tool = this.elements[toolName]; |
|
257 |
var length = tool[this.mode].list.length; |
|
258 | ||
259 |
if (typeof tool[this.mode].fn != 'function' || length == 0) { |
|
260 |
return null; |
|
261 |
} else { |
|
262 |
var options = {}; |
|
263 |
for (var i=0; i < length; i++) { |
|
264 |
var opt = tool[this.mode].list[i]; |
|
265 |
options[opt] = tool.options[opt]; |
|
266 |
} |
|
267 |
return new jsCombo(tool.title, options, this, tool[this.mode].fn); |
|
268 |
} |
|
269 |
}, |
|
270 |
draw: function(mode) { |
|
271 |
this.setMode(mode); |
|
272 | ||
273 |
// Empty toolbar |
|
274 |
while (this.toolbar.hasChildNodes()) { |
|
275 |
this.toolbar.removeChild(this.toolbar.firstChild) |
|
276 |
} |
|
277 |
this.toolNodes = {}; // vide les raccourcis DOM/**/ |
|
278 | ||
279 |
// Draw toolbar elements |
|
280 |
var b, tool, newTool; |
|
281 | ||
282 |
for (var i in this.elements) { |
|
283 |
b = this.elements[i]; |
|
284 | ||
285 |
var disabled = |
|
286 |
b.type == undefined || b.type == '' |
|
287 |
|| (b.disabled != undefined && b.disabled) |
|
288 |
|| (b.context != undefined && b.context != null && b.context != this.context); |
|
289 | ||
290 |
if (!disabled && typeof this[b.type] == 'function') { |
|
291 |
tool = this[b.type](i); |
|
292 |
if (tool) newTool = tool.draw(); |
|
293 |
if (newTool) { |
|
294 |
this.toolNodes[i] = newTool; //mémorise l'accès DOM pour usage éventuel ultérieur |
|
295 |
this.toolbar.appendChild(newTool); |
|
296 |
} |
|
297 |
} |
|
298 |
} |
|
299 |
}, |
|
300 | ||
301 |
singleTag: function(stag,etag) { |
|
302 |
stag = stag || null; |
|
303 |
etag = etag || stag; |
|
304 | ||
305 |
if (!stag || !etag) { return; } |
|
306 | ||
307 |
this.encloseSelection(stag,etag); |
|
308 |
}, |
|
309 | ||
310 |
encloseLineSelection: function(prefix, suffix, fn) { |
|
311 |
this.textarea.focus(); |
|
312 | ||
313 |
prefix = prefix || ''; |
|
314 |
suffix = suffix || ''; |
|
315 | ||
316 |
var start, end, sel, scrollPos, subst, res; |
|
317 | ||
318 |
if (typeof(document["selection"]) != "undefined") { |
|
319 |
sel = document.selection.createRange().text; |
|
320 |
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { |
|
321 |
start = this.textarea.selectionStart; |
|
322 |
end = this.textarea.selectionEnd; |
|
323 |
scrollPos = this.textarea.scrollTop; |
|
324 |
// go to the start of the line |
|
325 |
start = this.textarea.value.substring(0, start).replace(/[^\r\n]*$/g,'').length; |
|
326 |
// go to the end of the line |
|
327 |
end = this.textarea.value.length - this.textarea.value.substring(end, this.textarea.value.length).replace(/^[^\r\n]*/, '').length; |
|
328 |
sel = this.textarea.value.substring(start, end); |
|
329 |
} |
|
330 | ||
331 |
if (sel.match(/ $/)) { // exclude ending space char, if any |
|
332 |
sel = sel.substring(0, sel.length - 1); |
|
333 |
suffix = suffix + " "; |
|
334 |
} |
|
335 | ||
336 |
if (typeof(fn) == 'function') { |
|
337 |
res = (sel) ? fn.call(this,sel) : fn(''); |
|
338 |
} else { |
|
339 |
res = (sel) ? sel : ''; |
|
340 |
} |
|
341 | ||
342 |
subst = prefix + res + suffix; |
|
343 | ||
344 |
if (typeof(document["selection"]) != "undefined") { |
|
345 |
document.selection.createRange().text = subst; |
|
346 |
var range = this.textarea.createTextRange(); |
|
347 |
range.collapse(false); |
|
348 |
range.move('character', -suffix.length); |
|
349 |
range.select(); |
|
350 |
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { |
|
351 |
this.textarea.value = this.textarea.value.substring(0, start) + subst + |
|
352 |
this.textarea.value.substring(end); |
|
353 |
if (sel || (!prefix && start === end)) { |
|
354 |
this.textarea.setSelectionRange(start + subst.length, start + subst.length); |
|
355 |
} else { |
|
356 |
this.textarea.setSelectionRange(start + prefix.length, start + prefix.length); |
|
357 |
} |
|
358 |
this.textarea.scrollTop = scrollPos; |
|
359 |
} |
|
360 |
}, |
|
361 | ||
362 |
encloseSelection: function(prefix, suffix, fn) { |
|
363 |
this.textarea.focus(); |
|
364 |
prefix = prefix || ''; |
|
365 |
suffix = suffix || ''; |
|
366 | ||
367 |
var start, end, sel, scrollPos, subst, res; |
|
368 | ||
369 |
if (typeof(document["selection"]) != "undefined") { |
|
370 |
sel = document.selection.createRange().text; |
|
371 |
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { |
|
372 |
start = this.textarea.selectionStart; |
|
373 |
end = this.textarea.selectionEnd; |
|
374 |
scrollPos = this.textarea.scrollTop; |
|
375 |
sel = this.textarea.value.substring(start, end); |
|
376 |
if (start > 0 && this.textarea.value.substr(start-1, 1).match(/\S/)) { |
|
377 |
prefix = ' ' + prefix; |
|
378 |
} |
|
379 |
if (this.textarea.value.substr(end, 1).match(/\S/)) { |
|
380 |
suffix = suffix + ' '; |
|
381 |
} |
|
382 |
} |
|
383 |
if (sel.match(/ $/)) { // exclude ending space char, if any |
|
384 |
sel = sel.substring(0, sel.length - 1); |
|
385 |
suffix = suffix + " "; |
|
386 |
} |
|
387 | ||
388 |
if (typeof(fn) == 'function') { |
|
389 |
res = (sel) ? fn.call(this,sel) : fn(''); |
|
390 |
} else { |
|
391 |
res = (sel) ? sel : ''; |
|
392 |
} |
|
393 | ||
394 |
subst = prefix + res + suffix; |
|
395 | ||
396 |
if (typeof(document["selection"]) != "undefined") { |
|
397 |
document.selection.createRange().text = subst; |
|
398 |
var range = this.textarea.createTextRange(); |
|
399 |
range.collapse(false); |
|
400 |
range.move('character', -suffix.length); |
|
401 |
range.select(); |
|
402 |
// this.textarea.caretPos -= suffix.length; |
|
403 |
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { |
|
404 |
this.textarea.value = this.textarea.value.substring(0, start) + subst + |
|
405 |
this.textarea.value.substring(end); |
|
406 |
if (sel) { |
|
407 |
this.textarea.setSelectionRange(start + subst.length, start + subst.length); |
|
408 |
} else { |
|
409 |
this.textarea.setSelectionRange(start + prefix.length, start + prefix.length); |
|
410 |
} |
|
411 |
this.textarea.scrollTop = scrollPos; |
|
412 |
} |
|
413 |
}, |
|
414 |
showPreview: function(event) { |
|
415 |
if (event.target.classList.contains('selected')) { return; } |
|
416 |
lastJstPreviewed = this.toolbarBlock; |
|
417 |
this.preview.setAttribute('style', 'min-height: ' + this.textarea.clientHeight + 'px;') |
|
418 |
this.toolbar.classList.add('hidden'); |
|
419 |
this.textarea.classList.add('hidden'); |
|
420 |
this.preview.classList.remove('hidden'); |
|
421 |
this.tabsBlock.querySelector('.tab-edit').classList.remove('selected'); |
|
422 |
event.target.classList.add('selected'); |
|
423 |
}, |
|
424 |
hidePreview: function(event) { |
|
425 |
if (event.target.classList.contains('selected')) { return; } |
|
426 |
this.toolbar.classList.remove('hidden'); |
|
427 |
this.textarea.classList.remove('hidden'); |
|
428 |
this.textarea.focus(); |
|
429 |
this.preview.classList.add('hidden'); |
|
430 |
this.tabsBlock.querySelector('.tab-preview').classList.remove('selected'); |
|
431 |
event.target.classList.add('selected'); |
|
432 |
}, |
|
433 |
keyboardShortcuts: function(e) { |
|
434 |
let stop = false; |
|
435 |
if (isToogleEditPreviewShortcut(e)) { |
|
436 |
// Switch to preview only if Edit tab is selected when the event triggers. |
|
437 |
if (this.tabsBlock.querySelector('.tab-edit.selected')) { |
|
438 |
stop = true |
|
439 |
this.tabsBlock.querySelector('.tab-preview').click(); |
|
440 |
} |
|
441 |
} |
|
442 |
if (isModifierKey(e) && this.shortcuts.hasOwnProperty(e.key.toLowerCase())) { |
|
443 |
stop = true |
|
444 |
this.toolbar.querySelector("." + this.shortcuts[e.key.toLowerCase()]).click(); |
|
445 |
} |
|
446 |
if (stop) { |
|
447 |
e.stopPropagation(); |
|
448 |
e.preventDefault(); |
|
449 |
} |
|
450 |
}, |
|
451 |
stripBaseURL: function(url) { |
|
452 |
if (this.base_url != '') { |
|
453 |
var pos = url.indexOf(this.base_url); |
|
454 |
if (pos == 0) { |
|
455 |
url = url.substr(this.base_url.length); |
|
456 |
} |
|
457 |
} |
|
458 | ||
459 |
return url; |
|
460 |
} |
|
461 |
}; |
|
462 | ||
463 |
/** Resizer |
|
464 |
-------------------------------------------------------- */ |
|
465 |
jsToolBar.prototype.resizeSetStartH = function() { |
|
466 |
this.dragStartH = this.textarea.offsetHeight + 0; |
|
467 |
}; |
|
468 |
jsToolBar.prototype.resizeDragStart = function(event) { |
|
469 |
var This = this; |
|
470 |
this.dragStartY = event.clientY; |
|
471 |
this.resizeSetStartH(); |
|
472 |
document.addEventListener('mousemove', this.dragMoveHdlr=function(event){This.resizeDragMove(event);}, false); |
|
473 |
document.addEventListener('mouseup', this.dragStopHdlr=function(event){This.resizeDragStop(event);}, false); |
|
474 |
}; |
|
475 | ||
476 |
jsToolBar.prototype.resizeDragMove = function(event) { |
|
477 |
this.textarea.style.height = (this.dragStartH+event.clientY-this.dragStartY)+'px'; |
|
478 |
}; |
|
479 | ||
480 |
jsToolBar.prototype.resizeDragStop = function(event) { |
|
481 |
document.removeEventListener('mousemove', this.dragMoveHdlr, false); |
|
482 |
document.removeEventListener('mouseup', this.dragStopHdlr, false); |
|
483 |
}; |
|
484 | ||
485 |
/* Code highlighting menu */ |
|
486 |
jsToolBar.prototype.precodeMenu = function(fn){ |
|
487 |
var hlLanguages = window.userHlLanguages; |
|
488 |
var menu = $("<ul style='position:absolute;'></ul>"); |
|
489 |
for (var i = 0; i < hlLanguages.length; i++) { |
|
490 |
var langItem = $('<div></div>').text(hlLanguages[i]); |
|
491 |
$("<li></li>").html(langItem).appendTo(menu).mousedown(function(){ |
|
492 |
fn($(this).text()); |
|
493 |
}); |
|
494 |
} |
|
495 |
$("body").append(menu); |
|
496 |
menu.menu().width(150).position({ |
|
497 |
my: "left top", |
|
498 |
at: "left bottom", |
|
499 |
of: this.toolNodes['precode'] |
|
500 |
}); |
|
501 |
$(document).on("mousedown", function() { |
|
502 |
menu.remove(); |
|
503 |
}); |
|
504 |
return false; |
|
505 |
}; |
|
506 | ||
507 |
/* Table generator */ |
|
508 |
jsToolBar.prototype.tableMenu = function(fn){ |
|
509 |
var alphabets = "ABCDEFGHIJ".split(''); |
|
510 |
var menu = $("<table class='table-generator'></table>"); |
|
511 | ||
512 |
for (var r = 1; r <= 5; r++) { |
|
513 |
var row = $("<tr></tr>").appendTo(menu); |
|
514 |
for (var c = 1; c <= 10; c++) { |
|
515 |
$("<td data-row="+r+" data-col="+c+" title="+(c)+'×'+(r)+"></td>").mousedown(function(){ |
|
516 |
fn(alphabets.slice(0, $(this).data('col')), $(this).data('row')); |
|
517 |
}).hover(function(){ |
|
518 |
var hoverRow = $(this).data('row'); |
|
519 |
var hoverCol = $(this).data('col'); |
|
520 |
$(this).closest('table').find('td').each(function(_index, element){ |
|
521 |
if ($(element).data('row') <= hoverRow && $(element).data('col') <= hoverCol){ |
|
522 |
$(element).addClass('selected-cell'); |
|
523 |
} else { |
|
524 |
$(element).removeClass('selected-cell'); |
|
525 |
} |
|
526 |
}); |
|
527 |
}).appendTo(row); |
|
528 |
} |
|
529 |
} |
|
530 |
$("body").append(menu); |
|
531 |
menu.position({ |
|
532 |
my: "left top", |
|
533 |
at: "left bottom", |
|
534 |
of: this.toolNodes['table'] |
|
535 |
}); |
|
536 |
$(document).on("mousedown", function() { |
|
537 |
menu.remove(); |
|
538 |
}); |
|
539 |
return false; |
|
540 |
}; |
|
541 | ||
542 |
$(document).keydown(function(e) { |
|
543 |
if (isToogleEditPreviewShortcut(e)) { |
|
544 |
if (lastJstPreviewed !== null) { |
|
545 |
e.preventDefault(); |
|
546 |
e.stopPropagation(); |
|
547 |
lastJstPreviewed.querySelector('.tab-edit').click(); |
|
548 |
lastJstPreviewed = null; |
|
549 |
} |
|
550 |
} |
|
551 |
}); |
|
552 | ||
553 |
function isToogleEditPreviewShortcut(e) { |
|
554 |
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.key.toLowerCase() === 'p') { |
|
555 |
return true; |
|
556 |
} else { |
|
557 |
return false; |
|
558 |
} |
|
559 |
} |
|
560 |
function isModifierKey(e) { |
|
561 |
if (isMac && e.metaKey) { |
|
562 |
return true; |
|
563 |
} else if (!isMac && e.ctrlKey) { |
|
564 |
return true; |
|
565 |
} else { |
|
566 |
return false; |
|
567 |
} |
|
568 |
} |
app/assets/javascripts/jstoolbar/lang/jstoolbar-ar.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'قوي'; |
|
3 |
jsToolBar.strings['Italic'] = 'مائل'; |
|
4 |
jsToolBar.strings['Underline'] = 'تسطير'; |
|
5 |
jsToolBar.strings['Deleted'] = 'محذوف'; |
|
6 |
jsToolBar.strings['Code'] = 'رمز ضمني'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'عنوان 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'عنوان 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'عنوان 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'قائمة غير مرتبة'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'قائمة مرتبة'; |
|
13 |
jsToolBar.strings['Quote'] = 'اقتباس'; |
|
14 |
jsToolBar.strings['Unquote'] = 'إزالة الاقتباس'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'نص مسبق التنسيق'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'رابط الى صفحة ويكي'; |
|
18 |
jsToolBar.strings['Image'] = 'صورة'; |
|
19 |
jsToolBar.strings['Edit'] = 'تعديل'; |
|
20 |
jsToolBar.strings['Preview'] = 'معاينة'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-az.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Strong'; |
|
3 |
jsToolBar.strings['Italic'] = 'Italic'; |
|
4 |
jsToolBar.strings['Underline'] = 'Underline'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Deleted'; |
|
6 |
jsToolBar.strings['Code'] = 'Inline Code'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Heading 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Heading 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Heading 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Unordered list'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Ordered list'; |
|
13 |
jsToolBar.strings['Quote'] = 'Quote'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Remove Quote'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Preformatted text'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; |
|
18 |
jsToolBar.strings['Image'] = 'Image'; |
|
19 |
jsToolBar.strings['Edit'] = 'Redaktə etmək'; |
|
20 |
jsToolBar.strings['Preview'] = 'İlkin baxış'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-bg.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Получер'; |
|
3 |
jsToolBar.strings['Italic'] = 'Курсив'; |
|
4 |
jsToolBar.strings['Underline'] = 'Подчертан'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Изтрит'; |
|
6 |
jsToolBar.strings['Code'] = 'Вграден код'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Заглавие 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Заглавие 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Заглавие 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Вграден код'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Неподреден списък'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Подреден списък'; |
|
13 |
jsToolBar.strings['Quote'] = 'Цитат'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Премахване на цитат'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Форматиран текст'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Връзка до Wiki страница'; |
|
18 |
jsToolBar.strings['Image'] = 'Изображение'; |
|
19 |
jsToolBar.strings['Edit'] = 'Редакция'; |
|
20 |
jsToolBar.strings['Preview'] = 'Преглед'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-bs.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Strong'; |
|
3 |
jsToolBar.strings['Italic'] = 'Italic'; |
|
4 |
jsToolBar.strings['Underline'] = 'Underline'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Deleted'; |
|
6 |
jsToolBar.strings['Code'] = 'Inline Code'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Heading 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Heading 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Heading 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Unordered list'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Ordered list'; |
|
13 |
jsToolBar.strings['Table'] = 'Table'; |
|
14 |
jsToolBar.strings['Preformatted text'] = 'Preformatted text'; |
|
15 |
jsToolBar.strings['Wiki link'] = 'Link na Wiki stranicu'; |
|
16 |
jsToolBar.strings['Image'] = 'Slika'; |
|
17 |
jsToolBar.strings['Edit'] = 'Ispravka'; |
|
18 |
jsToolBar.strings['Preview'] = 'Pregled'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-ca.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Negreta'; |
|
3 |
jsToolBar.strings['Italic'] = 'Cursiva'; |
|
4 |
jsToolBar.strings['Underline'] = 'Subratllat'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Barrat'; |
|
6 |
jsToolBar.strings['Code'] = 'Codi en línia'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Encapçalament 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Encapçalament 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Encapçalament 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Llista sense ordre'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Llista ordenada'; |
|
13 |
jsToolBar.strings['Quote'] = 'Cometes'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Sense cometes'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Text formatat'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Enllaça a una pàgina Wiki'; |
|
18 |
jsToolBar.strings['Image'] = 'Imatge'; |
|
19 |
jsToolBar.strings['Edit'] = 'Editar'; |
|
20 |
jsToolBar.strings['Preview'] = 'Previsualitzar'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-cs.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Tučné'; |
|
3 |
jsToolBar.strings['Italic'] = 'Kurzíva'; |
|
4 |
jsToolBar.strings['Underline'] = 'Podtržené'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Přeškrtnuté '; |
|
6 |
jsToolBar.strings['Code'] = 'Vnořený kód'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Nadpis 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Nadpis 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Nadpis 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Zvýrazněný kód'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Seznam'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Uspořádaný seznam'; |
|
13 |
jsToolBar.strings['Quote'] = 'Citace'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Odstranit citaci'; |
|
15 |
jsToolBar.strings['Table'] = 'Tabulka'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Předformátovaný text'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Vložit odkaz na Wiki stránku'; |
|
18 |
jsToolBar.strings['Image'] = 'Vložit obrázek'; |
|
19 |
jsToolBar.strings['Edit'] = 'Upravit'; |
|
20 |
jsToolBar.strings['Preview'] = 'Náhled'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-da.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Fed'; |
|
3 |
jsToolBar.strings['Italic'] = 'Kursiv'; |
|
4 |
jsToolBar.strings['Underline'] = 'Understreget'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Slettet'; |
|
6 |
jsToolBar.strings['Code'] = 'Inline-kode'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Overskrift 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Overskrift 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Overskrift 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Unummereret liste'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Nummereret liste'; |
|
13 |
jsToolBar.strings['Quote'] = 'Citér'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Fjern citér'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Præformateret tekst'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Link til en wiki-side'; |
|
18 |
jsToolBar.strings['Image'] = 'Billede'; |
|
19 |
jsToolBar.strings['Edit'] = 'Ret'; |
|
20 |
jsToolBar.strings['Preview'] = 'Forhåndsvisning'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-de.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Fett'; |
|
3 |
jsToolBar.strings['Italic'] = 'Kursiv'; |
|
4 |
jsToolBar.strings['Underline'] = 'Unterstrichen'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Durchgestrichen'; |
|
6 |
jsToolBar.strings['Code'] = 'Quelltext'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Überschrift 1. Ordnung'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Überschrift 2. Ordnung'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Überschrift 3. Ordnung'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Aufzählungsliste'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Nummerierte Liste'; |
|
13 |
jsToolBar.strings['Quote'] = 'Zitat'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Zitat entfernen'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Präformatierter Text'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Verweis (Link) zu einer Wiki-Seite'; |
|
18 |
jsToolBar.strings['Image'] = 'Grafik'; |
|
19 |
jsToolBar.strings['Edit'] = 'Bearbeiten'; |
|
20 |
jsToolBar.strings['Preview'] = 'Vorschau'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-en-gb.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Strong'; |
|
3 |
jsToolBar.strings['Italic'] = 'Italic'; |
|
4 |
jsToolBar.strings['Underline'] = 'Underline'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Deleted'; |
|
6 |
jsToolBar.strings['Code'] = 'Inline Code'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Heading 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Heading 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Heading 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Unordered list'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Ordered list'; |
|
13 |
jsToolBar.strings['Quote'] = 'Quote'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Remove Quote'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Preformatted text'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; |
|
18 |
jsToolBar.strings['Image'] = 'Image'; |
|
19 |
jsToolBar.strings['Edit'] = 'Edit'; |
|
20 |
jsToolBar.strings['Preview'] = 'Preview'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-en.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Strong'; |
|
3 |
jsToolBar.strings['Italic'] = 'Italic'; |
|
4 |
jsToolBar.strings['Underline'] = 'Underline'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Deleted'; |
|
6 |
jsToolBar.strings['Code'] = 'Inline Code'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Heading 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Heading 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Heading 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Unordered list'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Ordered list'; |
|
13 |
jsToolBar.strings['Quote'] = 'Quote'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Remove Quote'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Preformatted text'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; |
|
18 |
jsToolBar.strings['Image'] = 'Image'; |
|
19 |
jsToolBar.strings['Edit'] = 'Edit'; |
|
20 |
jsToolBar.strings['Preview'] = 'Preview'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-es-pa.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Negrita'; |
|
3 |
jsToolBar.strings['Italic'] = 'Itálica'; |
|
4 |
jsToolBar.strings['Underline'] = 'Subrayado'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Tachado'; |
|
6 |
jsToolBar.strings['Code'] = 'Código fuente'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Encabezado 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Encabezado 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Encabezado 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Código resaltado'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Lista sin ordenar'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Lista ordenada'; |
|
13 |
jsToolBar.strings['Quote'] = 'Citar'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Quitar cita'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Texto con formato'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Enlace a página Wiki'; |
|
18 |
jsToolBar.strings['Image'] = 'Imagen'; |
|
19 |
jsToolBar.strings['Edit'] = 'Modificar'; |
|
20 |
jsToolBar.strings['Preview'] = 'Previsualizar'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-es.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Negrita'; |
|
3 |
jsToolBar.strings['Italic'] = 'Itálica'; |
|
4 |
jsToolBar.strings['Underline'] = 'Subrayado'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Tachado'; |
|
6 |
jsToolBar.strings['Code'] = 'Código fuente'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Encabezado 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Encabezado 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Encabezado 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Código resaltado'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Lista sin ordenar'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Lista ordenada'; |
|
13 |
jsToolBar.strings['Quote'] = 'Citar'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Quitar cita'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Texto con formato'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Enlace a página Wiki'; |
|
18 |
jsToolBar.strings['Image'] = 'Imagen'; |
|
19 |
jsToolBar.strings['Edit'] = 'Modificar'; |
|
20 |
jsToolBar.strings['Preview'] = 'Previsualizar'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-et.js | ||
---|---|---|
1 |
/* |
|
2 |
Copyright (C) 2012 Kaitseministeerium |
|
3 |
This program is free software; you can redistribute it and/or |
|
4 |
modify it under the terms of the GNU General Public License |
|
5 |
as published by the Free Software Foundation; either version 2 |
|
6 |
of the License, or (at your option) any later version. |
|
7 | ||
8 |
This program is distributed in the hope that it will be useful, |
|
9 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 |
GNU General Public License for more details. |
|
12 | ||
13 |
You should have received a copy of the GNU General Public License |
|
14 |
along with this program; if not, write to the Free Software |
|
15 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 |
*/ |
|
17 | ||
18 |
jsToolBar.strings = {}; |
|
19 |
jsToolBar.strings['Strong'] = 'Rõhutatult'; |
|
20 |
jsToolBar.strings['Italic'] = 'Kaldkirjas'; |
|
21 |
jsToolBar.strings['Underline'] = 'Allakriipsutatult'; |
|
22 |
jsToolBar.strings['Deleted'] = 'Läbikriipsutatult'; |
|
23 |
jsToolBar.strings['Code'] = 'Koodiblokk'; |
|
24 |
jsToolBar.strings['Heading 1'] = '1. taseme pealkiri'; |
|
25 |
jsToolBar.strings['Heading 2'] = '2. taseme pealkiri'; |
|
26 |
jsToolBar.strings['Heading 3'] = '3. taseme pealkiri'; |
|
27 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
28 |
jsToolBar.strings['Unordered list'] = 'Täpitud nimekiri'; |
|
29 |
jsToolBar.strings['Ordered list'] = 'Nummerdatud nimekiri'; |
|
30 |
jsToolBar.strings['Quote'] = 'Tsitaat: aste juurde'; |
|
31 |
jsToolBar.strings['Unquote'] = 'Tsitaat: aste madalamaks'; |
|
32 |
jsToolBar.strings['Table'] = 'Table'; |
|
33 |
jsToolBar.strings['Preformatted text'] = 'Eelvormindatud tekst'; |
|
34 |
jsToolBar.strings['Wiki link'] = 'Vikilehe link'; |
|
35 |
jsToolBar.strings['Image'] = 'Pilt'; |
|
36 |
jsToolBar.strings['Edit'] = 'Muuda'; |
|
37 |
jsToolBar.strings['Preview'] = 'Eelvaade'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-eu.js | ||
---|---|---|
1 |
// jsToolBar EU language |
|
2 |
// Author: Ales Zabala Alava (Shagi), <shagi@gisa-elkartea.org> |
|
3 |
// 2010-01-25 |
|
4 |
// Distributed under the same terms as the jsToolBar itself. |
|
5 |
jsToolBar.strings = {}; |
|
6 |
jsToolBar.strings['Strong'] = 'Lodia'; |
|
7 |
jsToolBar.strings['Italic'] = 'Etzana'; |
|
8 |
jsToolBar.strings['Underline'] = 'Azpimarra'; |
|
9 |
jsToolBar.strings['Deleted'] = 'Ezabatuta'; |
|
10 |
jsToolBar.strings['Code'] = 'Inline Code'; |
|
11 |
jsToolBar.strings['Heading 1'] = '1 Goiburua'; |
|
12 |
jsToolBar.strings['Heading 2'] = '2 Goiburua'; |
|
13 |
jsToolBar.strings['Heading 3'] = '3 Goiburua'; |
|
14 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
15 |
jsToolBar.strings['Unordered list'] = 'Ordenatu gabeko zerrenda'; |
|
16 |
jsToolBar.strings['Ordered list'] = 'Ordenatutako zerrenda'; |
|
17 |
jsToolBar.strings['Quote'] = 'Aipamena'; |
|
18 |
jsToolBar.strings['Unquote'] = 'Aipamena kendu'; |
|
19 |
jsToolBar.strings['Table'] = 'Table'; |
|
20 |
jsToolBar.strings['Preformatted text'] = 'Aurrez formateatutako testua'; |
|
21 |
jsToolBar.strings['Wiki link'] = 'Wiki orri baterako esteka'; |
|
22 |
jsToolBar.strings['Image'] = 'Irudia'; |
|
23 |
jsToolBar.strings['Edit'] = 'Editatu'; |
|
24 |
jsToolBar.strings['Preview'] = 'Aurreikusi'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-fa.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'پررنگ'; |
|
3 |
jsToolBar.strings['Italic'] = 'کج'; |
|
4 |
jsToolBar.strings['Underline'] = 'زیرخط'; |
|
5 |
jsToolBar.strings['Deleted'] = 'برداشته شده'; |
|
6 |
jsToolBar.strings['Code'] = 'کد درون خطی'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'سربرگ ۱'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'سربرگ ۲'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'سربرگ ۳'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'فهرست بدون شماره'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'فهرست با شماره'; |
|
13 |
jsToolBar.strings['Quote'] = 'تو بردن'; |
|
14 |
jsToolBar.strings['Unquote'] = 'بیرون آوردن'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'نوشته قالب بندی شده'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'پیوند به برگ ویکی'; |
|
18 |
jsToolBar.strings['Image'] = 'عکس'; |
|
19 |
jsToolBar.strings['Edit'] = 'ویرایش'; |
|
20 |
jsToolBar.strings['Preview'] = 'پیشنمایش'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-fi.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Lihavoitu'; |
|
3 |
jsToolBar.strings['Italic'] = 'Kursivoitu'; |
|
4 |
jsToolBar.strings['Underline'] = 'Alleviivattu'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Yliviivattu'; |
|
6 |
jsToolBar.strings['Code'] = 'Koodi näkymä'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Otsikko 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Otsikko 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Otsikko 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Highlighted code'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Järjestämätön lista'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Järjestetty lista'; |
|
13 |
jsToolBar.strings['Quote'] = 'Quote'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Remove Quote'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Ennaltamuotoiltu teksti'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Linkki Wiki sivulle'; |
|
18 |
jsToolBar.strings['Image'] = 'Kuva'; |
|
19 |
jsToolBar.strings['Edit'] = 'Muokkaa'; |
|
20 |
jsToolBar.strings['Preview'] = 'Esikatselu'; |
app/assets/javascripts/jstoolbar/lang/jstoolbar-fr.js | ||
---|---|---|
1 |
jsToolBar.strings = {}; |
|
2 |
jsToolBar.strings['Strong'] = 'Gras'; |
|
3 |
jsToolBar.strings['Italic'] = 'Italique'; |
|
4 |
jsToolBar.strings['Underline'] = 'Souligné'; |
|
5 |
jsToolBar.strings['Deleted'] = 'Rayé'; |
|
6 |
jsToolBar.strings['Code'] = 'Code en ligne'; |
|
7 |
jsToolBar.strings['Heading 1'] = 'Titre niveau 1'; |
|
8 |
jsToolBar.strings['Heading 2'] = 'Titre niveau 2'; |
|
9 |
jsToolBar.strings['Heading 3'] = 'Titre niveau 3'; |
|
10 |
jsToolBar.strings['Highlighted code'] = 'Code colorisé'; |
|
11 |
jsToolBar.strings['Unordered list'] = 'Liste à puces'; |
|
12 |
jsToolBar.strings['Ordered list'] = 'Liste numérotée'; |
|
13 |
jsToolBar.strings['Quote'] = 'Indenté'; |
|
14 |
jsToolBar.strings['Unquote'] = 'Supprimer indentation'; |
|
15 |
jsToolBar.strings['Table'] = 'Table'; |
|
16 |
jsToolBar.strings['Preformatted text'] = 'Texte préformaté'; |
|
17 |
jsToolBar.strings['Wiki link'] = 'Lien vers une page Wiki'; |
|
18 |
jsToolBar.strings['Image'] = 'Image'; |
|
19 |
jsToolBar.strings['Edit'] = 'Modifier'; |
|
20 |
jsToolBar.strings['Preview'] = 'Prévisualiser'; |