annotate media/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js @ 265:1ba2c6bf6eb7

Closing #98. Animated GIFs were losing their transparency and animated properties when saved as avatars. Reworked the avatar save process to only run the avatar through PIL if it is too big. This preserves the original uploaded file if it is within the desired size settings. This may still mangle big animated gifs. If this becomes a problem, then maybe look into calling the PIL Image.resize() method directly. Moved the PIL image specific functions from bio.forms to a new module: core.image for better reusability in the future.
author Brian Neal <bgneal@gmail.com>
date Fri, 24 Sep 2010 02:12:09 +0000
parents 149c3567fec1
children
rev   line source
bgneal@45 1 /**
bgneal@183 2 * editor_plugin_src.js
bgneal@45 3 *
bgneal@183 4 * Copyright 2009, Moxiecode Systems AB
bgneal@183 5 * Released under LGPL License.
bgneal@183 6 *
bgneal@183 7 * License: http://tinymce.moxiecode.com/license
bgneal@183 8 * Contributing: http://tinymce.moxiecode.com/contributing
bgneal@45 9 */
bgneal@45 10
bgneal@45 11 (function() {
bgneal@45 12 tinymce.create('tinymce.plugins.SearchReplacePlugin', {
bgneal@45 13 init : function(ed, url) {
bgneal@45 14 function open(m) {
bgneal@45 15 ed.windowManager.open({
bgneal@45 16 file : url + '/searchreplace.htm',
bgneal@45 17 width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
bgneal@183 18 height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
bgneal@45 19 inline : 1,
bgneal@45 20 auto_focus : 0
bgneal@45 21 }, {
bgneal@45 22 mode : m,
bgneal@45 23 search_string : ed.selection.getContent({format : 'text'}),
bgneal@45 24 plugin_url : url
bgneal@45 25 });
bgneal@45 26 };
bgneal@45 27
bgneal@45 28 // Register commands
bgneal@45 29 ed.addCommand('mceSearch', function() {
bgneal@45 30 open('search');
bgneal@45 31 });
bgneal@45 32
bgneal@45 33 ed.addCommand('mceReplace', function() {
bgneal@45 34 open('replace');
bgneal@45 35 });
bgneal@45 36
bgneal@45 37 // Register buttons
bgneal@45 38 ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
bgneal@45 39 ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
bgneal@45 40
bgneal@45 41 ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
bgneal@45 42 },
bgneal@45 43
bgneal@45 44 getInfo : function() {
bgneal@45 45 return {
bgneal@45 46 longname : 'Search/Replace',
bgneal@45 47 author : 'Moxiecode Systems AB',
bgneal@45 48 authorurl : 'http://tinymce.moxiecode.com',
bgneal@45 49 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
bgneal@45 50 version : tinymce.majorVersion + "." + tinymce.minorVersion
bgneal@45 51 };
bgneal@45 52 }
bgneal@45 53 });
bgneal@45 54
bgneal@45 55 // Register plugin
bgneal@45 56 tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
bgneal@45 57 })();