/******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin('filemanager', function(K) { var self = this, name = 'filemanager', fileManagerJson = K.undef(self.fileManagerJson, false), //imgPath = self.pluginsPath + name + '/images/', lang = self.lang(name + '.'), editorid = self.editorid; ; self.plugin.filemanagerDialog = function(options) { var width = K.undef(options.width, 600), height = K.undef(options.height, 440), upUrl = options.upUrl; clickFn = options.clickFn; var html = ['
'].join(''); var dialog = self.createDialog({ name : name, width : width, height : height, title : self.lang(name), body : html, yesBtn : { name : self.lang('yes'), click : function(e) { datadiv = K('#myuploadform div', doc); var num = datadiv.length; var imgdata='' ,datas='' ,src,status,aid,name; datadiv.each(function() { src = $(this).find('#filedata').val(); status = $(this).find('#status').val(); aid = $(this).find('#aids').val(); name = $(this).find('#namedata').val(); if(status==0) datas += ''; if(src) imgdata += '

'; }); oldaidhtml=K('#'+editorid+'_aid_box').html(); K('#'+editorid+'_aid_box').html(oldaidhtml+datas); //self.insertHtml(imgdata).hideDialog().focus(); clickFn.call(this, src, name); } } }), div = dialog.div,win, doc; var iframe = K(''); function ready() { win = iframe[0].contentWindow; doc = K.iframeDoc(iframe); } iframe.bind('load', function() { iframe.unbind('load'); if (K.IE) { ready(); } else { setTimeout(ready, 0); } }); K('.ke-map', div).replaceWith(iframe); } });