Committer: bcoffeltAdded in Video functionality for RTE.
U trunk/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js
U trunk/htdocs/stc/fck/fckconfig.js
Modified: trunk/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js
===================================================================
--- trunk/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js 2006-06-20 19:21:20 UTC (rev 7732)
+++ trunk/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js 2006-06-20 19:24:08 UTC (rev 7733)
@@ -57,6 +57,52 @@
// Register the button to use in the config
FCKToolbarItems.RegisterItem('LJUserLink', oLJUserLink) ;
+
+////////// LJ Video Button //////////////
+var LJVideoCommand=function(){
+};
+LJVideoCommand.prototype.Execute=function(){
+}
+LJVideoCommand.GetState=function() {
+ return FCK_TRISTATE_OFF; //we dont want the button to be toggled
+}
+
+LJVideoCommand.Execute=function() {
+ var user;
+ var selection = '';
+
+ if (FCK.EditorWindow.getSelection) {
+ selection = FCK.EditorWindow.getSelection();
+ } else if (FCK.EditorDocument.selection) {
+ selection = FCK.EditorDocument.selection.createRange().text;
+ }
+ if (selection != '') {
+ url = selection;
+ } else {
+ url = prompt('Please enter the YouTube URL:');
+ }
+
+ if (url != null && url != '') {
+ // Make the tag like the editor would
+ var html = "";
+
+ FCK.InsertHtml(html);
+ FCK.Focus();
+ }
+ return;
+}
+
+FCKCommands.RegisterCommand('LJVideoLink', LJVideoCommand ); //otherwise our command will not be found
+
+// Create the toolbar button.
+var oLJVideoLink = new FCKToolbarButton('LJVideoLink', 'LiveJournal Video');
+oLJVideoLink.IconPath = FCKConfig.PluginsPath + 'livejournal/ljvideo.gif' ;
+
+// Register the button to use in the config
+FCKToolbarItems.RegisterItem('LJVideoLink', oLJVideoLink) ;
+
////////// LJ Cut Button //////////////
var LJCutCommand=function(){
};
Modified: trunk/htdocs/stc/fck/fckconfig.js
===================================================================
--- trunk/htdocs/stc/fck/fckconfig.js 2006-06-20 19:21:20 UTC (rev 7732)
+++ trunk/htdocs/stc/fck/fckconfig.js 2006-06-20 19:24:08 UTC (rev 7733)
@@ -97,7 +97,7 @@
] ;
FCKConfig.ToolbarSets["Update"] = [
- ['LJUserLink', 'LJCutLink', '-', 'Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript', '-', 'TextColor', 'FontSize'],
+ ['LJVideoLink','LJUserLink', 'LJCutLink', '-', 'Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript', '-', 'TextColor', 'FontSize'],
['Image', '-', 'Link', 'Unlink'],
['OrderedList','UnorderedList', 'Table'],
['Outdent','Indent'],