simditor 2.3.5 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1f44c26e34b3aece6942197da6e3314d0c7c635
4
- data.tar.gz: 951effb9402b5164749c2c8ad72b35038ccebe3b
3
+ metadata.gz: 90022d714fce1f5ad22d442e42f723b4a6b8ca07
4
+ data.tar.gz: d2cd50d57ab4f38390bb788b1d4a320281481f3b
5
5
  SHA512:
6
- metadata.gz: 875fb95f73906783e4982f12f1a975686bc7a5beefe85b6344493439d945437434dd4e34da3d09ad0bae09fe383f21039bf2b7e9c3f51ae075e8497d4a2a2db5
7
- data.tar.gz: 34711d636b9dec976c9cc847a2c1b89af88088cf6139e5f9e10f0e768f11f7d5ee345c7f68ec708468bc5bb7ce08a9e60b6964c64237e3b2bd324a5fed782a92
6
+ metadata.gz: 9ca54cffd592bd2fb1addbd26be2f91e7dbb22b3c89f5944f0bf3408f9c70cd6d20e161531ffe60ae00562fa45d9d94a564af91aca7e5bbfc58ab70d9d0ba56f
7
+ data.tar.gz: b4a4ee18741ab25cde19c9e6cc3e49e454c88c9fb82ada5eefa23795bf27e0e5b12f587306f597350ea754fb99b422b600c2b97695204b6921d41a390fb22fe2
@@ -1,5 +1,5 @@
1
1
  module Simditor
2
2
  module Version
3
- EDITOR = "2.3.5"
3
+ EDITOR = "2.3.6"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * Simditor v2.3.5
2
+ * Simditor v2.3.6
3
3
  * http://simditor.tower.im/
4
- * 2015-11-19
4
+ * 2015-12-21
5
5
  */
6
6
  (function (root, factory) {
7
7
  if (typeof define === 'function' && define.amd) {
@@ -1348,7 +1348,8 @@ UndoManager = (function(superClass) {
1348
1348
  })(this));
1349
1349
  this.editor.on('selectionchanged', (function(_this) {
1350
1350
  return function(e) {
1351
- return _this.resetCaretPosition();
1351
+ _this.resetCaretPosition();
1352
+ return _this.update();
1352
1353
  };
1353
1354
  })(this));
1354
1355
  this.editor.on('focus', (function(_this) {
@@ -1430,7 +1431,7 @@ UndoManager = (function(superClass) {
1430
1431
  this.editor.hidePopover();
1431
1432
  this._index -= 1;
1432
1433
  state = this._stack[this._index];
1433
- this.editor.body.html(state.html);
1434
+ this.editor.body.get(0).innerHTML = state.html;
1434
1435
  this.caretPosition(state.caret);
1435
1436
  this.editor.body.find('.selected').removeClass('selected');
1436
1437
  this.editor.sync();
@@ -1445,7 +1446,7 @@ UndoManager = (function(superClass) {
1445
1446
  this.editor.hidePopover();
1446
1447
  this._index += 1;
1447
1448
  state = this._stack[this._index];
1448
- this.editor.body.html(state.html);
1449
+ this.editor.body.get(0).innerHTML = state.html;
1449
1450
  this.caretPosition(state.caret);
1450
1451
  this.editor.body.find('.selected').removeClass('selected');
1451
1452
  this.editor.sync();
@@ -1453,13 +1454,12 @@ UndoManager = (function(superClass) {
1453
1454
  };
1454
1455
 
1455
1456
  UndoManager.prototype.update = function() {
1456
- var currentState, html;
1457
+ var currentState;
1457
1458
  currentState = this.currentState();
1458
1459
  if (!currentState) {
1459
1460
  return;
1460
1461
  }
1461
- html = this.editor.body.html();
1462
- currentState.html = html;
1462
+ currentState.html = this.editor.body.html();
1463
1463
  return currentState.caret = this.caretPosition();
1464
1464
  };
1465
1465
 
@@ -2211,7 +2211,8 @@ Clipboard = (function(superClass) {
2211
2211
  Clipboard.pluginName = 'Clipboard';
2212
2212
 
2213
2213
  Clipboard.prototype.opts = {
2214
- pasteImage: false
2214
+ pasteImage: false,
2215
+ cleanPaste: false
2215
2216
  };
2216
2217
 
2217
2218
  Clipboard.prototype._init = function() {
@@ -2296,13 +2297,13 @@ Clipboard = (function(superClass) {
2296
2297
  return function() {
2297
2298
  var pasteContent;
2298
2299
  _this.editor.hidePopover();
2299
- _this.editor.body.html(state.html);
2300
+ _this.editor.body.get(0).innerHTML = state.html;
2300
2301
  _this.editor.undoManager.caretPosition(state.caret);
2301
2302
  _this.editor.body.focus();
2302
2303
  _this.editor.selection.reset();
2303
2304
  _this.editor.selection.range();
2304
2305
  _this._pasteInBlockEl = _this.editor.selection.blockNodes().last();
2305
- _this._pastePlainText = _this._pasteInBlockEl.is('pre, table');
2306
+ _this._pastePlainText = _this.opts.cleanPaste || _this._pasteInBlockEl.is('pre, table');
2306
2307
  if (_this._pastePlainText) {
2307
2308
  pasteContent = _this.editor.formatter.clearHtml(_this._pasteBin.html(), true);
2308
2309
  } else {
@@ -2569,7 +2570,7 @@ Simditor = (function(superClass) {
2569
2570
  Simditor.prototype.setValue = function(val) {
2570
2571
  this.hidePopover();
2571
2572
  this.textarea.val(val);
2572
- this.body.html(val);
2573
+ this.body.get(0).innerHTML = val;
2573
2574
  this.formatter.format();
2574
2575
  this.formatter.decorate();
2575
2576
  this.util.reflow(this.body);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wentao Liu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails assets wrapper for https://github.com/mycolorway/simditor
14
14
  email: