Skip to content

Commit

Permalink
2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Feb 15, 2017
1 parent df4c556 commit d01ecee
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 29 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trumbowyg",
"version": "2.4.2",
"version": "2.4.3",
"homepage": "https://github.com/Alex-D/Trumbowyg",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion dist/langs/fi.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/langs/fr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/langs/ru.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/sass/trumbowyg.colors.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.4.2 - A lightweight WYSIWYG editor
* Trumbowyg v2.4.3 - A lightweight WYSIWYG editor
* Colors plugin stylesheet for Trumbowyg editor
* ------------------------
* @link https://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.4.2 - A lightweight WYSIWYG editor
* Trumbowyg v2.4.3 - A lightweight WYSIWYG editor
* Colors plugin stylesheet for Trumbowyg editor
* ------------------------
* @link https://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions dist/plugins/upload/trumbowyg.upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
var defaultOptions = {
serverPath: './src/plugins/upload/trumbowyg.upload.php',
fileFieldName: 'fileToUpload',
data: [],
headers: {},
xhrFields: {},
urlPropertyName: 'file',
statusPropertyName: 'success',
success: undefined,
error: undefined
data: [], // Additional data for ajax [{name: 'key', value: 'value'}]
headers: {}, // Additional headers
xhrFields: {}, // Additional fields
urlPropertyName: 'file', // How to get url from the json response (for instance 'url' for {url: ....})
statusPropertyName: 'success', // How to get status from the json response
success: undefined, // Success callback: function (data, trumbowyg, $modal, values) {}
error: undefined // Error callback: function () {}
};

function getDeep(object, propertyParts) {
Expand Down
31 changes: 22 additions & 9 deletions dist/trumbowyg.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.4.2 - A lightweight WYSIWYG editor
* Trumbowyg v2.4.3 - A lightweight WYSIWYG editor
* Trumbowyg core file
* ------------------------
* @link https://alex-d.github.io/Trumbowyg
Expand Down Expand Up @@ -70,7 +70,9 @@ jQuery.trumbowyg = {
plugins: {},

// SVG Path globally
svgPath: null
svgPath: null,

hideButtonTexts: null
};


Expand Down Expand Up @@ -159,6 +161,8 @@ jQuery.trumbowyg = {
t.lang = $.trumbowyg.langs.en;
}

t.hideButtonTexts = $.trumbowyg.hideButtonTexts != null ? $.trumbowyg.hideButtonTexts : options.hideButtonTexts;

// SVG path
var svgPathOption = $.trumbowyg.svgPath != null ? $.trumbowyg.svgPath : options.svgPath;
t.hasSvg = svgPathOption !== false;
Expand Down Expand Up @@ -583,6 +587,8 @@ jQuery.trumbowyg = {
} else if (!ctrl && e.which !== 17 && !composition) {
t.semanticCode(false, e.which === 13);
t.$c.trigger('tbwchange');
} else if (typeof e.which === 'undefined' && composition) {
t.semanticCode(false, false, true);
}

setTimeout(function () {
Expand Down Expand Up @@ -708,7 +714,9 @@ jQuery.trumbowyg = {
$btn = $('<button/>', {
type: 'button',
class: prefix + btnName + '-button ' + (btn.class || '') + (!hasIcon ? ' ' + prefix + 'textual-button' : ''),
html: t.hasSvg && hasIcon ? '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' : (btn.text || btn.title || t.lang[btnName] || btnName),
html: t.hasSvg && hasIcon ?
'<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' :
t.hideButtonTexts ? '' : (btn.text || btn.title || t.lang[btnName] || btnName),
title: (btn.title || btn.text || textDef) + ((btn.key) ? ' (Ctrl + ' + btn.key + ')' : ''),
tabindex: -1,
mousedown: function () {
Expand Down Expand Up @@ -974,10 +982,12 @@ jQuery.trumbowyg = {

$(window).trigger('scroll');

$('body', d).on('mousedown.'+t.eventNamespace, function () {
$('.' + prefix + 'dropdown', d).hide();
$('.' + prefix + 'active', d).removeClass(prefix + 'active');
$('body', d).off('mousedown.'+t.eventNamespace);
$('body', d).on('mousedown.'+t.eventNamespace, function (e) {
if (!$dropdown.is(e.target)) {
$('.' + prefix + 'dropdown', d).hide();
$('.' + prefix + 'active', d).removeClass(prefix + 'active');
$('body', d).off('mousedown.'+t.eventNamespace);
}
});
}
},
Expand Down Expand Up @@ -1017,7 +1027,8 @@ jQuery.trumbowyg = {
// Analyse and update to semantic code
// @param force : force to sync code from textarea
// @param full : wrap text nodes in <p>
semanticCode: function (force, full) {
// @param keepRange : leave selection range as it is
semanticCode: function (force, full, keepRange) {
var t = this;
t.saveRange();
t.syncCode(force);
Expand Down Expand Up @@ -1066,7 +1077,9 @@ jQuery.trumbowyg = {
t.$ed.find('p:empty').remove();
}

t.restoreRange();
if (!keepRange) {
t.restoreRange();
}

t.syncTextarea();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/trumbowyg.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ui/sass/trumbowyg.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.4.2 - A lightweight WYSIWYG editor
* Trumbowyg v2.4.3 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor
* ------------------------
* @link https://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/ui/trumbowyg.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.4.2 - A lightweight WYSIWYG editor
* Trumbowyg v2.4.3 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor
* ------------------------
* @link https://alex-d.github.io/Trumbowyg
Expand Down
Loading

0 comments on commit d01ecee

Please sign in to comment.