summernote
Advanced tools
Comparing version 0.6.7 to 0.6.8
{ | ||
"name": "summernote", | ||
"version": "0.6.7", | ||
"main": [ | ||
@@ -5,0 +4,0 @@ "./dist/summernote.js", |
@@ -17,2 +17,3 @@ # Thanks for contributing to [Summernote](http://summernote.org)! | ||
### If you would like to contribute code, please use this PR template(copy/paste into github PR) | ||
And please **DO NOT INCLUDE FILES IN DIST FOLDER**. They disturb merge processes. | ||
@@ -19,0 +20,0 @@ **go ahead and delete any lines that aren't relevant** |
@@ -62,2 +62,5 @@ module.exports = function (grunt) { | ||
uglify: { | ||
options: { | ||
banner: '/*! Summernote v<%=pkg.version%> | (c) 2013-2015 Alan Hong and other contributors | MIT license */\n' | ||
}, | ||
all: { | ||
@@ -64,0 +67,0 @@ files: { 'dist/summernote.min.js': ['dist/summernote.js'] } |
@@ -13,3 +13,3 @@ (function ($) { | ||
superscript: 'Exposant', | ||
subscript: 'Indicé', | ||
subscript: 'Indice', | ||
size: 'Taille de police' | ||
@@ -26,4 +26,11 @@ }, | ||
floatNone: 'Pas d\'alignement', | ||
dragImageHere: 'Faites glisser une image avec la souris dans ce cadre', | ||
shapeRounded: 'Forme: Rectangle arrondie', | ||
shapeCircle: 'Forme: Cercle', | ||
shapeThumbnail: 'Forme: Vignette', | ||
shapeNone: 'Forme: Aucune', | ||
dragImageHere: 'Faites glisser une image ou un texte dans ce cadre', | ||
dropImage: 'Lachez l\'image ou le texte', | ||
selectFromFiles: 'Choisir un fichier', | ||
maximumFileSize: 'Taille de fichier maximale', | ||
maximumFileSizeError: 'Taille maximale du fichier dépassée', | ||
url: 'URL de l\'image', | ||
@@ -45,3 +52,3 @@ remove: 'Supprimer l\'image' | ||
hr: { | ||
insert: 'Insérer une ligne horizontale de séparation' | ||
insert: 'Insérer une ligne horizontale' | ||
}, | ||
@@ -94,3 +101,4 @@ style: { | ||
paragraphFormatting: 'Mise en forme des paragraphes', | ||
documentStyle: 'Style du document' | ||
documentStyle: 'Style du document', | ||
extraKeys: 'Touches supplémentaires' | ||
}, | ||
@@ -97,0 +105,0 @@ history: { |
{ | ||
"name": "summernote", | ||
"description": "Super Simple WYSIWYG Editor on Bootstrap", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "editor", |
@@ -29,5 +29,5 @@ (function (factory) { | ||
buttons: { // buttons | ||
hello: function () { | ||
hello: function (lang, options) { | ||
return tmpl.iconButton('fa fa-header', { | ||
return tmpl.iconButton(options.iconPrefix + 'header', { | ||
event : 'hello', | ||
@@ -38,3 +38,3 @@ title: 'hello', | ||
}, | ||
helloDropdown: function () { | ||
helloDropdown: function (lang, options) { | ||
@@ -46,3 +46,3 @@ | ||
return tmpl.iconButton('fa fa-header', { | ||
return tmpl.iconButton(options.iconPrefix + 'header', { | ||
title: 'hello', | ||
@@ -53,4 +53,4 @@ hide: true, | ||
}, | ||
helloImage : function () { | ||
return tmpl.iconButton('fa fa-file-image-o', { | ||
helloImage : function (lang, options) { | ||
return tmpl.iconButton(options.iconPrefix + 'file-image-o', { | ||
event : 'helloImage', | ||
@@ -57,0 +57,0 @@ title: 'helloImage', |
@@ -43,3 +43,3 @@ (function (factory) { | ||
var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)\.html/; | ||
var youkuRegExp = /\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/; | ||
var youkuMatch = url.match(youkuRegExp); | ||
@@ -208,4 +208,4 @@ | ||
buttons: { | ||
video: function (lang) { | ||
return tmpl.iconButton('fa fa-youtube-play', { | ||
video: function (lang, options) { | ||
return tmpl.iconButton(options.iconPrefix + 'youtube-play', { | ||
event: 'showVideoDialog', | ||
@@ -212,0 +212,0 @@ title: lang.video.video, |
@@ -81,2 +81,6 @@ # Summernote | ||
#### Warning - code injection | ||
The code view allows the user to enter script contents. Make sure to filter/[sanitize the HTML on the server](https://github.com/search?l=JavaScript&q=sanitize+html). Otherwise, an attacker can inject arbitrary JavaScript code into clients. | ||
### Supported platforms | ||
@@ -165,2 +169,5 @@ | ||
#### Contribution guide | ||
* Please read [CONTRIBUTING.md](https://github.com/summernote/summernote/blob/develop/CONTRIBUTING.md) before sending pull requests. | ||
### Contacts | ||
@@ -167,0 +174,0 @@ * Email: susukang98@gmail.com |
require.config({ | ||
baseUrl: 'src/js', | ||
paths: { | ||
jquery: '//code.jquery.com/jquery-1.9.1.min', | ||
bootstrap: '//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min', | ||
jquery: '//code.jquery.com/jquery-1.11.3', | ||
bootstrap: '//netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min', | ||
summernotevideo: '/../../plugin/summernote-ext-video', | ||
@@ -7,0 +7,0 @@ CodeMirror: '//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror', |
@@ -58,2 +58,68 @@ define('summernote/defaults', function () { | ||
icons: { | ||
font: { | ||
bold: 'bold', | ||
italic: 'italic', | ||
underline: 'underline', | ||
clear: 'eraser', | ||
height: 'text-height', | ||
strikethrough: 'strikethrough', | ||
superscript: 'superscript', | ||
subscript: 'subscript' | ||
}, | ||
image: { | ||
image: 'picture-o', | ||
floatLeft: 'align-left', | ||
floatRight: 'align-right', | ||
floatNone: 'align-justify', | ||
shapeRounded: 'square', | ||
shapeCircle: 'circle-o', | ||
shapeThumbnail: 'picture-o', | ||
shapeNone: 'times', | ||
remove: 'trash-o' | ||
}, | ||
link: { | ||
link: 'link', | ||
unlink: 'unlink', | ||
edit: 'edit' | ||
}, | ||
table: { | ||
table: 'table' | ||
}, | ||
hr: { | ||
insert: 'minus' | ||
}, | ||
style: { | ||
style: 'magic' | ||
}, | ||
lists: { | ||
unordered: 'list-ul', | ||
ordered: 'list-ol' | ||
}, | ||
options: { | ||
help: 'question', | ||
fullscreen: 'arrows-alt', | ||
codeview: 'code' | ||
}, | ||
paragraph: { | ||
paragraph: 'align-left', | ||
outdent: 'outdent', | ||
indent: 'indent', | ||
left: 'align-left', | ||
center: 'align-center', | ||
right: 'align-right', | ||
justify: 'align-justify' | ||
}, | ||
color: { | ||
recent: 'font' | ||
}, | ||
history: { | ||
undo: 'undo', | ||
redo: 'repeat' | ||
}, | ||
misc: { | ||
check: 'check' | ||
} | ||
}, | ||
codemirror: { // codemirror options | ||
@@ -169,4 +235,2 @@ mode: 'text/html', | ||
sLinkUrl = 'mailto:' + sLinkUrl; | ||
} else if (sLinkUrl.indexOf('://') === -1) { | ||
sLinkUrl = 'http://' + sLinkUrl; | ||
} | ||
@@ -173,0 +237,0 @@ |
@@ -200,3 +200,3 @@ define([ | ||
var hScrollAndBlur = function (event) { | ||
var hScroll = function (event) { | ||
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target); | ||
@@ -371,3 +371,3 @@ //hide popover and handle when scrolled | ||
layoutInfo.editable().on('keyup mouseup', hKeyupAndMouseup); | ||
layoutInfo.editable().on('scroll blur', hScrollAndBlur); | ||
layoutInfo.editable().on('scroll', hScroll); | ||
@@ -437,3 +437,4 @@ // handler for clipboard | ||
onImageUploadError: options.onImageUploadError, | ||
onMediaDelete : options.onMediaDelete | ||
onMediaDelete: options.onMediaDelete, | ||
onToolbarClick: options.onToolbarClick | ||
}); | ||
@@ -440,0 +441,0 @@ |
define([ | ||
'summernote/core/list', | ||
'summernote/core/dom' | ||
], function (list, dom) { | ||
'summernote/core/dom', | ||
'summernote/core/agent' | ||
], function (list, dom, agent) { | ||
var Clipboard = function (handler) { | ||
var $paste; | ||
this.attach = function (layoutInfo) { | ||
if (window.clipboardData || agent.isFF) { | ||
$paste = $('<div />').attr('contenteditable', true).css({ | ||
position : 'absolute', | ||
left : -100000, | ||
'opacity' : 0 | ||
}); | ||
layoutInfo.editable().after($paste); | ||
$paste.one('paste', hPasteClipboardImage); | ||
layoutInfo.editable().on('keydown', function (e) { | ||
if (e.ctrlKey && e.keyCode === 86) { // CTRL+V | ||
handler.invoke('saveRange', layoutInfo.editable()); | ||
if ($paste) { | ||
$paste.focus(); | ||
} | ||
} | ||
}); | ||
} | ||
layoutInfo.editable().on('paste', hPasteClipboardImage); | ||
@@ -17,2 +40,3 @@ }; | ||
var hPasteClipboardImage = function (event) { | ||
var clipboardData = event.originalEvent.clipboardData; | ||
@@ -23,2 +47,3 @@ var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target); | ||
if (!clipboardData || !clipboardData.items || !clipboardData.items.length) { | ||
var callbacks = $editable.data('callbacks'); | ||
@@ -30,43 +55,32 @@ // only can run if it has onImageUpload method | ||
// save cursor | ||
handler.invoke('editor.saveNode', $editable); | ||
handler.invoke('editor.saveRange', $editable); | ||
$editable.html(''); | ||
setTimeout(function () { | ||
var $img = $editable.find('img'); | ||
if (!$paste) { | ||
return; | ||
} | ||
// if img is no in clipboard, insert text or dom | ||
if (!$img.length || $img[0].src.indexOf('data:') === -1) { | ||
var html = $editable.html(); | ||
var imgNode = $paste[0].firstChild; | ||
if (!imgNode) { | ||
return; | ||
} | ||
handler.invoke('editor.restoreNode', $editable); | ||
handler.invoke('editor.restoreRange', $editable); | ||
handler.invoke('restoreRange', $editable); | ||
if (!dom.isImg(imgNode)) { | ||
handler.invoke('pasteHTML', $editable, $paste.html()); | ||
} else { | ||
var datauri = imgNode.src; | ||
handler.invoke('editor.focus', $editable); | ||
try { | ||
handler.invoke('editor.pasteHTML', $editable, html); | ||
} catch (ex) { | ||
handler.invoke('editor.insertText', $editable, html); | ||
var data = atob(datauri.split(',')[1]); | ||
var array = new Uint8Array(data.length); | ||
for (var i = 0; i < data.length; i++) { | ||
array[i] = data.charCodeAt(i); | ||
} | ||
return; | ||
} | ||
var datauri = $img[0].src; | ||
var data = atob(datauri.split(',')[1]); | ||
var array = new Uint8Array(data.length); | ||
for (var i = 0; i < data.length; i++) { | ||
array[i] = data.charCodeAt(i); | ||
var blob = new Blob([array], { type : 'image/png' }); | ||
blob.name = 'clipboard.png'; | ||
handler.invoke('focus', $editable); | ||
handler.insertImages(layoutInfo, [blob]); | ||
} | ||
var blob = new Blob([array], { type : 'image/png' }); | ||
blob.name = 'clipboard.png'; | ||
$paste.remove(); | ||
handler.invoke('editor.restoreNode', $editable); | ||
handler.invoke('editor.restoreRange', $editable); | ||
handler.insertImages(layoutInfo, [blob]); | ||
handler.invoke('editor.afterCommand', $editable); | ||
}, 0); | ||
@@ -73,0 +87,0 @@ |
@@ -69,21 +69,25 @@ define([ | ||
$dropzone.on('drop', function (event) { | ||
event.preventDefault(); | ||
var dataTransfer = event.originalEvent.dataTransfer; | ||
var html = dataTransfer.getData('text/html'); | ||
var text = dataTransfer.getData('text/plain'); | ||
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target); | ||
if (dataTransfer && dataTransfer.files && dataTransfer.files.length) { | ||
event.preventDefault(); | ||
layoutInfo.editable().focus(); | ||
handler.insertImages(layoutInfo, dataTransfer.files); | ||
} else if (html) { | ||
$(html).each(function () { | ||
layoutInfo.editable().focus(); | ||
handler.invoke('editor.insertNode', layoutInfo.editable(), this); | ||
}); | ||
} else if (text) { | ||
layoutInfo.editable().focus(); | ||
handler.invoke('editor.insertText', layoutInfo.editable(), text); | ||
} else { | ||
var insertNodefunc = function () { | ||
layoutInfo.holder().summernote('insertNode', this); | ||
}; | ||
for (var i = 0, len = dataTransfer.types.length; i < len; i++) { | ||
var type = dataTransfer.types[i]; | ||
var content = dataTransfer.getData(type); | ||
if (type.toLowerCase().indexOf('text') > -1) { | ||
layoutInfo.holder().summernote('pasteHTML', content); | ||
} else { | ||
$(content).each(insertNodefunc); | ||
} | ||
} | ||
} | ||
@@ -90,0 +94,0 @@ }).on('dragover', false); // prevent default dragover event |
@@ -555,3 +555,3 @@ define([ | ||
this.unlink = function ($editable) { | ||
var rng = this.createRange(); | ||
var rng = this.createRange($editable); | ||
if (rng.isOnAnchor()) { | ||
@@ -792,2 +792,12 @@ var anchor = dom.ancestor(rng.sc, dom.isAnchor); | ||
}; | ||
/** | ||
* returns whether contents is empty or not. | ||
* | ||
* @param {jQuery} $editable | ||
* @return {Boolean} | ||
*/ | ||
this.isEmpty = function ($editable) { | ||
return dom.isEmpty($editable[0]) || dom.emptyPara === $editable.html(); | ||
}; | ||
}; | ||
@@ -794,0 +804,0 @@ |
@@ -62,3 +62,3 @@ define([ | ||
if (!linkInfo.url) { | ||
linkInfo.url = linkInfo.text; | ||
linkInfo.url = linkInfo.text || 'http://'; | ||
toggleBtn($linkBtn, linkInfo.text); | ||
@@ -65,0 +65,0 @@ } |
@@ -35,5 +35,7 @@ define([ | ||
return '<button type="button"' + | ||
return (dropdown ? '<div class="btn-group' + | ||
(className ? ' ' + className : '') + '">' : '') + | ||
'<button type="button"' + | ||
' class="btn btn-default btn-sm btn-small' + | ||
(className ? ' ' + className : '') + | ||
((!dropdown && className) ? ' ' + className : '') + | ||
(dropdown ? ' dropdown-toggle' : '') + | ||
@@ -47,6 +49,7 @@ '"' + | ||
' tabindex="-1">' + | ||
label + | ||
(dropdown ? ' <span class="caret"></span>' : '') + | ||
'</button>' + | ||
(dropdown || ''); | ||
label + | ||
(dropdown ? ' <span class="caret"></span>' : '') + | ||
'</button>' + | ||
(dropdown || '') + | ||
(dropdown ? '</div>' : ''); | ||
}; | ||
@@ -115,3 +118,3 @@ | ||
picture: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'picture-o', { | ||
return tplIconButton(options.iconPrefix + options.icons.image.image, { | ||
event: 'showImageDialog', | ||
@@ -123,3 +126,3 @@ title: lang.image.image, | ||
link: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'link', { | ||
return tplIconButton(options.iconPrefix + options.icons.link.link, { | ||
event: 'showLinkDialog', | ||
@@ -139,3 +142,3 @@ title: lang.link.link, | ||
'</ul>'; | ||
return tplIconButton(options.iconPrefix + 'table', { | ||
return tplIconButton(options.iconPrefix + options.icons.table.table, { | ||
title: lang.table.table, | ||
@@ -156,3 +159,3 @@ dropdown: dropdown | ||
return tplIconButton(options.iconPrefix + 'magic', { | ||
return tplIconButton(options.iconPrefix + options.icons.style.style, { | ||
title: lang.style.style, | ||
@@ -170,3 +173,3 @@ dropdown: '<ul class="dropdown-menu">' + items + '</ul>' | ||
return memo + '<li><a data-event="fontName" href="#" data-value="' + v + '" style="font-family:\'' + v + '\'">' + | ||
'<i class="' + options.iconPrefix + 'check"></i> ' + v + | ||
'<i class="' + options.iconPrefix + options.icons.misc.check + '"></i> ' + v + | ||
'</a></li>'; | ||
@@ -183,2 +186,3 @@ }, ''); | ||
title: lang.font.name, | ||
className: 'note-fontname', | ||
dropdown: '<ul class="dropdown-menu note-check">' + items + '</ul>' | ||
@@ -190,3 +194,3 @@ }); | ||
return memo + '<li><a data-event="fontSize" href="#" data-value="' + v + '">' + | ||
'<i class="fa fa-check"></i> ' + v + | ||
'<i class="' + options.iconPrefix + options.icons.misc.check + '"></i> ' + v + | ||
'</a></li>'; | ||
@@ -198,2 +202,3 @@ }, ''); | ||
title: lang.font.size, | ||
className: 'note-fontsize', | ||
dropdown: '<ul class="dropdown-menu note-check">' + items + '</ul>' | ||
@@ -203,4 +208,6 @@ }); | ||
color: function (lang, options) { | ||
var colorButtonLabel = '<i class="' + options.iconPrefix + 'font" style="color:black;background-color:yellow;"></i>'; | ||
var colorButton = tplButton(colorButtonLabel, { | ||
var colorButtonLabel = '<i class="' + | ||
options.iconPrefix + options.icons.color.recent + | ||
'" style="color:black;background-color:yellow;"></i>', | ||
colorButton = tplButton(colorButtonLabel, { | ||
className: 'note-recent-color', | ||
@@ -240,3 +247,3 @@ title: lang.color.recent, | ||
bold: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'bold', { | ||
return tplIconButton(options.iconPrefix + options.icons.font.bold, { | ||
event: 'bold', | ||
@@ -247,3 +254,3 @@ title: lang.font.bold | ||
italic: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'italic', { | ||
return tplIconButton(options.iconPrefix + options.icons.font.italic, { | ||
event: 'italic', | ||
@@ -254,3 +261,3 @@ title: lang.font.italic | ||
underline: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'underline', { | ||
return tplIconButton(options.iconPrefix + options.icons.font.underline, { | ||
event: 'underline', | ||
@@ -260,4 +267,4 @@ title: lang.font.underline | ||
}, | ||
strikethrough: function (lang) { | ||
return tplIconButton('fa fa-strikethrough', { | ||
strikethrough: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + options.icons.font.strikethrough, { | ||
event: 'strikethrough', | ||
@@ -267,4 +274,4 @@ title: lang.font.strikethrough | ||
}, | ||
superscript: function (lang) { | ||
return tplIconButton('fa fa-superscript', { | ||
superscript: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + options.icons.font.superscript, { | ||
event: 'superscript', | ||
@@ -274,4 +281,4 @@ title: lang.font.superscript | ||
}, | ||
subscript: function (lang) { | ||
return tplIconButton('fa fa-subscript', { | ||
subscript: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + options.icons.font.subscript, { | ||
event: 'subscript', | ||
@@ -282,3 +289,3 @@ title: lang.font.subscript | ||
clear: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'eraser', { | ||
return tplIconButton(options.iconPrefix + options.icons.font.clear, { | ||
event: 'removeFormat', | ||
@@ -289,3 +296,3 @@ title: lang.font.clear | ||
ul: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'list-ul', { | ||
return tplIconButton(options.iconPrefix + options.icons.lists.unordered, { | ||
event: 'insertUnorderedList', | ||
@@ -296,3 +303,3 @@ title: lang.lists.unordered | ||
ol: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'list-ol', { | ||
return tplIconButton(options.iconPrefix + options.icons.lists.ordered, { | ||
event: 'insertOrderedList', | ||
@@ -303,15 +310,15 @@ title: lang.lists.ordered | ||
paragraph: function (lang, options) { | ||
var leftButton = tplIconButton(options.iconPrefix + 'align-left', { | ||
var leftButton = tplIconButton(options.iconPrefix + options.icons.paragraph.left, { | ||
title: lang.paragraph.left, | ||
event: 'justifyLeft' | ||
}); | ||
var centerButton = tplIconButton(options.iconPrefix + 'align-center', { | ||
var centerButton = tplIconButton(options.iconPrefix + options.icons.paragraph.center, { | ||
title: lang.paragraph.center, | ||
event: 'justifyCenter' | ||
}); | ||
var rightButton = tplIconButton(options.iconPrefix + 'align-right', { | ||
var rightButton = tplIconButton(options.iconPrefix + options.icons.paragraph.right, { | ||
title: lang.paragraph.right, | ||
event: 'justifyRight' | ||
}); | ||
var justifyButton = tplIconButton(options.iconPrefix + 'align-justify', { | ||
var justifyButton = tplIconButton(options.iconPrefix + options.icons.paragraph.justify, { | ||
title: lang.paragraph.justify, | ||
@@ -321,7 +328,7 @@ event: 'justifyFull' | ||
var outdentButton = tplIconButton(options.iconPrefix + 'outdent', { | ||
var outdentButton = tplIconButton(options.iconPrefix + options.icons.paragraph.outdent, { | ||
title: lang.paragraph.outdent, | ||
event: 'outdent' | ||
}); | ||
var indentButton = tplIconButton(options.iconPrefix + 'indent', { | ||
var indentButton = tplIconButton(options.iconPrefix + options.icons.paragraph.indent, { | ||
title: lang.paragraph.indent, | ||
@@ -340,3 +347,3 @@ event: 'indent' | ||
return tplIconButton(options.iconPrefix + 'align-left', { | ||
return tplIconButton(options.iconPrefix + options.icons.paragraph.paragraph, { | ||
title: lang.paragraph.paragraph, | ||
@@ -349,7 +356,7 @@ dropdown: dropdown | ||
return memo + '<li><a data-event="lineHeight" href="#" data-value="' + parseFloat(v) + '">' + | ||
'<i class="' + options.iconPrefix + 'check"></i> ' + v + | ||
'<i class="' + options.iconPrefix + options.icons.misc.check + '"></i> ' + v + | ||
'</a></li>'; | ||
}, ''); | ||
return tplIconButton(options.iconPrefix + 'text-height', { | ||
return tplIconButton(options.iconPrefix + options.icons.font.height, { | ||
title: lang.font.height, | ||
@@ -361,3 +368,3 @@ dropdown: '<ul class="dropdown-menu note-check">' + items + '</ul>' | ||
help: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'question', { | ||
return tplIconButton(options.iconPrefix + options.icons.options.help, { | ||
event: 'showHelpDialog', | ||
@@ -369,3 +376,3 @@ title: lang.options.help, | ||
fullscreen: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'arrows-alt', { | ||
return tplIconButton(options.iconPrefix + options.icons.options.fullscreen, { | ||
event: 'fullscreen', | ||
@@ -376,3 +383,3 @@ title: lang.options.fullscreen | ||
codeview: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'code', { | ||
return tplIconButton(options.iconPrefix + options.icons.options.codeview, { | ||
event: 'codeview', | ||
@@ -383,3 +390,3 @@ title: lang.options.codeview | ||
undo: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'undo', { | ||
return tplIconButton(options.iconPrefix + options.icons.history.undo, { | ||
event: 'undo', | ||
@@ -390,3 +397,3 @@ title: lang.history.undo | ||
redo: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'repeat', { | ||
return tplIconButton(options.iconPrefix + options.icons.history.redo, { | ||
event: 'redo', | ||
@@ -397,3 +404,3 @@ title: lang.history.redo | ||
hr: function (lang, options) { | ||
return tplIconButton(options.iconPrefix + 'minus', { | ||
return tplIconButton(options.iconPrefix + options.icons.hr.insert, { | ||
event: 'insertHorizontalRule', | ||
@@ -407,3 +414,3 @@ title: lang.hr.insert | ||
var tplLinkPopover = function () { | ||
var linkButton = tplIconButton(options.iconPrefix + 'edit', { | ||
var linkButton = tplIconButton(options.iconPrefix + options.icons.link.edit, { | ||
title: lang.link.edit, | ||
@@ -413,3 +420,3 @@ event: 'showLinkDialog', | ||
}); | ||
var unlinkButton = tplIconButton(options.iconPrefix + 'unlink', { | ||
var unlinkButton = tplIconButton(options.iconPrefix + options.icons.link.unlink, { | ||
title: lang.link.unlink, | ||
@@ -442,3 +449,3 @@ event: 'unlink' | ||
var leftButton = tplIconButton(options.iconPrefix + 'align-left', { | ||
var leftButton = tplIconButton(options.iconPrefix + options.icons.image.floatLeft, { | ||
title: lang.image.floatLeft, | ||
@@ -448,3 +455,3 @@ event: 'floatMe', | ||
}); | ||
var rightButton = tplIconButton(options.iconPrefix + 'align-right', { | ||
var rightButton = tplIconButton(options.iconPrefix + options.icons.image.floatRight, { | ||
title: lang.image.floatRight, | ||
@@ -454,3 +461,3 @@ event: 'floatMe', | ||
}); | ||
var justifyButton = tplIconButton(options.iconPrefix + 'align-justify', { | ||
var justifyButton = tplIconButton(options.iconPrefix + options.icons.image.floatNone, { | ||
title: lang.image.floatNone, | ||
@@ -461,3 +468,3 @@ event: 'floatMe', | ||
var roundedButton = tplIconButton(options.iconPrefix + 'square', { | ||
var roundedButton = tplIconButton(options.iconPrefix + options.icons.image.shapeRounded, { | ||
title: lang.image.shapeRounded, | ||
@@ -467,3 +474,3 @@ event: 'imageShape', | ||
}); | ||
var circleButton = tplIconButton(options.iconPrefix + 'circle-o', { | ||
var circleButton = tplIconButton(options.iconPrefix + options.icons.image.shapeCircle, { | ||
title: lang.image.shapeCircle, | ||
@@ -473,3 +480,3 @@ event: 'imageShape', | ||
}); | ||
var thumbnailButton = tplIconButton(options.iconPrefix + 'picture-o', { | ||
var thumbnailButton = tplIconButton(options.iconPrefix + options.icons.image.shapeThumbnail, { | ||
title: lang.image.shapeThumbnail, | ||
@@ -479,3 +486,3 @@ event: 'imageShape', | ||
}); | ||
var noneButton = tplIconButton(options.iconPrefix + 'times', { | ||
var noneButton = tplIconButton(options.iconPrefix + options.icons.image.shapeNone, { | ||
title: lang.image.shapeNone, | ||
@@ -486,3 +493,3 @@ event: 'imageShape', | ||
var removeButton = tplIconButton(options.iconPrefix + 'trash-o', { | ||
var removeButton = tplIconButton(options.iconPrefix + options.icons.image.remove, { | ||
title: lang.image.remove, | ||
@@ -681,3 +688,3 @@ event: 'removeMedia', | ||
'<label>' + lang.link.url + '</label>' + | ||
'<input class="note-link-url form-control span12" type="text" />' + | ||
'<input class="note-link-url form-control span12" type="text" value="http://" />' + | ||
'</div>' + | ||
@@ -684,0 +691,0 @@ (!options.disableLinkTarget ? |
@@ -92,3 +92,3 @@ define([ | ||
* // make icon button by template function | ||
* return tmpl.iconButton('fa fa-header', { | ||
* return tmpl.iconButton(options.iconPrefix + 'header', { | ||
* // callback function name when button clicked | ||
@@ -197,2 +197,3 @@ * event : 'hello', | ||
options = $.extend({}, $.summernote.options, options); | ||
options.icons = $.extend({}, $.summernote.options.icons, options.icons); | ||
@@ -199,0 +200,0 @@ // Include langInfo in options for later use, e.g. for image drag-n-drop |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1422596
34522
177