[pLog-svn] r7100 - plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio

mark at devel.lifetype.net mark at devel.lifetype.net
Tue Dec 21 13:11:22 EST 2010


Author: mark
Date: 2010-12-21 13:11:22 -0500 (Tue, 21 Dec 2010)
New Revision: 7100

Modified:
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/dialog.htm
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin.js
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin_src.js
Log:
Clean up the code, remove some useless stuff. BTW, this plugin does not need to deal with those complex editor events like onBeforeSetContent or onPostProcess ... etc., becasue InsertResource plugin will take care of that

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/dialog.htm
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/dialog.htm	2010-12-21 17:37:54 UTC (rev 7099)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/dialog.htm	2010-12-21 18:11:22 UTC (rev 7100)
@@ -1,43 +1,39 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>{#insertaudio_dlg.title}</title>
-	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
-	<script type="text/javascript">
-       tinyMCEPopup.requireLangPack();
+    <title>{#insertaudio_dlg.title}</title>
+    <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+    <script type="text/javascript">
+        tinyMCEPopup.requireLangPack();
     </script>
-	<script type="text/javascript" src="../../tiny_mce-plog-resourcelist.js"></script>	
-	<base target="_self" />
+    <script type="text/javascript" src="../../tiny_mce-plog-resourcelist.js"></script>
+    <base target="_self" />
 </head>
 <body style="display: none">
-	<form name="audio" id="audio" method="post" action="#">
-	<div class="tabs">
-	  <ul>
-	   <li id="general_tab" class="current"><span>{#insertaudio_dlg.title}</span></li>
-	  </ul>
-	</div>
-	<div class="panel_wrapper">
-	  <div id="general_panel" class="panel_current">
-	     <legend>{#insertaudio_dlg.panel_legend}</legend>
-	     <table border="0" cellpadding="4" cellspacing="0">
-	      <tr>
-	       <td nowrap="nowrap">{#insertaudio_dlg.audio_url}</td>
-	       <td><input type="text" id="url" name="url" value="" {#insertaudio_dlg.inputurlstyle} /></td>
-	      </tr>		
-		 </table>		    
-		</div>
-		</div>
-		<div class="mceActionPanel">
-		  <div style="float:left">		
-			<input type="button" name="insert" value="{#insert}" 
-                   onClick="insertMediaPlayer(document.audio.url.value,
-                            true,'20','300')" id="insert" />
-		  </div>
-		  <div style="float:right">
-		    <input type="button" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" id="cancel" />
-		  </div>
-		</div>
-	 </div>
-	</div>				
-	 </form>
+    <form name="audio" id="audio" method="post" action="#">
+        <div class="tabs">
+            <ul>
+                <li id="general_tab" class="current"><span>{#insertaudio_dlg.title}</span></li>
+            </ul>
+        </div>
+        <div class="panel_wrapper">
+            <div id="general_panel" class="panel_current">
+                 <legend>{#insertaudio_dlg.panel_legend}</legend>
+                 <table border="0" cellpadding="4" cellspacing="0">
+                     <tr>
+                         <td nowrap="nowrap">{#insertaudio_dlg.audio_url}</td>
+                         <td><input type="text" id="url" name="url" value="" {#insertaudio_dlg.inputurlstyle} /></td>
+                     </tr>
+                 </table>
+            </div>
+        </div>
+        <div class="mceActionPanel">
+            <div style="float:left">
+                <input type="button" name="insert" value="{#insert}" onClick="insertMediaPlayer(document.audio.url.value,true,'20','300')" id="insert" />
+            </div>
+            <div style="float:right">
+                <input type="button" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" id="cancel" />
+            </div>
+        </div>
+    </form>
 </body>
 </html>

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin.js
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin.js	2010-12-21 17:37:54 UTC (rev 7099)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin.js	2010-12-21 18:11:22 UTC (rev 7100)
@@ -1,2 +1,2 @@
 
-(function(){tinymce.PluginManager.requireLangPack('insertaudio');tinymce.create('tinymce.plugins.InsertAudioPlugin',{init:function(ed,url){ed.addCommand('mceInsertAudio',function(){ed.windowManager.open({file:url+'/dialog.htm',width:500+parseInt(ed.getLang('InsertAudio.delta_width',0)),height:120+parseInt(ed.getLang('InsertAudio.delta_height',0)),inline:1},{plugin_url:url,});});ed.addButton('insertaudio',{title:'insertaudio.desc',cmd:'mceInsertAudio',image:url+'/img/insertaudio.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('insertaudio',n.className=='ltFlashPlayer');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'InsertAudio plugin',author:'LifeType',authorurl:'http://lifetype.net',infourl:'',version:"1.0"};}});tinymce.PluginManager.add('insertaudio',tinymce.plugins.InsertAudioPlugin);})();
\ No newline at end of file
+(function(){tinymce.PluginManager.requireLangPack('insertaudio');tinymce.create('tinymce.plugins.InsertAudioPlugin',{init:function(ed,url){ed.addCommand('mceInsertAudio',function(){ed.windowManager.open({file:url+'/dialog.htm',width:500,height:120,inline:1},{plugin_url:url});});ed.addButton('insertaudio',{title:'insertaudio.desc',cmd:'mceInsertAudio',image:url+'/img/insertaudio.gif'});},getInfo:function(){return{longname:'Insert Audio',author:'LifeType Team',authorurl:'http://www.lifetype.net',infourl:'http://www.lifetype.net',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('insertaudio',tinymce.plugins.InsertAudioPlugin);})();
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin_src.js
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin_src.js	2010-12-21 17:37:54 UTC (rev 7099)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertaudio/editor_plugin_src.js	2010-12-21 18:11:22 UTC (rev 7100)
@@ -1,73 +1,45 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2010, Lifetype Team, http://www.lifetype.net
+ * Released under GPLv2 License.
+ */
+
 (function() {
-	// Load plugin specific language pack
-	tinymce.PluginManager.requireLangPack('insertaudio');
+    tinymce.PluginManager.requireLangPack('insertaudio');
+    tinymce.create('tinymce.plugins.InsertAudioPlugin', {
+        init : function(ed, url) {
+            // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceInsertAudio');
+            ed.addCommand('mceInsertAudio', function() {
+                ed.windowManager.open({
+                    file : url + '/dialog.htm',
+                    width : 500,
+                    height : 120,
+                    inline : 1
+                }, {
+                    plugin_url : url
+                });
+            });
 
-	tinymce.create('tinymce.plugins.InsertAudioPlugin', {
-		/**
-		 * Initializes the plugin, this will be executed after the plugin has been created.
-		 * This call is done before the editor instance has finished it's initialization so use the onInit event
-		 * of the editor instance to intercept that event.
-		 *
-		 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
-		 * @param {string} url Absolute URL to where the plugin is located.
-		 */
-		init : function(ed, url) {
-			// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceInsertAudio');
-			ed.addCommand('mceInsertAudio', function() {
-				ed.windowManager.open({
-					file : url + '/dialog.htm',
-					width : 500 + parseInt(ed.getLang('InsertAudio.delta_width', 0)),
-					height : 120 + parseInt(ed.getLang('InsertAudio.delta_height', 0)),
-					inline : 1
-				}, {
-					plugin_url : url, // Plugin absolute URL
-				});
-			});
+            // Register insertAudio button
+            ed.addButton('insertaudio', {
+                title : 'insertaudio.desc',
+                cmd : 'mceInsertAudio',
+                image : url + '/img/insertaudio.gif'
+            });
+        },
 
-			// Register insertAudio button
-			ed.addButton('insertaudio', {
-				title : 'insertaudio.desc',
-				cmd : 'mceInsertAudio',
-				image : url + '/img/insertaudio.gif'
-			});
+        getInfo : function() {
+            return {
+                longname : 'Insert Audio',
+                author : 'LifeType Team',
+                authorurl : 'http://www.lifetype.net',
+                infourl : 'http://www.lifetype.net',
+                version : tinymce.majorVersion + "." + tinymce.minorVersion
+            };
+        }
+    });
 
-			// Add a node change handler, selects the button in the UI when a image is selected
-			ed.onNodeChange.add(function(ed, cm, n) {
-				cm.setActive('insertaudio', n.className == 'ltFlashPlayer');
-			});
-		},
-
-		/**
-		 * Creates control instances based in the incomming name. This method is normally not
-		 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
-		 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
-		 * method can be used to create those.
-		 *
-		 * @param {String} n Name of the control to create.
-		 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
-		 * @return {tinymce.ui.Control} New control instance or null if no control was created.
-		 */
-		createControl : function(n, cm) {
-			return null;
-		},
-
-		/**
-		 * Returns information about the plugin as a name/value array.
-		 * The current keys are longname, author, authorurl, infourl and version.
-		 *
-		 * @return {Object} Name/value array containing information about the plugin.
-		 */
-		getInfo : function() {
-			return {
-				longname : 'InsertAudio plugin',
-				author : 'LifeType',
-				authorurl : 'http://lifetype.net',
-				infourl : '',
-				version : "1.0"
-			};
-		}
-	});
-
-	// Register plugin
-	tinymce.PluginManager.add('insertaudio', tinymce.plugins.InsertAudioPlugin);
+    // Register plugin
+    tinymce.PluginManager.add('insertaudio', tinymce.plugins.InsertAudioPlugin);
 })();



More information about the pLog-svn mailing list