Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Dec 30, 2019
2 parents cce4c18 + c961ca0 commit 376dd2d
Show file tree
Hide file tree
Showing 16 changed files with 316 additions and 49 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.20.0",
"version": "2.21.0",
"homepage": "https://github.com/Alex-D/Trumbowyg",
"authors": [
{
Expand Down
10 changes: 6 additions & 4 deletions docs/demos/plugins/resizimg.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2 class="section-title">Resizimg plugin</h2>
<div class="feature">
<h3>Basic usage</h3>
<p>
Images can be resized by dragging their bottom-right corner.
Images can be resized by click over the image and dragging their bottom-right corner (the red ones).
</p>

<a href="../../documentation/plugins/#plugin-resizimg" class="button button-demo">Read resizimg plugin documentation</a>
Expand Down Expand Up @@ -53,7 +53,9 @@ <h4>At the end of body</h4>
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">&lt;/script>
&lt;script>window.jQuery || document.write('&lt;script src="js/vendor/jquery-3.3.1.min.js">&lt;\/script>')&lt;/script>

&lt;!-- Import dependency for Resizimg. For a productive setup, follow install instructions here: https://github.com/RickStrahl/jquery-resizable -->
&lt;!-- Import only if you use JQuery UI with Resizable interaction -->
&lt;script src="//rawcdn.githack.com/trumbowyg/dist/plugins/resizimg/resizable-resolveconflict.min.js">&lt;/script>
&lt;!-- Import dependency for Resizimg. For a production setup, follow install instructions here: https://github.com/RickStrahl/jquery-resizable -->
&lt;script src="//rawcdn.githack.com/RickStrahl/jquery-resizable/master/dist/jquery-resizable.min.js">&lt;/script>
</code></pre>
</div>
Expand All @@ -70,8 +72,8 @@ <h4>At the end of body</h4>
<!-- DO NOT COPY THESE LINES IN YOUR PROJECT, THEY ARE THERE JUST FOR THE EXAMPLE PAGE PURPOSE -->
<script src="../js/loader.js"></script>
<script>
loadStyle('dist/ui/trumbowyg.min.css');
loadScript('dist/trumbowyg.min.js', 'Import Trumbowyg');
loadStyle('dist/ui/trumbowyg.css');
loadScript('dist/trumbowyg.js', 'Import Trumbowyg');
loadScript('dist/plugins/resizimg/trumbowyg.resizimg.min.js', 'Import all plugins you want AFTER importing jQuery and Trumbowyg');
</script>
<script src="../js/runExampleCode.js"></script>
Expand Down
7 changes: 7 additions & 0 deletions docs/documentation/plugins/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -977,12 +977,19 @@ <h4>Dependencies</h4>
<a href="https://github.com/RickStrahl/jquery-resizable" target="_blank">jquery-resizable</a> plugin,
which must be loaded beforehand.
</p>
<p>
If in your project use the JQuery UI library with resizable interaction you need to include this
<a href="https://github.com/Alex-D/Trumbowyg/tree/develop/plugins/resizimg/resolveconflict-resizable.js">script</a> to avoid issue before load jquery-resizable.
</p>

<h4>How to use it?</h4>
<pre><code class="html">
&lt;-- Import this only if you use jQuery UI with resizable extension -->
&lt;script src="trumbowyg/dist/plugins/resizimg/resolveconflict-resizable.min.js">&lt;/script>
&lt;-- Import jQuery resizimg plugin -->
&lt;script src="jquery-resizable/dist/jquery-resizable.min.js">&lt;/script>
&lt;-- Import Trumbowyg plugins... -->
&lt;script src="trumbowyg/dist/plugins/resizimg/resize.with.canvas.min.js">&lt;/script>
&lt;script src="trumbowyg/dist/plugins/resizimg/trumbowyg.resizimg.min.js">&lt;/script>
</code></pre>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "trumbowyg",
"title": "Trumbowyg",
"description": "A lightweight WYSIWYG editor",
"version": "2.20.0",
"version": "2.21.0",
"main": "dist/trumbowyg.js",
"homepage": "http://alex-d.github.io/Trumbowyg",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/emoji/trumbowyg.emoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@
defaultEmojiBtnDef = {
text: emoji,
fn: function () {
var encodedEmoji = String.fromCodePoint(emoji.replace("&#", "0"));
var encodedEmoji = String.fromCodePoint(emoji.replace('&#', '0'));
trumbowyg.execCmd('insertText', encodedEmoji);
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions plugins/giphy/trumbowyg.giphy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
fr: {
giphy: 'Insérer un GIF',
},
// jshint camelcase:true
}
});
// jshint camelcase:true

var giphyLogo = '<svg viewBox="0 0 231 53" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M48.32 22.386c0-1.388-.252-1.892-1.767-1.85-3.448.126-6.855.042-10.303.042H25.443c-.927 0-1.346.211-1.305 1.22.085 2.86.085 5.72.043 8.58 0 .883.252 1.169 1.169 1.135 2.018-.084 3.995-.042 6.014 0 1.64 0 4.164-.546 4.752.252.841 1.169.421 3.364.337 5.089-.043.547-.547 1.304-1.094 1.598-2.692 1.556-5.678 2.018-8.747 1.892-5.342-.21-9.336-2.439-11.481-7.527-1.388-3.364-1.725-6.855-1.01-10.43 1.01-4.963 3.407-8.747 8.58-10.051 5.215-1.305 10.136-.547 14.467 2.817 1.219.967 1.798.715 2.691-.294 1.514-1.724 3.154-3.322 4.753-4.963 1.892-1.933 1.892-1.892-.169-3.7C38.429.813 31.238-.617 23.5.224 12.818 1.393 5.248 6.658 1.59 17.045-.177 22.008-.428 27.097.623 32.227c1.682 7.914 5.551 14.12 13.289 17.368 6.898 2.901 14.046 3.448 21.321 1.598 4.331-1.093 8.411-2.608 11.354-6.223 1.136-1.388 1.725-2.902 1.682-4.71l.043-17.873.008-.001zm125.153 3.784l.042-23.046c0-1.136-.168-1.598-1.472-1.556a238.02 238.02 0 0 1-11.017 0c-1.136-.042-1.439.337-1.439 1.439v15.645c0 1.345-.421 1.556-1.641 1.556a422.563 422.563 0 0 0-14.593 0c-1.262.042-1.472-.421-1.439-1.556l.043-15.813c0-.926-.169-1.304-1.17-1.262h-11.513c-.927 0-1.304.169-1.304 1.22v46.764c0 .967.252 1.262 1.219 1.262h11.512c1.169.042 1.262-.462 1.262-1.388l-.042-15.644c0-1.053.251-1.346 1.304-1.346h15.14c1.22 0 1.388.421 1.388 1.472l-.042 15.477c0 1.093.21 1.472 1.388 1.439 3.615-.085 7.233-.085 10.807 0 1.304.042 1.598-.337 1.598-1.598l-.042-23.047.011-.018zM106.565 1.654c-8.369-.211-16.728-.126-25.065-.211-1.346 0-1.767.337-1.767 1.724l.043 23.004v23.215c0 1.009.168 1.439 1.304 1.387a271.22 271.22 0 0 1 11.691 0c1.094 0 1.346-.336 1.346-1.345l-.042-10.64c0-1.052.294-1.345 1.345-1.345 3.322.042 6.645.085 9.967-.085 4.407-.21 8.621-1.219 12.111-4.12 5.551-4.584 7.613-12.701 5.131-20.061-2.313-6.561-8.747-11.354-16.064-11.522v-.001zm-3.028 24.013c-2.818.042-5.594-.043-8.411.042-1.169.042-1.439-.378-1.345-1.439.084-1.556 0-3.069 0-4.626v-5.131c-.043-.841.251-1.094 1.052-1.052 2.986.042 5.929-.085 8.915.042 3.616.126 5.887 2.692 5.846 6.266-.126 3.658-2.313 5.846-6.055 5.887l-.002.011zM229.699 1.569c-4.458 0-8.915-.042-13.415.043-.629 0-1.472.503-1.85 1.052a505.695 505.695 0 0 0-8.957 14.214c-.884 1.472-1.22 1.169-1.977-.084l-8.496-14.089c-.503-.841-1.052-1.136-2.018-1.136l-13.078.043c-.462 0-.967.125-1.439.21.21.378.378.799.629 1.169l17.412 27.167c.462.715.715 1.682.757 2.524v16.653c0 1.052.168 1.514 1.388 1.472 3.784-.084 7.57-.084 11.354 0 1.136.043 1.304-.377 1.304-1.387l-.042-8.58c0-2.734-.084-5.51.042-8.243.043-.926.337-1.933.841-2.649l18.167-27.041c.252-.337.337-.758.547-1.17a3.636 3.636 0 0 0-1.169-.168zM70.104 2.661c0-1.009-.294-1.219-1.262-1.219H57.69c-1.262-.043-1.472.377-1.472 1.513l.042 23.004v23.34c0 1.053.126 1.514 1.346 1.473 3.7-.085 7.444-.043 11.152 0 .966 0 1.387-.085 1.387-1.262l-.042-46.857.001.008z" fill="currentColor" fill-rule="nonzero"/></svg>';

Expand Down Expand Up @@ -139,7 +139,6 @@
dataType: 'json',

success: function(response) {
console.log(arguments);
renderGifs(response, $giphyModal, trumbowyg, true);
},
error: ajaxError
Expand Down
2 changes: 2 additions & 0 deletions plugins/highlight/trumbowyg.highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
$.extend(true, $.trumbowyg, {
// Add some translations
langs: {
// jshint camelcase:false
en: {
highlight: 'Code syntax highlight'
},
Expand All @@ -68,6 +69,7 @@
ko: {
highlight: '코드 문법 하이라이트'
},
// jshint camelcase:true
},
// Add our plugin to Trumbowyg registered plugins
plugins: {
Expand Down
2 changes: 2 additions & 0 deletions plugins/history/trumbowyg.history.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'use strict';
$.extend(true, $.trumbowyg, {
langs: {
// jshint camelcase:false
de: {
history: {
redo: 'Wiederholen',
Expand Down Expand Up @@ -52,6 +53,7 @@
undo: '되돌리기'
}
},
// jshint camelcase:true
},
plugins: {
history: {
Expand Down
2 changes: 2 additions & 0 deletions plugins/insertaudio/trumbowyg.insertaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

$.extend(true, $.trumbowyg, {
langs: {
// jshint camelcase:false
en: {
insertAudio: 'Insert Audio'
},
Expand All @@ -57,6 +58,7 @@
ko: {
insertAudio: '소리 넣기'
},
// jshint camelcase:true
},
plugins: {
insertAudio: {
Expand Down
2 changes: 2 additions & 0 deletions plugins/noembed/trumbowyg.noembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

$.extend(true, $.trumbowyg, {
langs: {
// jshint camelcase:false
en: {
noembed: 'Noembed',
noembedError: 'Error'
Expand Down Expand Up @@ -56,6 +57,7 @@
noembed: 'oEmbed 넣기',
noembedError: '에러'
},
// jshint camelcase:true
},

plugins: {
Expand Down
20 changes: 20 additions & 0 deletions plugins/resizimg/resizable-resolveconflict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(function (factory, define, require, module) {
'use strict';

if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
// CommonJS
module.exports = factory(require('jquery'));
} else {
// Global jQuery
factory(jQuery);
}
}(function ($) {
'use strict';

// rename to avoid conflict with jquery-resizable
$.fn.uiresizable = $.fn.resizable;
delete $.fn.resizable;
}));
Loading

0 comments on commit 376dd2d

Please sign in to comment.