From c0f24cb905833be16595d72c31765f50b2e4be3f Mon Sep 17 00:00:00 2001 From: taggon Date: Mon, 12 Dec 2011 08:28:18 +0000 Subject: [PATCH] issue 570: Fixed a bug for document preview git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9939 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- common/js/common.js | 4 +++- common/js/xe.js | 4 +++- common/js/xe.min.js | 58 ++++++++++++++++++++++----------------------- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/common/js/common.js b/common/js/common.js index e4b8ea323..b35e42c50 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -532,7 +532,9 @@ function doDocumentPreview(obj) { ).appendTo(document.body); dummy_obj = jQuery("#previewDocument")[0]; - } + } else { + dummy_obj = dummy_obj[0]; + } if(dummy_obj) { dummy_obj.content.value = content; diff --git a/common/js/xe.js b/common/js/xe.js index 674a79a5d..4d7942148 100644 --- a/common/js/xe.js +++ b/common/js/xe.js @@ -816,7 +816,9 @@ function doDocumentPreview(obj) { ).appendTo(document.body); dummy_obj = jQuery("#previewDocument")[0]; - } + } else { + dummy_obj = dummy_obj[0]; + } if(dummy_obj) { dummy_obj.content.value = content; diff --git a/common/js/xe.min.js b/common/js/xe.min.js index c6afc5035..07b2bd1dc 100644 --- a/common/js/xe.min.js +++ b/common/js/xe.min.js @@ -4,16 +4,16 @@ * @brief XE Common JavaScript **/ (function(a){function b(){return function(){var g=this;if(a.isArray(this._plugins))this._plugins=[];this._messages?this._messages={}:this._binded_fn={};a.each(this,function(c,b){if(!a.isFunction(b))return!0;if(!/^API_([A-Z0-9_]+)$/.test(c))return!0;var d=RegExp.$1,e=function(a,b){return g[c](a,b)};g._messages?g._messages[d]=[e]:g._binded_fn[d]=e});a.isFunction(this.init)&&this.init.apply(this,arguments)}}var d,c,e=[];d={_plugins:[],_messages:{},getPlugin:function(g){g=g.toLowerCase();return a.isArray(this._plugins[g])? -this._plugins[g]:[]},registerPlugin:function(g){var c=this,b=g.getName().toLowerCase();if(0<=a.inArray(g,this._plugins))return!1;this._plugins.push(g);a.isArray(this._plugins[b])||(this._plugins[b]=[]);this._plugins[b].push(g);a.each(g._binded_fn,function(a,g){c.registerHandler(a,g)});g.oApp=this;a.isFunction(g.activate)&&g.activate();return!0},registerHandler:function(g,c){var b=this._messages,g=g.toUpperCase();a.isArray(b[g])||(b[g]=[]);b[g].push(c)},cast:function(a,c){return this._cast(this,a, -c||[])},broadcast:function(a,c,b){this.parent&&this.parent._broadcast&&this.parent._broadcast(a,c,b)},_cast:function(g,c,b){var d,e=this._messages,c=c.toUpperCase();if(!e["BEFORE_"+c]&&!this["API_BEFORE_"+c]||this._cast(g,"BEFORE_"+c,b)){var h=[];if(a.isArray(e[c]))for(d=0;dh.length&&(h=h[0]);(e["AFTER_"+c]||this["API_AFTER_"+c])&&this._cast(g,"AFTER_"+c,b);return/^(?:AFTER|BEFORE)_/.test(c)?a.isArray(h)?0>a.inArray(!1,h):"undefined"==typeof h?!0:!!h:h}}};c= -{oApp:null,cast:function(a,c){if(this.oApp&&this.oApp._cast)return this.oApp._cast(this,a,c||[])},broadcast:function(a,c){this.oApp&&this.oApp.broadcast&&this.oApp.broadcast(this,mag,c||[])}};window.xe=a.extend(d,{getName:function(){return"Core"},createApp:function(c,e){var l=b();a.extend(l.prototype,d,e);l.prototype.getName=function(){return c};return l},createPlugin:function(g,d){var e=b();a.extend(e.prototype,c,d);e.prototype.getName=function(){return g};return e},getApps:function(){return a.makeArray(e)}, -getApp:function(a){a=(a||"").toLowerCase();return"undefined"!=typeof e[a]?e[a]:null},registerApp:function(c){var b=c.getName().toLowerCase();e.push(c);a.isArray(e[b])||(e[b]=[]);e[b].push(c);c.parent=this;a.isFunction(c.activate)&&c.activate()},unregisterApp:function(c){var b=c.getName().toLowerCase(),d=a.inArray(c,e);0<=d&&(e=e.splice(d,1));a.isArray(e[b])&&(d=a.inArray(c,e[b]),0<=d&&(e[b]=e[b].splice(d,1)));a.isFunction(c.deactivate)&&c.deactivate()},broadcast:function(a,c){this._broadcast(this, -a,c)},_broadcast:function(a,c,b){for(var d=0;dh.length&&(h=h[0]);(e["AFTER_"+b]||this["API_AFTER_"+b])&&this._cast(g,"AFTER_"+b,c);return/^(?:AFTER|BEFORE)_/.test(b)?a.isArray(h)?0>a.inArray(!1,h):"undefined"==typeof h?!0:!!h:h}}};c= +{oApp:null,cast:function(a,b){if(this.oApp&&this.oApp._cast)return this.oApp._cast(this,a,b||[])},broadcast:function(a,b){this.oApp&&this.oApp.broadcast&&this.oApp.broadcast(this,mag,b||[])}};window.xe=a.extend(d,{getName:function(){return"Core"},createApp:function(g,c){var e=b();a.extend(e.prototype,d,c);e.prototype.getName=function(){return g};return e},createPlugin:function(g,d){var e=b();a.extend(e.prototype,c,d);e.prototype.getName=function(){return g};return e},getApps:function(){return a.makeArray(e)}, +getApp:function(a){a=(a||"").toLowerCase();return"undefined"!=typeof e[a]?e[a]:null},registerApp:function(b){var c=b.getName().toLowerCase();e.push(b);a.isArray(e[c])||(e[c]=[]);e[c].push(b);b.parent=this;a.isFunction(b.activate)&&b.activate()},unregisterApp:function(b){var c=b.getName().toLowerCase(),d=a.inArray(b,e);0<=d&&(e=e.splice(d,1));a.isArray(e[c])&&(d=a.inArray(b,e[c]),0<=d&&(e[c]=e[c].splice(d,1)));a.isFunction(b.deactivate)&&b.deactivate()},broadcast:function(a,b){this._broadcast(this, +a,b)},_broadcast:function(a,b,c){for(var d=0;dg.length)g=Array(g);if(g.length)for(var j=0;j"+m+" "}}this.loaded_popup_menus[c]=b}if(b)c=a("#popup_menu_area").html("