summernote-rails 0.6.7.0 → 0.6.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c02b349b30cb6166bfedc07dce5d0acae4e3bae
4
- data.tar.gz: bee6ade51443ad9daf85e2be658a1e52cdf740ea
3
+ metadata.gz: f5cb15d8591364b1ceb1017edf2162d29900cee9
4
+ data.tar.gz: 7c2d869058695740d1346e0be7fbbf424ac2a4df
5
5
  SHA512:
6
- metadata.gz: 117085c2a7aa565af37a70dbc9b28eefbd0bcab17e91e1e3c10eca1c4f8ec0d536df1b5d2c487e1c283aa7c303c6bcaccaf0751740808eee8729e8db924b45d7
7
- data.tar.gz: fcbbc94f20a79ba645c66177ec69cd32113a6cae2cf26b3976b37ef86efd39e1344d7113486fa740d4bee2b46ffa105e62564af5bd20f170ffa38a1ea0532cce
6
+ metadata.gz: f1f5990ca679cb884e949d73b2bbc8c1dc5e944f17d9e632b42e52ff90e3910051f122315685704e3345d8b139b2613282ab11e08bc61d1a09e461657a61ad4e
7
+ data.tar.gz: 962edc4c209758d9aee11d4a6a948163a203ebf482f2112b0bdd7394e737f7ddebf1b2a16366fc3bf1f5109d7880b03f29ca271e4b204e3b0cb5ba80f1996f8b
@@ -1,5 +1,5 @@
1
1
  module SummernoteRails
2
2
  module Rails
3
- VERSION = "0.6.7.0"
3
+ VERSION = "0.6.9.0"
4
4
  end
5
5
  end
@@ -0,0 +1,99 @@
1
+ (function ($) {
2
+ $.extend($.summernote.lang, {
3
+ 'bg-BG': {
4
+ font: {
5
+ bold: 'Удебелен',
6
+ italic: 'Наклонен',
7
+ underline: 'Подчертан',
8
+ clear: 'Изчисти стиловете',
9
+ height: 'Височина',
10
+ name: 'Шрифт',
11
+ strikethrough: 'Задраскано',
12
+ subscript: 'Долен индекс',
13
+ superscript: 'Горен индекс',
14
+ size: 'Размер на шрифта'
15
+ },
16
+ image: {
17
+ image: 'Изображение',
18
+ insert: 'Постави картинка',
19
+ resizeFull: 'Цял размер',
20
+ resizeHalf: 'Размер на 50%',
21
+ resizeQuarter: 'Размер на 25%',
22
+ floatLeft: 'Подравни в ляво',
23
+ floatRight: 'Подравни в дясно',
24
+ floatNone: 'Без подравняване',
25
+ dragImageHere: 'Пуснете изображението тук',
26
+ selectFromFiles: 'Изберете файл',
27
+ url: 'URL адрес на изображение',
28
+ remove: 'Премахни изображение'
29
+ },
30
+ link: {
31
+ link: 'Връзка',
32
+ insert: 'Добави връзка',
33
+ unlink: 'Премахни връзка',
34
+ edit: 'Промени',
35
+ textToDisplay: 'Текст за показване',
36
+ url: 'URL адрес',
37
+ openInNewWindow: 'Отвори в нов прозорец'
38
+ },
39
+ table: {
40
+ table: 'Таблица'
41
+ },
42
+ hr: {
43
+ insert: 'Добави хоризонтална линия'
44
+ },
45
+ style: {
46
+ style: 'Стил',
47
+ normal: 'Нормален',
48
+ blockquote: 'Цитат',
49
+ pre: 'Код',
50
+ h1: 'Заглавие 1',
51
+ h2: 'Заглавие 2',
52
+ h3: 'Заглавие 3',
53
+ h4: 'Заглавие 4',
54
+ h5: 'Заглавие 5',
55
+ h6: 'Заглавие 6'
56
+ },
57
+ lists: {
58
+ unordered: 'Символен списък',
59
+ ordered: 'Цифров списък'
60
+ },
61
+ options: {
62
+ help: 'Помощ',
63
+ fullscreen: 'На цял екран',
64
+ codeview: 'Преглед на код'
65
+ },
66
+ paragraph: {
67
+ paragraph: 'Параграф',
68
+ outdent: 'Намаляване на отстъпа',
69
+ indent: 'Абзац',
70
+ left: 'Подравняване в ляво',
71
+ center: 'Център',
72
+ right: 'Подравняване в дясно',
73
+ justify: 'Разтягане по ширина'
74
+ },
75
+ color: {
76
+ recent: 'Последния избран цвят',
77
+ more: 'Още цветове',
78
+ background: 'Цвят на фона',
79
+ foreground: 'Цвят на шрифта',
80
+ transparent: 'Прозрачен',
81
+ setTransparent: 'Направете прозрачен',
82
+ reset: 'Възстанови',
83
+ resetToDefault: 'Възстанови оригиналните'
84
+ },
85
+ shortcut: {
86
+ shortcuts: 'Клавишни комбинации',
87
+ close: 'Затвори',
88
+ textFormatting: 'Форматиране на текста',
89
+ action: 'Действие',
90
+ paragraphFormatting: 'Форматиране на параграф',
91
+ documentStyle: 'Стил на документа'
92
+ },
93
+ history: {
94
+ undo: 'Назад',
95
+ redo: 'Напред'
96
+ }
97
+ }
98
+ });
99
+ })(jQuery);
@@ -10,7 +10,7 @@
10
10
  name: 'Famille de police',
11
11
  strikethrough: 'Barré',
12
12
  superscript: 'Exposant',
13
- subscript: 'Indicé',
13
+ subscript: 'Indice',
14
14
  size: 'Taille de police'
15
15
  },
16
16
  image: {
@@ -22,8 +22,15 @@
22
22
  floatLeft: 'Aligné à gauche',
23
23
  floatRight: 'Aligné à droite',
24
24
  floatNone: 'Pas d\'alignement',
25
- dragImageHere: 'Faites glisser une image avec la souris dans ce cadre',
25
+ shapeRounded: 'Forme: Rectangle arrondie',
26
+ shapeCircle: 'Forme: Cercle',
27
+ shapeThumbnail: 'Forme: Vignette',
28
+ shapeNone: 'Forme: Aucune',
29
+ dragImageHere: 'Faites glisser une image ou un texte dans ce cadre',
30
+ dropImage: 'Lachez l\'image ou le texte',
26
31
  selectFromFiles: 'Choisir un fichier',
32
+ maximumFileSize: 'Taille de fichier maximale',
33
+ maximumFileSizeError: 'Taille maximale du fichier dépassée',
27
34
  url: 'URL de l\'image',
28
35
  remove: 'Supprimer l\'image'
29
36
  },
@@ -40,7 +47,7 @@
40
47
  table: 'Tableau'
41
48
  },
42
49
  hr: {
43
- insert: 'Insérer une ligne horizontale de séparation'
50
+ insert: 'Insérer une ligne horizontale'
44
51
  },
45
52
  style: {
46
53
  style: 'Style',
@@ -88,7 +95,8 @@
88
95
  textFormatting: 'Mise en forme du texte',
89
96
  action: 'Action',
90
97
  paragraphFormatting: 'Mise en forme des paragraphes',
91
- documentStyle: 'Style du document'
98
+ documentStyle: 'Style du document',
99
+ extraKeys: 'Touches supplémentaires'
92
100
  },
93
101
  history: {
94
102
  undo: 'Annuler la dernière action',
@@ -26,29 +26,29 @@
26
26
  * @property {Function} buttons.helloImage function to make button
27
27
  */
28
28
  buttons: { // buttons
29
- hello: function () {
29
+ hello: function (lang, options) {
30
30
 
31
- return tmpl.iconButton('fa fa-header', {
31
+ return tmpl.iconButton(options.iconPrefix + 'header', {
32
32
  event : 'hello',
33
33
  title: 'hello',
34
34
  hide: true
35
35
  });
36
36
  },
37
- helloDropdown: function () {
37
+ helloDropdown: function (lang, options) {
38
38
 
39
39
 
40
40
  var list = '<li><a data-event="helloDropdown" href="#" data-value="summernote">summernote</a></li>';
41
41
  list += '<li><a data-event="helloDropdown" href="#" data-value="codemirror">Code Mirror</a></li>';
42
42
  var dropdown = '<ul class="dropdown-menu">' + list + '</ul>';
43
43
 
44
- return tmpl.iconButton('fa fa-header', {
44
+ return tmpl.iconButton(options.iconPrefix + 'header', {
45
45
  title: 'hello',
46
46
  hide: true,
47
47
  dropdown : dropdown
48
48
  });
49
49
  },
50
- helloImage : function () {
51
- return tmpl.iconButton('fa fa-file-image-o', {
50
+ helloImage : function (lang, options) {
51
+ return tmpl.iconButton(options.iconPrefix + 'file-image-o', {
52
52
  event : 'helloImage',
53
53
  title: 'helloImage',
54
54
  hide: true
@@ -40,7 +40,7 @@
40
40
  var dmRegExp = /.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/;
41
41
  var dmMatch = url.match(dmRegExp);
42
42
 
43
- var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)\.html/;
43
+ var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/;
44
44
  var youkuMatch = url.match(youkuRegExp);
45
45
 
46
46
  var mp4RegExp = /^.+.(mp4|m4v)$/;
@@ -204,8 +204,8 @@
204
204
  * @property {function(object): string} buttons.video
205
205
  */
206
206
  buttons: {
207
- video: function (lang) {
208
- return tmpl.iconButton('fa fa-youtube-play', {
207
+ video: function (lang, options) {
208
+ return tmpl.iconButton(options.iconPrefix + 'youtube-play', {
209
209
  event: 'showVideoDialog',
210
210
  title: lang.video.video,
211
211
  hide: true
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Super simple wysiwyg editor on Bootstrap v0.6.7
2
+ * Super simple wysiwyg editor on Bootstrap v0.6.8
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-05-17T06:58Z
9
+ * Date: 2015-06-21T11:34Z
10
10
  */
11
11
  (function (factory) {
12
12
  /* global define */
@@ -2271,7 +2271,7 @@
2271
2271
  */
2272
2272
  var defaults = {
2273
2273
  /** @property */
2274
- version: '0.6.7',
2274
+ version: '0.6.8',
2275
2275
 
2276
2276
  /**
2277
2277
  *
@@ -2320,6 +2320,72 @@
2320
2320
 
2321
2321
  iconPrefix: 'fa fa-', // prefix for css icon classes
2322
2322
 
2323
+ icons: {
2324
+ font: {
2325
+ bold: 'bold',
2326
+ italic: 'italic',
2327
+ underline: 'underline',
2328
+ clear: 'eraser',
2329
+ height: 'text-height',
2330
+ strikethrough: 'strikethrough',
2331
+ superscript: 'superscript',
2332
+ subscript: 'subscript'
2333
+ },
2334
+ image: {
2335
+ image: 'picture-o',
2336
+ floatLeft: 'align-left',
2337
+ floatRight: 'align-right',
2338
+ floatNone: 'align-justify',
2339
+ shapeRounded: 'square',
2340
+ shapeCircle: 'circle-o',
2341
+ shapeThumbnail: 'picture-o',
2342
+ shapeNone: 'times',
2343
+ remove: 'trash-o'
2344
+ },
2345
+ link: {
2346
+ link: 'link',
2347
+ unlink: 'unlink',
2348
+ edit: 'edit'
2349
+ },
2350
+ table: {
2351
+ table: 'table'
2352
+ },
2353
+ hr: {
2354
+ insert: 'minus'
2355
+ },
2356
+ style: {
2357
+ style: 'magic'
2358
+ },
2359
+ lists: {
2360
+ unordered: 'list-ul',
2361
+ ordered: 'list-ol'
2362
+ },
2363
+ options: {
2364
+ help: 'question',
2365
+ fullscreen: 'arrows-alt',
2366
+ codeview: 'code'
2367
+ },
2368
+ paragraph: {
2369
+ paragraph: 'align-left',
2370
+ outdent: 'outdent',
2371
+ indent: 'indent',
2372
+ left: 'align-left',
2373
+ center: 'align-center',
2374
+ right: 'align-right',
2375
+ justify: 'align-justify'
2376
+ },
2377
+ color: {
2378
+ recent: 'font'
2379
+ },
2380
+ history: {
2381
+ undo: 'undo',
2382
+ redo: 'repeat'
2383
+ },
2384
+ misc: {
2385
+ check: 'check'
2386
+ }
2387
+ },
2388
+
2323
2389
  codemirror: { // codemirror options
2324
2390
  mode: 'text/html',
2325
2391
  htmlMode: true,
@@ -2430,8 +2496,6 @@
2430
2496
  onCreateLink: function (sLinkUrl) {
2431
2497
  if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) {
2432
2498
  sLinkUrl = 'mailto:' + sLinkUrl;
2433
- } else if (sLinkUrl.indexOf('://') === -1) {
2434
- sLinkUrl = 'http://' + sLinkUrl;
2435
2499
  }
2436
2500
 
2437
2501
  return sLinkUrl;
@@ -3852,7 +3916,7 @@
3852
3916
  * @param {jQuery} $editable
3853
3917
  */
3854
3918
  this.unlink = function ($editable) {
3855
- var rng = this.createRange();
3919
+ var rng = this.createRange($editable);
3856
3920
  if (rng.isOnAnchor()) {
3857
3921
  var anchor = dom.ancestor(rng.sc, dom.isAnchor);
3858
3922
  rng = range.createFromNode(anchor);
@@ -4088,6 +4152,16 @@
4088
4152
  .select();
4089
4153
  }
4090
4154
  };
4155
+
4156
+ /**
4157
+ * returns whether contents is empty or not.
4158
+ *
4159
+ * @param {jQuery} $editable
4160
+ * @return {Boolean}
4161
+ */
4162
+ this.isEmpty = function ($editable) {
4163
+ return dom.isEmpty($editable[0]) || dom.emptyPara === $editable.html();
4164
+ };
4091
4165
  };
4092
4166
 
4093
4167
  /**
@@ -4837,25 +4911,29 @@
4837
4911
 
4838
4912
  // attach dropImage
4839
4913
  $dropzone.on('drop', function (event) {
4840
- event.preventDefault();
4841
4914
 
4842
4915
  var dataTransfer = event.originalEvent.dataTransfer;
4843
- var html = dataTransfer.getData('text/html');
4844
- var text = dataTransfer.getData('text/plain');
4845
-
4846
4916
  var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
4847
4917
 
4848
4918
  if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
4919
+ event.preventDefault();
4849
4920
  layoutInfo.editable().focus();
4850
4921
  handler.insertImages(layoutInfo, dataTransfer.files);
4851
- } else if (html) {
4852
- $(html).each(function () {
4853
- layoutInfo.editable().focus();
4854
- handler.invoke('editor.insertNode', layoutInfo.editable(), this);
4855
- });
4856
- } else if (text) {
4857
- layoutInfo.editable().focus();
4858
- handler.invoke('editor.insertText', layoutInfo.editable(), text);
4922
+ } else {
4923
+ var insertNodefunc = function () {
4924
+ layoutInfo.holder().summernote('insertNode', this);
4925
+ };
4926
+
4927
+ for (var i = 0, len = dataTransfer.types.length; i < len; i++) {
4928
+ var type = dataTransfer.types[i];
4929
+ var content = dataTransfer.getData(type);
4930
+
4931
+ if (type.toLowerCase().indexOf('text') > -1) {
4932
+ layoutInfo.holder().summernote('pasteHTML', content);
4933
+ } else {
4934
+ $(content).each(insertNodefunc);
4935
+ }
4936
+ }
4859
4937
  }
4860
4938
  }).on('dragover', false); // prevent default dragover event
4861
4939
  };
@@ -4863,7 +4941,29 @@
4863
4941
 
4864
4942
  var Clipboard = function (handler) {
4865
4943
 
4944
+ var $paste;
4945
+
4866
4946
  this.attach = function (layoutInfo) {
4947
+
4948
+ if (window.clipboardData || agent.isFF) {
4949
+ $paste = $('<div />').attr('contenteditable', true).css({
4950
+ position : 'absolute',
4951
+ left : -100000,
4952
+ 'opacity' : 0
4953
+ });
4954
+ layoutInfo.editable().after($paste);
4955
+ $paste.one('paste', hPasteClipboardImage);
4956
+
4957
+ layoutInfo.editable().on('keydown', function (e) {
4958
+ if (e.ctrlKey && e.keyCode === 86) { // CTRL+V
4959
+ handler.invoke('saveRange', layoutInfo.editable());
4960
+ if ($paste) {
4961
+ $paste.focus();
4962
+ }
4963
+ }
4964
+ });
4965
+ }
4966
+
4867
4967
  layoutInfo.editable().on('paste', hPasteClipboardImage);
4868
4968
  };
4869
4969
 
@@ -4873,58 +4973,49 @@
4873
4973
  * @param {Event} event
4874
4974
  */
4875
4975
  var hPasteClipboardImage = function (event) {
4976
+
4876
4977
  var clipboardData = event.originalEvent.clipboardData;
4877
4978
  var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
4878
4979
  var $editable = layoutInfo.editable();
4879
4980
 
4880
4981
  if (!clipboardData || !clipboardData.items || !clipboardData.items.length) {
4982
+
4881
4983
  var callbacks = $editable.data('callbacks');
4882
4984
  // only can run if it has onImageUpload method
4883
4985
  if (!callbacks.onImageUpload) {
4884
4986
  return;
4885
4987
  }
4886
4988
 
4887
- // save cursor
4888
- handler.invoke('editor.saveNode', $editable);
4889
- handler.invoke('editor.saveRange', $editable);
4890
-
4891
- $editable.html('');
4892
-
4893
4989
  setTimeout(function () {
4894
- var $img = $editable.find('img');
4895
-
4896
- // if img is no in clipboard, insert text or dom
4897
- if (!$img.length || $img[0].src.indexOf('data:') === -1) {
4898
- var html = $editable.html();
4899
-
4900
- handler.invoke('editor.restoreNode', $editable);
4901
- handler.invoke('editor.restoreRange', $editable);
4990
+ if (!$paste) {
4991
+ return;
4992
+ }
4902
4993
 
4903
- handler.invoke('editor.focus', $editable);
4904
- try {
4905
- handler.invoke('editor.pasteHTML', $editable, html);
4906
- } catch (ex) {
4907
- handler.invoke('editor.insertText', $editable, html);
4908
- }
4994
+ var imgNode = $paste[0].firstChild;
4995
+ if (!imgNode) {
4909
4996
  return;
4910
4997
  }
4911
4998
 
4912
- var datauri = $img[0].src;
4999
+ handler.invoke('restoreRange', $editable);
5000
+ if (!dom.isImg(imgNode)) {
5001
+ handler.invoke('pasteHTML', $editable, $paste.html());
5002
+ } else {
5003
+ var datauri = imgNode.src;
5004
+
5005
+ var data = atob(datauri.split(',')[1]);
5006
+ var array = new Uint8Array(data.length);
5007
+ for (var i = 0; i < data.length; i++) {
5008
+ array[i] = data.charCodeAt(i);
5009
+ }
4913
5010
 
4914
- var data = atob(datauri.split(',')[1]);
4915
- var array = new Uint8Array(data.length);
4916
- for (var i = 0; i < data.length; i++) {
4917
- array[i] = data.charCodeAt(i);
5011
+ var blob = new Blob([array], { type : 'image/png' });
5012
+ blob.name = 'clipboard.png';
5013
+ handler.invoke('focus', $editable);
5014
+ handler.insertImages(layoutInfo, [blob]);
4918
5015
  }
4919
5016
 
4920
- var blob = new Blob([array], { type : 'image/png' });
4921
- blob.name = 'clipboard.png';
5017
+ $paste.remove();
4922
5018
 
4923
- handler.invoke('editor.restoreNode', $editable);
4924
- handler.invoke('editor.restoreRange', $editable);
4925
- handler.insertImages(layoutInfo, [blob]);
4926
-
4927
- handler.invoke('editor.afterCommand', $editable);
4928
5019
  }, 0);
4929
5020
 
4930
5021
  return;
@@ -4999,7 +5090,7 @@
4999
5090
 
5000
5091
  // if no url was given, copy text to url
5001
5092
  if (!linkInfo.url) {
5002
- linkInfo.url = linkInfo.text;
5093
+ linkInfo.url = linkInfo.text || 'http://';
5003
5094
  toggleBtn($linkBtn, linkInfo.text);
5004
5095
  }
5005
5096
 
@@ -5378,7 +5469,7 @@
5378
5469
  }, 0);
5379
5470
  };
5380
5471
 
5381
- var hScrollAndBlur = function (event) {
5472
+ var hScroll = function (event) {
5382
5473
  var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
5383
5474
  //hide popover and handle when scrolled
5384
5475
  modules.popover.hide(layoutInfo.popover());
@@ -5548,7 +5639,7 @@
5548
5639
  }
5549
5640
  layoutInfo.editable().on('mousedown', hMousedown);
5550
5641
  layoutInfo.editable().on('keyup mouseup', hKeyupAndMouseup);
5551
- layoutInfo.editable().on('scroll blur', hScrollAndBlur);
5642
+ layoutInfo.editable().on('scroll', hScroll);
5552
5643
 
5553
5644
  // handler for clipboard
5554
5645
  modules.clipboard.attach(layoutInfo, options);
@@ -5613,7 +5704,8 @@
5613
5704
  onChange: options.onChange,
5614
5705
  onImageUpload: options.onImageUpload,
5615
5706
  onImageUploadError: options.onImageUploadError,
5616
- onMediaDelete : options.onMediaDelete
5707
+ onMediaDelete: options.onMediaDelete,
5708
+ onToolbarClick: options.onToolbarClick
5617
5709
  });
5618
5710
 
5619
5711
  // Textarea: auto filling the code before form submit.
@@ -5726,9 +5818,11 @@
5726
5818
  var dropdown = options.dropdown;
5727
5819
  var hide = options.hide;
5728
5820
 
5729
- return '<button type="button"' +
5821
+ return (dropdown ? '<div class="btn-group' +
5822
+ (className ? ' ' + className : '') + '">' : '') +
5823
+ '<button type="button"' +
5730
5824
  ' class="btn btn-default btn-sm btn-small' +
5731
- (className ? ' ' + className : '') +
5825
+ ((!dropdown && className) ? ' ' + className : '') +
5732
5826
  (dropdown ? ' dropdown-toggle' : '') +
5733
5827
  '"' +
5734
5828
  (dropdown ? ' data-toggle="dropdown"' : '') +
@@ -5737,10 +5831,11 @@
5737
5831
  (value ? ' data-value=\'' + value + '\'' : '') +
5738
5832
  (hide ? ' data-hide=\'' + hide + '\'' : '') +
5739
5833
  ' tabindex="-1">' +
5740
- label +
5741
- (dropdown ? ' <span class="caret"></span>' : '') +
5742
- '</button>' +
5743
- (dropdown || '');
5834
+ label +
5835
+ (dropdown ? ' <span class="caret"></span>' : '') +
5836
+ '</button>' +
5837
+ (dropdown || '') +
5838
+ (dropdown ? '</div>' : '');
5744
5839
  };
5745
5840
 
5746
5841
  /**
@@ -5804,14 +5899,14 @@
5804
5899
 
5805
5900
  var tplButtonInfo = {
5806
5901
  picture: function (lang, options) {
5807
- return tplIconButton(options.iconPrefix + 'picture-o', {
5902
+ return tplIconButton(options.iconPrefix + options.icons.image.image, {
5808
5903
  event: 'showImageDialog',
5809
5904
  title: lang.image.image,
5810
5905
  hide: true
5811
5906
  });
5812
5907
  },
5813
5908
  link: function (lang, options) {
5814
- return tplIconButton(options.iconPrefix + 'link', {
5909
+ return tplIconButton(options.iconPrefix + options.icons.link.link, {
5815
5910
  event: 'showLinkDialog',
5816
5911
  title: lang.link.link,
5817
5912
  hide: true
@@ -5826,7 +5921,7 @@
5826
5921
  '</div>' +
5827
5922
  '<div class="note-dimension-display"> 1 x 1 </div>' +
5828
5923
  '</ul>';
5829
- return tplIconButton(options.iconPrefix + 'table', {
5924
+ return tplIconButton(options.iconPrefix + options.icons.table.table, {
5830
5925
  title: lang.table.table,
5831
5926
  dropdown: dropdown
5832
5927
  });
@@ -5842,7 +5937,7 @@
5842
5937
  '</a></li>';
5843
5938
  }, '');
5844
5939
 
5845
- return tplIconButton(options.iconPrefix + 'magic', {
5940
+ return tplIconButton(options.iconPrefix + options.icons.style.style, {
5846
5941
  title: lang.style.style,
5847
5942
  dropdown: '<ul class="dropdown-menu">' + items + '</ul>'
5848
5943
  });
@@ -5855,7 +5950,7 @@
5855
5950
  }
5856
5951
  realFontList.push(v);
5857
5952
  return memo + '<li><a data-event="fontName" href="#" data-value="' + v + '" style="font-family:\'' + v + '\'">' +
5858
- '<i class="' + options.iconPrefix + 'check"></i> ' + v +
5953
+ '<i class="' + options.iconPrefix + options.icons.misc.check + '"></i> ' + v +
5859
5954
  '</a></li>';
5860
5955
  }, '');
5861
5956
 
@@ -5867,25 +5962,29 @@
5867
5962
  '</span>';
5868
5963
  return tplButton(label, {
5869
5964
  title: lang.font.name,
5965
+ className: 'note-fontname',
5870
5966
  dropdown: '<ul class="dropdown-menu note-check">' + items + '</ul>'
5871
5967
  });
5872
5968
  },
5873
5969
  fontsize: function (lang, options) {
5874
5970
  var items = options.fontSizes.reduce(function (memo, v) {
5875
5971
  return memo + '<li><a data-event="fontSize" href="#" data-value="' + v + '">' +
5876
- '<i class="fa fa-check"></i> ' + v +
5972
+ '<i class="' + options.iconPrefix + options.icons.misc.check + '"></i> ' + v +
5877
5973
  '</a></li>';
5878
5974
  }, '');
5879
5975
 
5880
5976
  var label = '<span class="note-current-fontsize">11</span>';
5881
5977
  return tplButton(label, {
5882
5978
  title: lang.font.size,
5979
+ className: 'note-fontsize',
5883
5980
  dropdown: '<ul class="dropdown-menu note-check">' + items + '</ul>'
5884
5981
  });
5885
5982
  },
5886
5983
  color: function (lang, options) {
5887
- var colorButtonLabel = '<i class="' + options.iconPrefix + 'font" style="color:black;background-color:yellow;"></i>';
5888
- var colorButton = tplButton(colorButtonLabel, {
5984
+ var colorButtonLabel = '<i class="' +
5985
+ options.iconPrefix + options.icons.color.recent +
5986
+ '" style="color:black;background-color:yellow;"></i>',
5987
+ colorButton = tplButton(colorButtonLabel, {
5889
5988
  className: 'note-recent-color',
5890
5989
  title: lang.color.recent,
5891
5990
  event: 'color',
@@ -5920,82 +6019,82 @@
5920
6019
  return colorButton + moreButton;
5921
6020
  },
5922
6021
  bold: function (lang, options) {
5923
- return tplIconButton(options.iconPrefix + 'bold', {
6022
+ return tplIconButton(options.iconPrefix + options.icons.font.bold, {
5924
6023
  event: 'bold',
5925
6024
  title: lang.font.bold
5926
6025
  });
5927
6026
  },
5928
6027
  italic: function (lang, options) {
5929
- return tplIconButton(options.iconPrefix + 'italic', {
6028
+ return tplIconButton(options.iconPrefix + options.icons.font.italic, {
5930
6029
  event: 'italic',
5931
6030
  title: lang.font.italic
5932
6031
  });
5933
6032
  },
5934
6033
  underline: function (lang, options) {
5935
- return tplIconButton(options.iconPrefix + 'underline', {
6034
+ return tplIconButton(options.iconPrefix + options.icons.font.underline, {
5936
6035
  event: 'underline',
5937
6036
  title: lang.font.underline
5938
6037
  });
5939
6038
  },
5940
- strikethrough: function (lang) {
5941
- return tplIconButton('fa fa-strikethrough', {
6039
+ strikethrough: function (lang, options) {
6040
+ return tplIconButton(options.iconPrefix + options.icons.font.strikethrough, {
5942
6041
  event: 'strikethrough',
5943
6042
  title: lang.font.strikethrough
5944
6043
  });
5945
6044
  },
5946
- superscript: function (lang) {
5947
- return tplIconButton('fa fa-superscript', {
6045
+ superscript: function (lang, options) {
6046
+ return tplIconButton(options.iconPrefix + options.icons.font.superscript, {
5948
6047
  event: 'superscript',
5949
6048
  title: lang.font.superscript
5950
6049
  });
5951
6050
  },
5952
- subscript: function (lang) {
5953
- return tplIconButton('fa fa-subscript', {
6051
+ subscript: function (lang, options) {
6052
+ return tplIconButton(options.iconPrefix + options.icons.font.subscript, {
5954
6053
  event: 'subscript',
5955
6054
  title: lang.font.subscript
5956
6055
  });
5957
6056
  },
5958
6057
  clear: function (lang, options) {
5959
- return tplIconButton(options.iconPrefix + 'eraser', {
6058
+ return tplIconButton(options.iconPrefix + options.icons.font.clear, {
5960
6059
  event: 'removeFormat',
5961
6060
  title: lang.font.clear
5962
6061
  });
5963
6062
  },
5964
6063
  ul: function (lang, options) {
5965
- return tplIconButton(options.iconPrefix + 'list-ul', {
6064
+ return tplIconButton(options.iconPrefix + options.icons.lists.unordered, {
5966
6065
  event: 'insertUnorderedList',
5967
6066
  title: lang.lists.unordered
5968
6067
  });
5969
6068
  },
5970
6069
  ol: function (lang, options) {
5971
- return tplIconButton(options.iconPrefix + 'list-ol', {
6070
+ return tplIconButton(options.iconPrefix + options.icons.lists.ordered, {
5972
6071
  event: 'insertOrderedList',
5973
6072
  title: lang.lists.ordered
5974
6073
  });
5975
6074
  },
5976
6075
  paragraph: function (lang, options) {
5977
- var leftButton = tplIconButton(options.iconPrefix + 'align-left', {
6076
+ var leftButton = tplIconButton(options.iconPrefix + options.icons.paragraph.left, {
5978
6077
  title: lang.paragraph.left,
5979
6078
  event: 'justifyLeft'
5980
6079
  });
5981
- var centerButton = tplIconButton(options.iconPrefix + 'align-center', {
6080
+ var centerButton = tplIconButton(options.iconPrefix + options.icons.paragraph.center, {
5982
6081
  title: lang.paragraph.center,
5983
6082
  event: 'justifyCenter'
5984
6083
  });
5985
- var rightButton = tplIconButton(options.iconPrefix + 'align-right', {
6084
+ var rightButton = tplIconButton(options.iconPrefix + options.icons.paragraph.right, {
5986
6085
  title: lang.paragraph.right,
5987
6086
  event: 'justifyRight'
5988
6087
  });
5989
- var justifyButton = tplIconButton(options.iconPrefix + 'align-justify', {
6088
+ var justifyButton = tplIconButton(options.iconPrefix + options.icons.paragraph.justify, {
5990
6089
  title: lang.paragraph.justify,
5991
6090
  event: 'justifyFull'
5992
6091
  });
5993
6092
 
5994
- var outdentButton = tplIconButton(options.iconPrefix + 'outdent', {
6093
+ var outdentButton = tplIconButton(options.iconPrefix + options.icons.paragraph.outdent, {
5995
6094
  title: lang.paragraph.outdent,
5996
6095
  event: 'outdent'
5997
6096
  });
5998
- var indentButton = tplIconButton(options.iconPrefix + 'indent', {
6097
+ var indentButton = tplIconButton(options.iconPrefix + options.icons.paragraph.indent, {
5999
6098
  title: lang.paragraph.indent,
6000
6099
  event: 'indent'
6001
6100
  });
@@ -6009,7 +6108,7 @@
6009
6108
  '</div>' +
6010
6109
  '</div>';
6011
6110
 
6012
- return tplIconButton(options.iconPrefix + 'align-left', {
6111
+ return tplIconButton(options.iconPrefix + options.icons.paragraph.paragraph, {
6013
6112
  title: lang.paragraph.paragraph,
6014
6113
  dropdown: dropdown
6015
6114
  });
@@ -6017,49 +6116,49 @@
6017
6116
  height: function (lang, options) {
6018
6117
  var items = options.lineHeights.reduce(function (memo, v) {
6019
6118
  return memo + '<li><a data-event="lineHeight" href="#" data-value="' + parseFloat(v) + '">' +
6020
- '<i class="' + options.iconPrefix + 'check"></i> ' + v +
6119
+ '<i class="' + options.iconPrefix + options.icons.misc.check + '"></i> ' + v +
6021
6120
  '</a></li>';
6022
6121
  }, '');
6023
6122
 
6024
- return tplIconButton(options.iconPrefix + 'text-height', {
6123
+ return tplIconButton(options.iconPrefix + options.icons.font.height, {
6025
6124
  title: lang.font.height,
6026
6125
  dropdown: '<ul class="dropdown-menu note-check">' + items + '</ul>'
6027
6126
  });
6028
6127
 
6029
6128
  },
6030
6129
  help: function (lang, options) {
6031
- return tplIconButton(options.iconPrefix + 'question', {
6130
+ return tplIconButton(options.iconPrefix + options.icons.options.help, {
6032
6131
  event: 'showHelpDialog',
6033
6132
  title: lang.options.help,
6034
6133
  hide: true
6035
6134
  });
6036
6135
  },
6037
6136
  fullscreen: function (lang, options) {
6038
- return tplIconButton(options.iconPrefix + 'arrows-alt', {
6137
+ return tplIconButton(options.iconPrefix + options.icons.options.fullscreen, {
6039
6138
  event: 'fullscreen',
6040
6139
  title: lang.options.fullscreen
6041
6140
  });
6042
6141
  },
6043
6142
  codeview: function (lang, options) {
6044
- return tplIconButton(options.iconPrefix + 'code', {
6143
+ return tplIconButton(options.iconPrefix + options.icons.options.codeview, {
6045
6144
  event: 'codeview',
6046
6145
  title: lang.options.codeview
6047
6146
  });
6048
6147
  },
6049
6148
  undo: function (lang, options) {
6050
- return tplIconButton(options.iconPrefix + 'undo', {
6149
+ return tplIconButton(options.iconPrefix + options.icons.history.undo, {
6051
6150
  event: 'undo',
6052
6151
  title: lang.history.undo
6053
6152
  });
6054
6153
  },
6055
6154
  redo: function (lang, options) {
6056
- return tplIconButton(options.iconPrefix + 'repeat', {
6155
+ return tplIconButton(options.iconPrefix + options.icons.history.redo, {
6057
6156
  event: 'redo',
6058
6157
  title: lang.history.redo
6059
6158
  });
6060
6159
  },
6061
6160
  hr: function (lang, options) {
6062
- return tplIconButton(options.iconPrefix + 'minus', {
6161
+ return tplIconButton(options.iconPrefix + options.icons.hr.insert, {
6063
6162
  event: 'insertHorizontalRule',
6064
6163
  title: lang.hr.insert
6065
6164
  });
@@ -6068,12 +6167,12 @@
6068
6167
 
6069
6168
  var tplPopovers = function (lang, options) {
6070
6169
  var tplLinkPopover = function () {
6071
- var linkButton = tplIconButton(options.iconPrefix + 'edit', {
6170
+ var linkButton = tplIconButton(options.iconPrefix + options.icons.link.edit, {
6072
6171
  title: lang.link.edit,
6073
6172
  event: 'showLinkDialog',
6074
6173
  hide: true
6075
6174
  });
6076
- var unlinkButton = tplIconButton(options.iconPrefix + 'unlink', {
6175
+ var unlinkButton = tplIconButton(options.iconPrefix + options.icons.link.unlink, {
6077
6176
  title: lang.link.unlink,
6078
6177
  event: 'unlink'
6079
6178
  });
@@ -6101,44 +6200,44 @@
6101
6200
  value: '0.25'
6102
6201
  });
6103
6202
 
6104
- var leftButton = tplIconButton(options.iconPrefix + 'align-left', {
6203
+ var leftButton = tplIconButton(options.iconPrefix + options.icons.image.floatLeft, {
6105
6204
  title: lang.image.floatLeft,
6106
6205
  event: 'floatMe',
6107
6206
  value: 'left'
6108
6207
  });
6109
- var rightButton = tplIconButton(options.iconPrefix + 'align-right', {
6208
+ var rightButton = tplIconButton(options.iconPrefix + options.icons.image.floatRight, {
6110
6209
  title: lang.image.floatRight,
6111
6210
  event: 'floatMe',
6112
6211
  value: 'right'
6113
6212
  });
6114
- var justifyButton = tplIconButton(options.iconPrefix + 'align-justify', {
6213
+ var justifyButton = tplIconButton(options.iconPrefix + options.icons.image.floatNone, {
6115
6214
  title: lang.image.floatNone,
6116
6215
  event: 'floatMe',
6117
6216
  value: 'none'
6118
6217
  });
6119
6218
 
6120
- var roundedButton = tplIconButton(options.iconPrefix + 'square', {
6219
+ var roundedButton = tplIconButton(options.iconPrefix + options.icons.image.shapeRounded, {
6121
6220
  title: lang.image.shapeRounded,
6122
6221
  event: 'imageShape',
6123
6222
  value: 'img-rounded'
6124
6223
  });
6125
- var circleButton = tplIconButton(options.iconPrefix + 'circle-o', {
6224
+ var circleButton = tplIconButton(options.iconPrefix + options.icons.image.shapeCircle, {
6126
6225
  title: lang.image.shapeCircle,
6127
6226
  event: 'imageShape',
6128
6227
  value: 'img-circle'
6129
6228
  });
6130
- var thumbnailButton = tplIconButton(options.iconPrefix + 'picture-o', {
6229
+ var thumbnailButton = tplIconButton(options.iconPrefix + options.icons.image.shapeThumbnail, {
6131
6230
  title: lang.image.shapeThumbnail,
6132
6231
  event: 'imageShape',
6133
6232
  value: 'img-thumbnail'
6134
6233
  });
6135
- var noneButton = tplIconButton(options.iconPrefix + 'times', {
6234
+ var noneButton = tplIconButton(options.iconPrefix + options.icons.image.shapeNone, {
6136
6235
  title: lang.image.shapeNone,
6137
6236
  event: 'imageShape',
6138
6237
  value: ''
6139
6238
  });
6140
6239
 
6141
- var removeButton = tplIconButton(options.iconPrefix + 'trash-o', {
6240
+ var removeButton = tplIconButton(options.iconPrefix + options.icons.image.remove, {
6142
6241
  title: lang.image.remove,
6143
6242
  event: 'removeMedia',
6144
6243
  value: 'none'
@@ -6332,7 +6431,7 @@
6332
6431
  '</div>' +
6333
6432
  '<div class="form-group row-fluid">' +
6334
6433
  '<label>' + lang.link.url + '</label>' +
6335
- '<input class="note-link-url form-control span12" type="text" />' +
6434
+ '<input class="note-link-url form-control span12" type="text" value="http://" />' +
6336
6435
  '</div>' +
6337
6436
  (!options.disableLinkTarget ?
6338
6437
  '<div class="checkbox">' +
@@ -6350,7 +6449,7 @@
6350
6449
  '<div class="title">' + lang.shortcut.shortcuts + '</div>' +
6351
6450
  (agent.isMac ? tplShortcutTable(lang, options) : replaceMacKeys(tplShortcutTable(lang, options))) +
6352
6451
  '<p class="text-center">' +
6353
- '<a href="//summernote.org/" target="_blank">Summernote 0.6.7</a> · ' +
6452
+ '<a href="//summernote.org/" target="_blank">Summernote 0.6.8</a> · ' +
6354
6453
  '<a href="//github.com/summernote/summernote" target="_blank">Project</a> · ' +
6355
6454
  '<a href="//github.com/summernote/summernote/issues" target="_blank">Issues</a>' +
6356
6455
  '</p>';
@@ -6755,7 +6854,7 @@
6755
6854
  * // "hello" is button's namespace.
6756
6855
  * "hello" : function(lang, options) {
6757
6856
  * // make icon button by template function
6758
- * return tmpl.iconButton('fa fa-header', {
6857
+ * return tmpl.iconButton(options.iconPrefix + 'header', {
6759
6858
  * // callback function name when button clicked
6760
6859
  * event : 'hello',
6761
6860
  * // set data-value property
@@ -6859,6 +6958,7 @@
6859
6958
  var options = hasInitOptions ? list.head(arguments) : {};
6860
6959
 
6861
6960
  options = $.extend({}, $.summernote.options, options);
6961
+ options.icons = $.extend({}, $.summernote.options.icons, options.icons);
6862
6962
 
6863
6963
  // Include langInfo in options for later use, e.g. for image drag-n-drop
6864
6964
  // Setup language info with en-US as default
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.7.0
4
+ version: 0.6.9.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-06-16 00:00:00.000000000 Z
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -68,6 +68,7 @@ files:
68
68
  - lib/summernote-rails/version.rb
69
69
  - vendor/assets/javascripts/summernote/index.js
70
70
  - vendor/assets/javascripts/summernote/locales/ar-AR.js
71
+ - vendor/assets/javascripts/summernote/locales/bg-BG.js
71
72
  - vendor/assets/javascripts/summernote/locales/ca-ES.js
72
73
  - vendor/assets/javascripts/summernote/locales/cs-CZ.js
73
74
  - vendor/assets/javascripts/summernote/locales/da-DK.js