mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
MINOR Fixed indentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@101971 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f5be047b97
commit
77718a05f0
@ -20,74 +20,73 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
/**
|
/**
|
||||||
* These map the action buttons to the IDs of the forms that they open/close
|
* These map the action buttons to the IDs of the forms that they open/close
|
||||||
*/
|
*/
|
||||||
forms = {
|
forms = {
|
||||||
'sslink' : 'Form_EditorToolbarLinkForm',
|
'sslink' : 'Form_EditorToolbarLinkForm',
|
||||||
'ssimage' : 'Form_EditorToolbarImageForm',
|
'ssimage' : 'Form_EditorToolbarImageForm',
|
||||||
'ssflash' : 'Form_EditorToolbarFlashForm'
|
'ssflash' : 'Form_EditorToolbarFlashForm'
|
||||||
};
|
};
|
||||||
|
|
||||||
ed.addButton('sslink', {title : ed.getLang('tinymce_ssbuttons.insertlink'), cmd : 'sslink', 'class' : 'mce_link'});
|
ed.addButton('sslink', {title : ed.getLang('tinymce_ssbuttons.insertlink'), cmd : 'sslink', 'class' : 'mce_link'});
|
||||||
ed.addButton('ssimage', {title : ed.getLang('tinymce_ssbuttons.insertimage'), cmd : 'ssimage', 'class' : 'mce_image'});
|
ed.addButton('ssimage', {title : ed.getLang('tinymce_ssbuttons.insertimage'), cmd : 'ssimage', 'class' : 'mce_image'});
|
||||||
ed.addButton('ssflash', {title : ed.getLang('tinymce_ssbuttons.insertflash'), cmd : 'ssflash', 'class' : 'mce_flash', 'image': url + '/img/flash.gif'});
|
ed.addButton('ssflash', {title : ed.getLang('tinymce_ssbuttons.insertflash'), cmd : 'ssflash', 'class' : 'mce_flash', 'image': url + '/img/flash.gif'});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a side panel, hiding others
|
* Show a side panel, hiding others
|
||||||
* If showCommand isn't set, then this will simply hide panels
|
* If showCommand isn't set, then this will simply hide panels
|
||||||
*/
|
*/
|
||||||
function showSidePanel(showCommand, hideCommands) {
|
function showSidePanel(showCommand, hideCommands) {
|
||||||
hideCommands.each(function(command) {
|
hideCommands.each(function(command) {
|
||||||
ed.controlManager.setActive(command,false);
|
ed.controlManager.setActive(command,false);
|
||||||
Element.hide(forms[command]);
|
Element.hide(forms[command]);
|
||||||
});
|
});
|
||||||
|
|
||||||
var showForm = null;
|
var showForm = null;
|
||||||
if(forms[showCommand]) {
|
if(forms[showCommand]) {
|
||||||
showForm = $(forms[showCommand]);
|
showForm = $(forms[showCommand]);
|
||||||
showForm.toggle(ed);
|
showForm.toggle(ed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!showForm || showForm.style.display == "none") {
|
if(!showForm || showForm.style.display == "none") {
|
||||||
ed.controlManager.setActive(showCommand, false);
|
ed.controlManager.setActive(showCommand, false);
|
||||||
// Can't use $('contentPanel'), as its in a different window
|
// Can't use $('contentPanel'), as its in a different window
|
||||||
window.parent.document.getElementById('contentPanel').style.display = "none";
|
window.parent.document.getElementById('contentPanel').style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
ed.controlManager.setActive(showCommand, true);
|
ed.controlManager.setActive(showCommand, true);
|
||||||
window.parent.document.getElementById('contentPanel').style.display = "block";
|
window.parent.document.getElementById('contentPanel').style.display = "block";
|
||||||
}
|
}
|
||||||
window.onresize();
|
window.onresize();
|
||||||
}
|
}
|
||||||
|
|
||||||
ed.addCommand("ssclosesidepanel", function(ed) {
|
ed.addCommand("ssclosesidepanel", function(ed) {
|
||||||
showSidePanel('', [ 'sslink', 'ssimage', 'ssflash' ]);
|
showSidePanel('', [ 'sslink', 'ssimage', 'ssflash' ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.addCommand("sslink", function(ed) {
|
ed.addCommand("sslink", function(ed) {
|
||||||
showSidePanel('sslink', [ 'ssimage', 'ssflash' ]);
|
showSidePanel('sslink', [ 'ssimage', 'ssflash' ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.addCommand("ssimage", function(ed) {
|
ed.addCommand("ssimage", function(ed) {
|
||||||
showSidePanel('ssimage', [ 'sslink', 'ssflash' ]);
|
showSidePanel('ssimage', [ 'sslink', 'ssflash' ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.addCommand("ssflash", function(ed) {
|
ed.addCommand("ssflash", function(ed) {
|
||||||
showSidePanel('ssflash', [ 'ssimage', 'sslink' ]);
|
showSidePanel('ssflash', [ 'ssimage', 'sslink' ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.onNodeChange.add(function(ed, o) {
|
ed.onNodeChange.add(function(ed, o) {
|
||||||
if ($('Form_EditorToolbarLinkForm').updateSelection) {
|
if ($('Form_EditorToolbarLinkForm').updateSelection) {
|
||||||
$('Form_EditorToolbarLinkForm').updateSelection(ed);
|
$('Form_EditorToolbarLinkForm').updateSelection(ed);
|
||||||
$('Form_EditorToolbarLinkForm').respondToNodeChange(ed);
|
$('Form_EditorToolbarLinkForm').respondToNodeChange(ed);
|
||||||
}
|
}
|
||||||
$('Form_EditorToolbarImageForm').respondToNodeChange(ed);
|
$('Form_EditorToolbarImageForm').respondToNodeChange(ed);
|
||||||
});
|
});
|
||||||
ed.onKeyUp.add(function(ed, o) {
|
ed.onKeyUp.add(function(ed, o) {
|
||||||
$('Form_EditorToolbarLinkForm').updateSelection(ed);
|
$('Form_EditorToolbarLinkForm').updateSelection(ed);
|
||||||
});
|
});
|
||||||
|
|
||||||
// resize image containers when the image is resized.
|
// resize image containers when the image is resized.
|
||||||
if(!tinymce.isOpera && !tinymce.isWebKit) ed.onMouseUp.add(function(ed, o) {
|
if(!tinymce.isOpera && !tinymce.isWebKit) ed.onMouseUp.add(function(ed, o) {
|
||||||
@ -96,8 +95,8 @@
|
|||||||
// we have to delay the resize check here, as this event handler is called before the actual image
|
// we have to delay the resize check here, as this event handler is called before the actual image
|
||||||
// resizing is done.
|
// resizing is done.
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var ed = tinyMCE.activeEditor, // we need to redeclare these for IE.
|
var ed = tinyMCE.activeEditor, // we need to redeclare these for IE.
|
||||||
node = ed.selection.getNode(),
|
node = ed.selection.getNode(),
|
||||||
container = ed.dom.getParent(node, 'div');
|
container = ed.dom.getParent(node, 'div');
|
||||||
|
|
||||||
if(node.width && node.width != parseInt(ed.dom.getStyle(container, 'width'))) {
|
if(node.width && node.width != parseInt(ed.dom.getStyle(container, 'width'))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user