Topic: New Plugin Summernote Monstra 3x Version
New Plugin Summernote Monstra 3x Version
link download https://www.dropbox.com/s/kyc1tra6gbqqn … e.zip?dl=0
Pages 1
New Plugin Summernote Monstra 3x Version
link download https://www.dropbox.com/s/kyc1tra6gbqqn … e.zip?dl=0
excellent editor. works well.
I'm attempting to use this in monstra 3.0.1 and it won't show at all in the admin
I'm attempting to use this in monstra 3.0.1 and it won't show at all in the admin
look video http://s000.tinyupload.com/download.php … 8632724027
good very
Hello,
How can i config this plugin?
summernote/src/js/settings.js : doesn't work.
No answer?
@polochOn
Hi there, what to you want to edit on summernote?
Hi wormsunited,
I want configure what can i see to back office.
Example : delete line height.
@poloch0n
If you want to edit the CORE of summernote you have to go at: plugins/summernote/summernote/src/js/settings.js
Here is the code of the file:
define('summernote/settings', function () { var settings = { // version version: '@VERSION', /** * options */ options: { width: null, // set editor width height: null, // set editor height, ex) 300 minHeight: null, // set minimum height of editor maxHeight: null, // set maximum height of editor focus: false, // set focus to editable area after initializing summernote tabsize: 4, // size of tab ex) 2 or 4 styleWithSpan: true, // style with span (Chrome and FF only) disableLinkTarget: false, // hide link Target Checkbox disableDragAndDrop: false, // disable drag and drop event disableResizeEditor: false, // disable resizing editor codemirror: { // codemirror options mode: 'text/html', htmlMode: true, lineNumbers: true }, // language lang: 'en-US', // language 'en-US', 'ko-KR', ... direction: null, // text direction, ex) 'rtl' // toolbar toolbar: [ ['style', ['style']], ['font', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']], ['fontname', ['fontname']], // ['fontsize', ['fontsize']], // Still buggy ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['height', ['height']], ['table', ['table']], ['insert', ['link', 'picture', 'video', 'hr']], ['view', ['fullscreen', 'codeview']], ['help', ['help']] ], // air mode: inline editor airMode: false, // airPopover: [ // ['style', ['style']], // ['font', ['bold', 'italic', 'underline', 'clear']], // ['fontname', ['fontname']], // ['fontsize', ['fontsize']], // Still buggy // ['color', ['color']], // ['para', ['ul', 'ol', 'paragraph']], // ['height', ['height']], // ['table', ['table']], // ['insert', ['link', 'picture', 'video']], // ['help', ['help']] // ], airPopover: [ ['color', ['color']], ['font', ['bold', 'underline', 'clear']], ['para', ['ul', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture']] ], // style tag styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], // default fontName defaultFontName: 'Helvetica Neue', // fontName fontNames: [ 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Helvetica Neue', 'Impact', 'Lucida Grande', 'Tahoma', 'Times New Roman', 'Verdana' ], // pallete colors(n x n) colors: [ ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'], ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'], ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'], ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'], ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'], ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'], ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'], ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'] ], // fontSize fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'], // lineHeight lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'], // insertTable max size insertTableMaxSize: { col: 10, row: 10 }, // callbacks oninit: null, // initialize onfocus: null, // editable has focus onblur: null, // editable out of focus onenter: null, // enter key pressed onkeyup: null, // keyup onkeydown: null, // keydown onImageUpload: null, // imageUpload onImageUploadError: null, // imageUploadError onToolbarClick: null, /** * manipulate link address when user create link * @param {String} sLinkUrl * @return {String} */ onCreateLink: function (sLinkUrl) { if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) { sLinkUrl = 'mailto:' + sLinkUrl; } else if (sLinkUrl.indexOf('://') === -1) { sLinkUrl = 'http://' + sLinkUrl; } return sLinkUrl; }, keyMap: { pc: { 'ENTER': 'insertParagraph', 'CTRL+Z': 'undo', 'CTRL+Y': 'redo', 'TAB': 'tab', 'SHIFT+TAB': 'untab', 'CTRL+B': 'bold', 'CTRL+I': 'italic', 'CTRL+U': 'underline', 'CTRL+SHIFT+S': 'strikethrough', 'CTRL+BACKSLASH': 'removeFormat', 'CTRL+SHIFT+L': 'justifyLeft', 'CTRL+SHIFT+E': 'justifyCenter', 'CTRL+SHIFT+R': 'justifyRight', 'CTRL+SHIFT+J': 'justifyFull', 'CTRL+SHIFT+NUM7': 'insertUnorderedList', 'CTRL+SHIFT+NUM8': 'insertOrderedList', 'CTRL+LEFTBRACKET': 'outdent', 'CTRL+RIGHTBRACKET': 'indent', 'CTRL+NUM0': 'formatPara', 'CTRL+NUM1': 'formatH1', 'CTRL+NUM2': 'formatH2', 'CTRL+NUM3': 'formatH3', 'CTRL+NUM4': 'formatH4', 'CTRL+NUM5': 'formatH5', 'CTRL+NUM6': 'formatH6', 'CTRL+ENTER': 'insertHorizontalRule', 'CTRL+K': 'showLinkDialog' }, mac: { 'ENTER': 'insertParagraph', 'CMD+Z': 'undo', 'CMD+SHIFT+Z': 'redo', 'TAB': 'tab', 'SHIFT+TAB': 'untab', 'CMD+B': 'bold', 'CMD+I': 'italic', 'CMD+U': 'underline', 'CMD+SHIFT+S': 'strikethrough', 'CMD+BACKSLASH': 'removeFormat', 'CMD+SHIFT+L': 'justifyLeft', 'CMD+SHIFT+E': 'justifyCenter', 'CMD+SHIFT+R': 'justifyRight', 'CMD+SHIFT+J': 'justifyFull', 'CMD+SHIFT+NUM7': 'insertUnorderedList', 'CMD+SHIFT+NUM8': 'insertOrderedList', 'CMD+LEFTBRACKET': 'outdent', 'CMD+RIGHTBRACKET': 'indent', 'CMD+NUM0': 'formatPara', 'CMD+NUM1': 'formatH1', 'CMD+NUM2': 'formatH2', 'CMD+NUM3': 'formatH3', 'CMD+NUM4': 'formatH4', 'CMD+NUM5': 'formatH5', 'CMD+NUM6': 'formatH6', 'CMD+ENTER': 'insertHorizontalRule', 'CMD+K': 'showLinkDialog' } } }, // default language: en-US lang: { 'en-US': { font: { bold: 'Bold', italic: 'Italic', underline: 'Underline', strikethrough: 'Strikethrough', subscript: 'Subscript', superscript: 'Superscript', clear: 'Remove Font Style', height: 'Line Height', name: 'Font Family', size: 'Font Size' }, image: { image: 'Picture', insert: 'Insert Image', resizeFull: 'Resize Full', resizeHalf: 'Resize Half', resizeQuarter: 'Resize Quarter', floatLeft: 'Float Left', floatRight: 'Float Right', floatNone: 'Float None', dragImageHere: 'Drag an image here', selectFromFiles: 'Select from files', url: 'Image URL', remove: 'Remove Image' }, link: { link: 'Link', insert: 'Insert Link', unlink: 'Unlink', edit: 'Edit', textToDisplay: 'Text to display', url: 'To what URL should this link go?', openInNewWindow: 'Open in new window' }, video: { video: 'Video', videoLink: 'Video Link', insert: 'Insert Video', url: 'Video URL?', providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)' }, table: { table: 'Table' }, hr: { insert: 'Insert Horizontal Rule' }, style: { style: 'Style', normal: 'Normal', blockquote: 'Quote', pre: 'Code', h1: 'Header 1', h2: 'Header 2', h3: 'Header 3', h4: 'Header 4', h5: 'Header 5', h6: 'Header 6' }, lists: { unordered: 'Unordered list', ordered: 'Ordered list' }, options: { help: 'Help', fullscreen: 'Full Screen', codeview: 'Code View' }, paragraph: { paragraph: 'Paragraph', outdent: 'Outdent', indent: 'Indent', left: 'Align left', center: 'Align center', right: 'Align right', justify: 'Justify full' }, color: { recent: 'Recent Color', more: 'More Color', background: 'Background Color', foreground: 'Foreground Color', transparent: 'Transparent', setTransparent: 'Set transparent', reset: 'Reset', resetToDefault: 'Reset to default' }, shortcut: { shortcuts: 'Keyboard shortcuts', close: 'Close', textFormatting: 'Text formatting', action: 'Action', paragraphFormatting: 'Paragraph formatting', documentStyle: 'Document Style' }, history: { undo: 'Undo', redo: 'Redo' } } } }; return settings; });
To delete or edit line height settings you need to go at: plugins/summernote/summernote/src/js/editing/Style.js
Here s the code
define(['core/dom'], function (dom) { /** * Style */ var Style = function () { // para level style this.stylePara = function (rng, oStyle) { var aPara = rng.listPara(); $.each(aPara, function (idx, elPara) { $.each(oStyle, function (sKey, sValue) { elPara.style[sKey] = sValue; }); }); }; // get current style, elTarget: target element on event. this.current = function (rng, elTarget) { var $cont = $(dom.isText(rng.sc) ? rng.sc.parentNode : rng.sc); var oStyle = $cont.css(['font-size', 'text-align', 'list-style-type', 'line-height']) || {}; oStyle['font-size'] = parseInt(oStyle['font-size']); // document.queryCommandState for toggle state oStyle['font-bold'] = document.queryCommandState('bold') ? 'bold' : 'normal'; oStyle['font-italic'] = document.queryCommandState('italic') ? 'italic' : 'normal'; oStyle['font-underline'] = document.queryCommandState('underline') ? 'underline' : 'normal'; // list-style-type to list-style(unordered, ordered) if (!rng.isOnList()) { oStyle['list-style'] = 'none'; } else { var aOrderedType = ['circle', 'disc', 'disc-leading-zero', 'square']; var bUnordered = $.inArray(oStyle['list-style-type'], aOrderedType) > -1; oStyle['list-style'] = bUnordered ? 'unordered' : 'ordered'; } var elPara = dom.ancestor(rng.sc, dom.isPara); if (elPara && elPara.style['line-height']) { oStyle['line-height'] = elPara.style.lineHeight; } else { var lineHeight = parseInt(oStyle['line-height']) / parseInt(oStyle['font-size']); oStyle['line-height'] = lineHeight.toFixed(1); } oStyle.image = dom.isImg(elTarget) && elTarget; oStyle.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor); oStyle.aAncestor = dom.listAncestor(rng.sc, dom.isEditable); return oStyle; }; }; return Style; });
You sure need to know about Javascript in order to edit some variables
U can change the language or Line height ?
@poloch0n
You have all the code there you may change the values on it and edit as you wish in order to meet your criteria
Yes i understand. But for me, when i change the value, he doesn't work. i want know if for your when you change the value, it works ?
@poloch0n
Yes, you need to refresh the page and clear Cookies that helps, also in your Monstra Backoffice, delete tempory files.
By the way i am using Monstra 3.0.1
Ok i don't understand what i do false but nothing work for me, I can delete or change parameters and... nothing..
I don't know why. (and yes for cookies and tempory files)
@poloch0n
You have to look in the files were the changes are made or in the core files from the developer wich is: @dextra.
Try to send him a PM maybe dextra can reply to you and help you on that.
@poloch0n
ok follow the steps below
1) go plugins/summernote/summernote.plugin.php line 38
from
changed
2) go plugins/summernote/summernote/dist/summernote.js line 2344
from
height: 'Line Height',
changed
height: 'Line Height', //Enter here the language you want
@dextra
Thx, work perfectly ! And you can change the toolbar at line 2444
toolbar: [ ['style', ['style']], ['font', ['bold', 'italic', 'underline', 'clear']], ['fontsize', ['fontsize']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['height', ['height']], ['table', ['table']], ['insert', ['link', 'picture', 'video']], ['view', ['fullscreen', 'codeview']], ['help', ['help']] ],
Nice that is fixed ;-)
The background color of the dropdown buttons look very weird.
Is there a way to change it manually?
Thanks
Pages 1