summernote-rails 0.6.5.0 → 0.6.6.0

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: be0643d568fdb6a2066aab7bf5c9391585526a22
4
- data.tar.gz: 50cf01fb4366b9efb9c7aa2976f9a198ae921c91
3
+ metadata.gz: 19b45bb9daa2646246b1105c3bd4b0aa9af022a9
4
+ data.tar.gz: 1a4d108c0c78d1087f76f63c8caaff9a369caa21
5
5
  SHA512:
6
- metadata.gz: 580fca4c1b9dd5174c5bb47bfd484cefc4917236d8a09131081fb47768abaaa9ba09bdfeb4f01b0e019bc8059f66e9e1716ecfd8de84008acb15fdeff441fe57
7
- data.tar.gz: c05e152907bd0c0e85d2ccf1992a491479fb023caf466d1a902f02f8b1f999e6d6956bec55e6fa6b12fe8f9abde53912d6350bfc7e4f15c88bb0b6043423f1eb
6
+ metadata.gz: cd390d9edd16033ecccd36cdbe55e0d19663b1debfc24a6e9820d9cc19b8c969aec92641cc418ae6fd9881bf0c45c996abe5587191495aee7ec36e7de8470571
7
+ data.tar.gz: 5ac15a12993e99f3443c6e92ea841e80952edbafcd4dbb42a96a806ac8341c8b8387b6b3f4f114cc7fe169e42a79d34f888dff6ae85f2a79193fd3bd075a6fd7
@@ -1,5 +1,5 @@
1
1
  module SummernoteRails
2
2
  module Rails
3
- VERSION = "0.6.5.0"
3
+ VERSION = "0.6.6.0"
4
4
  end
5
5
  end
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Super simple wysiwyg editor on Bootstrap v0.6.5
2
+ * Super simple wysiwyg editor on Bootstrap v0.6.6
3
3
  * http://summernote.org/
4
4
  *
5
5
  * summernote.js
6
6
  * Copyright 2013-2015 Alan Hong. and other contributors
7
7
  * summernote may be freely distributed under the MIT license./
8
8
  *
9
- * Date: 2015-04-26T03:15Z
9
+ * Date: 2015-04-29T19:41Z
10
10
  */
11
11
  (function (factory) {
12
12
  /* global define */
@@ -1695,30 +1695,6 @@
1695
1695
  return this;
1696
1696
  };
1697
1697
 
1698
- /**
1699
- * Moves the scrollbar to start container(sc) of current range
1700
- *
1701
- * @return {WrappedRange}
1702
- */
1703
- this.scrollIntoView = function () {
1704
- if (this.sc.scrollIntoView) {
1705
- this.sc.scrollIntoView(false);
1706
- }
1707
-
1708
- return this;
1709
- };
1710
-
1711
- /**
1712
- * set a focus into start container of current range
1713
- *
1714
- * @return {WrappedRange}
1715
- */
1716
- this.focus = function () {
1717
- this.sc.focus();
1718
-
1719
- return this;
1720
- };
1721
-
1722
1698
  /**
1723
1699
  * @return {WrappedRange}
1724
1700
  */
@@ -2267,7 +2243,7 @@
2267
2243
  */
2268
2244
  var defaults = {
2269
2245
  /** @property */
2270
- version: '0.6.5',
2246
+ version: '0.6.6',
2271
2247
 
2272
2248
  /**
2273
2249
  *
@@ -3243,7 +3219,7 @@
3243
3219
  }
3244
3220
  }
3245
3221
 
3246
- range.create(nextPara, 0).normalize().select().focus().scrollIntoView();
3222
+ range.create(nextPara, 0).normalize().select();
3247
3223
 
3248
3224
  };
3249
3225
 
@@ -3397,17 +3373,17 @@
3397
3373
  };
3398
3374
 
3399
3375
  var triggerOnBeforeChange = function ($editable) {
3400
- // TODO find holder
3376
+ var $holder = dom.makeLayoutInfo($editable).holder();
3401
3377
  handler.bindCustomEvent(
3402
- $(), $editable.data('callbacks'), 'before.command'
3403
- ).call($editable.html(), $editable);
3378
+ $holder, $editable.data('callbacks'), 'before.command'
3379
+ )($editable.html(), $editable);
3404
3380
  };
3405
3381
 
3406
3382
  var triggerOnChange = function ($editable) {
3407
- // TODO find holder
3383
+ var $holder = dom.makeLayoutInfo($editable).holder();
3408
3384
  handler.bindCustomEvent(
3409
- $(), $editable.data('callbacks'), 'change'
3410
- ).call($editable.html(), $editable);
3385
+ $holder, $editable.data('callbacks'), 'change'
3386
+ )($editable.html(), $editable);
3411
3387
  };
3412
3388
 
3413
3389
  /**
@@ -4681,7 +4657,8 @@
4681
4657
  * @param {Object} layoutInfo
4682
4658
  */
4683
4659
  this.deactivate = function (layoutInfo) {
4684
- var $editor = layoutInfo.editor(),
4660
+ var $holder = layoutInfo.holder(),
4661
+ $editor = layoutInfo.editor(),
4685
4662
  $toolbar = layoutInfo.toolbar(),
4686
4663
  $editable = layoutInfo.editable(),
4687
4664
  $codable = layoutInfo.codable();
@@ -4695,10 +4672,19 @@
4695
4672
  cmEditor.toTextArea();
4696
4673
  }
4697
4674
 
4698
- $editable.html(dom.value($codable, options.prettifyHtml) || dom.emptyPara);
4675
+ var value = dom.value($codable, options.prettifyHtml) || dom.emptyPara;
4676
+ var isChange = $editable.html() !== value;
4677
+
4678
+ $editable.html(value);
4699
4679
  $editable.height(options.height ? $codable.height() : 'auto');
4700
4680
  $editor.removeClass('codeview');
4701
4681
 
4682
+ if (isChange) {
4683
+ handler.bindCustomEvent(
4684
+ $holder, $editable.data('callbacks'), 'change'
4685
+ )($editable.html(), $editable);
4686
+ }
4687
+
4702
4688
  $editable.focus();
4703
4689
 
4704
4690
  handler.invoke('toolbar.updateCodeview', $toolbar, false);
@@ -5140,7 +5126,6 @@
5140
5126
  *
5141
5127
  * EventHandler
5142
5128
  * - TODO: new instance per a editor
5143
- * - TODO: rename EventHandler
5144
5129
  */
5145
5130
  var EventHandler = function () {
5146
5131
  /**
@@ -5161,8 +5146,13 @@
5161
5146
  helpDialog: new HelpDialog(this)
5162
5147
  };
5163
5148
 
5164
- // TODO refactor modules and eventHandler
5165
- // - remove this method and use custom event from $holder instead
5149
+ /**
5150
+ * invoke module's method
5151
+ *
5152
+ * @param {String} moduleAndMethod - ex) 'editor.redo'
5153
+ * @param {...*} arguments - arguments of method
5154
+ * @return {*}
5155
+ */
5166
5156
  this.invoke = function () {
5167
5157
  var moduleAndMethod = list.head(list.from(arguments));
5168
5158
  var args = list.tail(list.from(arguments));
@@ -5198,7 +5188,7 @@
5198
5188
  return function () {
5199
5189
  var callback = callbacks[func.namespaceToCamel(eventNamespace, 'on')];
5200
5190
  if (callback) {
5201
- callback(arguments);
5191
+ callback.apply($holder[0], arguments);
5202
5192
  }
5203
5193
  return $holder.trigger('summernote.' + eventNamespace, arguments);
5204
5194
  };
@@ -5221,7 +5211,7 @@
5221
5211
 
5222
5212
  // If onImageUpload options setted
5223
5213
  if (callbacks.onImageUpload) {
5224
- bindCustomEvent($holder, callbacks, 'image.upload')([files]);
5214
+ bindCustomEvent($holder, callbacks, 'image.upload')(files);
5225
5215
  // else insert Image as dataURL
5226
5216
  } else {
5227
5217
  $.each(files, function (idx, file) {
@@ -5568,12 +5558,11 @@
5568
5558
  $editable.on('paste', bindCustomEvent($holder, callbacks, 'paste'));
5569
5559
 
5570
5560
  // [workaround] for old IE - IE8 don't have input events
5571
- if (agent.isMSIE) {
5572
- var sDomEvents = 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted';
5573
- $editable.on(sDomEvents, bindCustomEvent($holder, callbacks, 'change'));
5574
- } else {
5575
- $editable.on('input', bindCustomEvent($holder, callbacks, 'change'));
5576
- }
5561
+ // - TODO check IE version
5562
+ var changeEventName = agent.isMSIE ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';
5563
+ $editable.on(changeEventName, function () {
5564
+ bindCustomEvent($holder, callbacks, 'change')($editable.html(), $editable);
5565
+ });
5577
5566
 
5578
5567
  // callbacks for advanced features (camel)
5579
5568
  if (!options.airMode) {
@@ -6268,7 +6257,7 @@
6268
6257
  '<div class="title">' + lang.shortcut.shortcuts + '</div>' +
6269
6258
  (agent.isMac ? tplShortcutTable(lang, options) : replaceMacKeys(tplShortcutTable(lang, options))) +
6270
6259
  '<p class="text-center">' +
6271
- '<a href="//summernote.org/" target="_blank">Summernote 0.6.5</a> · ' +
6260
+ '<a href="//summernote.org/" target="_blank">Summernote 0.6.6</a> · ' +
6272
6261
  '<a href="//github.com/summernote/summernote" target="_blank">Project</a> · ' +
6273
6262
  '<a href="//github.com/summernote/summernote/issues" target="_blank">Issues</a>' +
6274
6263
  '</p>';
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: summernote-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5.0
4
+ version: 0.6.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hyo Seong Choi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties