Update: 3rd Party Libraries
Newtonsoft.Json 5.0.8; RazorGenerator.Mvc 2.1.2; jQuery 2.0.3; jQuery Validate Unobtrusive 3.0.0; Microsoft.Net.Http 2.1.10; KnockoutJS 2.3.0; Highcharts 2.0; T4MVC 3.7.4; TinyMCE 4.0.9
This commit is contained in:
@@ -1 +0,0 @@
|
||||
(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
|
||||
@@ -1,84 +0,0 @@
|
||||
/**
|
||||
* editor_template_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var DOM = tinymce.DOM;
|
||||
|
||||
// Tell it to load theme specific language pack(s)
|
||||
tinymce.ThemeManager.requireLangPack('simple');
|
||||
|
||||
tinymce.create('tinymce.themes.SimpleTheme', {
|
||||
init : function(ed, url) {
|
||||
var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
|
||||
|
||||
t.editor = ed;
|
||||
ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css");
|
||||
|
||||
ed.onInit.add(function() {
|
||||
ed.onNodeChange.add(function(ed, cm) {
|
||||
tinymce.each(states, function(c) {
|
||||
cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");
|
||||
},
|
||||
|
||||
renderUI : function(o) {
|
||||
var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;
|
||||
|
||||
n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);
|
||||
n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});
|
||||
n = tb = DOM.add(n, 'tbody');
|
||||
|
||||
// Create iframe container
|
||||
n = DOM.add(tb, 'tr');
|
||||
n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});
|
||||
|
||||
// Create toolbar container
|
||||
n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});
|
||||
|
||||
// Create toolbar
|
||||
tb = t.toolbar = cf.createToolbar("tools1");
|
||||
tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));
|
||||
tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));
|
||||
tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));
|
||||
tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));
|
||||
tb.add(cf.createSeparator());
|
||||
tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));
|
||||
tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));
|
||||
tb.add(cf.createSeparator());
|
||||
tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));
|
||||
tb.add(cf.createSeparator());
|
||||
tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));
|
||||
tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));
|
||||
tb.renderTo(n);
|
||||
|
||||
return {
|
||||
iframeContainer : ic,
|
||||
editorContainer : ed.id + '_container',
|
||||
sizeContainer : sc,
|
||||
deltaHeight : -20
|
||||
};
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Simple theme',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);
|
||||
})();
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 806 B |
@@ -1 +0,0 @@
|
||||
tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"});
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
body, td, pre {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.mceVisualAid {
|
||||
border: 1px dashed #BBBBBB;
|
||||
}
|
||||
|
||||
/* MSIE specific */
|
||||
|
||||
* html body {
|
||||
scrollbar-3dlight-color: #F0F0EE;
|
||||
scrollbar-arrow-color: #676662;
|
||||
scrollbar-base-color: #F0F0EE;
|
||||
scrollbar-darkshadow-color: #DDDDDD;
|
||||
scrollbar-face-color: #E0E0DD;
|
||||
scrollbar-highlight-color: #F0F0EE;
|
||||
scrollbar-shadow-color: #F0F0EE;
|
||||
scrollbar-track-color: #F5F5F5;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/* Reset */
|
||||
.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||
|
||||
/* Containers */
|
||||
.defaultSimpleSkin {position:relative}
|
||||
.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}
|
||||
.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}
|
||||
.defaultSimpleSkin .mceToolbar {height:24px;}
|
||||
|
||||
/* Layout */
|
||||
.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}
|
||||
.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
||||
|
||||
/* Button */
|
||||
.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}
|
||||
.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
|
||||
.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}
|
||||
.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
|
||||
/* Separator */
|
||||
.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}
|
||||
|
||||
/* Theme */
|
||||
.defaultSimpleSkin span.mce_bold {background-position:0 0}
|
||||
.defaultSimpleSkin span.mce_italic {background-position:-60px 0}
|
||||
.defaultSimpleSkin span.mce_underline {background-position:-140px 0}
|
||||
.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}
|
||||
.defaultSimpleSkin span.mce_undo {background-position:-160px 0}
|
||||
.defaultSimpleSkin span.mce_redo {background-position:-100px 0}
|
||||
.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}
|
||||
.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
|
||||
.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
|
||||
@@ -1,17 +0,0 @@
|
||||
body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
|
||||
body {background: #FFF;}
|
||||
.mceVisualAid {border: 1px dashed #BBB;}
|
||||
|
||||
/* IE */
|
||||
|
||||
* html body {
|
||||
scrollbar-3dlight-color: #F0F0EE;
|
||||
scrollbar-arrow-color: #676662;
|
||||
scrollbar-base-color: #F0F0EE;
|
||||
scrollbar-darkshadow-color: #DDDDDD;
|
||||
scrollbar-face-color: #E0E0DD;
|
||||
scrollbar-highlight-color: #F0F0EE;
|
||||
scrollbar-shadow-color: #F0F0EE;
|
||||
scrollbar-track-color: #F5F5F5;
|
||||
}
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -1,35 +0,0 @@
|
||||
/* Reset */
|
||||
.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||
|
||||
/* Containers */
|
||||
.o2k7SimpleSkin {position:relative}
|
||||
.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}
|
||||
.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}
|
||||
.o2k7SimpleSkin .mceToolbar {height:26px;}
|
||||
|
||||
/* Layout */
|
||||
.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }
|
||||
.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
|
||||
.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px}
|
||||
.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
||||
|
||||
/* Button */
|
||||
.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
|
||||
.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}
|
||||
.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
|
||||
.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}
|
||||
.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
|
||||
/* Separator */
|
||||
.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
|
||||
|
||||
/* Theme */
|
||||
.o2k7SimpleSkin span.mce_bold {background-position:0 0}
|
||||
.o2k7SimpleSkin span.mce_italic {background-position:-60px 0}
|
||||
.o2k7SimpleSkin span.mce_underline {background-position:-140px 0}
|
||||
.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0}
|
||||
.o2k7SimpleSkin span.mce_undo {background-position:-160px 0}
|
||||
.o2k7SimpleSkin span.mce_redo {background-position:-100px 0}
|
||||
.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0}
|
||||
.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
|
||||
.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
|
||||
@@ -0,0 +1,566 @@
|
||||
/**
|
||||
* theme.js
|
||||
*
|
||||
* Copyright, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/*global tinymce:true */
|
||||
|
||||
tinymce.ThemeManager.add('simple', function(editor) {
|
||||
var self = this, settings = editor.settings, Factory = tinymce.ui.Factory, each = tinymce.each, DOM = tinymce.DOM;
|
||||
|
||||
// Default menus
|
||||
defaultMenus = {};
|
||||
|
||||
var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
|
||||
"bullist numlist";
|
||||
|
||||
/**
|
||||
* Creates the toolbars from config and returns a toolbar array.
|
||||
*
|
||||
* @return {Array} Array with toolbars.
|
||||
*/
|
||||
function createToolbars() {
|
||||
var toolbars = [];
|
||||
|
||||
function addToolbar(items) {
|
||||
var toolbarItems = [], buttonGroup;
|
||||
|
||||
if (!items) {
|
||||
return;
|
||||
}
|
||||
|
||||
each(items.split(/[ ,]/), function(item) {
|
||||
var itemName;
|
||||
|
||||
function bindSelectorChanged() {
|
||||
var selection = editor.selection;
|
||||
|
||||
if (itemName == "bullist") {
|
||||
selection.selectorChanged('ul > li', function(state, args) {
|
||||
var nodeName, i = args.parents.length;
|
||||
|
||||
while (i--) {
|
||||
nodeName = args.parents[i].nodeName;
|
||||
if (nodeName == "OL" || nodeName == "UL") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
item.active(state && nodeName == "UL");
|
||||
});
|
||||
}
|
||||
|
||||
if (itemName == "numlist") {
|
||||
selection.selectorChanged('ol > li', function(state, args) {
|
||||
var nodeName, i = args.parents.length;
|
||||
|
||||
while (i--) {
|
||||
nodeName = args.parents[i].nodeName;
|
||||
if (nodeName == "OL" || nodeName == "UL") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
item.active(state && nodeName == "OL");
|
||||
});
|
||||
}
|
||||
|
||||
if (item.settings.stateSelector) {
|
||||
selection.selectorChanged(item.settings.stateSelector, function(state) {
|
||||
item.active(state);
|
||||
}, true);
|
||||
}
|
||||
|
||||
if (item.settings.disabledStateSelector) {
|
||||
selection.selectorChanged(item.settings.disabledStateSelector, function(state) {
|
||||
item.disabled(state);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (item == "|") {
|
||||
buttonGroup = null;
|
||||
} else {
|
||||
if (Factory.has(item)) {
|
||||
item = {type: item};
|
||||
|
||||
if (settings.toolbar_items_size) {
|
||||
item.size = settings.toolbar_items_size;
|
||||
}
|
||||
|
||||
toolbarItems.push(item);
|
||||
buttonGroup = null;
|
||||
} else {
|
||||
if (!buttonGroup) {
|
||||
buttonGroup = {type: 'buttongroup', items: []};
|
||||
toolbarItems.push(buttonGroup);
|
||||
}
|
||||
|
||||
if (editor.buttons[item]) {
|
||||
// TODO: Move control creation to some UI class
|
||||
itemName = item;
|
||||
item = editor.buttons[itemName];
|
||||
|
||||
if (typeof(item) == "function") {
|
||||
item = item();
|
||||
}
|
||||
|
||||
item.type = item.type || 'button';
|
||||
|
||||
if (settings.toolbar_items_size) {
|
||||
item.size = settings.toolbar_items_size;
|
||||
}
|
||||
|
||||
item = Factory.create(item);
|
||||
buttonGroup.items.push(item);
|
||||
|
||||
if (editor.initialized) {
|
||||
bindSelectorChanged();
|
||||
} else {
|
||||
editor.on('init', bindSelectorChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
toolbars.push({type: 'toolbar', layout: 'flow', items: toolbarItems});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Generate toolbar<n>
|
||||
for (var i = 1; i < 10; i++) {
|
||||
if (!addToolbar(settings["toolbar" + i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate toolbar or default toolbar
|
||||
if (!toolbars.length) {
|
||||
addToolbar(settings.toolbar || defaultToolbar);
|
||||
}
|
||||
|
||||
return toolbars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the menu buttons based on config.
|
||||
*
|
||||
* @return {Array} Menu buttons array.
|
||||
*/
|
||||
function createMenuButtons() {
|
||||
var name, menuButtons = [];
|
||||
|
||||
function createMenuItem(name) {
|
||||
var menuItem;
|
||||
|
||||
if (name == '|') {
|
||||
return {text: '|'};
|
||||
}
|
||||
|
||||
menuItem = editor.menuItems[name];
|
||||
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
function createMenu(context) {
|
||||
var menuButton, menu, menuItems, isUserDefined, removedMenuItems;
|
||||
|
||||
removedMenuItems = tinymce.makeMap((settings.removed_menuitems || '').split(/[ ,]/));
|
||||
|
||||
// User defined menu
|
||||
if (settings.menu) {
|
||||
menu = settings.menu[context];
|
||||
isUserDefined = true;
|
||||
} else {
|
||||
menu = defaultMenus[context];
|
||||
}
|
||||
|
||||
if (menu) {
|
||||
menuButton = {text: menu.title};
|
||||
menuItems = [];
|
||||
|
||||
// Default/user defined items
|
||||
each((menu.items || '').split(/[ ,]/), function(item) {
|
||||
var menuItem = createMenuItem(item);
|
||||
|
||||
if (menuItem && !removedMenuItems[item]) {
|
||||
menuItems.push(createMenuItem(item));
|
||||
}
|
||||
});
|
||||
|
||||
// Added though context
|
||||
if (!isUserDefined) {
|
||||
each(editor.menuItems, function(menuItem) {
|
||||
if (menuItem.context == context) {
|
||||
if (menuItem.separator == 'before') {
|
||||
menuItems.push({text: '|'});
|
||||
}
|
||||
|
||||
if (menuItem.prependToContext) {
|
||||
menuItems.unshift(menuItem);
|
||||
} else {
|
||||
menuItems.push(menuItem);
|
||||
}
|
||||
|
||||
if (menuItem.separator == 'after') {
|
||||
menuItems.push({text: '|'});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (var i = 0; i < menuItems.length; i++) {
|
||||
if (menuItems[i].text == '|') {
|
||||
if (i === 0 || i == menuItems.length - 1) {
|
||||
menuItems.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menuButton.menu = menuItems;
|
||||
|
||||
if (!menuButton.menu.length) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return menuButton;
|
||||
}
|
||||
|
||||
var defaultMenuBar = [];
|
||||
if (settings.menu) {
|
||||
for (name in settings.menu) {
|
||||
defaultMenuBar.push(name);
|
||||
}
|
||||
} else {
|
||||
for (name in defaultMenus) {
|
||||
defaultMenuBar.push(name);
|
||||
}
|
||||
}
|
||||
|
||||
var enabledMenuNames = typeof(settings.menubar) == "string" ? settings.menubar.split(/[ ,]/) : defaultMenuBar;
|
||||
for (var i = 0; i < enabledMenuNames.length; i++) {
|
||||
var menu = enabledMenuNames[i];
|
||||
menu = createMenu(menu);
|
||||
|
||||
if (menu) {
|
||||
menuButtons.push(menu);
|
||||
}
|
||||
}
|
||||
|
||||
return menuButtons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds accessibility shortcut keys to panel.
|
||||
*
|
||||
* @param {tinymce.ui.Panel} panel Panel to add focus to.
|
||||
*/
|
||||
function addAccessibilityKeys(panel) {
|
||||
function focus(type) {
|
||||
var item = panel.find(type)[0];
|
||||
|
||||
if (item) {
|
||||
item.focus();
|
||||
}
|
||||
}
|
||||
|
||||
editor.shortcuts.add('Alt+F9', '', function() {
|
||||
focus('menubar');
|
||||
});
|
||||
|
||||
editor.shortcuts.add('Alt+F10', '', function() {
|
||||
focus('toolbar');
|
||||
});
|
||||
|
||||
editor.shortcuts.add('Alt+F11', '', function() {
|
||||
focus('elementpath');
|
||||
});
|
||||
|
||||
panel.on('cancel', function() {
|
||||
editor.focus();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes the editor to the specified width, height.
|
||||
*/
|
||||
function resizeTo(width, height) {
|
||||
var containerElm, iframeElm, containerSize, iframeSize;
|
||||
|
||||
function getSize(elm) {
|
||||
return {
|
||||
width: elm.clientWidth,
|
||||
height: elm.clientHeight
|
||||
};
|
||||
}
|
||||
|
||||
containerElm = editor.getContainer();
|
||||
iframeElm = editor.getContentAreaContainer().firstChild;
|
||||
containerSize = getSize(containerElm);
|
||||
iframeSize = getSize(iframeElm);
|
||||
|
||||
if (width !== null) {
|
||||
width = Math.max(settings.min_width || 100, width);
|
||||
width = Math.min(settings.max_width || 0xFFFF, width);
|
||||
|
||||
DOM.css(containerElm, 'width', width + (containerSize.width - iframeSize.width));
|
||||
DOM.css(iframeElm, 'width', width);
|
||||
}
|
||||
|
||||
height = Math.max(settings.min_height || 100, height);
|
||||
height = Math.min(settings.max_height || 0xFFFF, height);
|
||||
DOM.css(iframeElm, 'height', height);
|
||||
|
||||
editor.fire('ResizeEditor');
|
||||
}
|
||||
|
||||
function resizeBy(dw, dh) {
|
||||
var elm = editor.getContentAreaContainer();
|
||||
self.resizeTo(elm.clientWidth + dw, elm.clientHeight + dh);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the inline editor UI.
|
||||
*
|
||||
* @return {Object} Name/value object with theme data.
|
||||
*/
|
||||
function renderInlineUI() {
|
||||
var panel, inlineToolbarContainer;
|
||||
|
||||
if (settings.fixed_toolbar_container) {
|
||||
inlineToolbarContainer = DOM.select(settings.fixed_toolbar_container)[0];
|
||||
}
|
||||
|
||||
function reposition() {
|
||||
if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
|
||||
// TODO: This is kind of ugly and doesn't handle multiple scrollable elements
|
||||
var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
|
||||
var deltaX = 0, deltaY = 0;
|
||||
|
||||
if (scrollContainer) {
|
||||
var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
|
||||
|
||||
deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
|
||||
deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
|
||||
}
|
||||
|
||||
panel.fixed(false).moveRel(body, editor.rtl ? ['tr-br', 'br-tr'] : ['tl-bl', 'bl-tl']).moveBy(deltaX, deltaY);
|
||||
}
|
||||
}
|
||||
|
||||
function show() {
|
||||
if (panel) {
|
||||
panel.show();
|
||||
reposition();
|
||||
DOM.addClass(editor.getBody(), 'mce-edit-focus');
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
if (panel) {
|
||||
panel.hide();
|
||||
DOM.removeClass(editor.getBody(), 'mce-edit-focus');
|
||||
}
|
||||
}
|
||||
|
||||
function render() {
|
||||
if (panel) {
|
||||
if (!panel.visible()) {
|
||||
show();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Render a plain panel inside the inlineToolbarContainer if it's defined
|
||||
panel = self.panel = Factory.create({
|
||||
type: inlineToolbarContainer ? 'panel' : 'floatpanel',
|
||||
classes: 'tinymce tinymce-inline',
|
||||
layout: 'flex',
|
||||
direction: 'column',
|
||||
align: 'stretch',
|
||||
autohide: false,
|
||||
autofix: true,
|
||||
fixed: !!inlineToolbarContainer,
|
||||
border: 1,
|
||||
items: [
|
||||
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
|
||||
settings.toolbar === false ? null : {type: 'panel', name: 'toolbar', layout: 'stack', items: createToolbars()}
|
||||
]
|
||||
});
|
||||
|
||||
// Add statusbar
|
||||
/*if (settings.statusbar !== false) {
|
||||
panel.add({type: 'panel', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
|
||||
{type: 'elementpath'}
|
||||
]});
|
||||
}*/
|
||||
|
||||
panel.renderTo(inlineToolbarContainer || document.body).reflow();
|
||||
|
||||
addAccessibilityKeys(panel);
|
||||
show();
|
||||
|
||||
editor.on('nodeChange', reposition);
|
||||
editor.on('activate', show);
|
||||
editor.on('deactivate', hide);
|
||||
}
|
||||
|
||||
settings.content_editable = true;
|
||||
|
||||
editor.on('focus', render);
|
||||
editor.on('blur', hide);
|
||||
|
||||
// Remove the panel when the editor is removed
|
||||
editor.on('remove', function() {
|
||||
if (panel) {
|
||||
panel.remove();
|
||||
panel = null;
|
||||
}
|
||||
});
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the iframe editor UI.
|
||||
*
|
||||
* @param {Object} args Details about target element etc.
|
||||
* @return {Object} Name/value object with theme data.
|
||||
*/
|
||||
function renderIframeUI(args) {
|
||||
var panel, resizeHandleCtrl, startSize;
|
||||
|
||||
// Basic UI layout
|
||||
panel = self.panel = Factory.create({
|
||||
type: 'panel',
|
||||
classes: 'tinymce',
|
||||
style: 'visibility: hidden',
|
||||
layout: 'stack',
|
||||
border: 1,
|
||||
items: [
|
||||
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
|
||||
settings.toolbar === false ? null : {type: 'panel', layout: 'stack', items: createToolbars()},
|
||||
{type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
|
||||
]
|
||||
});
|
||||
|
||||
if (settings.resize !== false) {
|
||||
resizeHandleCtrl = {
|
||||
type: 'resizehandle',
|
||||
direction: settings.resize,
|
||||
|
||||
onResizeStart: function() {
|
||||
var elm = editor.getContentAreaContainer().firstChild;
|
||||
|
||||
startSize = {
|
||||
width: elm.clientWidth,
|
||||
height: elm.clientHeight
|
||||
};
|
||||
},
|
||||
|
||||
onResize: function(e) {
|
||||
if (settings.resize == 'both') {
|
||||
resizeTo(startSize.width + e.deltaX, startSize.height + e.deltaY);
|
||||
} else {
|
||||
resizeTo(null, startSize.height + e.deltaY);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Add statusbar if needed
|
||||
if (settings.statusbar !== false) {
|
||||
panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', items: [
|
||||
{type: 'elementpath'},
|
||||
resizeHandleCtrl
|
||||
]});
|
||||
}
|
||||
|
||||
if (settings.readonly) {
|
||||
panel.find('*').disabled(true);
|
||||
}
|
||||
|
||||
// Render before the target textarea/div
|
||||
panel.renderBefore(args.targetNode).reflow();
|
||||
|
||||
if (settings.width) {
|
||||
tinymce.DOM.setStyle(panel.getEl(), 'width', settings.width);
|
||||
}
|
||||
|
||||
// Remove the panel when the editor is removed
|
||||
editor.on('remove', function() {
|
||||
panel.remove();
|
||||
panel = null;
|
||||
});
|
||||
|
||||
// Add accesibility shortkuts
|
||||
addAccessibilityKeys(panel);
|
||||
|
||||
return {
|
||||
iframeContainer: panel.find('#iframe')[0].getEl(),
|
||||
editorContainer: panel.getEl()
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the UI for the theme. This gets called by the editor.
|
||||
*
|
||||
* @param {Object} args Details about target element etc.
|
||||
* @return {Object} Theme UI data items.
|
||||
*/
|
||||
self.renderUI = function(args) {
|
||||
var skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
|
||||
|
||||
if (skin) {
|
||||
var skinUrl = settings.skin_url;
|
||||
|
||||
if (skinUrl) {
|
||||
skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
|
||||
} else {
|
||||
skinUrl = tinymce.baseURL + '/skins/' + skin;
|
||||
}
|
||||
|
||||
// Load special skin for IE7
|
||||
// TODO: Remove this when we drop IE7 support
|
||||
if (tinymce.Env.documentMode <= 7) {
|
||||
tinymce.DOM.loadCSS(skinUrl + '/skin.ie7.min.css');
|
||||
} else {
|
||||
tinymce.DOM.loadCSS(skinUrl + '/skin.min.css');
|
||||
}
|
||||
|
||||
// Load content.min.css or content.inline.min.css
|
||||
editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
|
||||
}
|
||||
|
||||
// Handle editor setProgressState change
|
||||
editor.on('ProgressState', function(e) {
|
||||
self.throbber = self.throbber || new tinymce.ui.Throbber(self.panel.getEl('body'));
|
||||
|
||||
if (e.state) {
|
||||
self.throbber.show(e.time);
|
||||
} else {
|
||||
self.throbber.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Render inline UI
|
||||
if (settings.inline) {
|
||||
return renderInlineUI(args);
|
||||
}
|
||||
|
||||
// Render iframe UI
|
||||
return renderIframeUI(args);
|
||||
};
|
||||
|
||||
self.resizeTo = resizeTo;
|
||||
self.resizeBy = resizeBy;
|
||||
});
|
||||
Reference in New Issue
Block a user