Login   Register  
Icontem

File: editor_plugin.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sandro Alves Peres  >  Crazy Uploader  >  editor_plugin.js  >  Download  
File: editor_plugin.js
Role: Auxiliary script
Content type: text/plain
Description: file
Class: Crazy Uploader
Plug-in for TinyMCE to upload document files
Author: By
Last change:
Date: 2012-09-26 11:46
Size: 1,506 bytes
 

Contents

Class file image Download
/**
 * editor_plugin_src.js
 *
 * Copyright 2012, Sandro Alves Peres
 * Released under LGPL License.
 *
 * License: http://tinymce.moxiecode.com/license
 * Contributing: http://tinymce.moxiecode.com/contributing
 */

(function()
{
	tinymce.create('tinymce.plugins.CrazyUploaderPlugin', 
    {
		init : function(ed, url) {
			var t = this;

			t.editor = ed;

			// Comando que abre a janela do editor
			ed.addCommand('mceCrazyUploader', function(ui)
            {                
				ed.windowManager.open({
					file : url + '/crazyuploader.php',
					width : ed.getParam('crazyuploader_popup_width', 700),
					height : ed.getParam('crazyuploader_popup_height', 420),
					inline : 1
				}, 
                {
					plugin_url : url
				});
			});

			ed.addCommand('mceInsertCrazyUploader', t._insertCrazyUploader, t);

			// Adiciona o botão do CrazyUploader
			ed.addButton('crazyuploader', {
                title : "Crazy Uploader", 
                image: url + '/img/crazyuploader_icon.png', 
                cmd : 'mceCrazyUploader'
            });
		},

		getInfo : function()
        {
			return {
				longname : 'CrazyUploader plugin',
				author : 'Sandro Alves Peres',
				authorurl : 'http://www.facebook.com/SandroAlvesPeres',
				infourl : '',
				version : tinymce.majorVersion + "." + tinymce.minorVersion
			};
		}
	});

	// Register plugin
	tinymce.PluginManager.add('crazyuploader', tinymce.plugins.CrazyUploaderPlugin);
})();