TrexConfig.add({ pvpage: "#host#path/pages/pv/#pvname.html", canvas: { wysiwygUrl:'/' }, events: { preventUnload: false }, sidebar: { attachbox: { show: true }, embeder: { media: { popPageUrl: "/daumeditor/pages/popup/type/multimedia" } }, attacher: { image: { checksize: true, multipleuse: false, objattr: { width:700 }, // 기본 //features: {width:550, height:240, left:400, top:100 }, // 간단한 사진 첨부 features: {width:550, height:240, left:400, top:100 }, popPageUrl: "/daumeditor/pages/popup/type/image/token/hsP8CyVjZI" }, file: { multipleuse: false, features: {width:550, height:240, left:400, top:100 }, popPageUrl: "/daumeditor/pages/popup/type/file/token/hsP8CyVjZI" } } }, plugin: { fullscreen: { use: true } } });/* additional Message */ Trex.define(Trex.MESSAGE, { /* tool */ }); TrexConfig.addTool( "movie", { wysiwygonly: true, sync: false, status: false } ); Trex.Tool.Movie = Trex.Class.create({ $const: { __Identity: 'movie' }, $extend: Trex.Tool, oninitialized: function(config) { var _editor = this.editor; this.weave.bind(this)( new Trex.Button(this.buttonCfg), null, function() { _editor.getSidebar().getAttacher("movie").execute(); } ); } }); TrexConfig.addAttacher( "movie", { multiple: true, multipleuse: false, checksize: false, boxonly: false, wysiwygonly: true, objattr: {}, features: {width:550, height:240, left:400, top:100 }, popPageUrl: "/daumeditor/pages/popup/type/movie/token/hsP8CyVjZI" }, function(root){ var _config = TrexConfig.getAttacher("movie", root); _config.popPageUrl = TrexConfig.getUrl(_config.popPageUrl); _config.features = TrexConfig.getPopFeatures(_config.features); } ); /** * Trex.Attacher.Movie * @class * @extends Trex.Attacher */ Trex.Attacher.Movie = Trex.Class.create({ $const: { __Identity: 'movie' }, $extend: Trex.Attacher, name: 'movie', title: TXMSG("@image.title"), canModified: false, canResized: true, oninitialized: function(root) { }, getKey: function(data) { return data.movieurl; }, getDataForEntry: function(data) { if(!data.dispElId) { data.dispElId = Trex.Util.getDispElId(); } var _seq = ((data.tmpSeq)? this.entryBox.syncSeq(data.tmpSeq): this.entryBox.newSeq()); var _data = Object.extend({ dataSeq: _seq }, data); //NOTE: Cuz IE return _data; }, createEntry: function(data, type) { return this.createAttachment(data, type); }, execAttach: function(data, type) { var _entry = this.createEntry(this.getDataForEntry(data), type); _entry.execRegister(); }, execReload: function(data, content, type) { var _entry = this.createEntry(this.getDataForEntry(data, content), type); _entry.execReload(); } }); /** * Trex.Attachment.Image * * @example * data = { * thumburl: "string", * movieurl: "string", * filename: "string", * filesize: number * } * @class * @extends Trex.Attachment */ Trex.Attachment.Movie = Trex.Class.create({ $const: { __Identity: 'movie' }, $extend: Trex.Attachment, getFieldAttr: function(data) { return { name: 'tx_attach_movie', value: [data.thumburl, data.movieurl, data.originalurl, data.exifurl, data.filename, data.filesize].join('|') }; }, getBoxAttr: function(data) { var _rectangle = data.width ? data.width + "x" + data.height + " / " : ""; return { name: data.filename + " (" + _rectangle + data.filesize.toByteUnit() + ")", image: data.thumburl }; }, getObjectAttr: function(data) { var _objattr = Object.extend({}, this.actor.config.objattr); if(data.width) { if(!_objattr.width || _objattr.width > data.width) { _objattr.width = data.width; } } else { _objattr.width = null; } if(data.height) { if(!_objattr.height || _objattr.height > data.height) { _objattr.height = data.height; } } else { _objattr.height = null; } return _objattr; }, getObjectStyle: function(data) { var _objstyle = {}; if(this.actor.config.objstyle) { _objstyle = Object.extend(_objstyle, this.actor.config.objstyle); } if(data.imagealign) { var _objectStyle = { "L": Trex.Tool.AlignLeft, "C": Trex.Tool.AlignCenter, "FL": Trex.Tool.AlignRight, "FR": Trex.Tool.AlignFull }[data.imagealign]; if (_objectStyle && _objectStyle.__ImageStyle) { _objstyle = Object.extend(_objstyle, _objectStyle.__ImageStyle.image); } } return _objstyle; }, getParaStyle: function(data) { var _parastyle = Object.extend({}, this.actor.config.parastyle || this.actor.config.defaultstyle); if(data.imagealign) { var _objectStyle = { "L": Trex.Tool.AlignLeft, "C": Trex.Tool.AlignCenter, "FL": Trex.Tool.AlignRight, "FR": Trex.Tool.AlignFull }[data.imagealign]; if (_objectStyle && _objectStyle.__ImageStyle) { _parastyle = Object.extend(_parastyle, _objectStyle.__ImageStyle.paragraph); } } return _parastyle; }, getSaveHtml: function(data) { return ""; //return ""; //return ""; //return ""; }, getDispHtml: function(data) { return ""; //return ""; //return ""; //return ""; }, getDispText: function(data) { return ""; //return ""; //return ""; //return ""; }, getRegLoad: function(data) { return new RegExp("<(?:embed|EMBED)[^>]*src=[^>]*(?:\/?>|><\/(?:embed|EMBED)>)", "gim"); //return new RegExp("<(?:embed|EMBED)[^>]*url':'" + data.movieurl.getRegExp() + "'[^>]*\/?>", "gm"); //return new RegExp("<(?:embed|EMBED)[^>]*flashvars=\"?file=" + data.movieurl.getRegExp() + "&[^>]*\/?>", "gm"); }, getRegHtml: function(data) { return new RegExp("<(?:embed|EMBED)[^>]*src=[^>]*(?:\/?>|><\/(?:embed|EMBED)>)", "gim"); //return new RegExp("<(?:embed|EMBED)[^>]*url':'" + data.movieurl.getRegExp() + "'[^>]*\/?>", "gm"); //return new RegExp("<(?:embed|EMBED)[^>]*flashvars=\"?file=" + data.movieurl.getRegExp() + "&[^>]*\/?>", "gm"); }, getRegText: function(data) { return new RegExp("<(?:embed|EMBED)[^>]*src=[^>]*(?:\/?>|><\/(?:embed|EMBED)>)", "gim"); //return new RegExp("<(?:embed|EMBED)[^>]*url':'" + data.movieurl.getRegExp() + "'[^>]*\/?>", "gm"); //return new RegExp("<(?:embed|EMBED)[^>]*flashvars=\"?file=" + data.movieurl.getRegExp() + "&[^>]*\/?>", "gm"); } });