Redmine 4.1.1

This commit is contained in:
Manuel Cillero 2020-11-22 21:20:06 +01:00
parent 33e7b881a5
commit 3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
/* Fix for CVE-2015-9251, to be removed with JQuery >= 3.0 */
$.ajaxPrefilter(function (s) {
@ -17,7 +17,7 @@ function toggleCheckboxesBySelector(selector) {
$(selector).each(function(index) {
if (!$(this).is(':checked')) { all_checked = false; }
});
$(selector).prop('checked', !all_checked);
$(selector).prop('checked', !all_checked).trigger('change');
}
function showAndScrollTo(id, focus) {
@ -32,6 +32,7 @@ function toggleRowGroup(el) {
var tr = $(el).parents('tr').first();
var n = tr.next();
tr.toggleClass('open');
$(el).toggleClass('icon-expended icon-collapsed');
while (n.length && !n.hasClass('group')) {
n.toggle();
n = n.next('tr');
@ -43,6 +44,7 @@ function collapseAllRowGroups(el) {
tbody.children('tr').each(function(index) {
if ($(this).hasClass('group')) {
$(this).removeClass('open');
$(this).find('.expander').switchClass('icon-expended', 'icon-collapsed');
} else {
$(this).hide();
}
@ -54,6 +56,7 @@ function expandAllRowGroups(el) {
tbody.children('tr').each(function(index) {
if ($(this).hasClass('group')) {
$(this).addClass('open');
$(this).find('.expander').switchClass('icon-collapsed', 'icon-expended');
} else {
$(this).show();
}
@ -72,6 +75,7 @@ function toggleAllRowGroups(el) {
function toggleFieldset(el) {
var fieldset = $(el).parents('fieldset').first();
fieldset.toggleClass('collapsed');
fieldset.children('legend').toggleClass('icon-expended icon-collapsed');
fieldset.children('div').toggle();
}
@ -117,7 +121,8 @@ function initFilters() {
toggleFilter($(this).val());
});
$('#filters-table').on('click', '.toggle-multiselect', function() {
toggleMultiSelect($(this).siblings('select'));
toggleMultiSelect($(this).siblings('select'))
$(this).toggleClass('icon-toggle-plus icon-toggle-minus')
});
$('#filters-table').on('keypress', 'input[type=text]', function(e) {
if (e.keyCode == 13) $(this).closest('form').submit();
@ -172,7 +177,7 @@ function buildFilterRow(field, operator, values) {
select = tr.find('td.operator select');
for (i = 0; i < operators.length; i++) {
var option = $('<option>').val(operators[i]).text(operatorLabels[operators[i]]);
if (operators[i] == operator) { option.attr('selected', true); }
if (operators[i] == operator) { option.prop('selected', true); }
select.append(option);
}
select.change(function(){ toggleOperator(field); });
@ -184,7 +189,7 @@ function buildFilterRow(field, operator, values) {
case "list_subprojects":
tr.find('td.values').append(
'<span style="display:none;"><select class="value" id="values_'+fieldId+'_1" name="v['+field+'][]"></select>' +
' <span class="toggle-multiselect">&nbsp;</span></span>'
' <span class="toggle-multiselect icon-only icon-toggle-plus">&nbsp;</span></span>'
);
select = tr.find('td.values select');
if (values.length > 1) { select.attr('multiple', true); }
@ -193,7 +198,7 @@ function buildFilterRow(field, operator, values) {
var option = $('<option>');
if ($.isArray(filterValue)) {
option.val(filterValue[1]).text(filterValue[0]);
if ($.inArray(filterValue[1], values) > -1) {option.attr('selected', true);}
if ($.inArray(filterValue[1], values) > -1) {option.prop('selected', true);}
if (filterValue.length == 3) {
var optgroup = select.find('optgroup').filter(function(){return $(this).attr('label') == filterValue[2]});
if (!optgroup.length) {optgroup = $('<optgroup>').attr('label', filterValue[2]);}
@ -201,7 +206,7 @@ function buildFilterRow(field, operator, values) {
}
} else {
option.val(filterValue).text(filterValue);
if ($.inArray(filterValue, values) > -1) {option.attr('selected', true);}
if ($.inArray(filterValue, values) > -1) {option.prop('selected', true);}
}
select.append(option);
}
@ -235,7 +240,7 @@ function buildFilterRow(field, operator, values) {
var filterValue = filterValues[i];
var option = $('<option>');
option.val(filterValue[1]).text(filterValue[0]);
if (values[0] == filterValue[1]) { option.attr('selected', true); }
if (values[0] == filterValue[1]) { option.prop('selected', true); }
select.append(option);
}
break;
@ -289,11 +294,14 @@ function toggleOperator(field) {
switch (operator.val()) {
case "!*":
case "*":
case "nd":
case "t":
case "ld":
case "nw":
case "w":
case "lw":
case "l2w":
case "nm":
case "m":
case "lm":
case "y":
@ -342,15 +350,71 @@ function toggleMultiSelect(el) {
function showTab(name, url) {
$('#tab-content-' + name).parent().find('.tab-content').hide();
$('#tab-content-' + name).parent().find('div.tabs a').removeClass('selected');
$('#tab-content-' + name).show();
$('#tab-' + name).closest('.tabs').find('a').removeClass('selected');
$('#tab-' + name).addClass('selected');
//replaces current URL with the "href" attribute of the current link
//(only triggered if supported by browser)
if ("replaceState" in window.history) {
replaceInHistory(url)
return false;
}
function showIssueHistory(journal, url) {
tab_content = $('#tab-content-history');
tab_content.parent().find('.tab-content').hide();
tab_content.show();
tab_content.parent().children('div.tabs').find('a').removeClass('selected');
$('#tab-' + journal).addClass('selected');
replaceInHistory(url)
switch(journal) {
case 'notes':
tab_content.find('.journal:not(.has-notes)').hide();
tab_content.find('.journal.has-notes').show();
break;
case 'properties':
tab_content.find('.journal.has-notes').hide();
tab_content.find('.journal:not(.has-notes)').show();
break;
default:
tab_content.find('.journal').show();
}
return false;
}
function getRemoteTab(name, remote_url, url, load_always) {
load_always = load_always || false;
var tab_content = $('#tab-content-' + name);
tab_content.parent().find('.tab-content').hide();
tab_content.parent().children('div.tabs').find('a').removeClass('selected');
$('#tab-' + name).addClass('selected');
replaceInHistory(url);
if (tab_content.children().length == 0 && load_always == false) {
$.ajax({
url: remote_url,
type: 'get',
success: function(data){
tab_content.html(data)
}
});
}
tab_content.show();
return false;
}
//replaces current URL with the "href" attribute of the current link
//(only triggered if supported by browser)
function replaceInHistory(url) {
if ("replaceState" in window.history && url !== undefined) {
window.history.replaceState(null, document.title, url);
}
return false;
}
function moveTabRight(el) {
@ -426,7 +490,7 @@ function showModal(id, width, title) {
if (el.length === 0 || el.is(':visible')) {return;}
if (!title) title = el.find('h3.title').text();
// moves existing modals behind the transparent background
$(".modal").zIndex(99);
$(".modal").css('zIndex',99);
el.dialog({
width: width,
modal: true,
@ -434,7 +498,7 @@ function showModal(id, width, title) {
dialogClass: 'modal',
title: title
}).on('dialogclose', function(){
$(".modal").zIndex(101);
$(".modal").css('zIndex',101);
});
el.find("input[type=text], input[type=submit]").first().focus();
}
@ -449,17 +513,6 @@ function hideModal(el) {
modal.dialog("close");
}
function submitPreview(url, form, target) {
$.ajax({
url: url,
type: 'post',
data: $('#'+form).serialize(),
success: function(data){
$('#'+target).html(data);
}
});
}
function collapseScmEntry(id) {
$('.'+id).each(function() {
if ($(this).hasClass('open')) {
@ -484,10 +537,12 @@ function scmEntryClick(id, url) {
var el = $('#'+id);
if (el.hasClass('open')) {
collapseScmEntry(id);
el.find('.expander').switchClass('icon-expended', 'icon-collapsed');
el.addClass('collapsed');
return false;
} else if (el.hasClass('loaded')) {
expandScmEntry(id);
el.find('.expander').switchClass('icon-collapsed', 'icon-expended');
el.removeClass('collapsed');
return false;
}
@ -500,6 +555,7 @@ function scmEntryClick(id, url) {
success: function(data) {
el.after(data);
el.addClass('open').addClass('loaded').removeClass('loading');
el.find('.expander').switchClass('icon-collapsed', 'icon-expended');
}
});
return true;
@ -767,6 +823,36 @@ function setupTabs() {
}
}
function setupFilePreviewNavigation() {
// only bind arrow keys when preview navigation is present
const element = $('.pagination.filepreview').first();
if (element) {
const handleArrowKey = function(selector, e){
const href = $(element).find(selector).attr('href');
if (href) {
window.location = href;
e.preventDefault();
}
};
$(document).keydown(function(e) {
if(e.shiftKey || e.metaKey || e.ctrlKey || e.altKey) return;
switch(e.key) {
case 'ArrowLeft':
handleArrowKey('.previous a', e);
break;
case 'ArrowRight':
handleArrowKey('.next a', e);
break;
}
});
}
}
function hideOnLoad() {
$('.hol').hide();
}
@ -844,6 +930,33 @@ function toggleNewObjectDropdown() {
$(document).ready(function(){
$('#content').on('change', 'input[data-disables], input[data-enables], input[data-shows]', toggleDisabledOnChange);
toggleDisabledInit();
$('#history .tabs').on('click', 'a', function(e){
var tab = $(e.target).attr('id').replace('tab-','');
document.cookie = 'history_last_tab=' + tab
});
});
$(document).ready(function(){
$('#content').on('click', 'div.jstTabs a.tab-preview', function(event){
var tab = $(event.target);
var url = tab.data('url');
var form = tab.parents('form');
var jstBlock = tab.parents('.jstBlock');
var element = encodeURIComponent(jstBlock.find('.wiki-edit').val());
var attachments = form.find('.attachments_fields input').serialize();
$.ajax({
url: url,
type: 'post',
data: "text=" + element + '&' + attachments,
success: function(data){
jstBlock.find('.wiki-preview').html(data);
}
});
});
});
function keepAnchorOnSignIn(form){
@ -857,8 +970,98 @@ function keepAnchorOnSignIn(form){
return true;
}
$(function ($) {
$('#auth_source_ldap_mode').change(function () {
$('.ldaps_warning').toggle($(this).val() != 'ldaps_verify_peer');
}).change();
});
function setFilecontentContainerHeight() {
var $filecontainer = $('.filecontent-container');
var fileTypeSelectors = ['.image', 'video'];
if($filecontainer.length > 0 && $filecontainer.find(fileTypeSelectors.join(',')).length === 1) {
var containerOffsetTop = $filecontainer.offset().top;
var containerMarginBottom = parseInt($filecontainer.css('marginBottom'));
var paginationHeight = $filecontainer.next('.pagination').height();
var diff = containerOffsetTop + containerMarginBottom + paginationHeight;
$filecontainer.css('height', 'calc(100vh - ' + diff + 'px)')
}
}
function setupAttachmentDetail() {
setFilecontentContainerHeight();
$(window).resize(setFilecontentContainerHeight);
}
$(function () {
$('[title]').tooltip({
show: {
delay: 400
},
position: {
my: "center bottom-5",
at: "center top"
}
});
});
function inlineAutoComplete(element) {
'use strict';
// do not attach if Tribute is already initialized
if (element.dataset.tribute === 'true') {return;}
const issuesUrl = element.dataset.issuesUrl;
const usersUrl = element.dataset.usersUrl;
const remoteSearch = function(url, cb) {
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = function ()
{
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
cb(data);
} else if (xhr.status === 403) {
cb([]);
}
}
};
xhr.open("GET", url, true);
xhr.send();
};
const tribute = new Tribute({
trigger: '#',
values: function (text, cb) {
if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
$(element).attr('autocomplete', 'off');
}
remoteSearch(issuesUrl + text, function (issues) {
return cb(issues);
});
},
lookup: 'label',
fillAttr: 'label',
requireLeadingSpace: true,
selectTemplate: function (issue) {
return '#' + issue.original.id;
}
});
tribute.attach(element);
}
$(document).ready(setupAjaxIndicator);
$(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit);
$(document).ready(defaultFocus);
$(document).ready(setupAttachmentDetail);
$(document).ready(setupTabs);
$(document).ready(setupFilePreviewNavigation);
$(document).on('focus', '[data-auto-complete=true]', function(event) {
inlineAutoComplete(event.target);
});

View file

@ -1,5 +1,5 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
function addFile(inputEl, file, eagerUpload) {
var attachmentsFields = $(inputEl).closest('.attachments_form').find('.attachments_fields');
@ -103,7 +103,7 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
}, options);
uploadUrl = uploadUrl + '?attachment_id=' + attachmentId;
if (blob instanceof window.File) {
if (blob instanceof window.Blob) {
uploadUrl += '&filename=' + encodeURIComponent(blob.name);
uploadUrl += '&content_type=' + encodeURIComponent(blob.type);
}
@ -185,6 +185,7 @@ handleFileDropEvent.target = '';
function dragOverHandler(e) {
$(this).addClass('fileover');
blockEventPropagation(e);
e.dataTransfer.dropEffect = 'copy';
}
function dragOutHandler(e) {
@ -195,13 +196,15 @@ function dragOutHandler(e) {
function setupFileDrop() {
if (window.File && window.FileList && window.ProgressEvent && window.FormData) {
$.event.fixHooks.dragover = { props: [ 'dataTransfer' ] };
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
$('form div.box:not(.filedroplistner)').has('input:file.filedrop').each(function() {
$(this).on({
dragover: dragOverHandler,
dragleave: dragOutHandler,
drop: handleFileDropEvent
drop: handleFileDropEvent,
paste: copyImageFromClipboard
}).addClass('filedroplistner');
});
}
@ -237,8 +240,7 @@ function addInlineAttachmentMarkup(file) {
'selectionStart': cursorPosition + newLineBefore,
'selectionEnd': cursorPosition + inlineFilename.length + newLineBefore
});
$textarea.closest('.jstEditor')
.siblings('.jstElements')
$textarea.parents('.jstBlock')
.find('.jstb_img').click();
// move cursor into next line
@ -251,6 +253,35 @@ function addInlineAttachmentMarkup(file) {
}
}
function copyImageFromClipboard(e) {
if (!$(e.target).hasClass('wiki-edit')) { return; }
var clipboardData = e.clipboardData || e.originalEvent.clipboardData
if (!clipboardData) { return; }
if (clipboardData.types.some(function(t){ return /^text/.test(t); })) { return; }
var items = clipboardData.items
for (var i = 0 ; i < items.length ; i++) {
var item = items[i];
if (item.type.indexOf("image") != -1) {
var blob = item.getAsFile();
var date = new Date();
var filename = 'clipboard-'
+ date.getFullYear()
+ ('0'+(date.getMonth()+1)).slice(-2)
+ ('0'+date.getDate()).slice(-2)
+ ('0'+date.getHours()).slice(-2)
+ ('0'+date.getMinutes()).slice(-2)
+ '-' + randomKey(5).toLocaleLowerCase()
+ '.' + blob.name.split('.').pop();
var file = new Blob([blob], {type: blob.type});
file.name = filename;
var inputEl = $('input:file.filedrop').first()
handleFileDropEvent.target = e.target;
addFile(inputEl, file, true);
}
}
}
$(document).ready(setupFileDrop);
$(document).ready(function(){
$("input.deleted_attachment").change(function(){

View file

@ -1,11 +1,11 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
var contextMenuObserving;
function contextMenuRightClick(event) {
var target = $(event.target);
if (target.is('a')) {return;}
if (target.is('a:not(.js-contextmenu)')) {return;}
var tr = target.closest('.hascontextmenu').first();
if (tr.length < 1) {return;}
event.preventDefault();
@ -30,7 +30,12 @@ function contextMenuClick(event) {
if (event.which == 1 || (navigator.appVersion.match(/\bMSIE\b/))) {
var tr = target.closest('.hascontextmenu').first();
if (tr.length > 0) {
// a row was clicked, check if the click was on checkbox
// a row was clicked
if (target.is('td.checkbox')) {
// the td containing the checkbox was clicked, toggle the checkbox
target = target.find('input').first();
target.prop("checked", !target.prop("checked"));
}
if (target.is('input')) {
// a checkbox may be clicked
if (target.prop('checked')) {
@ -218,6 +223,7 @@ function contextMenuInit() {
if (!contextMenuObserving) {
$(document).click(contextMenuClick);
$(document).contextmenu(contextMenuRightClick);
$(document).on('click', '.js-contextmenu', contextMenuRightClick);
contextMenuObserving = true;
}
}

View file

@ -1,5 +1,5 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
var draw_gantt = null;
var draw_top;
@ -17,6 +17,7 @@ function setDrawArea() {
function getRelationsArray() {
var arr = new Array();
$.each($('div.task_todo[data-rels]'), function(index_div, element) {
if(!$(element).is(':visible')) return true;
var element_id = $(element).attr("id");
if (element_id != null) {
var issue_id = element_id.replace("task-todo-issue-", "");
@ -106,6 +107,7 @@ function getProgressLinesArray() {
var today_left = $('#today_line').position().left;
arr.push({left: today_left, top: 0});
$.each($('div.issue-subject, div.version-name'), function(index, element) {
if(!$(element).is(':visible')) return true;
var t = $(element).position().top - draw_top ;
var h = ($(element).height() / 9);
var element_top_upper = t - h;
@ -161,6 +163,37 @@ function drawGanttProgressLines() {
}
}
function drawSelectedColumns(){
if ($("#draw_selected_columns").prop('checked')) {
if(isMobile()) {
$('td.gantt_selected_column').each(function(i) {
$(this).hide();
});
}else{
$('.gantt_subjects_container').addClass('draw_selected_columns');
$('td.gantt_selected_column').each(function() {
$(this).show();
var column_name = $(this).attr('id');
$(this).resizable({
alsoResize: '.gantt_' + column_name + '_container, .gantt_' + column_name + '_container > .gantt_hdr',
minWidth: 20,
handles: "e",
create: function() {
$(".ui-resizable-e").css("cursor","ew-resize");
}
}).on('resize', function (e) {
e.stopPropagation();
});
});
}
}else{
$('td.gantt_selected_column').each(function (i) {
$(this).hide();
$('.gantt_subjects_container').removeClass('draw_selected_columns');
});
}
}
function drawGanttHandler() {
var folder = document.getElementById('gantt_draw_area');
if(draw_gantt != null)
@ -168,8 +201,103 @@ function drawGanttHandler() {
else
draw_gantt = Raphael(folder);
setDrawArea();
drawSelectedColumns();
if ($("#draw_progress_line").prop('checked'))
drawGanttProgressLines();
try{drawGanttProgressLines();}catch(e){}
if ($("#draw_relations").prop('checked'))
drawRelations();
$('#content').addClass('gantt_content');
}
function resizableSubjectColumn(){
$('.issue-subject, .project-name, .version-name').each(function(){
$(this).width($(".gantt_subjects_column").width()-$(this).position().left);
});
$('td.gantt_subjects_column').resizable({
alsoResize: '.gantt_subjects_container, .gantt_subjects_container>.gantt_hdr, .project-name, .issue-subject, .version-name',
minWidth: 100,
handles: 'e',
create: function( event, ui ) {
$('.ui-resizable-e').css('cursor','ew-resize');
}
}).on('resize', function (e) {
e.stopPropagation();
});
if(isMobile()) {
$('td.gantt_subjects_column').resizable('disable');
}else{
$('td.gantt_subjects_column').resizable('enable');
};
}
ganttEntryClick = function(e){
var icon_expander = e.target;
var subject = $(icon_expander.parentElement);
var subject_left = parseInt(subject.css('left')) + parseInt(icon_expander.offsetWidth);
var target_shown = null;
var target_top = 0;
var total_height = 0;
var out_of_hierarchy = false;
var iconChange = null;
if(subject.hasClass('open'))
iconChange = function(element){
$(element).find('.expander').switchClass('icon-expended', 'icon-collapsed');
$(element).removeClass('open');
};
else
iconChange = function(element){
$(element).find('.expander').switchClass('icon-collapsed', 'icon-expended');
$(element).addClass('open');
};
iconChange(subject);
subject.nextAll('div').each(function(_, element){
var el = $(element);
var json = el.data('collapse-expand');
if(out_of_hierarchy || parseInt(el.css('left')) <= subject_left){
out_of_hierarchy = true;
if(target_shown == null) return false;
var new_top_val = parseInt(el.css('top')) + total_height * (target_shown ? -1 : 1);
el.css('top', new_top_val);
$('#gantt_area form > div[data-collapse-expand="' + json.obj_id + '"], td.gantt_selected_column div[data-collapse-expand="' + json.obj_id + '"]').each(function(_, el){
$(el).css('top', new_top_val);
});
return true;
}
var is_shown = el.is(':visible');
if(target_shown == null){
target_shown = is_shown;
target_top = parseInt(el.css('top'));
total_height = 0;
}
if(is_shown == target_shown){
$('#gantt_area form > div[data-collapse-expand="' + json.obj_id + '"]').each(function(_, task) {
var el_task = $(task);
if(!is_shown)
el_task.css('top', target_top + total_height);
if(!el_task.hasClass('tooltip'))
el_task.toggle(!is_shown);
});
$('td.gantt_selected_column div[data-collapse-expand="' + json.obj_id + '"]'
).each(function (_, attr) {
var el_attr = $(attr);
if (!is_shown)
el_attr.css('top', target_top + total_height);
el_attr.toggle(!is_shown);
});
if(!is_shown)
el.css('top', target_top + total_height);
iconChange(el);
el.toggle(!is_shown);
total_height += parseInt(json.top_increment);
}
});
drawGanttHandler();
};
function disable_unavailable_columns(unavailable_columns) {
$.each(unavailable_columns, function (index, value) {
$('#available_c, #selected_c').children("[value='" + value + "']").prop('disabled', true);
});
}

File diff suppressed because one or more lines are too long

View file

@ -7,12 +7,12 @@
* 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.
*
*
* DotClear 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 DotClear; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@ -34,15 +34,46 @@ function jsToolBar(textarea) {
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.textarea.parentNode.insertBefore(this.editor,this.textarea);
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.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';
this.editor.parentNode.insertBefore(this.toolbar,this.editor);
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/))
@ -53,19 +84,40 @@ function jsToolBar(textarea) {
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() {
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
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;
@ -91,6 +143,7 @@ jsButton.prototype.draw = function() {
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; };
@ -110,7 +163,7 @@ jsSpace.prototype.draw = function() {
if (this.width) span.style.marginRight = this.width+'px';
return span;
}
}
function jsCombo(title, options, scope, fn, className) {
this.title = title || null;
@ -136,7 +189,7 @@ jsCombo.prototype.draw = function() {
var This = this;
select.onchange = function() {
try {
try {
This.fn.call(This.scope, this.value);
} catch (e) { alert(e); }
@ -152,7 +205,7 @@ jsToolBar.prototype = {
mode: 'wiki',
elements: {},
help_link: '',
getMode: function() {
return this.mode;
},
@ -170,6 +223,10 @@ jsToolBar.prototype = {
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;
@ -292,7 +349,6 @@ jsToolBar.prototype = {
encloseSelection: function(prefix, suffix, fn) {
this.textarea.focus();
prefix = prefix || '';
suffix = suffix || '';
@ -305,8 +361,13 @@ jsToolBar.prototype = {
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 + " ";
@ -338,7 +399,24 @@ jsToolBar.prototype = {
this.textarea.scrollTop = scrollPos;
}
},
showPreview: function(event) {
if (event.target.classList.contains('selected')) { return; }
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.getElementsByClassName('tab-edit')[0].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.preview.classList.add('hidden');
this.tabsBlock.getElementsByClassName('tab-preview')[0].classList.remove('selected');
event.target.classList.add('selected');
},
stripBaseURL: function(url) {
if (this.base_url != '') {
var pos = url.indexOf(this.base_url);
@ -375,10 +453,10 @@ jsToolBar.prototype.resizeDragStop = function(event) {
/* Code highlighting menu */
jsToolBar.prototype.precodeMenu = function(fn){
var codeRayLanguages = ["c", "clojure", "cpp", "css", "delphi", "diff", "erb", "go", "groovy", "haml", "html", "java", "javascript", "json", "lua", "php", "python", "ruby", "sass", "sql", "taskpaper", "text", "xml", "yaml"];
var hlLanguages = ["c", "cpp", "csharp", "css", "diff", "go", "groovy", "html", "java", "javascript", "objc", "perl", "php", "python", "r", "ruby", "sass", "scala", "shell", "sql", "swift", "xml", "yaml"];
var menu = $("<ul style='position:absolute;'></ul>");
for (var i = 0; i < codeRayLanguages.length; i++) {
$("<li></li>").text(codeRayLanguages[i]).appendTo(menu).mousedown(function(){
for (var i = 0; i < hlLanguages.length; i++) {
$("<li></li>").text(hlLanguages[i]).appendTo(menu).mousedown(function(){
fn($(this).text());
});
}

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'إزالة الاقتباس';
jsToolBar.strings['Preformatted text'] = 'نص مسبق التنسيق';
jsToolBar.strings['Wiki link'] = 'رابط الى صفحة ويكي';
jsToolBar.strings['Image'] = 'صورة';
jsToolBar.strings['Edit'] = 'تعديل';
jsToolBar.strings['Preview'] = 'معاينة';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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ış';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Премахване на цитат';
jsToolBar.strings['Preformatted text'] = 'Форматиран текст';
jsToolBar.strings['Wiki link'] = 'Връзка до Wiki страница';
jsToolBar.strings['Image'] = 'Изображение';
jsToolBar.strings['Edit'] = 'Редакция';
jsToolBar.strings['Preview'] = 'Преглед';

View file

@ -13,3 +13,5 @@ jsToolBar.strings['Ordered list'] = 'Ordered list';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Sense cometes';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Fjern citér';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Quitar cita';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Quitar cita';
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';

View file

@ -32,3 +32,5 @@ jsToolBar.strings['Unquote'] = 'Tsitaat: aste madalamaks';
jsToolBar.strings['Preformatted text'] = 'Eelvormindatud tekst';
jsToolBar.strings['Wiki link'] = 'Vikilehe link';
jsToolBar.strings['Image'] = 'Pilt';
jsToolBar.strings['Edit'] = 'Muuda';
jsToolBar.strings['Preview'] = 'Eelvaade';

View file

@ -19,3 +19,5 @@ jsToolBar.strings['Unquote'] = 'Aipamena kendu';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'بیرون آوردن';
jsToolBar.strings['Preformatted text'] = 'نوشته قالب بندی شده';
jsToolBar.strings['Wiki link'] = 'پیوند به برگ ویکی';
jsToolBar.strings['Image'] = 'عکس';
jsToolBar.strings['Edit'] = 'ویرایش';
jsToolBar.strings['Preview'] = 'پیش‌نمایش';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Supprimer indentation';
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';

View file

@ -1,7 +1,7 @@
jsToolBar.strings = {};
jsToolBar.strings['Strong'] = 'Negriña';
jsToolBar.strings['Italic'] = 'Itálica';
jsToolBar.strings['Underline'] = 'Suliñado';
jsToolBar.strings['Underline'] = 'Subliñado';
jsToolBar.strings['Deleted'] = 'Tachado';
jsToolBar.strings['Code'] = 'Código fonte';
jsToolBar.strings['Heading 1'] = 'Encabezado 1';
@ -13,5 +13,7 @@ jsToolBar.strings['Ordered list'] = 'Lista ordenada';
jsToolBar.strings['Quote'] = 'Citar';
jsToolBar.strings['Unquote'] = 'Quitar cita';
jsToolBar.strings['Preformatted text'] = 'Texto con formato';
jsToolBar.strings['Wiki link'] = 'Enlace a páxina Wiki';
jsToolBar.strings['Wiki link'] = 'Ligazón a páxina Wiki';
jsToolBar.strings['Image'] = 'Imaxe';
jsToolBar.strings['Edit'] = 'Modificar';
jsToolBar.strings['Preview'] = 'Vista previa';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
jsToolBar.strings['Preformatted text'] = 'Preformatted text';
jsToolBar.strings['Wiki link'] = 'Link to a Wiki page';
jsToolBar.strings['Image'] = 'Image';
jsToolBar.strings['Edit'] = 'ערוך';
jsToolBar.strings['Preview'] = 'תצוגה מקדימה';

View file

@ -14,4 +14,6 @@ jsToolBar.strings['Quote'] = 'Citat';
jsToolBar.strings['Unquote'] = 'Ukloni citat';
jsToolBar.strings['Preformatted text'] = 'Izveden tekst';
jsToolBar.strings['Wiki link'] = 'Link na Wiki stranicu';
jsToolBar.strings['Image'] = 'Slika';
jsToolBar.strings['Image'] = 'Slika';
jsToolBar.strings['Edit'] = 'Uredi';
jsToolBar.strings['Preview'] = 'Brzi pregled';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
jsToolBar.strings['Preformatted text'] = 'Előreformázott szöveg';
jsToolBar.strings['Wiki link'] = 'Link egy Wiki oldalra';
jsToolBar.strings['Image'] = 'Kép';
jsToolBar.strings['Edit'] = 'Szerkeszt';
jsToolBar.strings['Preview'] = 'Előnézet';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Hapus kutipan';
jsToolBar.strings['Preformatted text'] = 'Teks terformat';
jsToolBar.strings['Wiki link'] = 'Tautkan ke halaman wiki';
jsToolBar.strings['Image'] = 'Gambar';
jsToolBar.strings['Edit'] = 'Sunting';
jsToolBar.strings['Preview'] = 'Tinjauan';

View file

@ -18,3 +18,5 @@ jsToolBar.strings['Unquote'] = 'Riduci rientro';
jsToolBar.strings['Preformatted text'] = 'Testo preformattato';
jsToolBar.strings['Wiki link'] = 'Collegamento a pagina Wiki';
jsToolBar.strings['Image'] = 'Immagine';
jsToolBar.strings['Edit'] = 'Modifica';
jsToolBar.strings['Preview'] = 'Anteprima';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = '引用解除';
jsToolBar.strings['Preformatted text'] = '整形済みテキスト';
jsToolBar.strings['Wiki link'] = 'Wikiページへのリンク';
jsToolBar.strings['Image'] = '画像';
jsToolBar.strings['Edit'] = '編集';
jsToolBar.strings['Preview'] = 'プレビュー';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = '인용 취소';
jsToolBar.strings['Preformatted text'] = '있는 그대로 표현 (Preformatted text)';
jsToolBar.strings['Wiki link'] = 'Wiki 페이지에 연결';
jsToolBar.strings['Image'] = '그림';
jsToolBar.strings['Edit'] = '편집';
jsToolBar.strings['Preview'] = '미리보기';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Pašalinti citavimą';
jsToolBar.strings['Preformatted text'] = 'Preformatuotas tekstas';
jsToolBar.strings['Wiki link'] = 'Nuoroda į Wiki puslapį';
jsToolBar.strings['Image'] = 'Paveikslas';
jsToolBar.strings['Edit'] = 'Redaguoti';
jsToolBar.strings['Preview'] = 'Peržiūra';

View file

@ -16,3 +16,5 @@ jsToolBar.strings['Unquote'] = 'Noņemt citātu';
jsToolBar.strings['Preformatted text'] = 'Iepriekš formatēts teksts';
jsToolBar.strings['Wiki link'] = 'Saite uz Wiki lapu';
jsToolBar.strings['Image'] = 'Attēls';
jsToolBar.strings['Edit'] = 'Labot';
jsToolBar.strings['Preview'] = 'Priekšskatījums';

View file

@ -15,4 +15,5 @@ jsToolBar.strings['Unquote'] = 'Отстрани цитат';
jsToolBar.strings['Preformatted text'] = 'Форматиран текст';
jsToolBar.strings['Wiki link'] = 'Врска до вики страна';
jsToolBar.strings['Image'] = 'Слика';
jsToolBar.strings['Edit'] = 'Уреди';
jsToolBar.strings['Preview'] = 'Preview';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Ишлэлийг устгах';
jsToolBar.strings['Preformatted text'] = 'Өмнө нь хэлбэржсэн текст';
jsToolBar.strings['Wiki link'] = 'Вики хуудас руу холбох';
jsToolBar.strings['Image'] = 'Зураг';
jsToolBar.strings['Edit'] = 'Засварлах';
jsToolBar.strings['Preview'] = 'Ямар харагдахыг шалгах';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Citaat verwijderen';
jsToolBar.strings['Preformatted text'] = 'Vooropgemaakte tekst';
jsToolBar.strings['Wiki link'] = 'Link naar een Wikipagina';
jsToolBar.strings['Image'] = 'Afbeelding';
jsToolBar.strings['Edit'] = 'Bewerken';
jsToolBar.strings['Preview'] = 'Voorbeeldweergave';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Avslutt sitat';
jsToolBar.strings['Preformatted text'] = 'Preformatert tekst';
jsToolBar.strings['Wiki link'] = 'Lenke til Wiki-side';
jsToolBar.strings['Image'] = 'Bilde';
jsToolBar.strings['Edit'] = 'Endre';
jsToolBar.strings['Preview'] = 'Forhåndsvis';

View file

@ -16,3 +16,5 @@ jsToolBar.strings['Unquote'] = 'Usuń cytat';
jsToolBar.strings['Preformatted text'] = 'Sformatowany tekst';
jsToolBar.strings['Wiki link'] = 'Odnośnik do strony Wiki';
jsToolBar.strings['Image'] = 'Obraz';
jsToolBar.strings['Edit'] = 'Edytuj';
jsToolBar.strings['Preview'] = 'Podgląd';

View file

@ -17,3 +17,5 @@ jsToolBar.strings['Unquote'] = 'Remover identação';
jsToolBar.strings['Preformatted text'] = 'Texto pré-formatado';
jsToolBar.strings['Wiki link'] = 'Link para uma página Wiki';
jsToolBar.strings['Image'] = 'Imagem';
jsToolBar.strings['Edit'] = 'Editar';
jsToolBar.strings['Preview'] = 'Pré-visualizar';

View file

@ -16,3 +16,5 @@ jsToolBar.strings['Unquote'] = 'Remover citação';
jsToolBar.strings['Preformatted text'] = 'Texto pré-formatado';
jsToolBar.strings['Wiki link'] = 'Link para uma página da Wiki';
jsToolBar.strings['Image'] = 'Imagem';
jsToolBar.strings['Edit'] = 'Editar';
jsToolBar.strings['Preview'] = 'Pré-visualizar';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Fără citat';
jsToolBar.strings['Preformatted text'] = 'Text preformatat';
jsToolBar.strings['Wiki link'] = 'Trimitere către o pagină wiki';
jsToolBar.strings['Image'] = 'Imagine';
jsToolBar.strings['Edit'] = 'Editează';
jsToolBar.strings['Preview'] = 'Previzualizare';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Удалить цитату';
jsToolBar.strings['Preformatted text'] = 'Заранее форматированный текст';
jsToolBar.strings['Wiki link'] = 'Ссылка на страницу в Wiki';
jsToolBar.strings['Image'] = 'Вставка изображения';
jsToolBar.strings['Edit'] = 'Редактирование';
jsToolBar.strings['Preview'] = 'Предпросмотр';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Zrušiť odsadenie';
jsToolBar.strings['Preformatted text'] = 'Predformátovaný text';
jsToolBar.strings['Wiki link'] = 'Odkaz na wikistránku';
jsToolBar.strings['Image'] = 'Obrázok';
jsToolBar.strings['Edit'] = 'Upraviť';
jsToolBar.strings['Preview'] = 'Náhľad';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Odstrani citat';
jsToolBar.strings['Preformatted text'] = 'Predoblikovano besedilo';
jsToolBar.strings['Wiki link'] = 'Povezava na Wiki stran';
jsToolBar.strings['Image'] = 'Slika';
jsToolBar.strings['Edit'] = 'Uredi';
jsToolBar.strings['Preview'] = 'Predogled';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
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';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Ukloni navodnike';
jsToolBar.strings['Preformatted text'] = 'Prethodno formatiran tekst';
jsToolBar.strings['Wiki link'] = 'Veza prema Wiki strani';
jsToolBar.strings['Image'] = 'Slika';
jsToolBar.strings['Edit'] = 'Izmeni';
jsToolBar.strings['Preview'] = 'Pregled';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Уклони наводнике';
jsToolBar.strings['Preformatted text'] = 'Претходно форматиран текст';
jsToolBar.strings['Wiki link'] = 'Веза према Wiki страни';
jsToolBar.strings['Image'] = 'Слика';
jsToolBar.strings['Edit'] = 'Измени';
jsToolBar.strings['Preview'] = 'Преглед';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Ta bort citat';
jsToolBar.strings['Preformatted text'] = 'Förformaterad text';
jsToolBar.strings['Wiki link'] = 'Länk till en wikisida';
jsToolBar.strings['Image'] = 'Bild';
jsToolBar.strings['Edit'] = 'Ändra';
jsToolBar.strings['Preview'] = 'Förhandsgranska';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Remove Quote';
jsToolBar.strings['Preformatted text'] = 'รูปแบบข้อความคงที่';
jsToolBar.strings['Wiki link'] = 'เชื่อมโยงไปหน้า Wiki อื่น';
jsToolBar.strings['Image'] = 'รูปภาพ';
jsToolBar.strings['Edit'] = 'แก้ไข';
jsToolBar.strings['Preview'] = 'ตัวอย่างก่อนจัดเก็บ';

View file

@ -13,3 +13,5 @@ jsToolBar.strings['Ordered list'] = 'Sıralı liste';
jsToolBar.strings['Preformatted text'] = 'Preformatted text';
jsToolBar.strings['Wiki link'] = 'Wiki sayfasına bağlantı';
jsToolBar.strings['Image'] = 'Resim';
jsToolBar.strings['Edit'] = 'Düzenle';
jsToolBar.strings['Preview'] = 'Önizleme';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Видалити цитування';
jsToolBar.strings['Preformatted text'] = 'Попередньо відформатований текст';
jsToolBar.strings['Wiki link'] = 'Посилання на сторінку Wiki';
jsToolBar.strings['Image'] = 'Зображення';
jsToolBar.strings['Edit'] = 'Редагувати';
jsToolBar.strings['Preview'] = 'Попередній перегляд';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = 'Bỏ trích dẫn';
jsToolBar.strings['Preformatted text'] = 'Mã nguồn';
jsToolBar.strings['Wiki link'] = 'Liên kết đến trang wiki';
jsToolBar.strings['Image'] = 'Ảnh';
jsToolBar.strings['Edit'] = 'Sửa';
jsToolBar.strings['Preview'] = 'Xem trước';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = '取消引文';
jsToolBar.strings['Preformatted text'] = '已格式文字';
jsToolBar.strings['Wiki link'] = '連結至 Wiki 頁面';
jsToolBar.strings['Image'] = '圖片';
jsToolBar.strings['Edit'] = '編輯';
jsToolBar.strings['Preview'] = '預覽';

View file

@ -15,3 +15,5 @@ jsToolBar.strings['Unquote'] = '删除引用';
jsToolBar.strings['Preformatted text'] = '格式化文本';
jsToolBar.strings['Wiki link'] = '连接到 Wiki 页面';
jsToolBar.strings['Image'] = '图片';
jsToolBar.strings['Edit'] = '编辑';
jsToolBar.strings['Preview'] = '预览';

View file

@ -40,6 +40,15 @@ jsToolBar.prototype.elements.em = {
}
}
// ins
jsToolBar.prototype.elements.ins = {
type: 'button',
title: 'Underline',
fn: {
wiki: function() { this.singleTag('_') }
}
}
// del
jsToolBar.prototype.elements.del = {
type: 'button',
@ -166,7 +175,7 @@ jsToolBar.prototype.elements.pre = {
type: 'button',
title: 'Preformatted text',
fn: {
wiki: function() { this.encloseLineSelection('~~~\n', '\n~~~') }
wiki: function() { this.encloseLineSelection('```\n', '\n```') }
}
}
@ -178,7 +187,7 @@ jsToolBar.prototype.elements.precode = {
wiki: function() {
var This = this;
this.precodeMenu(function(lang){
This.encloseLineSelection('~~~ ' + lang + '\n', '\n~~~\n');
This.encloseLineSelection('``` ' + lang + '\n', '\n```\n');
});
}
}

View file

@ -1,5 +1,5 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
// Automatic project identifier generation

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
$(document).ready(function() {
/*

View file

@ -1,5 +1,5 @@
/* Redmine - project management software
Copyright (C) 2006-2017 Jean-Philippe Lang */
Copyright (C) 2006-2019 Jean-Philippe Lang */
var revisionGraph = null;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long