Index: lams_central/web/ckeditor/plugins/bootsnippets/dialogs/snippets.css =================================================================== diff -u --- lams_central/web/ckeditor/plugins/bootsnippets/dialogs/snippets.css (revision 0) +++ lams_central/web/ckeditor/plugins/bootsnippets/dialogs/snippets.css (revision 98d80295ca2398cfef80d796b9581cbc399a4077) @@ -0,0 +1,92 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ + +.cke_tpl_list { + border: #dcdcdc 1px solid; + background-color: #ffffff; + overflow-y: auto; + overflow-x: hidden; + width: 100%; + height: 568px; +} +.cke_dialog_contents_body { + padding-top: 10px; +} +#fakeId { + display: none; +} + +.cke_tpl_item +{ + padding: 7px; + border-bottom: 1px solid rgba(128, 128, 128, 0.22); +} + +.cke_tpl_preview +{ + border-collapse: separate; + text-indent:0; + width: 100%; +} +.cke_tpl_preview td +{ + padding: 2px; + vertical-align: middle; +} +.cke_tpl_preview .cke_tpl_preview_img +{ + width: 100px; +} +.cke_tpl_preview span +{ + white-space: normal; +} + +.cke_tpl_title{ + font-size: 16px; +} +.cke_dialog_contents { + background-color: #f3f3f3; +} + +.cke_dialog_contents a:hover { + text-decoration: none; +} + +.cke_tpl_list a:hover .cke_tpl_item, +.cke_tpl_list a:focus .cke_tpl_item, +.cke_tpl_list a:active .cke_tpl_item +{ + background-color: #fffee4; +} + +.cke_tpl_list a:hover *, +.cke_tpl_list a:focus *, +.cke_tpl_list a:active * +{ + cursor: pointer; +} + +/* IE Quirks contextual selectors children will not get :hover transition until + the hover style of the link itself contains certain CSS declarations. */ +.cke_browser_quirks .cke_tpl_list a:active, +.cke_browser_quirks .cke_tpl_list a:hover, +.cke_browser_quirks .cke_tpl_list a:focus +{ + background-position: 0 0; +} + +.cke_hc .cke_tpl_list a:hover .cke_tpl_item, +.cke_hc .cke_tpl_list a:focus .cke_tpl_item, +.cke_hc .cke_tpl_list a:active .cke_tpl_item +{ + border-width: 3px; +} + +.cke_tpl_empty, .cke_tpl_loading +{ + text-align: center; + padding: 5px; +} Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/hidpi/snippets-rtl.png =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/hidpi/snippets.png =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/ico_image.ico =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/ico_photo.gif =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/ico_text.ico =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/ico_video.png =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/snippets-rtl.png =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/icons/snippets.png =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/bootsnippets/lang/en.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/bootsnippets/lang/en.js (revision 0) +++ lams_central/web/ckeditor/plugins/bootsnippets/lang/en.js (revision 98d80295ca2398cfef80d796b9581cbc399a4077) @@ -0,0 +1,14 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'bootsnippets', 'en', { + emptyListMsg: '(No snippets defined)', + insertOption: 'Replace actual contents', + options: 'Snippet Options', + title: 'Content snippets', + tableButton: 'Table Snippets', + imageButton: 'Image Snippets', + multimediaButton: 'Multimedia Snippets', + tabsButton: 'Tabs Snippets' +} ); Index: lams_central/web/ckeditor/plugins/bootsnippets/plugin.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/bootsnippets/plugin.js (revision 0) +++ lams_central/web/ckeditor/plugins/bootsnippets/plugin.js (revision 98d80295ca2398cfef80d796b9581cbc399a4077) @@ -0,0 +1,276 @@ +/** + * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +( function() { + + //add all commands, dialogs and buttons specified in ckconfig_custom.js + CKEDITOR.plugins.add( 'bootsnippets', { + requires: 'dialog', + lang: 'en', + hidpi: false, + init: function( editor ) { + var snippetNames = (CKEDITOR.config.bootsnippets).split( ',' ); + var snippetIcons = (CKEDITOR.config.bootsnippets_icons).split( ',' ); + var snippetLabels = (CKEDITOR.config.bootsnippets_labels).split( ',' ); + + if ( snippetNames.length ) { + for ( var i = 0, snippetNamesCount = snippetNames.length; i < snippetNamesCount; i++ ) { + var snippetName = snippetNames[i].trim(); + var snippetIcon = snippetIcons[i].trim(); + var snippetLabel = snippetLabels[i].trim(); + + CKEDITOR.dialog.add( snippetName, bootsnippetDialogHandler ); + editor.addCommand( snippetName, new CKEDITOR.dialogCommand( snippetName ) ); + + editor.ui.addButton && editor.ui.addButton( + snippetName, + { + label: snippetLabel, + command: snippetName, + icon : snippetIcon, + toolbar: 'bootsnippets,'+i + } + ); + } + } + } + } ); + + var bootsnippets = {}, + loadedSnippetsFiles = {}; + + CKEDITOR.addSnippets = function( name, definition ) { + bootsnippets[ name ] = definition; + }; + + CKEDITOR.getSnippets = function( name ) { + return bootsnippets[ name ]; + }; + + CKEDITOR.loadSnippets = function( snippetFiles, callback ) { + // Holds the bootsnippets files to be loaded. + var toLoad = []; + + // Look for pending snippet files to get loaded. + for ( var i = 0, count = snippetFiles.length; i < count; i++ ) { + if ( !loadedSnippetsFiles[ snippetFiles[ i ] ] ) { + toLoad.push( snippetFiles[ i ] ); + loadedSnippetsFiles[ snippetFiles[ i ] ] = 1; + } + } + + if ( toLoad.length ) + CKEDITOR.scriptLoader.load( toLoad, callback ); + else + setTimeout( callback, 0 ); + }; + + //creates dialog for each snippet category + function bootsnippetDialogHandler(editor) { + + // Constructs the HTML view of the specified snippets data. + function renderSnippetsList( container, snippetsDefinitions ) { + // clear loading wait text. + container.setHtml( '' ); + + for ( var i = 0, totalDefs = snippetsDefinitions.length; i < totalDefs; i++ ) { + var definition = CKEDITOR.getSnippets( snippetsDefinitions[ i ] ), + imagesPath = definition.imagesPath, + snippets = definition.snippets, + count = snippets.length; + + for ( var j = 0; j < count; j++ ) { + var snippet = snippets[ j ], + item = createSnippetItem( snippet, imagesPath ); + item.setAttribute( 'aria-posinset', j + 1 ); + item.setAttribute( 'aria-setsize', count ); + container.append( item ); + } + } + } + + function createSnippetItem( snippet, imagesPath ) { + var item = CKEDITOR.dom.element.createFromHtml( '' + + '' + + '' ); + + // Build the inner HTML of our new item DIV. + var html = '
' + snippet.title + ' '; + if ( snippet.description ) { + html += '' + snippet.description + ''; + } + html += ' |