From 53031079ae532533a7b49321e43fd30336df7744 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 28 Sep 2017 17:57:27 +0900 Subject: [PATCH 1/5] Remove xpresseditor #895 --- modules/editor/skins/xpresseditor/LICENSE.txt | 9 - .../editor/skins/xpresseditor/css/default.css | 348 - .../skins/xpresseditor/css/default.min.css | 1 - modules/editor/skins/xpresseditor/editor.html | 483 -- .../skins/xpresseditor/img/bg_qmark.gif | Bin 59 -> 0 bytes .../skins/xpresseditor/img/bg_tool.black.gif | Bin 90 -> 0 bytes .../editor/skins/xpresseditor/img/bg_tool.gif | Bin 90 -> 0 bytes .../xpresseditor/img/btn_expand.black.gif | Bin 52 -> 0 bytes .../skins/xpresseditor/img/btn_expand.gif | Bin 55 -> 0 bytes .../xpresseditor/img/btn_layer_cancel.gif | Bin 460 -> 0 bytes .../img/btn_layer_cell_adjust.gif | Bin 154 -> 0 bytes .../xpresseditor/img/btn_layer_close.gif | Bin 211 -> 0 bytes .../xpresseditor/img/btn_layer_confirm.gif | Bin 336 -> 0 bytes .../xpresseditor/img/btn_layer_find_next.gif | Bin 365 -> 0 bytes .../img/btn_layer_find_next_strong.gif | Bin 374 -> 0 bytes .../xpresseditor/img/btn_layer_replace.gif | Bin 386 -> 0 bytes .../img/btn_layer_replace_all.gif | Bin 420 -> 0 bytes .../skins/xpresseditor/img/btn_layer_tab.gif | Bin 216 -> 0 bytes .../skins/xpresseditor/img/btn_qmark.gif | Bin 1364 -> 0 bytes .../skins/xpresseditor/img/btn_search.gif | Bin 730 -> 0 bytes .../skins/xpresseditor/img/btn_set.black.gif | Bin 11133 -> 0 bytes .../editor/skins/xpresseditor/img/btn_set.gif | Bin 11741 -> 0 bytes .../xpresseditor/img/btn_set_blank.black.gif | Bin 2026 -> 0 bytes .../skins/xpresseditor/img/btn_set_blank.gif | Bin 2201 -> 0 bytes .../skins/xpresseditor/img/bx_character.gif | Bin 2084 -> 0 bytes .../editor/skins/xpresseditor/img/bx_find.gif | Bin 514 -> 0 bytes .../skins/xpresseditor/img/bx_table.gif | Bin 721 -> 0 bytes .../editor/skins/xpresseditor/img/bx_url.gif | Bin 399 -> 0 bytes .../xpresseditor/img/vr_layer_character.gif | Bin 36 -> 0 bytes .../skins/xpresseditor/js/Xpress_Editor.js | 5823 ---------------- .../skins/xpresseditor/js/xe_interface.js | 296 - .../skins/xpresseditor/js/xe_textarea.js | 40 - .../skins/xpresseditor/js/xe_textarea.min.js | 1 - .../skins/xpresseditor/js/xpresseditor.js | 6091 ----------------- .../skins/xpresseditor/js/xpresseditor.min.js | 1 - modules/editor/skins/xpresseditor/skin.xml | 114 - 36 files changed, 13207 deletions(-) delete mode 100644 modules/editor/skins/xpresseditor/LICENSE.txt delete mode 100644 modules/editor/skins/xpresseditor/css/default.css delete mode 100644 modules/editor/skins/xpresseditor/css/default.min.css delete mode 100644 modules/editor/skins/xpresseditor/editor.html delete mode 100644 modules/editor/skins/xpresseditor/img/bg_qmark.gif delete mode 100755 modules/editor/skins/xpresseditor/img/bg_tool.black.gif delete mode 100644 modules/editor/skins/xpresseditor/img/bg_tool.gif delete mode 100755 modules/editor/skins/xpresseditor/img/btn_expand.black.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_expand.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_cancel.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_cell_adjust.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_close.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_find_next_strong.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_replace.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_replace_all.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_layer_tab.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_qmark.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_search.gif delete mode 100755 modules/editor/skins/xpresseditor/img/btn_set.black.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_set.gif delete mode 100755 modules/editor/skins/xpresseditor/img/btn_set_blank.black.gif delete mode 100644 modules/editor/skins/xpresseditor/img/btn_set_blank.gif delete mode 100644 modules/editor/skins/xpresseditor/img/bx_character.gif delete mode 100644 modules/editor/skins/xpresseditor/img/bx_find.gif delete mode 100644 modules/editor/skins/xpresseditor/img/bx_table.gif delete mode 100644 modules/editor/skins/xpresseditor/img/bx_url.gif delete mode 100644 modules/editor/skins/xpresseditor/img/vr_layer_character.gif delete mode 100644 modules/editor/skins/xpresseditor/js/Xpress_Editor.js delete mode 100644 modules/editor/skins/xpresseditor/js/xe_interface.js delete mode 100644 modules/editor/skins/xpresseditor/js/xe_textarea.js delete mode 100644 modules/editor/skins/xpresseditor/js/xe_textarea.min.js delete mode 100644 modules/editor/skins/xpresseditor/js/xpresseditor.js delete mode 100644 modules/editor/skins/xpresseditor/js/xpresseditor.min.js delete mode 100644 modules/editor/skins/xpresseditor/skin.xml diff --git a/modules/editor/skins/xpresseditor/LICENSE.txt b/modules/editor/skins/xpresseditor/LICENSE.txt deleted file mode 100644 index f237bc556..000000000 --- a/modules/editor/skins/xpresseditor/LICENSE.txt +++ /dev/null @@ -1,9 +0,0 @@ -XpressEditor - http://www.xpressengine.com - -XpressEditor nhn SmartEditor Basic ߽ϴ. -SmartEditor Basic LGPL v2 Ƿ, XpressEditor ش ̼ ϴ. - XpressEditor Ѵٴ XpressEditor ̼ ǹմϴ. - -LGPL v2̼ URL Ȯ ֽϴ. - -http://www.gnu.org/licenses/lgpl-2.1.html \ No newline at end of file diff --git a/modules/editor/skins/xpresseditor/css/default.css b/modules/editor/skins/xpresseditor/css/default.css deleted file mode 100644 index d118ed5dd..000000000 --- a/modules/editor/skins/xpresseditor/css/default.css +++ /dev/null @@ -1,348 +0,0 @@ -@charset "utf-8"; -/* NAVER (developers@xpressengine.com) */ -/* TextEditor */ -.xeTextEditor {margin:0 12px 0 0} -.xeTextEditor textarea {display:block;margin:0;padding:5px} -.xeTextEditor.black textarea {color:#fff;background-color:#000} -/* Type Selector */ -.xpress-editor *{margin:0;padding:0;font-style:normal;font-size:12px} -.xpress-editor img, -.xpress-editor fieldset, -.xpress-editor button{border:0} -.xpress-editor button{background:none;background-repeat:no-repeat;cursor:pointer} -.xpress-editor button *{visibility:hidden} -.xpress-editor legend{position:absolute;width:0;height:0;font-size:0;line-height:0;overflow:hidden;visibility:hidden} -.xpress-editor label{cursor:pointer} -.xpress-editor hr{display:none} -.xpress-editor li{list-style:none} -/* Layout Selector */ -.xpress-editor{position:relative;background:transparent} -.xpress-editor #smart_content{position:relative;clear:both;margin:0 0 10px 0;border:1px solid #c2c2c2;*zoom:1;z-index:1;background:#fff} -.xpress-editor.black #smart_content {background:transparent} -.xpress-editor #smart_footer{position:relative;text-align:center;padding:10px 0} -/* Footer */ -.xpress-editor #smart_footer *{vertical-align:top} -.xpress-editor #smart_footer button{position:relative;width:67px;height:25px;margin:0 5px 0 0} -.xpress-editor #smart_footer button.save_temp{background:url(../img/btn_save_temp.gif) no-repeat} -.xpress-editor #smart_footer button.preview{background:url(../img/btn_preview.gif) no-repeat} -.xpress-editor #smart_footer input{margin:0} -.xpress-editor #smart_footer input.reset{width:67px;height:25px;border:0;background:url(../img/btn_cancel.gif) no-repeat;cursor:pointer;margin-left:5px} -/* Content > Input Area */ -.xpress-editor a.skip{position:absolute;display:block;top:0;right:0;width:1px;height:1px;overflow:hidden;clear:both;zoom:1} -.xpress-editor a.skip:hover, -.xpress-editor a.skip:active, -.xpress-editor a.skip:focus{position:relative;display:block;padding:5px;right:0;z-index:60;width:auto;height:auto;text-align:right;white-space:nowrap;color:#000;text-decoration:none;letter-spacing:-1px;_zoom:1} -.xpress-editor .input_area{position:relative;margin:10px 10px 20px 10px;z-index:30;*zoom:1;height:300px;overflow:hidden} -.xpress-editor .input_area iframe, -.xpress-editor .input_area textarea{display:block;width:100% !important;position:relative;height:100%;border:0 !important;padding:0 !important;overflow:auto} -.xpress-editor .input_area textarea{*margin:0 -10px;_margin-bottom:-2px} -.xpress-editor .input_area textarea.blind{display:none} -.xpress-editor .input_control{position:relative;display:block;width:100%;height:25px;clear:both;text-align:center;border-top:1px solid #ccc;background:#f8f8f8 url(../img/btn_expand.gif) no-repeat center center;cursor:n-resize;margin:0 0 -25px 0} -.xpress-editor .input_control span{display:block;zoom:1;height:21px;visibility:hidden;overflow:visible;font-size:0;line-height:0;white-space:nowrap;color:#fff} -.xpress-editor .input_auto{position:relative;z-index:2;zoom:1;white-space:nowrap;display:block;height:0;border-top:1px solid #ccc;margin:0 0 24px 0;*margin:0} -.xpress-editor .input_auto input{margin:0 4px 0 0 !important;padding:0;width:13px;height:13px;vertical-align:middle} -.xpress-editor .input_auto label{position:absolute;font-size:11px;color:#666;padding:0 5px !important;line-height:25px;font-weight:normal !important} -.xpress-editor.black .input_control {background:#111 url(../img/btn_expand.black.gif) no-repeat center center} -.xpress-editor.black .input_control span{border-top:1px solid #333; color:#000} -.xpress-editor .tool{position:relative;overflow:visible;padding:5px 10px 6px 10px;*padding:5px 10px 8px 10px;z-index:40;clear:both;background:#f8f8f8 url(../img/bg_tool.gif) repeat-x left bottom;border:0;*zoom:1} -.xpress-editor .tool.disable {display:none} -.xpress-editor.black .tool{background:#111 url(../img/bg_tool.black.gif) repeat-x left bottom} -.xpress-editor .tool:after{content:"";display:block;clear:both} -.xpress-editor .tool ul{position:relative;overflow:visible;float:left;margin:0 5px 2px 0 !important;z-index:2;border:0 !important} -.xpress-editor .tool ul.action{width:43px} -.xpress-editor .tool ul.type{width:auto;white-space:nowrap;height:21px} -.xpress-editor .tool ul.style{width:169px;z-index:6} -.xpress-editor .tool ul.paragraph{width:169px;z-index:5} -.xpress-editor .tool ul.extra1{width:69px;z-index:4} -.xpress-editor .tool ul.table{width:85px;z-index:3} -.xpress-editor .tool ul.extra2{width:auto;z-index:2} -.xpress-editor .tool ul.extra3{float:left;width:auto;z-index:1;margin-right:1px} -.xpress-editor .tool ul.extra3 li{margin-right:4px} -.xpress-editor .tool li{position:relative;float:left;margin:0 !important;padding:0 !important;border:0 !important} -.xpress-editor .tool li button{width:21px;height:21px;background:url(../img/btn_set.gif) no-repeat 0 0;vertical-align:top;float:left} -.xpress-editor.black .tool li button{width:21px;height:21px;background:url(../img/btn_set.black.gif) no-repeat 0 0;vertical-align:top} -.xpress-editor .tool li button span{position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;visibility:hidden} -.xpress-editor .tool li.extensions span.exButton, -.xpress-editor .tool li.extensions span.exButton button{float:left;position:relative;display:inline-block;width:auto;background:url(../img/btn_set_blank.gif) no-repeat left top} -.xpress-editor .tool li.extensions span.exButton button{left:2px;height:21px;background-position:right top;padding:0 4px;font:11px/21px Tahoma, Sans-serif;text-align:left;*overflow:visible;*line-height:20px} -.xpress-editor.black .tool li.extensions span.exButton, -.xpress-editor.black .tool li.extensions span.exButton button{color:#fff;background-image:url(../img/btn_set_blank.black.gif)} -.xpress-editor .tool li.html span, -.xpress-editor .tool li.html span button, -.xpress-editor .tool li.preview span, -.xpress-editor .tool li.preview span button{float:left;position:relative;display:inline-block;width:auto;height:auto;visibility:visible;background:url(../img/btn_set_blank.gif) no-repeat 0 0;white-space:nowrap} -.xpress-editor.black .tool li.html span, -.xpress-editor.black .tool li.html span button, -.xpress-editor.black .tool li.preview span, -.xpress-editor.black .tool li.preview span button{color:#fff;background-image:url(../img/btn_set_blank.black.gif)} -.xpress-editor .tool li.html span, -.xpress-editor .tool li.preview span{margin-right:2px;background-position:left top} -.xpress-editor .tool li.html span button, -.xpress-editor .tool li.preview span button{left:2px;height:21px;background-position:right top;font:11px/21px Tahoma, Sans-serif;padding:0 4px;*overflow:visible;*line-height:20px} -.xpress-editor .tool ul.type li{float:none;display:inline;*top:1px} -.xpress-editor .tool ul.type li select{height:21px;width:64px;white-space:nowrap;min-width:64px;padding:0;font-size:12px} -.xpress-editor .tool ul.type li option{white-space:nowrap} -.xpress-editor.black .tool ul.type li select{color:#fff;background-color:#000} -/* Content > Tool > Button Default */ -.xpress-editor .tool li.undo button{width:22px;background-position:0 0} -.xpress-editor .tool li.redo button{background-position:-22px 0} -.xpress-editor .tool li.bold button{width:22px;background-position:-43px 0} -.xpress-editor .tool li.underline button{background-position:-65px 0} -.xpress-editor .tool li.italic button{background-position:-86px 0} -.xpress-editor .tool li.del button{background-position:-107px 0} -.xpress-editor .tool li.fcolor button{background-position:-128px 0} -.xpress-editor .tool li.bcolor button{background-position:-149px 0} -.xpress-editor .tool li.sup button{background-position:-170px 0} -.xpress-editor .tool li.sub button{background-position:-191px 0} -.xpress-editor .tool li.left button{width:22px;background-position:-212px 0} -.xpress-editor .tool li.center button{background-position:-234px 0} -.xpress-editor .tool li.right button{background-position:-255px 0} -.xpress-editor .tool li.justify button{background-position:-276px 0} -.xpress-editor .tool li.ol button{background-position:-297px 0} -.xpress-editor .tool li.ul button{background-position:-318px 0} -.xpress-editor .tool li.outdent button{background-position:-339px 0} -.xpress-editor .tool li.indent button{background-position:-360px 0} -.xpress-editor .tool li.blockquote button{width:22px;background-position:-381px 0} -.xpress-editor .tool li.url button{width:26px;background-position:-403px 0} -.xpress-editor .tool li.character button{background-position:-429px 0} -.xpress-editor .tool li.table{width:auto} -.xpress-editor .tool li.table button{width:22px;background-position:-450px 0} -.xpress-editor .tool li.merge button{background-position:-472px 0} -.xpress-editor .tool li.splitCol button{background-position:-493px 0} -.xpress-editor .tool li.splitRow button{background-position:-514px 0} -.xpress-editor .tool li.extensions span{background-position:0 0} -.xpress-editor .tool li.extensions span button{background-position:right 0} -.xpress-editor .tool li.html span{background-position:0 0} -.xpress-editor .tool li.html span button{background-position:right 0} -.xpress-editor .tool li.preview span{background-position:0 0} -.xpress-editor .tool li.preview span button{background-position:right 0} -/* Content > Tool > Button Hover */ -.xpress-editor .tool li.undo button.hover{width:22px;background-position:0 -21px} -.xpress-editor .tool li.redo button.hover{background-position:-22px -21px} -.xpress-editor .tool li.bold button.hover{width:22px;background-position:-43px -21px} -.xpress-editor .tool li.underline button.hover{background-position:-65px -21px} -.xpress-editor .tool li.italic button.hover{background-position:-86px -21px} -.xpress-editor .tool li.del button.hover{background-position:-107px -21px} -.xpress-editor .tool li.fcolor button.hover{background-position:-128px -21px} -.xpress-editor .tool li.bcolor button.hover{background-position:-149px -21px} -.xpress-editor .tool li.sup button.hover{background-position:-170px -21px} -.xpress-editor .tool li.sub button.hover{background-position:-191px -21px} -.xpress-editor .tool li.left button.hover{width:22px;background-position:-212px -21px} -.xpress-editor .tool li.center button.hover{background-position:-234px -21px} -.xpress-editor .tool li.right button.hover{background-position:-255px -21px} -.xpress-editor .tool li.justify button.hover{background-position:-276px -21px} -.xpress-editor .tool li.ol button.hover{background-position:-297px -21px} -.xpress-editor .tool li.ul button.hover{background-position:-318px -21px} -.xpress-editor .tool li.outdent button.hover{background-position:-339px -21px} -.xpress-editor .tool li.indent button.hover{background-position:-360px -21px} -.xpress-editor .tool li.blockquote button.hover{width:22px;background-position:-381px -21px} -.xpress-editor .tool li.url button.hover{width:26px;background-position:-403px -21px} -.xpress-editor .tool li.character button.hover{background-position:-429px -21px} -.xpress-editor .tool li.table button.hover{width:22px;background-position:-450px -21px} -.xpress-editor .tool li.merge button.hover{background-position:-472px -21px} -.xpress-editor .tool li.splitCol button.hover{background-position:-493px -21px} -.xpress-editor .tool li.splitRow button.hover{background-position:-514px -21px} -.xpress-editor .tool li.extensions span.hover{background-position:0 -21px} -.xpress-editor .tool li.extensions span.hover button{background-position:right -21px} -.xpress-editor .tool li.html span.hover{background-position:0 -21px} -.xpress-editor .tool li.html span.hover button{background-position:right -21px} -.xpress-editor .tool li.preview span.hover{background-position:0 -21px} -.xpress-editor .tool li.preview span.hover button{background-position:right -21px} -/* Content > Tool > Button Active */ -.xpress-editor .tool li.undo button.active{width:22px;background-position:0 -42px} -.xpress-editor .tool li.redo button.active{background-position:-22px -42px} -.xpress-editor .tool li.bold button.active{width:22px;background-position:-43px -42px} -.xpress-editor .tool li.underline button.active{background-position:-65px -42px} -.xpress-editor .tool li.italic button.active{background-position:-86px -42px} -.xpress-editor .tool li.del button.active{background-position:-107px -42px} -.xpress-editor .tool li.fcolor button.active{background-position:-128px -42px} -.xpress-editor .tool li.bcolor button.active{background-position:-149px -42px} -.xpress-editor .tool li.sup button.active{background-position:-170px -42px} -.xpress-editor .tool li.sub button.active{background-position:-191px -42px} -.xpress-editor .tool li.left button.active{width:22px;background-position:-212px -42px} -.xpress-editor .tool li.center button.active{background-position:-234px -42px} -.xpress-editor .tool li.right button.active{background-position:-255px -42px} -.xpress-editor .tool li.justify button.active{background-position:-276px -42px} -.xpress-editor .tool li.ol button.active{background-position:-297px -42px} -.xpress-editor .tool li.ul button.active{background-position:-318px -42px} -.xpress-editor .tool li.outdent button.active{background-position:-339px -42px} -.xpress-editor .tool li.indent button.active{background-position:-360px -42px} -.xpress-editor .tool li.blockquote button.active{width:22px;background-position:-381px -42px} -.xpress-editor .tool li.url button.active{width:26px;background-position:-403px -42px} -.xpress-editor .tool li.character button.active{background-position:-429px -42px} -.xpress-editor .tool li.table button.active{width:22px;background-position:-450px -42px} -.xpress-editor .tool li.merge button.active{background-position:-472px -42px} -.xpress-editor .tool li.splitCol button.active{background-position:-493px -42px} -.xpress-editor .tool li.splitRow button.active{background-position:-514px -42px} -.xpress-editor .tool li.extensions span.active{background-position:0 -42px} -.xpress-editor .tool li.extensions span.active button{background-position:right -42px} -.xpress-editor .tool li.html span.active{background-position:0 -42px} -.xpress-editor .tool li.html span.active button{background-position:right -42px} -.xpress-editor .tool li.preview span.active{background-position:0 -42px} -.xpress-editor .tool li.preview span.active button{background-position:right -42px} -/* Content > Tool > Button Off */ -.xpress-editor .tool.off li.undo button, -.xpress-editor .tool li.undo button.off{width:22px;background-position:0 -63px} -.xpress-editor .tool.off li.redo button, -.xpress-editor .tool li.redo button.off{background-position:-22px -63px} -.xpress-editor .tool.off li.bold button{width:22px;background-position:-43px -63px} -.xpress-editor .tool.off li.underline button{background-position:-65px -63px} -.xpress-editor .tool.off li.italic button{background-position:-86px -63px} -.xpress-editor .tool.off li.del button{background-position:-107px -63px} -.xpress-editor .tool.off li.fcolor button{background-position:-128px -63px} -.xpress-editor .tool.off li.bcolor button{background-position:-149px -63px} -.xpress-editor .tool.off li.sup button{background-position:-170px -63px} -.xpress-editor .tool.off li.sub button{background-position:-191px -63px} -.xpress-editor .tool.off li.left button{width:22px;background-position:-212px -63px} -.xpress-editor .tool.off li.center button{background-position:-234px -63px} -.xpress-editor .tool.off li.right button{background-position:-255px -63px} -.xpress-editor .tool.off li.justify button{background-position:-276px -63px} -.xpress-editor .tool.off li.ol button{background-position:-297px -63px} -.xpress-editor .tool.off li.ul button{background-position:-318px -63px} -.xpress-editor .tool.off li.outdent button{background-position:-339px -63px} -.xpress-editor .tool.off li.indent button{background-position:-360px -63px} -.xpress-editor .tool.off li.blockquote button{width:22px;background-position:-381px -63px} -.xpress-editor .tool.off li.url button{width:26px;background-position:-403px -63px} -.xpress-editor .tool.off li.character button{background-position:-429px -63px} -.xpress-editor .tool.off li.table button{width:22px;background-position:-450px -63px} -.xpress-editor .tool.off li.merge button, -.xpress-editor .tool li.merge button.off{background-position:-472px -63px} -.xpress-editor .tool.off li.splitCol button, -.xpress-editor .tool li.splitCol button.off{background-position:-493px -63px} -.xpress-editor .tool.off li.splitRow button, -.xpress-editor .tool li.splitRow button.off{background-position:-514px -63px} -.xpress-editor .tool.off li.extensions span{background-position:0 -63px} -.xpress-editor .tool.off li.extensions span button{background-position:right -63px;color:#bcbcbc} -.xpress-editor .tool.off li button{cursor:default} -.xpress-editor .tool.off ul.extra3 li button{cursor:pointer} -/* Content > Tool > Layer */ -.xpress-editor .tool .layer{display:none;position:absolute;left:0;top:20px;background-color:#fbfbfb;border:1px solid #c5c5c5;border-right:1px solid #9f9f9f;border-bottom:1px solid #9f9f9f} -.xpress-editor .tool .layer li{float:none;left:0} -.xpress-editor .tool .layer button, -.xpress-editor.black .tool .layer button{margin:0 !important;width:auto;height:auto;background:none;float:none} -.xpress-editor .tool .layer button span{position:absolute;width:0;height:0;font-size:0;line-height:0;overflow:hidden;visibility:hidden} -.xpress-editor .tool .btn_area{position:relative;clear:both;text-align:center !important;padding:7px 0 12px 0;width:100%;white-space:nowrap;*zoom:1} -.xpress-editor .tool .btn_area *{vertical-align:top} -.xpress-editor .tool button.close{position:absolute;top:4px;right:3px;width:21px;height:20px;background:url(../img/btn_layer_close.gif) no-repeat center center !important} -.xpress-editor .tool button.close span{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden} -.xpress-editor .tool .layer .btn_area button{*margin:0 2px !important} -.xpress-editor .tool .layer .btn_area button.confirm{width:38px;height:21px;background:url(../img/btn_layer_confirm.gif) no-repeat} -.xpress-editor .tool .layer .btn_area button.cancel{width:38px;height:21px;background:url(../img/btn_layer_cancel.gif) no-repeat} -.xpress-editor .tool li.fcolor .layer{width:218px !important;height:auto !important;background-image:none !important;overflow:hidden} -.xpress-editor .tool .layer .palette{width:210px;position:relative;left:7px;padding:8px 0 7px 0;margin:0} -.xpress-editor .tool .layer .palette li{float:left;margin:0 1px 1px 0 !important;font-size:0;line-height:0} -.xpress-editor .tool .layer .palette button{position:relative;overflow:hidden;width:11px !important;height:11px !important} -.xpress-editor .tool li.bcolor .layer {width:218px;overflow:hidden} -.xpress-editor .tool .layer .background{width:210px;position:relative;left:7px;margin:0 0 -2px 0;padding:8px 0 0 0;*padding-bottom:8px;_padding-bottom:4px} -.xpress-editor .tool .layer .background li{float:left;margin:0 5px 2px 0 !important} -.xpress-editor .tool .layer .background button{position:relative;overflow:hidden;width:65px;height:19px;text-align:left;padding:4px} -.xpress-editor .tool .layer .background button span{position:relative;visibility:visible;font-size:12px;line-height:normal;width:auto;height:auto} -.xpress-editor .tool li.style .layer{padding:4px 2px;_overflow:hidden;filter:progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=2)} -.xpress-editor .tool li.style .layer li{position:relative;background:#fbfbfb} -.xpress-editor .tool li.style .layer li button{display:block;width:134px;position:relative} -.xpress-editor .tool li.style .layer li button span{display:block;width:130px;text-align:left;letter-spacing:normal} -.xpress-editor .tool li.style .layer li.h3 button span{padding:3px 0 1px 4px;height:15px;font-size:16px;font-weight:bold} -.xpress-editor .tool li.style .layer li.h4 button span{padding:3px 0 2px 4px;height:13px;font-size:14px;font-weight:bold} -.xpress-editor .tool li.style .layer li.h5 button span{padding:3px 0 1px 4px;height:11px;font-size:12px;font-weight:bold} -.xpress-editor .tool li.style .layer li.h6 button span{padding:3px 0 1px 4px;height:11px;font-size:12px} -.xpress-editor .tool li.style .layer li.p button span{padding:3px 0 1px 4px;height:11px;font-size:12px;color:#5d5d5d} -.xpress-editor .tool li.style .layer li button.hover{background:#c1f471;*height:1%} -.xpress-editor .tool li.blockquote .layer{padding:6px 0 6px 7px;left:0;width:294px} -.xpress-editor .tool li.blockquote .layer ul{*zoom:1;margin:0} -.xpress-editor .tool li.blockquote .layer ul:after{content:"";display:block;clear:both} -.xpress-editor .tool li.blockquote .layer li{position:relative;float:left;overflow:hidden;width:32px;height:34px;margin:0 2px 0 0 !important;border:1px solid #cdcecc !important;background-image:url(../img/btn_qmark.gif);background-repeat:no-repeat} -.xpress-editor .tool li.blockquote .layer li.q1{background-position:0 0} -.xpress-editor .tool li.blockquote .layer li.q2{background-position:-32px 0} -.xpress-editor .tool li.blockquote .layer li.q3{background-position:-64px 0} -.xpress-editor .tool li.blockquote .layer li.q4{background-position:-96px 0} -.xpress-editor .tool li.blockquote .layer li.q5{background-position:-128px 0} -.xpress-editor .tool li.blockquote .layer li.q6{background-position:-160px 0} -.xpress-editor .tool li.blockquote .layer li.q7{background-position:-192px 0} -.xpress-editor .tool li.blockquote .layer li.q8{background-position:-224px 0} -.xpress-editor .tool li.blockquote .layer li button{width:32px;height:34px} -.xpress-editor .tool li.url .layer{width:231px;height:125px;background-image:url(../img/bx_url.gif);background-repeat:no-repeat;background-position:10px 14px} -.xpress-editor .tool li.url .layer fieldset{position:absolute;width:212px;left:10px;top:14px} -.xpress-editor .tool li.url .layer fieldset h3{position:absolute;top:-4px;left:15px;color:#404040;visibility:visible;font-size:12px;line-height:normal;width:auto;height:auto;background:none;margin:0;padding:0;font-weight:normal} -.xpress-editor .tool li.url .layer fieldset input.link{position:absolute;left:12px;top:19px;width:179px;padding:2px 0 1px 6px;*margin:-1px 0;font-size:11px;height:13px;border:1px solid #818181;border-right:1px solid #dadada;border-bottom:1px solid #dadada} -.xpress-editor .tool li.url .layer fieldset p{position:absolute;left:12px;top:44px} -.xpress-editor .tool li.url .layer fieldset p input{width:13px;height:13px;vertical-align:middle;margin-right:3px} -.xpress-editor .tool li.url .layer .btn_area{position:absolute;bottom:12px;padding:0} -.xpress-editor .tool li.table .layer{width:242px;height:239px;background-image:url(../img/bx_table.gif);background-repeat:no-repeat;background-position:10px 14px} -.xpress-editor .tool li.table .layer fieldset{position:absolute;width:222px;left:10px} -.xpress-editor .tool li.table .layer fieldset h3{position:absolute;top:-4px;left:15px;color:#404040;visibility:visible;font-size:12px;line-height:normal;width:auto;height:auto;background:none;margin:0;padding:0;font-weight:normal} -.xpress-editor .tool li.table .layer fieldset dl{position:absolute;left:10px} -.xpress-editor .tool li.table .layer fieldset dt{float:left;padding:3px 0 0 0;height:20px;white-space:nowrap;letter-spacing:-1px} -.xpress-editor .tool li.table .layer fieldset dd{float:right;position:relative} -.xpress-editor .tool li.table .layer fieldset dd button.add, -.xpress-editor .tool li.table .layer fieldset dd button.del{position:absolute;left:27px;width:15px;height:8px;background:url(../img/btn_layer_cell_adjust.gif) no-repeat} -.xpress-editor .tool li.table .layer fieldset dd button.add{top:1px} -.xpress-editor .tool li.table .layer fieldset dd button.del{top:9px;background-position:0 -8px} -.xpress-editor .tool li.table .layer fieldset dd .preview_palette{display:block;float:left;margin:0 3px 0 0;padding:2px;position:relative;border:1px solid #c8c9c6;width:14px;height:14px;overflow:hidden} -.xpress-editor .tool li.table .layer fieldset dd .preview_palette button{width:14px;height:14px;font-size:500px;line-height:0} -.xpress-editor .tool li.table .layer fieldset dd .find_palette{width:33px;height:20px;background:url(../img/btn_search.gif) no-repeat} -.xpress-editor .tool li.table .layer fieldset.num{top:14px} -.xpress-editor .tool li.table .layer fieldset.num dl{top:18px;width:60px} -.xpress-editor .tool li.table .layer fieldset.num dt{height:20px} -.xpress-editor .tool li.table .layer fieldset.num dd{height:23px} -.xpress-editor .tool li.table .layer fieldset.num dt label{font-size:11px;color:#333} -.xpress-editor .tool li.table .layer fieldset.num dd input{padding:3px 0 0 6px;*margin:-1px 0;width:35px;height:13px;font-size:11px;border:1px solid #818181;border-right:1px solid #dadada;border-bottom:1px solid #dadada} -.xpress-editor .tool li.table .layer fieldset.color{top:96px} -.xpress-editor .tool li.table .layer fieldset.color dl{top:18px;width:210px} -.xpress-editor .tool li.table .layer fieldset.color dt{height:23px} -.xpress-editor .tool li.table .layer fieldset.color dd{height:26px;width:146px} -.xpress-editor .tool li.table .layer fieldset.color dt label{font-size:11px;color:#333} -.xpress-editor .tool li.table .layer fieldset.color dd input{padding:3px 0 0 6px;*margin:-1px 0;font-size:11px;border:1px solid #818181;border-right:1px solid #dadada;border-bottom:1px solid #dadada} -.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_width{width:35px;height:13px} -.xpress-editor .tool li.table .layer fieldset.color dd input#table_border_color, -.xpress-editor .tool li.table .layer fieldset.color dd input#table_bg_color{width:70px;height:15px;*margin-right:3px} -.xpress-editor .tool li.table .layer table{position:absolute;top:18px;left:75px;width:137px;height:40px;table-layout:fixed;border-collapse:separate;border:0} -.xpress-editor .tool li.table .layer table *{font-size:0;line-height:0} -.xpress-editor .tool li.table .layer table th, -.xpress-editor .tool li.table .layer table td{text-align:center;padding:0;border:0} -.xpress-editor .tool li.table .layer .btn_area{position:absolute;bottom:12px;padding:0;z-index:1} -.xpress-editor .tool li.table .layer .palette{display:none;position:absolute;z-index:2;left:11px;width:204px;padding:8px 7px 7px 7px;_padding-right:6px;background-color:#fbfbfb;border:1px solid #c5c5c5;border-right:1px solid #9f9f9f;border-bottom:1px solid #9f9f9f} -.xpress-editor .tool li.table .layer.p1 .palette{display:block;top:163px} -.xpress-editor .tool li.table .layer.p2 .palette{display:block;top:189px} -.xpress-editor .tool li.character .layer{width:433px;height:242px;overflow:hidden} -.xpress-editor .tool li.character .layer ul{margin:0} -.xpress-editor .tool li.character .layer h3{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden} -.xpress-editor .tool li.character .layer .characterNav{position:absolute;top:11px;left:-1px;overflow:hidden;white-space:nowrap} -.xpress-editor .tool li.character .layer .characterNav li{display:inline;margin:0 -4px 0 0;padding:0 8px !important;background:url(../img/vr_layer_character.gif) no-repeat 0 0} -.xpress-editor .tool li.character .layer .characterNav li a{color:#444;text-decoration:none;letter-spacing:-1px} -.xpress-editor .tool li.character .layer .characterNav li a:hover, -.xpress-editor .tool li.character .layer .characterNav li a:active, -.xpress-editor .tool li.character .layer .characterNav li a:focus{text-decoration:underline} -.xpress-editor .tool li.character .layer .characterNav li a.on{font-weight:bold;color:#004790;display:inline} -.xpress-editor .tool li.character .layer .list{position:absolute;left:7px;top:30px;width:421px;height:172px;background:url(../img/bx_character.gif) no-repeat} -.xpress-editor .tool li.character .layer .list li{position:relative;top:1px;left:1px;float:left;width:20px;height:18px;margin:0 1px 1px 0 !important} -.xpress-editor .tool li.character .layer .list li button{width:20px;height:18px} -.xpress-editor .tool li.character .layer .list li button.hover{border:2px solid #27c11a} -.xpress-editor .tool li.character .layer .list li button span{overflow:visible;font-size:12px;width:auto;height:auto;position:relative;visibility:visible;line-height:normal} -.xpress-editor .tool li.character .layer p{position:absolute;top:212px;left:7px} -.xpress-editor .tool li.character .layer p *{vertical-align:top} -.xpress-editor .tool li.character .layer p label{position:relative;top:4px;margin:0 7px 0 0;color:#333;letter-spacing:-1px} -.xpress-editor .tool li.character .layer p input{padding:3px 0 0 4px;margin:0 4px 0 0;width:300px;_width /**/:306px;height:16px;_height /**/:20px;border:1px solid #acacac;border-right:1px solid #dadada;border-bottom:1px solid #dadada} -.xpress-editor .tool li.character .layer p button{position:relative;*top:1px;width:38px;height:21px;background:url(../img/btn_layer_confirm.gif) no-repeat} -.xpress-editor .tool li.character .layer p button span{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden} -.xpress-editor .tool li.extensions .layer{width:auto;white-space:nowrap;padding:5px 10px} -.xpress-editor .tool li.extensions .layer li{margin:2px 0} -.xpress-editor .tool li.extensions .layer li a {color:#000;text-decoration:none} -.xpress-editor .tool li.extensions .layer li a:hover {text-decoration:underline} -/* File Uploader */ -.xpress-editor .fileUploader{clear:both;padding-top:5px;margin-bottom:10px} -.xpress-editor .fileUploader:after{content:"";display:block;clear:both} -.xpress-editor .fileUploader .preview{float:left;width:64px;height:64px;border:1px solid #ccc;;padding:2px;margin:0 10px 5px 0} -.xpress-editor .fileUploader .preview.black {background-color:#000;border:1px solid #666} -.xpress-editor .fileUploader .preview img{display:block;width:64px;height:64px} -.xpress-editor .fileUploader .fileListArea{float:left;width:260px;margin:0 10px 5px 0} -.xpress-editor .fileUploader .fileListArea select{width:100%;height:70px;overflow:auto;margin:0;padding:0;float:none} -.xpress-editor .fileUploader .fileListArea select option{font-size:11px} -.xpress-editor .fileUploader .fileListArea.black select {background-color:#000;border:1px solid #666} -.xpress-editor .fileUploader .fileListArea.black select option {color:#aaa} -.xpress-editor .fileUploader .fileUploadControl{clear:right} -.xpress-editor .fileUploader .fileUploadControl .text{margin:0 0 5px 0;font-size:11px;text-decoration:underline} -.xpress-editor .fileUploader .file_attach_info{clear:right;margin:5px 0;font-size:11px;color:#333} -/* Auto Save */ -.xpress-editor .autosave_message {display:none;background: #f6ffdb;padding:6px 10px;margin:0;line-height:1} -.xpress-editor.black .autosave_message {display:none;background:#222;padding:6px 10px;margin:0;line-height:1;color:#fff} -.xpress-editor .input_syntax.black {background:transparent;color:#fff} diff --git a/modules/editor/skins/xpresseditor/css/default.min.css b/modules/editor/skins/xpresseditor/css/default.min.css deleted file mode 100644 index 303be945e..000000000 --- a/modules/editor/skins/xpresseditor/css/default.min.css +++ /dev/null @@ -1 +0,0 @@ -/* This file is not used in Rhymix. */ diff --git a/modules/editor/skins/xpresseditor/editor.html b/modules/editor/skins/xpresseditor/editor.html deleted file mode 100644 index 3baf416bc..000000000 --- a/modules/editor/skins/xpresseditor/editor.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - - - - {@ $editor_class = "black" } - - - - - -
- nbr" /> - -
- - - - - - - - - - - - - - - - - -
-
- - - -
- - -
    -
  • -
  • -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - - - - -
  • -
  • - - - - -
  • -
  • - -
  • -
  • - -
  • -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
    -
  • - - - - -
  • - -
  • - - - - -
  • -
- -
    -
  • - - - - -
  • -
  • -
  • -
  • -
- - - - - - -
    style="display:none"> - -
  • - -
-
- -
- - - -
- -
- - -

 

- - - - - -
- -
-
-
- -
-
- - - -
-
{$upload_status}
-
-
- - - - diff --git a/modules/editor/skins/xpresseditor/img/bg_qmark.gif b/modules/editor/skins/xpresseditor/img/bg_qmark.gif deleted file mode 100644 index 5a8a44625d0bcdbc038ee4aaa0f75575fbc4f146..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmZ?wbhEHbWM|-IX!y@?;J|^No*u=YEQ}05paUX6G7d~aEJ@R)YxnU?%3Kv;T*6z* J)5gkR4FK554=Mlv diff --git a/modules/editor/skins/xpresseditor/img/bg_tool.black.gif b/modules/editor/skins/xpresseditor/img/bg_tool.black.gif deleted file mode 100755 index 58eff2f9fb96a779ec82b8037d8db426c6c38e8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90 zcmZ?wbh9u|WMq(F_{_k-$H&LW$S5c%C?X=l#l^+T%PSxtkdTnT&(AL}FE1n{#KXhG q$;rvV!NJYV&A`B*1H=pxBufMUI}&IzK>z>% diff --git a/modules/editor/skins/xpresseditor/img/btn_expand.black.gif b/modules/editor/skins/xpresseditor/img/btn_expand.black.gif deleted file mode 100755 index 203a82eaae62a86b5c1725877c843d690c35ff7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmZ?wbhEHbt<8 diff --git a/modules/editor/skins/xpresseditor/img/btn_expand.gif b/modules/editor/skins/xpresseditor/img/btn_expand.gif deleted file mode 100644 index ea472d91ca68ca8f2ccee269408c5096520233a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55 zcmZ?wbh9u|(}4Ee*>*!paxL< z$->CMpuwO6G7RJ=2DX@BNcEq1vQa@m%w@@n60fyU%NJi-W+2t!_FzMWk6!y; z)pMOCS-bCl*zw2qmw^47opt}!ZhBY9*EAQ`l~=ZO=GRxW@NwoziPp%MwztS}^QrT2 z%hm+;bks<&h;j2YFLcT7;$)f7GOd9@ZQJ%8J0)4zcJABG(8Hj(f1fZHKMViSod?Ue zp4ra9C7>q2#c@$hk%8BR_rfhUk!>8}dvBdnRcGI)`2NGkPoF=svzM{TKfLv4=bd_W zl`qmadRPPn6&zS1b{H%?+%BN(#KYj^(y17?qT|Mijf;=>%dt=CP;luyIoZ>Ljgi3` E06Hhkh5!Hn diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_cell_adjust.gif b/modules/editor/skins/xpresseditor/img/btn_layer_cell_adjust.gif deleted file mode 100644 index 7cb1e0fbba4c89b5c78c8338d83d37e25198dcb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 154 zcmV;L0A>G2Nk%v~VGjTh0P_F<{{H^`{r%6*&dkir!NI}R)zx8PVWgv@?(XjL^78xp z`}p|y<>lp;mX^A@y8r+GEC2ui01p5V000C}u((Mp9WJQNy9$Q`EM#deK=>pqYqad6 zA~a&$H6l9?I4oD%$P6pNh1=ZdZ&#og&*1d7* z$z5}($lE_~%d^+LulLMbGWGICx9+x0fjJEGIwmGaoe*8q$dLTx#j{;~`Q=|UW}kl+ b$aE-Ao~{3&gQ3xu_vOtlDX-o;Ggt!v)dy&Q diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif b/modules/editor/skins/xpresseditor/img/btn_layer_confirm.gif deleted file mode 100644 index 39217dea4abc5abf4866a5990d56b1ce5fdb7849..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 336 zcmZ?wbhEHbRAUfjI3mXI{rmTK@7~?Gabw@UegFUe|MuqU{``6Q^5yH-umAY* zW6z#FzkdA+TqW}U{rfLpzWn?5@6VqE7=^uQ&885d>9?QD^p~7{}RDbERwyU}IW*-U-OY+O=8w#3Kyo=iF zYpatPL?%y}I=Nn?ZQAT93?&TwbEdY&H*cZ;A}o07YDz_W%F@ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif b/modules/editor/skins/xpresseditor/img/btn_layer_find_next.gif deleted file mode 100644 index 35487470ba79e66953fc36f1206cd147fb98978d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 365 zcmZ?wbhEHbG-nWHI3mjM{rmTS|Nh;$apTLEFaQ7l-?wky`}gm^ef#$F=g-TRFaP-Q zW6z#F*RNmy_3PKWckllG{rl(7pS^qcGB7ZF{rdIy@83WzKsFwr_>+Z^0ce#DNDatN z2G&;zsxB#+^DKD(yMF1qT{|{z ziC=hN*|GI&Hk>-Tl$n7;h2zMXD_74P5)@&-cIWOQW_I>CR^H3^o*zAzA;R_I-BAVs w6-G8TzVAPN{`&pr??1k8JS-gsPAB@BIfU6b92A_G1a*|W=2SdN({UE-@pI+_wW7t_cw0b`10k;|NsB@?c4Y5+qa)Te_p

+Z^0ce#DNDatN z2G-9Bt}ZE=^D`dGsP#A2 zl%0MXB*!4s@Je^~`3MgSBen(i3)V*Y^xb~^`eU@x#&4%nDUxtexClEErtfK6&cg1zq{gIgG-~SFBtmEVO*Wnh9$+Y^qtkZ8c*hBkT5Un>HL+ zvGwr&z1wysEjzaA=$7?I)*U^)oRyJNh4a+q+js7sn8k7T(c@LDtQ;JP>;kcyzaJxVz$BYbxCMH2$qpUkC9wl)w GSOWmi{IbXZ diff --git a/modules/editor/skins/xpresseditor/img/btn_layer_replace.gif b/modules/editor/skins/xpresseditor/img/btn_layer_replace.gif deleted file mode 100644 index 37b885ceb34c6344e7cf88c02baf6dcbb44235e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 386 zcmZ?wbhEHbG++>AI3mjM?%liZ-@kwP^5w>j8~gU{`~Uy{w{PEm{``6Q^5yH-ukYEj z=f{s9@87@w`}gm^fB$~{`t|3}pS^qce*OBDfq~)o@83Z6Kn5P5_>+Z^0ce#DNDatN z2G;)xrY({UE-@pI+_wW7t_cw0b`10k;|NsB@?c4Y5+qa)Te_p

D^bNH}Ag+%{}B}FH5tfsqoHVZ9`Sbt+p z+3B}cJNX$n1OCoBpHb|hqsV;egGH6C-s$&0bY{=l@ANC8zCM~Eu{2tsGo!h@E37HT zq`IuJKfR}@Ph>*$B$bekY5mQeeM@?lE{<9tY8Cj1X-Ld`Hfo+{fc5UB({nAGr z#cR87e))d+*{^f2?h1);T;a4a->~3d6f2j4gTgb0h6?sp*EtyzWTm;dHL~tx7&x#9 zF|qL!IBZ&Sag(#>-`?Kf-t6t{+uhs$|Nr~@`~Uy{A^8LW000L7 zEC2ui0LTCq000A>cp%jNFv>}*y*TU5yMF?p3`J?4XsWJk>%MR-&vb340}vEO@BhG{ za7Zi~kI1BQ$!t1~mzkW8o1LJBpP{6Gqot^Lr>U%NtF5qR Sud%dY1qTOlwYz1v2>?6Vo^GcA diff --git a/modules/editor/skins/xpresseditor/img/btn_qmark.gif b/modules/editor/skins/xpresseditor/img/btn_qmark.gif deleted file mode 100644 index 2232f5d1a4bba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KuRlE44} diff --git a/modules/editor/skins/xpresseditor/img/btn_search.gif b/modules/editor/skins/xpresseditor/img/btn_search.gif deleted file mode 100644 index e7fa10974f170cf7a5c440743c4d70f43f4b71f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 730 zcmV<00ww)NNk%w1VHE%r0Oo%H%Ef7^mr2vp)A8rkF)=d4tb~b&hupMmrFJOJ&d#cO zIr;hc+Ol%4i9P7flbD#A^Y7=dght`Slk)QNo@XSrzG|eJg4o#D)~#XNx`XTM>e#Pr z`S|wk?(XN;zuUQf_w(-6wubcd^#A|=_V)JMw|?EggY(^^(5`jYylU05aPr@@$h)iJ zzkuxM;mxs(RB?;x&!BXD9B~ynMyS%%r7MqmOU5y2HvYCfmPxy1KgS;nKL7 zSIVYUn{p_%u&T$ZeXXE~&rC+&;pCHmO47D^pP+WGh)_{rdX){QUg;`}@7Uz5oCJA^8LW004ggEC2ui z02Kff000O7fPWW$goTEOgcpK-d3=tKkdb z3+_zdp@o2f8#2!P(BTHk3=bUpkqAPds+A~AWB_;~rv(ZPBuIGl^T2=s99b$BR!lLHw$82@(h)KGoRgOI!_f9-tYil0`>ramoH!X`uei6 zva+$UadB}ydh|$0NC*rDKYaKQg+eVZF7op7K7IPs*49>2Q}fxgXCFR%aB_0e(a~{m zaImwp%gD&!TNyrKO{zqtBl||Mu-$7!1bE z&8?!Ma{c=C#Kgp}U%!foh`f6BN>Wnt`}gkz0^#=U+fq_eH8nNW)zud-Uc7MOLSJ9s z*w|Q8Q`3V74{~yHbai#FUcIWNrG-YL`}_Or>+6SxhLn_)Kp+qh2ox0+6%!K^5D+LR zDCp|yx_0eae0+RRP>{X7y{D(AzP>&lk2f?lbar;m%gf{7;J9?@l8uc`LPCPIwKWS1 z%e!~)^z`(stgM)snc3OdnV6X9bUNVw{gC=!i2v0Bz(fyX4*nhj4Gn{Z!y^!pQPIel z*tqzF#H8eu)U@;rRAyF~igjLoL1CeC5gM(MTUwbXUR707TUy^xRMJ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}tP=(HALe2fGYbVTkV8Z7KhmS3TSI>}qkZG(p#Z(Z`KWzkgX{U|tPb6m$k8u?d5%tF zF4AMJMPv5t;|^P6K0RYzkquwY#~^}Z(DTtCips~ zb%!*Mj+{R@A8nT&mUo`MRXopBJROK!JY%Pa%`m(%1Zd3Bz3FE-`#x`91einoVIj{u z6aoH?kkpNu6VVu3M9#l4pCL;xD2ULzTLR24mdrI6Ej54~|u9jTQgiWr#)|8)6`&cO`gx z3D&d%ky#57T1mWEa=KVH*QopHypmSD_Dg6zo@2eAx@Ijy=Wwy&*|hFpzFh1Kz)Gwa zrL9+@*PP8a?itd*7NKV<-Dr$j4~|-OPg`-9Shv;hVS+QhnFBD%^?0OhSQG^5ifHaB38vpHXalm5WF0{Ylzo%faFSE1#rgZzS8?M~E zf6riV*nex(d5a}r|1s^4r|W@`!QQe8$YAzhONd^;;P657uA_!s3*hKL=143WBTC!NN-B*NqJ7ldXzCqVP-!!j=?8_~;IzD%c31`8xdPseojv|Ads<*{R^f8i(0nQ} zdnz@%TPb`}H+zT%pLK!H`oSl|vgi2bvyr~tp>*nr#Q8Yq#f&g{KK*c|gt8_~*)X^m zoV}<3UsQ0?ObloeF0|fg8mWY~%*p)ae=D{j?i%ip@SpDY?uA9fLSteRf}n{JQScN< zd|D(76`GZu6z%SeDJ&{3bazFUR2CsBs;bJcwI%h9b>%IUe^+cfI!oIKT@8d9V$T2u zPaNs%9vJH^8ycP%Eg($|%`7e~&5id?uTS4oaNFBII6QQvoSZ1^QZM$7FHTs+#wcQcM6)TzuL$kL9JFzc!;7|JtrVFChF{|_q5M@s+z diff --git a/modules/editor/skins/xpresseditor/img/btn_set_blank.black.gif b/modules/editor/skins/xpresseditor/img/btn_set_blank.black.gif deleted file mode 100755 index 145bb47834385dd939bbf52faa9283e07b81fdb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2026 zcmbu7`BM^z0>?33G(}^w#AVB6D-{ustxb)5PPLVQT2`()Jh$iWHfn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7hhNTysZ@a7;jf~?ugIseki|(o&y9l|X{eX6Dyq}VV5^Fz(272hm!y@kJCL&`Sb(2vk8@j1zyoY`| z8p3CPila8_XA+qk`q^ZThhgsi)E&cos-)4d@KEwA{F@9*Poww=B+0m#v*oUPmNG8-Ak)Sz#X{Oevslpm31D6x9tt!m$Up{J% z;a-5Mi8;Y1ez2_PUPh^(5eX~bf9uA>;?&Q}ici?xVDqk|sf$RUI(Q(4f4y8?Obf0< zMDY0GEcJ^PLY=#>n*cYXF6k21d8Y6LH=jQ*=><`|@fhLn&{Jh>f6B>Ho-hVgRLXlu z`H6}V#Rr@!pA=Gjm^@KLHu0PoMD^ofM(&ksDx^=Y?wjO|JYZ>FD+yG831&2HMpJ1N zQUeUU(e!Oi6~LATgq|OJ4AqjXLWa!jq8~p&Y02P%xQihzW7$}3wWEl3S#|DOc9OOR zW?PSrXdQc2uC0ZimYP|I=9jRvbtdnE`rtpTtA7z{DSo2*D=9de!{gfT&e_sK@!0Wd z>j~;Np=N**{x}7ts}C)phf%Q;bexVJDWZon`4dfPI!5#c;`)!^$+mJ`LtF?0H^raq zynfgmHgFEGik)K3=$cYRjGG4jRPVN~Im5Og+A?T*0IF}v@jylul}`_&^sU5#hFh*d zpZMwtD$x5;fREtQNSeN#WZM`QIBRDw7yvl?KSq@?t^fc4 diff --git a/modules/editor/skins/xpresseditor/img/btn_set_blank.gif b/modules/editor/skins/xpresseditor/img/btn_set_blank.gif deleted file mode 100644 index fc65fa68a74ea9d49888b0bec2d38559c4e9747b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2201 zcmZ{iX;Tvh0zji6P(=n?6c$~Y5rl9f+CY(ZP^%;%prZ^hEOn`C0YQ*jM_9BJ1PMYE zl+$p9GZ&C>NVtRqklY-igqv_CB!S!~N4EU|`@X(UZ{`I;ulxG^;&vz$paKArDz5(V zKDbYu&eQc742IR!)q#NlKA-X_`^;(iB1 zlfQN_IJ=9NN~NRfoMF|UlRDIt9zCMY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0&jUPLb&!J>nP=qs<4jvFeH7d)dzFl=Kf{O6 z{N@a@*QxA!I}M%oqh40<3~moJh0?Fs$_sPh4QH*L1222a-xMMn9Gswxz~^s{l(QQg zeHe_8G6v)d z`WO?mD2&wf&Tv|vkXeg6X_~%;YddC?pd~p<(=P}fAf|CyOIxp_yX@mKpYem1^>dm5 zEr*z{VJ#o%HG=>PQids~gSNjdW3M}2`Y+?0Mdoi9_=d~Bbj+cXm+z9<8y-(}tZ0jlavFToyF$l~3+X^{ R*_+@#9Vgi%z!Cts^glR20ImQ4 diff --git a/modules/editor/skins/xpresseditor/img/bx_character.gif b/modules/editor/skins/xpresseditor/img/bx_character.gif deleted file mode 100644 index 44369479044296b02098bdb0403cfedd3c90e6f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2084 zcmV+<2;28ZNk%v~VWk1A0Pp|+-{Ic>|Nkri0001`0jvN30{?`MsmtvTqnxzbi?iOm z`wvpVNS3AvoT{3x?%2L-ET42;-Z;G5J^IT9NxEGTcdR94%U9F&oDF$X!!!_OU9-OG z_UjD~xj=D{EHwYnMDTdaroPp^IM#i}ul04l(T@bEB*+9u=yV8`C`I?z82C6CSvZMU zsdzbKx4Ed5={Xmg_t_=7M_OjuhnhCV$=U`hH>&Db3wbM`cBa-fX^heV$zo?Jf;ZEzipyPQQ)ct^a+t z&Oa`lz;^@V6`Xgl9zb*i8ya+o(8#}p`6%wQ*l%GwjQ;^4D&)xUp~#3Mtqt4gv0}=L zD>H&bSyE+8mNQ+p>{ye<#G4^W`uxZf=1-YJX%@AavnSA`LQTrL^K>WEdoQU5wK_Ex zIIZ@$YQ(BU>QS6yl@eWAw&~fmM$x)ui!?3Rw@}2=jeD1DUbAiC>h;SPFJQHO3kx=^ z^W@yYixCI@>zMH2$&e{OzAU-2X3RP4GWJ>(^i|PWXMH6t7xmuEoK=4|T_=R>*|clh zzKuJ#?%li@D0UsWv1Qi8g>Nnne7Nz}utzs94b|1}=c%c$UXI-Q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E+Xw#})n`OcYT3O@DovUI-0vkx#&M|@{uim{>{xTdYIAmcwKo4t3tT+K< z#g7k1E<9Oq<-eEpW@fv2ZD+Ng(}qSn`fO>lr^}`$yLxPEv9H6%20Qy}ZLhbx=1#hs zXz!rEeFon-9B1*G$7LpextwM5l+R5@A2}Ul^^VsyX1}o(Yc@yA%HUnZ)U^NFyli)K8GSlEP4 zl7$sjh#^cGZa9;NZA?gvh{KQwO@|=ngkp+3v8aZL39aa&P&1+-V~t|mh~p42PNU*wPAW4uJ3@rZzCKjx+)p&h&_x}WqqVUXl8LQUiyxy1Rpy0&VQ?c%S&HMic7VrlM zu;d+DQgkxMYAVC2Vz0GP>vwULoqk(Ye`|e(&%3tMFSb}!#O=OcAf)EEe);Whd;WFZ z|NY;qwxPKtvbeRQQ?aS5x1*;t+#C3skCF)UfDhS4sskgwD-u-oySjXJ#~8H*>h_zTwHni%F=7s7v8)z z_s-p!_a97s^myXaXT2|8cD{bo`tE)6$4`^nzwZ0;qw3f1>EHk5eC3u%S2*a)z`x6A zMF8*Nw)sL%CSMC4&FB(y_dN50Q`ucl&c=S;EsaY-CnkmZEsAk1TB~yv diff --git a/modules/editor/skins/xpresseditor/img/vr_layer_character.gif b/modules/editor/skins/xpresseditor/img/vr_layer_character.gif deleted file mode 100644 index 2d64980c36a62c8235ea85eb2f2aebf0e8af4a55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 ocmZ?wbh9u|WMtrG_`tw$<;oQX1_m7= 0 && xe.DOMFix.parentNode(aAllNodes[iChildIdx]) == aAllNodes[iCurIdx]){ - iChildIdx = this._recurConstructClonedTree(aAllNodes, iChildIdx, aAllNodes[iCurIdx], oCurNodeCloneWithChildren, oClonedStartContainer, oClonedEndContainer); - } - - // this may trigger an error message in IE when an erroneous script is inserted - oClonedParentNode.insertBefore(oCurNodeCloneWithChildren, oClonedParentNode.firstChild); - - return iChildIdx; - }; - - aNodes[aNodes.length] = xe.DOMFix.parentNode(aNodes[aNodes.length-1]); - _recurConstructClonedTree(aNodes, aNodes.length-1, aNodes[aNodes.length-1], oClonedParentNode); - - return {oStartContainer: oClonedStartContainer, oEndContainer: oClonedEndContainer}; - }, - - cloneRange : function(){ - return this._copyRange(new xe.W3CDOMRange(this._document)); - }, - - _copyRange : function(oClonedRange){ - oClonedRange.collapsed = this.collapsed; - oClonedRange.commonAncestorContainer = this.commonAncestorContainer; - oClonedRange.endContainer = this.endContainer; - oClonedRange.endOffset = this.endOffset; - oClonedRange.startContainer = this.startContainer; - oClonedRange.startOffset = this.startOffset; - oClonedRange._document = this._document; - - return oClonedRange; - }, - - collapse : function(toStart){ - if(toStart){ - this.endContainer = this.startContainer; - this.endOffset = this.startOffset; - }else{ - this.startContainer = this.endContainer; - this.startOffset = this.endOffset; - } - - this._updateRangeInfo(); - }, - - compareBoundaryPoints : function(how, sourceRange){ - switch(how){ - case xe.W3CDOMRange.START_TO_START: - return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.startContainer, sourceRange.startOffset); - case xe.W3CDOMRange.START_TO_END: - return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.startContainer, sourceRange.startOffset); - case xe.W3CDOMRange.END_TO_END: - return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.endContainer, sourceRange.endOffset); - case xe.W3CDOMRange.END_TO_START: - return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.endContainer, sourceRange.endOffset); - } - }, - - _findBody : function(oNode){ - if(!oNode) return null; - while(oNode){ - if(oNode.tagName == "BODY") return oNode; - oNode = xe.DOMFix.parentNode(oNode); - } - return null; - }, - - _compareEndPoint : function(oContainerA, iOffsetA, oContainerB, iOffsetB){ - var iIdxA, iIdxB; - - if(!oContainerA || this._findBody(oContainerA) != this._document.body){ - oContainerA = this._document.body; - iOffsetA = 0; - } - - if(!oContainerB || this._findBody(oContainerB) != this._document.body){ - oContainerB = this._document.body; - iOffsetB = 0; - } - - var compareIdx = function(iIdxA, iIdxB){ - // iIdxX == -1 when the node is the commonAncestorNode - // if iIdxA == -1 - // -> [[...]]... - // if iIdxB == -1 - // -> ...[[...]] - if(iIdxB == -1) iIdxB = iIdxA+1; - if(iIdxA < iIdxB) return -1; - if(iIdxA == iIdxB) return 0; - return 1; - }; - - var oCommonAncestor = this._getCommonAncestorContainer(oContainerA, oContainerB); - - // ================================================================================================================================================ - // Move up both containers so that both containers are direct child nodes of the common ancestor node. From there, just compare the offset - // Add 0.5 for each contaienrs that has "moved up" since the actual node is wrapped by 1 or more parent nodes and therefore its position is somewhere between idx & idx+1 - // NODE1

NODE2

NODE3 - // The position of NODE2 in COMMON_ANCESTOR is somewhere between after NODE1(idx1) and before NODE3(idx2), so we let that be 1.5 - - // container node A in common ancestor container - var oNodeA = oContainerA; - if(oNodeA != oCommonAncestor){ - while((oTmpNode = xe.DOMFix.parentNode(oNodeA)) != oCommonAncestor){oNodeA = oTmpNode;} - - iIdxA = this._getPosIdx(oNodeA)+0.5; - }else iIdxA = iOffsetA; - - // container node B in common ancestor container - var oNodeB = oContainerB; - if(oNodeB != oCommonAncestor){ - while((oTmpNode = xe.DOMFix.parentNode(oNodeB)) != oCommonAncestor){oNodeB = oTmpNode;} - - iIdxB = this._getPosIdx(oNodeB)+0.5; - }else iIdxB = iOffsetB; - - return compareIdx(iIdxA, iIdxB); - }, - - _getCommonAncestorContainer : function(oNode1, oNode2){ - var oComparingNode = oNode2; - - while(oNode1){ - while(oComparingNode){ - if(oNode1 == oComparingNode) return oNode1; - oComparingNode = xe.DOMFix.parentNode(oComparingNode); - } - oComparingNode = oNode2; - oNode1 = xe.DOMFix.parentNode(oNode1); - } - - return this._document.body; - }, - - deleteContents : function(){ - if(this.collapsed) return; - - this._splitTextEndNodesOfTheRange(); - - var aNodes = this._getNodesInRange(); - - if(aNodes.length < 1) return; - - var oPrevNode = aNodes[0].previousSibling; - while(oPrevNode && this._isBlankTextNode(oPrevNode)) oPrevNode = oPrevNode.previousSibling; - - var oNewStartContainer, iNewOffset; - if(!oPrevNode){ - oNewStartContainer = xe.DOMFix.parentNode(aNodes[0]); - iNewOffset = 0; - } - - for(var i=0; i oNode.nodeValue.length) iOffset = oNode.nodeValue.length; - }else{ - if(iOffset > xe.DOMFix.childNodes(oNode).length) iOffset = xe.DOMFix.childNodes(oNode).length; - } - - return iOffset; - }, - - - setEnd : function(refNode, offset){ - offset = this._endsNodeValidation(refNode, offset); - - this.endContainer = refNode; - this.endOffset = offset; - if(!this.startContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(false); - - this._updateRangeInfo(); - }, - - setEndAfter : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter"); - - if(refNode.tagName == "BODY"){ - this.setEnd(refNode, xe.DOMFix.childNodes(refNode).length); - return; - } - this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); - }, - - setEndBefore : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore"); - - if(refNode.tagName == "BODY"){ - this.setEnd(refNode, 0); - return; - } - - this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); - }, - - setStart : function(refNode, offset){ - offset = this._endsNodeValidation(refNode, offset); - - this.startContainer = refNode; - this.startOffset = offset; - - if(!this.endContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(true); - this._updateRangeInfo(); - }, - - setStartAfter : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter"); - - if(refNode.tagName == "BODY"){ - this.setStart(refNode, xe.DOMFix.childNodes(refNode).length); - return; - } - - this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); - }, - - setStartBefore : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore"); - - if(refNode.tagName == "BODY"){ - this.setStart(refNode, 0); - return; - } - this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); - }, - - surroundContents : function(newParent){ - newParent.appendChild(this.extractContents()); - this.insertNode(newParent); - this.selectNode(newParent); - }, - - toString : function(){ - var oTmpContainer = this._document.createElement("DIV"); - oTmpContainer.appendChild(this.cloneContents()); - - return oTmpContainer.textContent || oTmpContainer.innerText || ""; - }, - - _isBlankTextNode : function(oNode){ - if(oNode.nodeType == 3 && oNode.nodeValue == "") return true; - return false; - }, - - _getPosIdx : function(refNode){ - var idx = 0; - for(var node = refNode.previousSibling; node; node = node.previousSibling) idx++; - - return idx; - }, - - _updateRangeInfo : function(){ - if(!this.startContainer){ - this.init(this._document); - return; - } - - this.collapsed = this._isCollapsed(this.startContainer, this.startOffset, this.endContainer, this.endOffset); - - this.commonAncestorContainer = this._getCommonAncestorContainer(this.startContainer, this.endContainer); - }, - - _isCollapsed : function(oStartContainer, iStartOffset, oEndContainer, iEndOffset){ - var bCollapsed = false; - - if(oStartContainer == oEndContainer && iStartOffset == iEndOffset){ - bCollapsed = true; - }else{ - var oActualStartNode = this._getActualStartNode(oStartContainer, iStartOffset); - var oActualEndNode = this._getActualEndNode(oEndContainer, iEndOffset); - - // Take the parent nodes on the same level for easier comparison when they're next to each other - // eg) From - // - // - // - // - // - // - // - // - // - // - // - // - // , it's easier to compare the position of B and D rather than C and F because they are siblings - // - // If the range were collapsed, oActualEndNode will precede oActualStartNode by doing this - oActualStartNode = this._getNextNode(this._getPrevNode(oActualStartNode)); - oActualEndNode = this._getPrevNode(this._getNextNode(oActualEndNode)); - - if(oActualStartNode && oActualEndNode && oActualEndNode.tagName != "BODY" && - (this._getNextNode(oActualEndNode) == oActualStartNode || (oActualEndNode == oActualStartNode && this._isBlankTextNode(oActualEndNode))) - ) - bCollapsed = true; - } - - return bCollapsed; - }, - - _splitTextEndNodesOfTheRange : function(){ - var oEndPoints = this._splitTextEndNodes({oStartContainer: this.startContainer, iStartOffset: this.startOffset, - oEndContainer: this.endContainer, iEndOffset: this.endOffset}); - - this.startContainer = oEndPoints.oStartContainer; - this.startOffset = oEndPoints.iStartOffset; - - this.endContainer = oEndPoints.oEndContainer; - this.endOffset = oEndPoints.iEndOffset; - }, - - _splitTextEndNodes : function(oEndPoints){ - oEndPoints = this._splitStartTextNode(oEndPoints); - oEndPoints = this._splitEndTextNode(oEndPoints); - - return oEndPoints; - }, - - _splitStartTextNode : function(oEndPoints){ - var oStartContainer = oEndPoints.oStartContainer; - var iStartOffset = oEndPoints.iStartOffset; - - var oEndContainer = oEndPoints.oEndContainer; - var iEndOffset = oEndPoints.iEndOffset; - - if(!oStartContainer) return oEndPoints; - if(oStartContainer.nodeType != 3) return oEndPoints; - if(iStartOffset == 0) return oEndPoints; - - if(oStartContainer.nodeValue.length <= iStartOffset) return oEndPoints; - - var oLastPart = oStartContainer.splitText(iStartOffset); - - if(oStartContainer == oEndContainer){ - iEndOffset -= iStartOffset; - oEndContainer = oLastPart; - } - oStartContainer = oLastPart; - iStartOffset = 0; - - return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; - }, - - _splitEndTextNode : function(oEndPoints){ - var oStartContainer = oEndPoints.oStartContainer; - var iStartOffset = oEndPoints.iStartOffset; - - var oEndContainer = oEndPoints.oEndContainer; - var iEndOffset = oEndPoints.iEndOffset; - - if(!oEndContainer) return oEndPoints; - if(oEndContainer.nodeType != 3) return oEndPoints; - - if(iEndOffset >= oEndContainer.nodeValue.length) return oEndPoints; - if(iEndOffset == 0) return oEndPoints; - - oEndContainer.splitText(iEndOffset); - - return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; - }, - - _getNodesInRange : function(){ - if(this.collapsed) return []; - - var oStartNode = this._getActualStartNode(this.startContainer, this.startOffset); - var oEndNode = this._getActualEndNode(this.endContainer, this.endOffset); - - return this._getNodesBetween(oStartNode, oEndNode); - }, - - _getActualStartNode : function(oStartContainer, iStartOffset){ - var oStartNode = oStartContainer;; - - if(oStartContainer.nodeType == 3){ - if(iStartOffset >= oStartContainer.nodeValue.length){ - oStartNode = this._getNextNode(oStartContainer); - if(oStartNode.tagName == "BODY") oStartNode = null; - }else{ - oStartNode = oStartContainer; - } - }else{ - if(iStartOffset < xe.DOMFix.childNodes(oStartContainer).length){ - oStartNode = xe.DOMFix.childNodes(oStartContainer)[iStartOffset]; - }else{ - oStartNode = this._getNextNode(oStartContainer); - if(oStartNode.tagName == "BODY") oStartNode = null; - } - } - - return oStartNode; - }, - - _getActualEndNode : function(oEndContainer, iEndOffset){ - var oEndNode = oEndContainer; - - if(iEndOffset == 0){ - oEndNode = this._getPrevNode(oEndContainer); - if(oEndNode.tagName == "BODY") oEndNode = null; - }else if(oEndContainer.nodeType == 3){ - oEndNode = oEndContainer; - }else{ - oEndNode = xe.DOMFix.childNodes(oEndContainer)[iEndOffset-1]; - } - - return oEndNode; - }, - - _getNextNode : function(oNode){ - if(!oNode || oNode.tagName == "BODY") return this._document.body; - - if(oNode.nextSibling) return oNode.nextSibling; - - return this._getNextNode(xe.DOMFix.parentNode(oNode)); - }, - - _getPrevNode : function(oNode){ - if(!oNode || oNode.tagName == "BODY") return this._document.body; - - if(oNode.previousSibling) return oNode.previousSibling; - - return this._getPrevNode(xe.DOMFix.parentNode(oNode)); - }, - - // includes partially selected - // for
, _getNodesBetween(b, c) will yield to b, "a" and c - _getNodesBetween : function(oStartNode, oEndNode){ - var aNodesBetween = []; - this._nNodesBetweenLen = 0; - - if(!oStartNode || !oEndNode) return aNodesBetween; - - this._recurGetNextNodesUntil(oStartNode, oEndNode, aNodesBetween); - return aNodesBetween; - }, - - _recurGetNextNodesUntil : function(oNode, oEndNode, aNodesBetween){ - if(!oNode) return false; - - if(!this._recurGetChildNodesUntil(oNode, oEndNode, aNodesBetween)) return false; - - var oNextToChk = oNode.nextSibling; - - while(!oNextToChk){ - if(!(oNode = xe.DOMFix.parentNode(oNode))) return false; - - aNodesBetween[this._nNodesBetweenLen++] = oNode; - - if(oNode == oEndNode) return false; - - oNextToChk = oNode.nextSibling; - } - - return this._recurGetNextNodesUntil(oNextToChk, oEndNode, aNodesBetween); - }, - - _recurGetChildNodesUntil : function(oNode, oEndNode, aNodesBetween){ - if(!oNode) return false; - - var bEndFound = false; - var oCurNode = oNode; - if(oCurNode.firstChild){ - oCurNode = oCurNode.firstChild; - while(oCurNode){ - if(!this._recurGetChildNodesUntil(oCurNode, oEndNode, aNodesBetween)){ - bEndFound = true; - break; - } - oCurNode = oCurNode.nextSibling; - } - } - - aNodesBetween[this._nNodesBetweenLen++] = oNode; - - if(bEndFound) return false; - if(oNode == oEndNode) return false; - - return true; - } -}); - -xe.W3CDOMRange.START_TO_START = 0; -xe.W3CDOMRange.START_TO_END = 1; -xe.W3CDOMRange.END_TO_END = 2; -xe.W3CDOMRange.END_TO_START = 3; - - -/** - * @fileOverview This file contains a cross-browser function that implements all of the W3C's DOM Range specification and some more - * @name XpressRange.js - */ -xe.XpressRange = $.Class({ - setWindow : function(win){ - this._window = win; - this._document = win.document; - }, - - $init : function(win){ - this.HUSKY_BOOMARK_START_ID_PREFIX = "xpress_bookmark_start_"; - this.HUSKY_BOOMARK_END_ID_PREFIX = "xpress_bookmark_end_"; - - this.sBlockElement = "P|DIV|LI|H[1-6]|PRE"; - this.sBlockContainer = "BODY|TABLE|TH|TR|TD|UL|OL|BLOCKQUOTE|FORM"; - - this.rxBlockElement = new RegExp("^("+this.sBlockElement+")$"); - this.rxBlockContainer = new RegExp("^("+this.sBlockContainer+")$") - this.rxLineBreaker = new RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$") - - this.setWindow(win); - - this.oSimpleSelection = new xe.SimpleSelection(this._window); - this.selectionLoaded = this.oSimpleSelection.selectionLoaded; - - this.$super.$init(this._document); - }, - - select : function(){ - this.oSimpleSelection.selectRange(this); - }, - - setFromSelection : function(iNum){ - this.setRange(this.oSimpleSelection.getRangeAt(iNum)); - }, - - setRange : function(oW3CRange){ - this.setStart(oW3CRange.startContainer, oW3CRange.startOffset); - this.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); - }, - - setEndNodes : function(oSNode, oENode){ - this.setEndAfter(oENode); - this.setStartBefore(oSNode); - }, - - splitTextAtBothEnds : function(){ - this._splitTextEndNodesOfTheRange(); - }, - - getStartNode : function(){ - if(this.collapsed){ - if(this.startContainer.nodeType == 3){ - if(this.startOffset == 0) return null; - if(this.startContainer.nodeValue.length <= this.startOffset) return null; - return this.startContainer; - } - return null; - } - - if(this.startContainer.nodeType == 3){ - if(this.startOffset >= this.startContainer.nodeValue.length) return this._getNextNode(this.startContainer); - return this.startContainer; - }else{ - if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) return this._getNextNode(this.startContainer); - return xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; - } - }, - - getEndNode : function(){ - if(this.collapsed) return this.getStartNode(); - - if(this.endContainer.nodeType == 3){ - if(this.endOffset == 0) return this._getPrevNode(this.endContainer); - return this.endContainer; - }else{ - if(this.endOffset == 0) return this._getPrevNode(this.endContainer); - return xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; - } - }, - - getNodeAroundRange : function(bBefore, bStrict){ - if(this.collapsed && this.startContainer && this.startContainer.nodeType == 3) return this.startContainer; - if(!this.collapsed || (this.startContainer && this.startContainer.nodeType == 3)) return this.getStartNode(); - - var oBeforeRange, oAfterRange, oResult; - - if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) - oAfterRange = this._getNextNode(this.startContainer); - else - oAfterRange = xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; - - if(this.endOffset == 0) - oBeforeRange = this._getPrevNode(this.endContainer); - else - oBeforeRange = xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; - - if(bBefore){ - oResult = oBeforeRange; - if(!oResult && !bStrict) oResult = oAfterRange; - }else{ - oResult = oAfterRange; - if(!oResult && !bStrict) oResult = oBeforeRange; - } - - return oResult; - }, - - _getXPath : function(elNode){ - var sXPath = ""; - - while(elNode && elNode.nodeType == 1){ - sXPath = "/" + elNode.tagName+"["+this._getPosIdx4XPath(elNode)+"]" + sXPath; - elNode = xe.DOMFix.parentNode(elNode); - } - - return sXPath; - }, - - _getPosIdx4XPath : function(refNode){ - var idx = 0; - for(var node = refNode.previousSibling; node; node = node.previousSibling) - if(node.tagName == refNode.tagName) idx++; - - return idx; - }, - - // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes - _evaluateXPath : function(sXPath, oDoc){ - sXPath = sXPath.substring(1, sXPath.length-1); - var aXPath = sXPath.split(/\//); - var elNode = oDoc.body; - - for(var i=2; i -1 && elContainer){ - var aChildNodes = xe.DOMFix.childNodes(elContainer); - var elNode = null; - - var nIdx = nTextNodeIdx; - var nOffsetLeft = nOffset; - - while((elNode = aChildNodes[nIdx]) && elNode.nodeType == 3 && elNode.nodeValue.length < nOffsetLeft){ - nOffsetLeft -= elNode.nodeValue.length; - nIdx++; - } - - elContainer = xe.DOMFix.childNodes(elContainer)[nIdx]; - nOffset = nOffsetLeft; - } - - if(!elContainer){ - elContainer = this._document.body; - nOffset = 0; - } - return {elContainer: elContainer, nOffset: nOffset}; - }, - - // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes - getXPathBookmark : function(){ - var nTextNodeIdx1 = -1; - var htEndPt1 = {elContainer: this.startContainer, nOffset: this.startOffset}; - var elNode1 = this.startContainer; - if(elNode1.nodeType == 3){ - htEndPt1 = this._getFixedStartTextNode(); - nTextNodeIdx1 = this._getPosIdx(htEndPt1.elContainer); - elNode1 = xe.DOMFix.parentNode(elNode1); - } - var sXPathNode1 = this._getXPath(elNode1); - var oBookmark1 = {sXPath:sXPathNode1, nTextNodeIdx:nTextNodeIdx1, nOffset: htEndPt1.nOffset}; - - var nTextNodeIdx2 = -1; - var htEndPt2 = {elContainer: this.endContainer, nOffset: this.endOffset}; - var elNode2 = this.endContainer; - if(elNode2.nodeType == 3){ - htEndPt2 = this._getFixedEndTextNode(); - nTextNodeIdx2 = this._getPosIdx(htEndPt2.elContainer); - elNode2 = xe.DOMFix.parentNode(elNode2); - } - var sXPathNode2 = this._getXPath(elNode2); - var oBookmark2 = {sXPath:sXPathNode2, nTextNodeIdx:nTextNodeIdx2, nOffset: htEndPt2.nOffset}; - - return [oBookmark1, oBookmark2]; - }, - - moveToXPathBookmark : function(aBookmark){ - if(!aBookmark) return; - - var oBookmarkInfo1 = this._evaluateXPathBookmark(aBookmark[0]); - var oBookmarkInfo2 = this._evaluateXPathBookmark(aBookmark[1]); - - if(!oBookmarkInfo1["elContainer"] || !oBookmarkInfo2["elContainer"]) return; - - this.startContainer = oBookmarkInfo1["elContainer"]; - this.startOffset = oBookmarkInfo1["nOffset"]; - - this.endContainer = oBookmarkInfo2["elContainer"]; - this.endOffset = oBookmarkInfo2["nOffset"]; - }, - - _getFixedTextContainer : function(elNode, nOffset){ - while(elNode && elNode.nodeType == 3 && elNode.previousSibling && elNode.previousSibling.nodeType == 3){ - nOffset += elNode.previousSibling.nodeValue.length; - elNode = elNode.previousSibling; - } - - return {elContainer:elNode, nOffset:nOffset}; - }, - - _getFixedStartTextNode : function(){ - return this._getFixedTextContainer(this.startContainer, this.startOffset); - }, - - _getFixedEndTextNode : function(){ - return this._getFixedTextContainer(this.endContainer, this.endOffset); - }, - - placeStringBookmark : function(){ - var sTmpId = (new Date()).getTime(); - - var oInsertionPoint = this.cloneRange(); - oInsertionPoint.collapseToEnd(); - var oEndMarker = this._document.createElement("A"); - oEndMarker.id = this.HUSKY_BOOMARK_END_ID_PREFIX+sTmpId; - oInsertionPoint.insertNode(oEndMarker); - - var oInsertionPoint = this.cloneRange(); - oInsertionPoint.collapseToStart(); - var oStartMarker = this._document.createElement("A"); - oStartMarker.id = this.HUSKY_BOOMARK_START_ID_PREFIX+sTmpId; - oInsertionPoint.insertNode(oStartMarker); - - this.moveToBookmark(sTmpId); - - return sTmpId; - }, - - cloneRange : function(){ - return this._copyRange(new xe.XpressRange(this._window)); - }, - - moveToBookmark : function(vBookmark){ - if(typeof(vBookmark) != "object") - this.moveToStringBookmark(vBookmark); - else - this.moveToXPathBookmark(vBookmark); - }, - - moveToStringBookmark : function(sBookmarkID){ - var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); - var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); - - if(!oStartMarker || !oEndMarker) return; - - this.setEndBefore(oEndMarker); - this.setStartAfter(oStartMarker); - }, - - removeStringBookmark : function(sBookmarkID){ - var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); - var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); - - if(oStartMarker) xe.DOMFix.parentNode(oStartMarker).removeChild(oStartMarker); - if(oEndMarker) xe.DOMFix.parentNode(oEndMarker).removeChild(oEndMarker); - }, - - collapseToStart : function(){ - this.collapse(true); - }, - - collapseToEnd : function(){ - this.collapse(false); - }, - - createAndInsertNode : function(sTagName){ - tmpNode = this._document.createElement(tagName); - this.insertNode(tmpNode) - return tmpNode - }, - - getNodes : function(bSplitTextEndNodes, fnFilter){ - if(bSplitTextEndNodes) this._splitTextEndNodesOfTheRange(); - - var aAllNodes = this._getNodesInRange(); - var aFilteredNodes = []; - - if(!fnFilter) return aAllNodes; - - for(var i=0; i= 0) return true; - - if(bIncludePartlyIncluded){ - if(startToEnd == 1) return false; - if(endToStart == -1) return false; - return true; - } - - return false; - }, - - isNodeInRange : function(oNode, bIncludePartlySelected, bContentOnly){ - var oTmpRange = new xe.XpressRange(this._window); - - if(bContentOnly && oNode.firstChild){ - oTmpRange.setStartBefore(oNode.firstChild); - oTmpRange.setEndAfter(oNode.lastChild); - }else{ - oTmpRange.selectNode(oNode); - } - - return isRangeInRange(oTmpRange, bIncludePartlySelected); - }, - - pasteHTML : function(sHTML){ - if(sHTML == ""){ - this.deleteContents(); - return; - } - - var oTmpDiv = this._document.createElement("DIV"); - oTmpDiv.innerHTML = sHTML; - - var oFirstNode = oTmpDiv.firstChild; - var oLastNode = oTmpDiv.lastChild; - - var clone = this.cloneRange(); - var sBM = clone.placeStringBookmark(); - - while(oTmpDiv.lastChild) this.insertNode(oTmpDiv.lastChild); - - this.setEndNodes(oFirstNode, oLastNode); - - // delete the content later as deleting it first may mass up the insertion point - // eg)

[A]BCD

---paste O---> O

BCD

- clone.moveToBookmark(sBM); - clone.deleteContents(); - clone.removeStringBookmark(sBM); - }, - - toString : function(){ - this.toString = xe.W3CDOMRange.prototype.toString; - return this.toString(); - }, - - toHTMLString : function(){ - var oTmpContainer = this._document.createElement("DIV"); - oTmpContainer.appendChild(this.cloneContents()); - - return oTmpContainer.innerHTML; - }, - - findAncestorByTagName : function(sTagName){ - var oNode = this.commonAncestorContainer; - while(oNode && oNode.tagName != sTagName) oNode = xe.DOMFix.parentNode(oNode); - - return oNode; - }, - - selectNodeContents : function(oNode){ - if(!oNode) return; - - var oFirstNode = oNode.firstChild?oNode.firstChild:oNode; - var oLastNode = oNode.lastChild?oNode.lastChild:oNode; - - if(oFirstNode.nodeType == 3) - this.setStart(oFirstNode, 0); - else - this.setStartBefore(oFirstNode); - - if(oLastNode.nodeType == 3) - this.setEnd(oLastNode, oLastNode.nodeValue.length); - else - this.setEndAfter(oLastNode); - }, - - styleRange : function(oStyle, oAttribute, sNewSpanMarker){ - var aStyleParents = this._getStyleParentNodes(sNewSpanMarker); - if(aStyleParents.length < 1) return; - - var sName, sValue; - - for(var i=0; i= 0)){ - oSNode = this.getNodeAroundRange(false, true); - oENode = this.getNodeAroundRange(false, true); - oStart = this._getLineStartInfo(oSNode); - oEnd = this._getLineEndInfo(oENode); - } - - return {oStart: oStart, oEnd: oEnd}; - } -}).extend(xe.W3CDOMRange); - -/** - * @fileOverview This file contains cross-browser selection function - * @name SimpleSelection.js - */ -xe.SimpleSelection = function(win){ - this.init = function(win){ - this._window = win || window; - this._document = this._window.document; - }; - - this.init(win); - - if($.browser.msie) - xe.SimpleSelectionImpl_IE.apply(this); - else - xe.SimpleSelectionImpl_FF.apply(this); - - this.selectRange = function(oRng){ - this.selectNone(); - this.addRange(oRng); - }; - - this.selectionLoaded = true; - if(!this._oSelection) this.selectionLoaded = false; -}; - -xe.SimpleSelectionImpl_FF = function(){ - this._oSelection = this._window.getSelection(); - - this.getRangeAt = function(iNum){ - iNum = iNum || 0; - - try{ - var oFFRange = this._oSelection.getRangeAt(iNum); - }catch(e){return new xe.W3CDOMRange(this._document);} - - return this._FFRange2W3CRange(oFFRange); - }; - - this.addRange = function(oW3CRange){ - var oFFRange = this._W3CRange2FFRange(oW3CRange); - this._oSelection.addRange(oFFRange); - }; - - this.selectNone = function(){ - this._oSelection.removeAllRanges(); - }; - - this._FFRange2W3CRange = function(oFFRange){ - var oW3CRange = new xe.W3CDOMRange(this._document); - oW3CRange.setStart(oFFRange.startContainer, oFFRange.startOffset); - oW3CRange.setEnd(oFFRange.endContainer, oFFRange.endOffset); - return oW3CRange; - }; - - this._W3CRange2FFRange = function(oW3CRange){ - var oFFRange = this._document.createRange(); - oFFRange.setStart(oW3CRange.startContainer, oW3CRange.startOffset); - oFFRange.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); - - return oFFRange; - }; -}; - -xe.SimpleSelectionImpl_IE = function(){ - this._oSelection = this._document.selection; - - this.getRangeAt = function(iNum){ - iNum = iNum || 0; - - if(this._oSelection.type == "Control"){ - var oW3CRange = new xe.W3CDOMRange(this._document); - - var oSelectedNode = this._oSelection.createRange().item(iNum); - - // if the selction occurs in a different document, ignore - if(!oSelectedNode || oSelectedNode.ownerDocument != this._document) return oW3CRange; - - oW3CRange.selectNode(oSelectedNode); - - return oW3CRange; - }else{ - var oSelectedNode = this._oSelection.createRangeCollection().item(iNum).parentElement(); - - // if the selction occurs in a different document, ignore - if(!oSelectedNode || oSelectedNode.ownerDocument != this._document){ - var oW3CRange = new xe.W3CDOMRange(this._document); - return oW3CRange; - } - return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(iNum)); - } - }; - - this.addRange = function(oW3CRange){ - var oIERange = this._W3CRange2IERange(oW3CRange); - oIERange.select(); - }; - - this.selectNone = function(){ - this._oSelection.empty(); - }; - - this._W3CRange2IERange = function(oW3CRange){ - var oStartIERange = this._getIERangeAt(oW3CRange.startContainer, oW3CRange.startOffset); - var oEndIERange = this._getIERangeAt(oW3CRange.endContainer, oW3CRange.endOffset); - oStartIERange.setEndPoint("EndToEnd", oEndIERange); - - return oStartIERange; - }; - - this._getIERangeAt = function(oW3CContainer, iW3COffset){ - var oIERange = this._document.body.createTextRange(); - - var oEndPointInfoForIERange = this._getSelectableNodeAndOffsetForIE(oW3CContainer, iW3COffset); - - var oSelectableNode = oEndPointInfoForIERange.oSelectableNodeForIE; - var iIEOffset = oEndPointInfoForIERange.iOffsetForIE; - - oIERange.moveToElementText(oSelectableNode); - oIERange.collapse(oEndPointInfoForIERange.bCollapseToStart); - oIERange.moveStart("character", iIEOffset); - - return oIERange; - }; - - this._getSelectableNodeAndOffsetForIE = function(oW3CContainer, iW3COffset){ - var oIERange = this._document.body.createTextRange(); - - var oNonTextNode = null; - var aChildNodes = null; - var iNumOfLeftNodesToCount = 0; - - if(oW3CContainer.nodeType == 3){ - oNonTextNode = xe.DOMFix.parentNode(oW3CContainer); - aChildNodes = xe.DOMFix.childNodes(oNonTextNode); - iNumOfLeftNodesToCount = aChildNodes.length; - }else{ - oNonTextNode = oW3CContainer; - aChildNodes = xe.DOMFix.childNodes(oNonTextNode); - iNumOfLeftNodesToCount = iW3COffset; - } - - var oNodeTester = null; - - var iResultOffset = 0; - - var bCollapseToStart = true; - - for(var i=0; i=0) break; - - oPrevNonTextNode = aChildNodes[i]; - } - - var pointRangeIdx = i; - - if(pointRangeIdx != 0 && aChildNodes[pointRangeIdx-1].nodeType == 3){ - var oRgTextStart = this._document.body.createTextRange(); - var oCurTextNode = null; - if(oPrevNonTextNode){ - oRgTextStart.moveToElementText(oPrevNonTextNode); - oRgTextStart.collapse(false); - oCurTextNode = oPrevNonTextNode.nextSibling; - }else{ - oRgTextStart.moveToElementText(oContainer); - oRgTextStart.collapse(true); - oCurTextNode = oContainer.firstChild; - } - - var oRgTextsUpToThePoint = oRgOrigPoint.duplicate(); - oRgTextsUpToThePoint.setEndPoint("StartToStart", oRgTextStart); - - var textCount = oRgTextsUpToThePoint.text.length - - while(textCount > oCurTextNode.nodeValue.length && oCurTextNode.nextSibling){ - textCount -= oCurTextNode.nodeValue.length; - oCurTextNode = oCurTextNode.nextSibling; - } - - // this will enforce IE to re-reference oCurTextNode - var oTmp = oCurTextNode.nodeValue; - - if(bStartPt && oCurTextNode.nextSibling && oCurTextNode.nextSibling.nodeType == 3 && textCount == oCurTextNode.nodeValue.length){ - textCount -= oCurTextNode.nodeValue.length; - oCurTextNode = oCurTextNode.nextSibling; - } - - oContainer = oCurTextNode; - offset = textCount; - }else{ - oContainer = oRgOrigPoint.parentElement(); - offset = pointRangeIdx; - } - - return {"oContainer" : oContainer, "iOffset" : offset}; - }; -} - -xe.DOMFix = new ($.Class({ - $init : function(){ - if($.browser.msie || $.browser.opera){ - this.childNodes = this._childNodes_Fix; - this.parentNode = this._parentNode_Fix; - }else{ - this.childNodes = this._childNodes_Native; - this.parentNode = this._parentNode_Native; - } - }, - - _parentNode_Native : function(elNode){ - return elNode.parentNode; - }, - - _parentNode_Fix : function(elNode){ - if(!elNode) return elNode; - - while(elNode.previousSibling){elNode = elNode.previousSibling;} - - return elNode.parentNode; - }, - - _childNodes_Native : function(elNode){ - return elNode.childNodes; - }, - - _childNodes_Fix : function(elNode){ - var aResult = null; - var nCount = 0; - - if(elNode){ - var aResult = []; - elNode = elNode.firstChild; - while(elNode){ - aResult[nCount++] = elNode; - elNode=elNode.nextSibling; - } - } - - return aResult; - } -}))(); - -/** - * @fileOverview This file contains a function that takes care of the draggable layers - * @name N_DraggableLayer.js - */ -xe.DraggableLayer = $.Class({ - $init : function(oLayer, oOptions){ - this.oOptions = $.extend({ - bModal : "false", - oHandle : oLayer, - iMinX : -999999, - iMinY : -999999, - iMaxX : 999999, - iMaxY : 999999 - }, oOptions); - - this.oHandle = this.oOptions.oHandle; - - oLayer.style.display = "block"; - oLayer.style.position = "absolute"; - oLayer.style.zIndex = "9999"; - - this.aBasePosition = this.getBaseOffset(oLayer); - - // "number-ize" the position and set it as inline style. (the position could've been set as "auto" or set by css, not inline style) - oLayer.style.top = (this.toInt($(oLayer).offset().top) - this.aBasePosition.top)+"px"; - oLayer.style.left = (this.toInt($(oLayer).offset().left) - this.aBasePosition.left)+"px"; - - this.$FnMouseDown = $.fnBind(this._mousedown, this, oLayer); - this.$FnMouseMove = $.fnBind(this._mousemove, this, oLayer); - this.$FnMouseUp = $.fnBind(this._mouseup, this, oLayer); - - $(this.oHandle).bind("mousedown", this.$FnMouseDown); - }, - - _mousedown : function(oLayer, oEvent){ - if(oEvent.target.tagName == "INPUT") return; - - this.MouseOffsetY = (oEvent.pageY-this.toInt(oLayer.style.top)-this.aBasePosition['top']); - this.MouseOffsetX = (oEvent.pageX-this.toInt(oLayer.style.left)-this.aBasePosition['left']); - - $(oLayer).bind("mousemove", this.$FnMouseMove); - $(oLayer).bind("mouseup", this.$FnMouseUp); - }, - - _mousemove : function(oLayer, oEvent){ - var iTop = (oEvent.pageY-this.MouseOffsetY-this.aBasePosition['top']); - var iLeft = (oEvent.pageX-this.MouseOffsetX-this.aBasePosition['left']); - - if(iTopthis.oOptions.iMaxY) iTop = this.oOptions.iMaxY; - - if(iLeftthis.oOptions.iMaxX) iLeft = this.oOptions.iMaxX; - - oLayer.style.top = iTop + "px"; - oLayer.style.left = iLeft + "px"; - }, - - _mouseup : function(oLayer, oEvent){ - $(oLayer).unbind("mousemove", this.$FnMouseMove); - $(oLayer).unbind("mouseup", this.$FnMouseUp); - }, - - toInt : function(num){ - var result = parseInt(num); - return result || 0; - }, - - findNonStatic : function(oEl){ - if(!oEl) return null; - if(oEl.tagName == "BODY") return oEl; - - if($(oEl).css("position").match(/absolute|relative/i)) return oEl; - - return this.findNonStatic(oEl.offsetParent); - }, - - getBaseOffset : function(oEl){ - var oBase = this.findNonStatic(oEl.offsetParent); - var tmp = $(oBase).offset(); - - return {top: tmp.top, left: tmp.left}; - } -}); -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the messages related to core operations - * @name hp_CorePlugin.js - */ -xe.CorePlugin = $.Class({ - name : "CorePlugin", - - $init : function(funcOnReady){ - this.funcOnReady = funcOnReady; - }, - - $AFTER_MSG_APP_READY : function(){ - this.oApp.exec("EXEC_ON_READY_FUNCTION", []); - }, - - $ON_ADD_APP_PROPERTY : function(sPropertyName, oProperty){ - this.oApp[sPropertyName] = oProperty; - }, - - $ON_REGISTER_BROWSER_EVENT : function(obj, sEvent, sCMD, aParams, nDelay){ - this.oApp.registerBrowserEvent(obj, sEvent, sCMD, aParams, nDelay); - }, - - $ON_DISABLE_COMMAND : function(sCommand){ - this.oApp.disableCommand(sCommand, true); - }, - - $ON_ENABLE_COMMAND : function(sCommand){ - this.oApp.disableCommand(sCommand, false); - }, - - $ON_EXEC_ON_READY_FUNCTION : function(){ - if(typeof this.funcOnReady == "function") this.funcOnReady(); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that helps various operations. - * @name hp_Utils.js - */ - xe.Utils = $.Class({ - name : "Utils", - - $init : function(){ - if($.browser.msie && $.browser.nVersion == 6){ - try{ - document.execCommand('BackgroundImageCache', false, true); - }catch(e){} - } - }, - - $ON_ATTACH_HOVER_EVENTS : function(aElms, sHoverClass){ - sHoverClass = sHoverClass || "hover"; - - if(!aElms) return; - - $(aElms).hover( - function(){$(this).addClass(sHoverClass)}, - function(){$(this).removeClass(sHoverClass)} - ); - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that bridges the XpressRange function - * @name hp_XpressRangeManager.js - */ -xe.XpressRangeManager = $.Class({ - name : "XpressRangeManager", - - oWindow : null, - - $init : function(win){ - this.oWindow = win || window; - }, - - $BEFORE_MSG_APP_READY : function(){ - if(this.oWindow && this.oWindow.tagName == "IFRAME") - this.oWindow = this.oWindow.contentWindow; - - this.oApp.exec("ADD_APP_PROPERTY", ["getSelection", $.fnBind(this.getSelection, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["getEmptySelection", $.fnBind(this.getEmptySelection, this)]); - }, - - $ON_SET_EDITING_WINDOW : function(oWindow){ - this.oWindow = oWindow; - }, - - getEmptySelection : function(){ - var oXpressRange = new xe.XpressRange(this.oWindow); - return oXpressRange; - }, - - getSelection : function(){ - this.oApp.exec("RESTORE_IE_SELECTION", []); - - var oXpressRange = this.getEmptySelection(); - - // this may throw an exception if the selected is area is not yet shown - try{ - oXpressRange.setFromSelection(); - }catch(e){} - - return oXpressRange; - } -}); -//} -xe.Hotkey = $.Class({ - name : "Hotkey", - - storage : {}, - keyhash : {}, - - $init : function(){ - this.storage = {}; - - this.keyhash = { - backspace : 8, - tab : 9, - enter : 13, - shift : 16, - ctrl : 17, - alt : 18, - meta : 224, - esc : 27, - space : 32, - pageup : 33, - pagedown : 34, - end : 35, - home : 36, - left : 37, - up : 38, - right : 39, - down : 40, - del : 46, - comma : 188,//(,) - period : 190,//(.) - slash : 191,//(/) - hyphen : 109, - equal : 61 - }; - - if ($.browser.msie || $.browser.safari) { - this.keyhash.hyphen = 189; // (-) - this.keyhash.equal = 187; // (=) - this.keyhash.meta = 91; // meta - } - - - }, - - $ON_MSG_APP_READY : function(){ - $(this.oApp.getWYSIWYGDocument() || document).keydown($.fnBind(this.keydown, this)); - }, - - $ON_REGISTER_HOTKEY : function(sHotkey, sCMD, sArgs){ - if(!sArgs) sArgs = []; - var func = $.fnBind(this.oApp.exec, this.oApp, sCMD, sArgs); - - sHotkey = this.normalize(sHotkey); - if (!sHotkey) return false; - - this.add(sHotkey, func); - }, - - add : function(sHotkey, func) { - if (typeof this.storage[sHotkey] == 'undefined') { - this.storage[sHotkey] = [func]; - } else { - this.storage[sHotkey].push(func); - } - }, - - keydown : function(event) { - var key = [], kh = this.keyhash; - - if ($.inArray(event.keyCode, [kh.shift, kh.ctrl, kh.alt, kh.meta]) >= 0) return; - - if (event.shiftKey) key.push('shift'); - if (event.altKey) key.push('alt'); - if (event.ctrlKey) key.push('ctrl'); - if (event.metaKey) key.push('meta'); - if (!key.length) return; - if (key.length == 1 && event.metaKey) key = ['ctrl', 'meta']; - - key.push(event.keyCode); - - key = key.join('+'); - - if (!this.storage[key]) return; - - $.each(this.storage[key], function(){ this(); }); - - return false; - }, - - normalize : function(sHotkey) { - var shift, ctrl, alt, meta, key, keys = (sHotkey||"").toLowerCase().split('+'); - - shift = ctrl = alt = meta = key = false; - - $.each(keys, function(){ - var s = ""+this; - switch(s) { - case 'shift': shift = true; - case 'alt' : alt = true; - case 'ctrl' : ctrl = true; - case 'meta' : meta = true; - default: - key = s; - } - }); - - if (!key) return ''; - - keys = []; - if (shift) keys.push('shift'); - if (alt) keys.push('alt'); - if (ctrl) keys.push('ctrl'); - if (meta || (ctrl && !shift && !alt)) keys.push('meta'); - - keys.push(this.keyhash[key] || key.toUpperCase().charCodeAt(0)); - - return keys.join('+'); - } -}); - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the draggable layers - * @name hp_DialogLayerManager.js - */ -xe.DialogLayerManager = $.Class({ - name : "DialogLayerManager", - aMadeDraggable : null, - aOpenedLayers : null, - - $init : function(){ - this.aMadeDraggable = []; - this.aOpenedLayers = []; - }, - - $ON_SHOW_DIALOG_LAYER : function(oLayer, bModal){ - oLayer = $.$(oLayer); - bModal = $.$(bModal) || false; - if(!oLayer) return; - - if($.inArray(oLayer, this.aOpenedLayers) != -1) return; - - this.oApp.exec("POSITION_DIALOG_LAYER", [oLayer]); - - this.aOpenedLayers[this.aOpenedLayers.length] = oLayer; - - if($.inArray(oLayer, this.aMadeDraggable) == -1){ - new xe.DraggableLayer(oLayer, {bModal: bModal, iMinY: 0}); - this.aMadeDraggable[this.aMadeDraggable.length] = oLayer; - }else{ - oLayer.style.display = "block"; - } - }, - - $ON_HIDE_LAST_DIALOG_LAYER : function(){ - this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[this.aOpenedLayers.length-1]]); - }, - - $ON_HIDE_ALL_DIALOG_LAYER : function(){ - for(var i=this.aOpenedLayers.length-1; i>=0; i--) - this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[i]]); - }, - - $ON_HIDE_DIALOG_LAYER : function(oLayer){ - oLayer = $.$(oLayer); - - if(oLayer) oLayer.style.display = "none"; - this.aOpenedLayers = $.grep(this.aOpenedLayers, function(a){return a!=oLayer}); - }, - - $ON_SET_DIALOG_LAYER_POSITION : function(oLayer, iTop, iLeft){ - oLayer.style.top = iTop; - oLayer.style.left = iLeft; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the layers that should disappear when the focus is lost - * @name hp_ActiveLayerManager.js - */ -xe.ActiveLayerManager = $.Class({ - name : "ActiveLayerManager", - oCurrentLayer : null, - - $ON_TOGGLE_ACTIVE_LAYER : function(oLayer, sOnOpenCmd, aOnOpenParam, sOnCloseCmd, aOnCloseParam){ - if(oLayer == this.oCurrentLayer){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }else{ - this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sOnCloseCmd, aOnCloseParam]); - if(sOnOpenCmd) this.oApp.exec(sOnOpenCmd, aOnOpenParam); - } - }, - - $ON_SHOW_ACTIVE_LAYER : function(oLayer, sOnCloseCmd, aOnCloseParam){ - oLayer = $.$(oLayer); - this.sOnCloseCmd = sOnCloseCmd; - this.aOnCloseParam = aOnCloseParam; - - var oPrevLayer = this.oCurrentLayer; - - if(oLayer == oPrevLayer) return; - - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - - oLayer.style.display = "block"; - this.oCurrentLayer = oLayer; - }, - - $ON_HIDE_ACTIVE_LAYER : function(){ - var oLayer = this.oCurrentLayer; - if(!oLayer) return; - oLayer.style.display = "none"; - this.oCurrentLayer = null; - - if(this.sOnCloseCmd) - this.oApp.exec(this.sOnCloseCmd, this.aOnCloseParam); - }, - - // for backward compatibility only. - // use HIDE_ACTIVE_LAYER instead! - $ON_HIDE_CURRENT_ACTIVE_LAYER : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }, - - $ON_EVENT_EDITING_AREA_KEYDOWN : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }, - - $ON_EVENT_EDITING_AREA_MOUSEDOWN : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to string conversion. Ususally used to convert the IR value. - * @name hp_StringConverterManager.js - */ -xe.StringConverterManager = $.Class({ - name : "StringConverterManager", - - oConverters : null, - - $init : function(){ - this.oConverters = {}; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oApp.exec("ADD_APP_PROPERTY", ["applyConverter", $.fnBind(this.applyConverter, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["addConverter", $.fnBind(this.addConverter, this)]); - }, - - applyConverter : function(sRuleName, sContent){ - var aConverters = this.oConverters[sRuleName]; - if(!aConverters) return sContent; - - for(var i=0; i*:first-child", aAllLi[i]).get(0); - } - } - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.toolbarArea, "mouseover", "EVENT_TOOLBAR_MOUSEOVER", []); - this.oApp.registerBrowserEvent(this.toolbarArea, "mouseout", "EVENT_TOOLBAR_MOUSEOUT", []); - - this.oApp.exec("ADD_APP_PROPERTY", ["getToolbarButtonByUIName", $.fnBind(this.getToolbarButtonByUIName, this)]); - }, - - $ON_EVENT_TOOLBAR_MOUSEOVER : function(weEvent){ - if(weEvent.target.tagName == "BUTTON") $(weEvent.target).addClass("hover").parent("span").addClass("hover"); - }, - - $ON_EVENT_TOOLBAR_MOUSEOUT : function(weEvent){ - if(weEvent.target.tagName == "BUTTON") $(weEvent.target).removeClass("hover").parent("span").removeClass("hover"); - }, - - $ON_TOGGLE_TOOLBAR_ACTIVE_LAYER : function(oLayer, oBtn, sOpenCmd, aOpenArgs, sCloseCmd, aCloseArgs){ - this.oApp.exec("TOGGLE_ACTIVE_LAYER", [oLayer, "MSG_TOOLBAR_LAYER_SHOWN", [oLayer, oBtn, sOpenCmd, aOpenArgs], sCloseCmd, aCloseArgs]); - }, - - $ON_MSG_TOOLBAR_LAYER_SHOWN : function(oLayer, oBtn, aOpenCmd, aOpenArgs){ - this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); - if(aOpenCmd) this.oApp.exec(aOpenCmd, aOpenArgs); - }, - - $ON_SHOW_TOOLBAR_ACTIVE_LAYER : function(oLayer, sCmd, aArgs, oBtn){ - this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sCmd, aArgs]); - this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); - }, - - $ON_ENABLE_UI : function(sUIName){ - var elUI = this.htUIList[sUIName]; - if(!elUI) return; - $(elUI).removeClass("off"); - elUI.disabled = false; - - // enable related commands - var sCmd = ""; - if(this.aUICmdMap[sUIName]){ - for(var i=0; i nToolbarLeft) oLayer.style.left = (nToolbarLeft-nLayerLeft-5)+"px"; - }, - - getToolbarButtonByUIName : function(sUIName){ - return this.htUIList[sUIName]; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that manages multiple number editing area plugins and the IR value - * @name hp_XE_EditingAreaManager.js - */ -xe.XE_EditingAreaManager = $.Class({ - name : "XE_EditingAreaManager", - - // Currently active plugin instance(XE_EditingArea_???) - oActivePlugin : null, - - // Intermediate Representation of the content being edited. - // This should be a textarea element. - oIRField : null, - - bIsDirty : false, - - $init : function(sInitialMode, oIRField, oDimension, fOnBeforeUnload, oAppContainer){ - this.sInitialMode = sInitialMode; - this.oIRField = $.$(oIRField); - this._assignHTMLObjects(oAppContainer); - this.fOnBeforeUnload = fOnBeforeUnload; - - this.oEditingMode = {}; - - this.elEditingAreaContainer.style.height = parseInt(oDimension.nHeight || this.elEditingAreaContainer.offsetHeight)+"px"; - - this.nMinHeight = oDimension.nMinHeight || 10; - this.niMinWidth = oDimension.nMinWidth || 10; - }, - - _assignHTMLObjects : function(oAppContainer){ - oAppContainer = $.$(oAppContainer) || document; - this.elEditingAreaContainer = $("DIV.xpress_xeditor_editing_area_container", oAppContainer).get(0); - this.elEditingAreaSkipUI = $("A.skip", oAppContainer).get(0); - }, - - $BEFORE_MSG_APP_READY : function(msg){ - this.oApp.exec("ADD_APP_PROPERTY", ["elEditingAreaContainer", this.elEditingAreaContainer]); - this.oApp.exec("ADD_APP_PROPERTY", ["getIR", $.fnBind(this.getIR, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["setIR", this.setIR]); - this.oApp.exec("ADD_APP_PROPERTY", ["getEditingMode", $.fnBind(this.getEditingMode, this)]); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.exec("CHANGE_EDITING_MODE", [this.sInitialMode, true]); - this.oApp.exec("LOAD_IR_FIELD", [false]); - - this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "focus", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); - this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "blur", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); - -// var fOnBeforeUnload = this.fOnBeforeUnload||function(){if(this.getIR() != this.oIRField.value || this.bIsDirty) return this.oApp.$MSG("XE_EditingAreaManager.onExit")}; -// $(window).bind("beforeunload", $.fnBind(fOnBeforeUnload, this)); - }, - - $AFTER_MSG_APP_READY : function(){ - this.oApp.exec("UPDATE_IR_FIELD", []); - }, - - $ON_LOAD_IR_FIELD : function(bDontAddUndo){ - this.oApp.setIR(this.oIRField.value, bDontAddUndo); - }, - - $ON_UPDATE_IR_FIELD : function(){ - this.oIRField.value = this.oApp.getIR(); - }, - - $BEFORE_CHANGE_EDITING_MODE : function(sMode){ - this._oPrevActivePlugin = this.oActivePlugin; - this.oActivePlugin = this.oEditingMode[sMode]; - }, - - $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - if(this._oPrevActivePlugin){ - var sIR = this._oPrevActivePlugin.getIR(); - this.oApp.exec("SET_IR", [sIR]); - - this.oApp.exec("ENABLE_UI", [this._oPrevActivePlugin.sMode]); - - this._setEditingAreaDimension(); - } - this.oApp.exec("DISABLE_UI", [this.oActivePlugin.sMode]); - - if(!bNoFocus){ - this.oApp.exec("FOCUS", []); - } - }, - - $ON_SET_IS_DIRTY : function(bIsDirty){ - this.bIsDirty = bIsDirty; - }, - - $ON_FOCUS : function(){ - if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return - - this.oActivePlugin.focus(); - }, - - $BEFORE_SET_IR : function(sIR, bDontAddUndoHistory){ - bDontAddUndoHistory = bDontAddUndoHistory || false; - if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); - }, - - $ON_SET_IR : function(sIR){ - if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return - - this.oActivePlugin.setIR(sIR); - }, - - $AFTER_SET_IR : function(sIR, bDontAddUndoHistory){ - bDontAddUndoHistory = bDontAddUndoHistory || false; - if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); - }, - - $ON_REGISTER_EDITING_AREA : function(oEditingAreaPlugin){ - this.oEditingMode[oEditingAreaPlugin.sMode] = oEditingAreaPlugin; - this.attachDocumentEvents(oEditingAreaPlugin.oEditingArea); - }, - - $ON_MSG_EDITING_AREA_RESIZE_STARTED : function(){ - this.oActivePlugin.elEditingArea.style.display = "none"; - - this.iStartingHeight = parseInt(this.elEditingAreaContainer.style.height); - }, - - $ON_RESIZE_EDITING_AREA: function(ipNewWidth, ipNewHeight){ - var iNewWidth = parseInt(ipNewWidth); - var iNewHeight = parseInt(ipNewHeight); - - if(iNewWidth < this.niMinWidth) iNewWidth = this.niMinWidth; - if(iNewHeight < this.nMinHeight) iNewHeight = this.nMinHeight; - - if(ipNewWidth) this.elEditingAreaContainer.style.width = iNewWidth + "px"; - if(ipNewHeight) this.elEditingAreaContainer.style.height = iNewHeight + "px"; - }, - - $ON_RESIZE_EDITING_AREA_BY : function(ipWidthChange, ipHeightChange){ - var iWidthChange = parseInt(ipWidthChange); - var iHeightChange = parseInt(ipHeightChange); - - var iWidth = this.elEditingAreaContainer.style.width?parseInt(this.elEditingAreaContainer.style.width)+iWidthChange:null; - var iHeight = this.elEditingAreaContainer.style.height?this.iStartingHeight+iHeightChange:null; - - this.oApp.exec("RESIZE_EDITING_AREA", [iWidth, iHeight]); - }, - - $ON_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ - this.oActivePlugin.elEditingArea.style.display = "block"; - this._setEditingAreaDimension(); - }, - - _setEditingAreaDimension : function(){ - this.oActivePlugin.elEditingArea.style.height = this.elEditingAreaContainer.style.height; - this.oActivePlugin.elEditingArea.style.width = this.elEditingAreaContainer.style.width; - }, - - attachDocumentEvents : function(doc){ - this.oApp.registerBrowserEvent(doc, "click", "EVENT_EDITING_AREA_CLICK"); - this.oApp.registerBrowserEvent(doc, "mousedown", "EVENT_EDITING_AREA_MOUSEDOWN"); - this.oApp.registerBrowserEvent(doc, "mousemove", "EVENT_EDITING_AREA_MOUSEMOVE"); - this.oApp.registerBrowserEvent(doc, "mouseup", "EVENT_EDITING_AREA_MOUSEUP"); - this.oApp.registerBrowserEvent(doc, "keydown", "EVENT_EDITING_AREA_KEYDOWN"); - this.oApp.registerBrowserEvent(doc, "keypress", "EVENT_EDITING_AREA_KEYPRESS"); - this.oApp.registerBrowserEvent(doc, "keyup", "EVENT_EDITING_AREA_KEYUP"); - }, - - getIR : function(){ - return this.oActivePlugin.getIR(); - }, - - setIR : function(sIR, bDontAddUndo){ - this.oApp.exec("SET_IR", [sIR, bDontAddUndo]); - }, - - getEditingMode : function(){ - return this.oActivePlugin.sMode; - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to editing the HTML source code using Textarea element - * @name hp_XE_EditingArea_HTMLSrc.js - * @required XE_EditingAreaManager - */ -xe.XE_EditingArea_HTMLSrc = $.Class({ - name : "XE_EditingArea_HTMLSrc", - - sMode : "HTMLSrc", - textarea : null, - - $init : function(textarea){ - this.textarea = $.$(textarea); - this.elEditingArea = this.textarea; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oEditingArea = this.textarea; - this.oApp.exec("REGISTER_EDITING_AREA", [this]); - }, - - $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - if(sMode == this.sMode){ - this.textarea.style.display = "block"; - }else{ - this.textarea.style.display = "none"; - } - }, - - $ON_PASTE_HTML : function(sHTML, oPSelection){ - if(this.oApp.getEditingMode() != this.sMode) return; - - var o = new TextRange(this.textarea); - o.paste(sHTML); - this.textarea.focus(); - }, - - getIR : function(){ - var sIR; - var sContent = this.textarea.value; - - if(this.oApp.applyConverter) - sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); - else - sIR = sContent; - - return sIR; - }, - - setIR : function(sIR){ - var sContent; - - if(this.oApp.applyConverter) - sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); - else - sContent = sIR; - - this.textarea.value = sContent; - }, - - focus : function(){ - this.textarea.focus(); - } -}); - -var TextRange = function(oEl) { - this._o = oEl; -}; - -/** - * Selection for textfield - * @author NAVER (developer@xpressengine.com) - */ -TextRange.prototype.getSelection = function() { - var obj = this._o; - var ret = [ -1, -1 ]; - - if (isNaN(this._o.selectionStart)) { - obj.focus(); - - // textarea support added by nagoon97 - var range = document.body.createTextRange(); - var rangeField = null; - - rangeField = document.selection.createRange().duplicate(); - range.moveToElementText(obj); - rangeField.collapse(true); - range.setEndPoint("EndToEnd", rangeField); - ret[0] = range.text.length; - - rangeField = document.selection.createRange().duplicate(); - range.moveToElementText(obj); - rangeField.collapse(false); - range.setEndPoint("EndToEnd", rangeField); - ret[1] = range.text.length; - - obj.blur(); - } else { - ret[0] = obj.selectionStart; - ret[1] = obj.selectionEnd; - } - - return ret; -}; - -TextRange.prototype.setSelection = function(start, end) { - - var obj = this._o; - if (typeof end == 'undefined') end = start; - - if (obj.setSelectionRange) { - - obj.setSelectionRange(start, end); - - } else if (obj.createTextRange) { - - var range = obj.createTextRange(); - - range.collapse(true); - range.moveStart("character", start); - range.moveEnd("character", end - start); - range.select(); - - obj.blur(); - } - -}; - -TextRange.prototype.copy = function() { - - var r = this.getSelection(); - return this._o.value.substring(r[0], r[1]); - -}; - -TextRange.prototype.paste = function(sStr) { - - var obj = this._o; - var sel = this.getSelection(); - - var value = obj.value; - - var pre = value.substr(0, sel[0]); - var post = value.substr(sel[1]); - - value = pre + sStr + post; - obj.value = value; - - var n = 0; - if ( typeof document.body.style.maxHeight == "undefined" ) { - var a = pre.match( /\n/gi ); - n = ( a != null ? a.length : 0 ); - } - this.setSelection(sel[0] + sStr.length - n ); - -}; - -TextRange.prototype.cut = function() { - var r = this.copy(); - this.paste(''); - - return r; -}; -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to WYSIWYG iframe - * @name hp_XE_EditingArea_WYSIWYG.js - */ -xe.XE_EditingArea_WYSIWYG = $.Class({ - name : "XE_EditingArea_WYSIWYG", - status : xe.PLUGIN_STATUS["NOT_READY"], - - sMode : "WYSIWYG", - iframe : null, - doc : null, - - iLastUndoRecorded : 0, - iMinUndoInterval : 3000, - - _nIFrameReadyCount : 50, - - $init : function(iframe){ - this.iframe = $.$(iframe); - - this.initIframe(); - - this.elEditingArea = iframe; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oEditingArea = this.doc; - this.oApp.exec("REGISTER_EDITING_AREA", [this]); - this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGWindow", $.fnBind(this.getWindow, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGDocument", $.fnBind(this.getDocument, this)]); - }, - - $ON_MSG_APP_READY : function(){ - // uncomment this line if you wish to use the IE-style cursor in FF - // this.getDocument().body.style.cursor = "text"; - - if($.browser.msie){ - $(this.doc) - .unbind('keydown.ea') - .bind('keydown.ea', $.fnBind( - function(weEvent){ - if(this.doc.selection.type.toLowerCase() == 'control' && weEvent.keyCode == 8) { - this.oApp.exec("EXECCOMMAND", ['delete', false, false]); - weEvent.preventDefault(); weEvent.stopPropagation(); - } - } - , this)); - - $(this.doc.body) - .unbind('mousedown.ea') - .bind('mousedown.ea', $.fnBind( - function(weEvent){ - this._oIERange = null; - this._bIERangeReset = true; - } - , this)) - .unbind('beforedeactivate.ea') - .bind('beforedeactivate.ea', $.fnBind( - function(weEvent){ - // without this, cursor won't make it inside a table. - // mousedown(_oIERange gets reset) -> beforedeactivate(gets fired for table) -> RESTORE_IE_SELECTION - if(this._bIERangeReset) return; - - var tmpRange = this.getDocument().selection.createRange(0); - // Control range does not have parentElement - if(tmpRange.parentElement && tmpRange.parentElement() && tmpRange.parentElement().tagName == "INPUT"){ - this._oIERange = this._oPrevIERange; - }else{ - this._oIERange = tmpRange; - } - } - , this)) - .unbind('mouseup.ea') - .bind('mouseup.ea', $.fnBind( function(weEvent){ this._bIERangeReset = false;}, this)); - } - }, - - $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - if(sMode == this.sMode){ - this.iframe.style.display = "block"; - - this.oApp.exec("REFRESH_WYSIWYG", []); - this.oApp.exec("SET_EDITING_WINDOW", [this.getWindow()]); - }else{ - this.iframe.style.display = "none"; - } - }, - - $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - this._oIERange = null; - }, - - $ON_REFRESH_WYSIWYG : function(){ - if(!$.browser.mozilla) return; - - this._disableWYSIWYG(); - this._enableWYSIWYG(); - }, - - $ON_ENABLE_WYSIWYG : function(){ - this._enableWYSIWYG(); - }, - - $ON_DISABLE_WYSIWYG : function(){ - this._disableWYSIWYG(); - }, - - $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent) { - // ctrl-left/right add/remove indent - if(!oEvent.ctrlKey) return; - - switch(oEvent.keyCode) { - // outdent - case 37 : - this.oApp.exec("EXECCOMMAND", ["outdent", false, false]); - break; - // indent - case 39 : - this.oApp.exec("EXECCOMMAND", ["indent", false, false]); - break; - // h1 ~ h6, normal - case 49 : - case 50 : - case 51 : - case 52 : - case 53 : - case 54 : - this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, '']); - break; - default : - return; - } - oEvent.preventDefault(); oEvent.stopPropagation(); - - }, - - $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ - // 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down - if(oEvent.keyCode == 229 || oEvent.keyCode == 13 || oEvent.altKey || oEvent.ctrlKey || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 16) return; - this._recordUndo(oEvent); - }, - - $ON_PASTE_HTML : function(sHTML, oPSelection){ - if(this.oApp.getEditingMode() != this.sMode) return; - - var oSelection = oPSelection || this.oApp.getSelection(); - oSelection.pasteHTML(sHTML); - - // every browser except for IE may modify the innerHTML when it is inserted - if(!$.browser.msie){ - var sTmpBookmark = oSelection.placeStringBookmark(); - this.oApp.getWYSIWYGDocument().body.innerHTML = this.oApp.getWYSIWYGDocument().body.innerHTML; - oSelection.moveToBookmark(sTmpBookmark); - oSelection.collapseToEnd(); - oSelection.select(); - oSelection.removeStringBookmark(sTmpBookmark); - } - - this.oApp.exec("RECORD_UNDO_ACTION", ["INSERT HTML"]); - }, - - $AFTER_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ - this.oApp.exec("REFRESH_WYSIWYG", []); - }, - - $ON_RESTORE_IE_SELECTION : function(){ - if(this._oIERange){ - this._oIERange.select(); - this._oPrevIERange = this._oIERange; - this._oIERange = null; - } - }, - - initIframe : function(){ - try { - this.doc = this.iframe.contentWindow.document; - if (this.doc == null || this.doc.location.href == 'about:blank') { - throw new Error('Access denied'); - } - - this._enableWYSIWYG(); - - this.status = xe.PLUGIN_STATUS["READY"]; - } catch(e) { - if(this._nIFrameReadyCount-- > 0){ - setTimeout($.fnBind(this.initIframe, this), 100); - }else{ - throw("iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). "); - } - } - }, - - getIR : function(){ - var sContent = this.doc.body.innerHTML; - var sIR; - - - if(this.oApp.applyConverter) - sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); - else - sIR = sContent; - - return sIR; - }, - - setIR : function(sIR){ - var sContent; - if(this.oApp.applyConverter) - sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); - else - sContent = sIR; - - this.doc.body.innerHTML = sContent; - - if($.browser.mozilla){ - if(this.doc.body.innerHTML == "") this.doc.body.innerHTML = "
"; - } - }, - - getWindow : function(){ - return this.iframe.contentWindow; - }, - - getDocument : function(){ - return this.iframe.contentWindow.document; - }, - - focus : function(){ - //this.getWindow().focus(); - //this.oApp.exec("RESTORE_IE_SELECTION", []); - }, - - _recordUndo : function(oKeyInfo){ - var curTime = new Date(); - if(curTime-this.iLastUndoRecorded < this.iMinUndoInterval) return; - this.oApp.exec("RECORD_UNDO_ACTION", ["KEYPRESS"]); - - this.iLastUndoRecorded = new Date(); - - this.prevKeyCode = oKeyInfo.keyCode; - }, - - _enableWYSIWYG : function(){ - if ($.browser.msie){ - this.doc.body.disabled = true; - this.doc.body.contentEditable = true; - this.doc.body.removeAttribute('disabled'); - } else { - this.doc.designMode = "on"; - } - }, - - _disableWYSIWYG : function(){ - if ($.browser.msie){ - this.doc.body.contentEditable = false; - } else { - this.doc.designMode = "off"; - } - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to resizing the editing area vertically - * @name hp_XE_EditingAreaVerticalResizer.js - */ -xe.XE_EditingAreaVerticalResizer = $.Class({ - name : "XE_EditingAreaVerticalResizer", - oResizeGrip : null, - - $init : function(oAppContainer){ - this._assignHTMLObjects(oAppContainer); - - this.$FnMouseDown = $.fnBind(this._mousedown, this); - this.$FnMouseMove = $.fnBind(this._mousemove, this); - this.$FnMouseUp = $.fnBind(this._mouseup, this); - - $(this.oResizeGrip).bind("mousedown", this.$FnMouseDown); - }, - - _assignHTMLObjects : function(oAppContainer){ - oAppContainer = $.$(oAppContainer) || document; - this.oResizeGrip = $(".xpress_xeditor_editingArea_verticalResizer", oAppContainer).get(0); - }, - - _mousedown : function(oEvent){ - this.iStartHeight = oEvent.clientY; - - $(document).bind("mousemove", this.$FnMouseMove); - $(document).bind("mouseup", this.$FnMouseUp); - - this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); - }, - - _mousemove : function(oEvent){ - var iHeightChange = oEvent.clientY - this.iStartHeight; - - this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]); - }, - - _mouseup : function(oEvent){ - $(document).unbind("mousemove", this.$FnMouseMove); - $(document).unbind("mouseup", this.$FnMouseUp); - - this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the basic editor commands - * @name hp_XE_ExecCommand.js - */ -xe.XE_ExecCommand = $.Class({ - name : "XE_ExecCommand", - oEditingArea : null, - - $init : function(oEditingArea){ - this.oEditingArea = oEditingArea; - }, - - $BEFORE_MSG_APP_READY : function(){ - // the right document will be available only when the src is completely loaded - if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") - this.oEditingArea = this.oEditingArea.contentWindow.document; - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+b", "EXECCOMMAND", ["bold", false, false]]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+u", "EXECCOMMAND", ["underline", false, false]]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+i", "EXECCOMMAND", ["italic", false, false]]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+d", "EXECCOMMAND", ["strikethrough", false, false]]); - - this.oApp.exec("REGISTER_UI_EVENT", ["bold", "click", "EXECCOMMAND", ["bold", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["underline", "click", "EXECCOMMAND", ["underline", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["italic", "click", "EXECCOMMAND", ["italic", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["lineThrough", "click", "EXECCOMMAND", ["strikethrough", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["superscript", "click", "EXECCOMMAND", ["superscript", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["subscript", "click", "EXECCOMMAND", ["subscript", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifyleft", "click", "EXECCOMMAND", ["justifyleft", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifycenter", "click", "EXECCOMMAND", ["justifycenter", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifyright", "click", "EXECCOMMAND", ["justifyright", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifyfull", "click", "EXECCOMMAND", ["justifyfull", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["orderedlist", "click", "EXECCOMMAND", ["insertorderedlist", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["unorderedlist", "click", "EXECCOMMAND", ["insertunorderedlist", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["outdent", "click", "EXECCOMMAND", ["outdent", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["indent", "click", "EXECCOMMAND", ["indent", false, false]]); - }, - - $BEFORE_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ - this._bOnlyCursorChanged = false; - - this.oApp.exec("FOCUS", []); - - if(sCommand.match(/^bold|underline|italic|strikethrough|superscript|subscript$/i)){ - var oSelection = this.oApp.getSelection(); - if(oSelection.collapsed) this._bOnlyCursorChanged = true; - } - - if(!this._bOnlyCursorChanged){ - this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", [sCommand]); - } - }, - - $ON_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ - bUserInterface = (bUserInterface == "" || bUserInterface)?bUserInterface:false; - vValue = (vValue == "" || vValue)?vValue:false; - - this.oEditingArea.execCommand(sCommand, bUserInterface, vValue); - }, - - $AFTER_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ - if(!this._bOnlyCursorChanged){ - this.oApp.exec("RECORD_UNDO_AFTER_ACTION", [sCommand]); - } - - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to wrapping the sentence around with a

tag when enter key is pressed - * @name hp_XE_WYSIWYGEnterKey.js - */ -xe.XE_WYSIWYGEnterKey = $.Class({ - name : "XE_WYSIWYGEnterKey", - // IE/Opera do not need this - unsupportedBrowser : ['ie', 'opera'], - oEditingArea : null, - - $init : function(oEditingArea){ - this.oEditingArea = oEditingArea; - }, - - $BEFORE_MSG_APP_READY : function(){ - // the right document will be available only when the src is completely loaded - if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") - this.oEditingArea = this.oEditingArea.contentWindow.document; - }, - - $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent){ - if(this.oApp.getEditingMode() != "WYSIWYG") return; - - if(oEvent.shiftKey) return; - - if(oEvent.keyCode == 13){ - var oSelection = this.oApp.getSelection(); - var sBM = oSelection.placeStringBookmark(); - var oLineInfo = oSelection.getLineInfo(); - var oStart = oLineInfo.oStart; - var oEnd = oLineInfo.oEnd; - - //top.document.title = oStart.oNode.tagName+":"+oStart.oNode.nodeValue+", "+oEnd.oNode.tagName+":"+oEnd.oNode.nodeValue+"::"+oStart.bParentBreak+", "+oStart.oLineBreaker.tagName; - - // line broke by sibling - // or - // the parent line breaker is just a block container - if(!oStart.bParentBreak || oSelection.rxBlockContainer.test(oStart.oLineBreaker.tagName)){ - oEvent.stopPropagation(); - oEvent.preventDefault(); - - var oSWrapper = this.oEditingArea.createElement("P"); - oSelection.moveToBookmark(sBM); - oSelection.setStartBefore(oStart.oNode); - oSelection.surroundContents(oSWrapper); - - oSelection.collapseToEnd(); - - var oEWrapper = this.oEditingArea.createElement("P"); - oSelection.setEndAfter(oEnd.oNode); - oSelection.surroundContents(oEWrapper); - - oSelection.removeStringBookmark(sBM); - - if(oSWrapper.innerHTML == "") oSWrapper.innerHTML = "
"; - if(oEWrapper.innerHTML == "") oEWrapper.innerHTML = "
"; - - if(oEWrapper.nextSibling && oEWrapper.nextSibling.tagName == "BR") oEWrapper.parentNode.removeChild(oEWrapper.nextSibling); - - oSelection.selectNodeContents(oEWrapper); - oSelection.collapseToStart(); - oSelection.select(); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }else{ - oSelection.removeStringBookmark(sBM); - } - } - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to styling the font - * @name hp_XE_WYSIWYGStyler.js - * @required XE_EditingArea_WYSIWYG, XpressRangeManager - */ -xe.XE_WYSIWYGStyler = $.Class({ - name : "XE_WYSIWYGStyler", - - $PRECONDITION : function(sFullCommand, aArgs){ - return (this.oApp.getEditingMode() == "WYSIWYG"); - }, - - $ON_SET_WYSIWYG_STYLE : function(oStyles){ - var oSelection = this.oApp.getSelection(); - - // style cursor - if(oSelection.collapsed){ - var oSpan = this.oApp.getWYSIWYGDocument().createElement("SPAN"); - oSelection.insertNode(oSpan); - oSpan.innerHTML = unescape("%uFEFF"); - - var sValue; - for(var sName in oStyles){ - sValue = oStyles[sName]; - - if(typeof sValue != "string") continue; - - oSpan.style[sName] = sValue; - } - - oSelection.selectNodeContents(oSpan); - oSelection.collapseToEnd(); - oSelection._window.focus(); - oSelection._window.document.body.focus(); - oSelection.select(); - - // FF3 will actually display %uFEFF when it is followed by a number AND certain font-family is used(like Gulim), so remove the chcaracter for FF3 - if($.browser.mozilla && $.browser.nVersion == 3) - oSpan.innerHTML = ""; - - return; - } - - this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", ["FONT STYLE"]); - - oSelection.styleRange(oStyles); - oSelection._window.focus(); - oSelection.select(); - - this.oApp.exec("RECORD_UNDO_AFTER_ACTION", ["FONT STYLE"]); - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to detecting the style change - * @name hp_XE_WYSIWYGStyleGetter.js - */ -xe.XE_WYSIWYGStyleGetter = $.Class({ - name : "XE_WYSIWYGStyleGetter", - - hKeyUp : null, - - getStyleInterval : 200, - - oStyleMap : { - fontFamily : { - type : "Value", - css : "fontFamily" - }, - fontSize : { - type : "Value", - css : "fontSize" - }, - lineHeight : { - type : "Value", - css : "lineHeight", - converter : function(sValue, oStyle){ - if(!sValue.match(/px$/)) return sValue; - - return Math.ceil((parseInt(sValue)/parseInt(oStyle.fontSize))*10)/10; - } - }, - bold : { - command : "bold" - }, - underline : { - command : "underline" - }, - italic : { - command : "italic" - }, - lineThrough : { - command : "strikethrough" - }, - superscript : { - command : "superscript" - }, - subscript : { - command : "subscript" - }, - justifyleft : { - command : "justifyleft" - }, - justifycenter : { - command : "justifycenter" - }, - justifyright : { - command : "justifyright" - }, - justifyfull : { - command : "justifyfull" - }, - orderedlist : { - command : "insertorderedlist" - }, - unorderedlist : { - command : "insertunorderedlist" - } - }, - - $init : function(){ - this.oStyle = this._getBlankStyle(); - }, - - $PRECONDITION : function(){ - if(this.oApp.getEditingMode() != "WYSIWYG") return false; - - return true; - }, - - $ON_MSG_APP_READY : function(){ - this.oDocument = this.oApp.getWYSIWYGDocument(); - this.oApp.exec("ADD_APP_PROPERTY", ["getCurrentStyle", $.fnBind(this.getCurrentStyle, this)]); - }, - - $ON_EVENT_EDITING_AREA_MOUSEUP : function(oEvnet){ - if(this.hKeyUp) clearTimeout(this.hKeyUp); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ - /* - backspace 8 - page up 33 - page down 34 - end 35 - home 36 - left arrow 37 - up arrow 38 - right arrow 39 - down arrow 40 - insert 45 - delete 46 - */ - if(!(oEvent.keyCode == 8 || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 45 || oEvent.keyCode == 46)) return; - - if(this.hKeyUp) clearTimeout(this.hKeyUp); - - this.hKeyUp = setTimeout($.fnBind(this.oApp.exec, this.oApp, "CHECK_STYLE_CHANGE", []), this.getStyleInterval); - }, - - $ON_CHECK_STYLE_CHANGE : function(){ - this._getStyle(); - }, - - $ON_RESET_STYLE_STATUS : function(){ - var oBlankStyle = this._getBlankStyle(); - for(var sAttributeName in oBlankStyle) - this.oApp.exec("SET_STYLE_STATUS", [sAttributeName, oBlankStyle[sAttributeName]]); - }, - - getCurrentStyle : function(){ - return this.oStyle; - }, - - _check_style_change : function(){ - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - _getBlankStyle : function(){ - var oBlankStyle = {}; - for(var attributeName in this.oStyleMap){ - if(this.oStyleMap[attributeName].type == "Value") - oBlankStyle[attributeName] = ""; - else - oBlankStyle[attributeName] = 0; - } - - return oBlankStyle; - }, - - _getStyle : function(){ - var oSelection = this.oApp.getSelection(); - - var funcFilter = function(oNode){ - if (!oNode.childNodes || oNode.childNodes.length == 0) - return true; - else - return false; - } - - var aBottomNodes = oSelection.getNodes(false, funcFilter); - - var oStyle, oBaseStyle, oTmpStyle, attributeName; - if(aBottomNodes.length == 0){ - oStyle = this._getStyleOf(oSelection.commonAncestorContainer); - }else{ - oStyle = this._getStyleOf(aBottomNodes[0]); - } - - for(attributeName in oStyle){ - if(this.oStyleMap[attributeName].converter){ - oStyle[attributeName] = this.oStyleMap[attributeName].converter(oStyle[attributeName], oStyle); - } - - if(this.oStyle[attributeName] != oStyle[attributeName]) - this.oApp.exec("MSG_STYLE_CHANGED", [attributeName, oStyle[attributeName]]); - } - - this.oStyle = oStyle; - }, - - _getStyleOf : function(oNode){ - var oStyle = this._getBlankStyle(); - - // this must not happen - if(!oNode) return oStyle; - - if(oNode.nodeType == 3) oNode = oNode.parentNode; - - var welNode = $(oNode); - var attribute, cssName; - for(var styleName in this.oStyle){ - attribute = this.oStyleMap[styleName]; - - if(attribute.type && attribute.type == "Value"){ - if(attribute.css){ - var sValue = welNode.css(attribute.css); - - if(styleName == "fontFamily"){ - sValue = sValue.split(/,/)[0]; - } - - oStyle[styleName] = sValue; - }else{ - if(attribute.command){ - try{ - oStyle[styleName] = this.oDocument.queryCommandState(attribute.command); - }catch(e){} - }else{ - // todo - } - } - }else{ - if(attribute.command){ - try{ - if(this.oDocument.queryCommandState(attribute.command)){ - oStyle[styleName] = 1; - }else{ - oStyle[styleName] = 0; - } - }catch(e){} - }else{ - // todo - } - } - } - return oStyle; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font size using Select element - * @name hp_XE_FontSizeWithSelectUI.js - */ -xe.XE_FontSizeWithSelectUI = $.Class({ - name : "XE_FontSizeWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFontSizeSelect = $("SELECT.xpress_xeditor_ui_fontSize_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFontSizeSelect, "change", "SET_FONTSIZE_FROM_SELECT_UI"); - this.elFontSizeSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - if(sAttributeName == "fontSize"){ - this.elFontSizeSelect.value = sAttributeValue; - if(this.elFontSizeSelect.selectedIndex < 0) this.elFontSizeSelect.selectedIndex = 0; - } - }, - - $ON_SET_FONTSIZE_FROM_SELECT_UI : function(){ - var sFontSize = this.elFontSizeSelect.value; - if(!sFontSize) return; - - this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontSize":sFontSize}]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font name using Select element - * @name hp_XE_FontNameWithSelectUI.js - */ -xe.XE_FontNameWithSelectUI = $.Class({ - name : "XE_FontNameWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFontNameSelect = $("SELECT.xpress_xeditor_ui_fontName_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFontNameSelect, "change", "SET_FONTNAME_FROM_SELECT_UI"); - this.elFontNameSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - if(sAttributeName == "fontFamily"){ - this.elFontNameSelect.value = sAttributeValue.toLowerCase(); - if(this.elFontNameSelect.selectedIndex < 0) this.elFontNameSelect.selectedIndex = 0; - } - }, - - $ON_SET_FONTNAME_FROM_SELECT_UI : function(){ - var sFontName = this.elFontNameSelect.value; - if(!sFontName) return; - - this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontFamily":sFontName}]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to setting/changing the lineheight - * @name hp_XE_LineHeight.js - */ -xe.XE_LineHeight = $.Class({ - name : "XE_LineHeight", - - $init : function(oAppContainer){ - this._assignHTMLObjects(oAppContainer); - }, - - _assignHTMLObjects : function(oAppContainer){ - }, - - $ON_SET_LINEHEIGHT : function(nLineHeight){ - this.setLineHeight(nLineHeight); - }, - - getLineHeight : function(){ - var nodes = this._getSelectedNodes(false); - - var curWrapper, prevWrapper; - var iCurHeight, iHeight; - - if(nodes.length == 0) return -1; - - var iLength = nodes.length; - - if(iLength == 0){ - iHeight = -1; - }else{ - prevWrapper = this._getLineWrapper(nodes[0]); - iHeight = this._getWrapperLineheight(prevWrapper); - } - - var firstNode = this.oSelection.getStartNode(); - - if(iHeight > 0){ - for(var i=1; i=0; i--){ - if(aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR"){ - var oP = oSelection._document.createElement("P"); - oInsertionPoint = aNodes[i].nextSibling; - while(i>=0 && aNodes[i] && (aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR")){ - oP.insertBefore(aNodes[i--], oP.firstChild); - } - oFormattingNode.insertBefore(oP, oInsertionPoint); - i++; - } - } - - if(oFormattingNode && oFormattingNode.parentNode){ - var oP = oSelection._document.createElement("P"); - oP.innerHTML = unescape("
"); - oFormattingNode.parentNode.insertBefore(oP, oFormattingNode.nextSibling); - } - - this.oApp.exec("RECORD_UNDO_ACTION", ["Block Quote"]); - - return oFormattingNode; - }, - - _expandToTableStart : function(oSelection, oNode){ - var oC = oSelection.commonAncestorContainer; - var oResultNode = null; - - var bLastIteration = false; - while(oNode && !bLastIteration){ - if(oNode == oC) bLastIteration = true; - - if(/TBODY|TFOOT|THEAD|TR/i.test(oNode.tagName)){ - oResultNode = this._getTableRoot(oNode); - break; - } - oNode = oNode.parentNode; - } - - return oResultNode; - }, - - _getTableRoot : function(oNode){ - while(oNode && oNode.tagName != "TABLE") oNode = oNode.parentNode; - - return oNode; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to inserting special characters - * @name hp_XE_SCharacter.js - * @required XpressRangeManager - */ -xe.XE_SCharacter = $.Class({ - name : "XE_SCharacter", - - $init : function(oAppContainer){ - this.bIE = $.browser.msie; - - this._assignHTMLObjects(oAppContainer); - - this.charSet = []; - this.charSet[0] = unescape('FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[1] = unescape('%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[2] = unescape('3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[3] = unescape('3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[4] = unescape('0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[5] = unescape('3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - }, - - _assignHTMLObjects : function(oAppContainer){ - oAppContainer = $.$(oAppContainer) || document; - - this.elDropdownLayer = $("DIV.xpress_xeditor_sCharacter_layer", oAppContainer).get(0); - - this.oTextField = $("INPUT", this.elDropdownLayer).get(0); - this.oInsertButton = $("+ BUTTON", this.oTextField).get(0); - this.aCloseButton = $("BUTTON.close", this.elDropdownLayer).get(); - this.aSCharList = $(".list", this.elDropdownLayer).get(); - var oLabelUL = $(">UL", this.elDropdownLayer).get(0); - this.aLabelA = $("A", oLabelUL).get(); - }, - - $ON_MSG_APP_READY : function(){ - var funcInsert = $.fnBind(this.oApp.exec, this.oApp, "INSERT_SCHARACTERS", [this.oTextField.value]); - $(this.oInsertButton).click(funcInsert); - - this.oApp.exec("SET_SCHARACTER_LIST", [this.charSet]); - - for(var i=0; i'; - this.aSCharList[i].appendChild(aLI[ii]); - } - - // enable this after Jindo framework is updated -// this.oApp.exec("ATTACH_HOVER_EVENTS", [$(">LI>BUTTON", this.aSCharList[i])]).get(); - }, - - _stopBrowserEvent : function(obj, sEvent){ - $(obj).bind(sEvent, function(e){e.stopPropagation();e.preventDefault();} ) - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to Undo/Redo - * @name hp_XE_UndoRedo.js - * @required XE_EditingAreaManager, XpressRangeManager - */ -xe.XE_UndoRedo = $.Class({ - name : "XE_UndoRedo", - actionHistory : null, - // this may also be called, lastAdded/lastRestored - oCurStateIdx : null, - iMinimumSizeChange : 10, - sBlankContentsForFF : "
", - - $init : function(){ - this.aUndoHistory = []; - this.oCurStateIdx = {nIdx: 0, nStep: 0}; - }, - - $PRECONDITION : function(sCmd){ - if(sCmd.match(/_DO_RECORD_UNDO_HISTORY_AT$/)) return true; - - try{ - if(this.oApp.getEditingMode() != "WYSIWYG") return false; - }catch(e){ - return false; - } - - return true; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT", [this.oCurStateIdx, "", "", null]); - }, - - $ON_MSG_APP_READY : function(){ - this.bFF = $.browser.mozilla; - - this.oApp.exec("ADD_APP_PROPERTY", ["getUndoHistory", $.fnBind(this.getUndoHistory, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["getUndoStateIdx", $.fnBind(this.getUndoStateIdx, this)]); - - this.oApp.exec("REGISTER_UI_EVENT", ["undo", "click", "UNDO"]); - this.oApp.exec("REGISTER_UI_EVENT", ["redo", "click", "REDO"]); - - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+z", "UNDO"]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+y", "REDO"]); - }, - - $ON_UNDO : function(){ - var oTmpStateIdx = {}; - this.oApp.exec("DO_RECORD_UNDO_HISTORY", ["KEYPRESS", false, false, 1]); - if(this.oCurStateIdx.nIdx == 0) return; - - if(this.oCurStateIdx.nStep > 0){ - this.oCurStateIdx.nStep--; - }else{ - var oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - - this.oCurStateIdx.nIdx--; - - if(oTmpHistory.nTotalSteps>1){ - this.oCurStateIdx.nStep = 0; - }else{ - oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - this.oCurStateIdx.nStep = oTmpHistory.nTotalSteps-1; - } - } - - this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); - - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - - $ON_REDO : function(){ - if(this.oCurStateIdx.nIdx >= this.aUndoHistory.length) return; - - var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - if(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1 && this.oCurStateIdx.nStep >= oCurHistory.nTotalSteps-1) return; - - if(this.oCurStateIdx.nStep < oCurHistory.nTotalSteps-1){ - this.oCurStateIdx.nStep++; - }else{ - this.oCurStateIdx.nIdx++; - oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - this.oCurStateIdx.nStep = oCurHistory.nTotalSteps-1; - } - - this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); - - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - $ON_RECORD_UNDO_ACTION : function(sAction){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction]); - }, - - $ON_RECORD_UNDO_BEFORE_ACTION : function(sAction){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, true]); - }, - - $ON_RECORD_UNDO_AFTER_ACTION : function(sAction){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, false]); - }, - - $ON_RESTORE_UNDO_HISTORY : function(nUndoIdx, nUndoStateStep){ - this.oCurStateIdx.nIdx = nUndoIdx; - this.oCurStateIdx.nStep = nUndoStateStep; - - var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - var sContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; - var oBookmark = oCurHistory.oBookmark[this.oCurStateIdx.nStep]; - - this.oApp.setIR(sContent, true); - - // setting the innerHTML may change the internal DOM structure, so save the value again. - var sCurContent = this.oApp.getIR(); - if(this.bFF && sCurContent == this.sBlankContentsForFF){ - sCurContent = ""; - } - oCurHistory.sContent[this.oCurStateIdx.nStep] = sCurContent; - - var oSelection = this.oApp.getEmptySelection(); - if(oSelection.selectionLoaded){ - if(oBookmark){ - oSelection.moveToXPathBookmark(oBookmark); - }else{ - oSelection = this.oApp.getEmptySelection(); - } - - oSelection.select(); - } - }, - - $ON_DO_RECORD_UNDO_HISTORY : function(sAction, bTwoStepAction, bBeforeAction, nForceAddUnlessEqual){ - bTwoStepAction = bTwoStepAction || false; - bBeforeAction = bBeforeAction || false; - nForceAddUnlessEqual = nForceAddUnlessEqual || 0; - - // if we're in the middle of some action history, remove everything after current idx if any "little" change is made - if(!(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1)) nForceAddUnlessEqual = 1; - - var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - - var sCurContent = this.oApp.getIR(); - var sHistoryContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; - - if(this.bFF && sCurContent == this.sBlankContentsForFF){ - sCurContent = ""; - } - - // every TwoStepAction needs to be recorded - if(!bTwoStepAction){ - switch(nForceAddUnlessEqual){ - case 0: - if(Math.abs(sHistoryContent.length - sCurContent.length)" + sURL + ""; - this.oSelection.pasteHTML(str); - }else{ - var nSession = Math.ceil(Math.random()*10000); - var sMarker = this.sATagMarker+nSession; - var arg = ( sURL == "" ? ["unlink"] : ["createLink", false, sMarker+sURL] ); - this.oApp.exec("EXECCOMMAND", arg); - - try { this.oSelection.setFromSelection() }catch(e){}; - var oDoc = this.oApp.getWYSIWYGDocument(); - $(oDoc.body.getElementsByTagName("A")) - .filter('[href^="'+sMarker+'"]') - .attr('href', function(){ - var rx = new RegExp('^'+sMarker.replace(/([\.\\])/g, '\\$1'), 'i'); - - if (sTarget) $(this).attr('target', sTarget); - else $(this).removeAttr('target'); - - return this.href.replace(rx, ''); - }); - } - this.oApp.exec("HIDE_ACTIVE_LAYER"); - - setTimeout($.fnBind(function(){try{this.oSelection.select()}catch(e){}}, this), 0); - }, - - _validateURL : function(sURL){ - return /^(http|https|ftp|mailto):(?:\/\/)?((\w|-)+(?:[\.:@](\w|-))+)(?:\/|@)?([^"\?]*?)(?:\?([^\?"]*?))?$/.test(sURL); - }, - - $ON_EVENT_XE_HYPERLINK_KEYDOWN : function(oEvent){ - if (oEvent.keyCode == 13){ - this.oApp.exec("XE_APPLY_HYPERLINK"); - oEvent.preventDefault(); oEvent.stopPropagation(); - } - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to table creation - * @name hp_XE_Table.js - */ -xe.XE_Table = $.Class({ - name : "XE_Table", - iMinRows : 1, - iMaxRows : 20, - - iMinColumns : 1, - iMaxColumns : 10, - - iMinBorderWidth : 1, - iMaxBorderWidth : 10, - - oSelection : null, - - $init : function(oAppContainer){ - this._assignHTMLObjects(oAppContainer); - }, - - _assignHTMLObjects : function(oAppContainer){ - var tmp = null; - - this.elDropdownLayer = $("DIV.xpress_xeditor_table_layer", oAppContainer).get(0); - this.welDropdownLayer = $(this.elDropdownLayer); - - tmp = $("INPUT", this.elDropdownLayer).get(); - this.oRowInput = tmp[0]; - this.oColumnInput = tmp[1]; - this.oBorderWidthInput = tmp[2]; - this.oBorderColorInput = tmp[3]; - this.oBGColorInput = tmp[4]; - - tmp = $("BUTTON", this.elDropdownLayer).get(); - this.oButton_AddRow = tmp[0]; - this.oButton_RemoveRow = tmp[1]; - this.oButton_AddColumn = tmp[2]; - this.oButton_RemoveColumn = tmp[3]; - this.oButton_IncBorderWidth = tmp[4]; - this.oButton_DecBorderWidth = tmp[5]; - this.oButton_BorderColorPreview = tmp[6]; - this.oButton_BorderColor = tmp[7]; - this.oButton_BGColorPreview = tmp[8]; - this.oButton_BGColor = tmp[9]; - this.oButton_Insert = tmp[10]; - this.oButton_Cancel = tmp[11]; - - this.oSampleTable = $("TABLE", this.elDropdownLayer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.exec("REGISTER_UI_EVENT", ["table", "click", "ST_TOGGLE_TOOLBAR_LAYER"]); - - this.oApp.registerBrowserEvent(this.oRowInput, "change", "ST_SET_ROW_NUM", [null, 0]); - this.oApp.registerBrowserEvent(this.oColumnInput, "change", "ST_SET_COLUMN_NUM", [null, 0]); - this.oApp.registerBrowserEvent(this.oBorderWidthInput, "change", "ST_SET_BORDER_WIDTH", [null, 0]); - - this.oApp.registerBrowserEvent(this.oButton_AddRow, "click", "ST_ADD_ROW"); - this.oApp.registerBrowserEvent(this.oButton_RemoveRow, "click", "ST_REMOVE_ROW"); - this.oApp.registerBrowserEvent(this.oButton_AddColumn, "click", "ST_ADD_COLUMN"); - this.oApp.registerBrowserEvent(this.oButton_RemoveColumn, "click", "ST_REMOVE_COLUMN"); - - this.oApp.registerBrowserEvent(this.oButton_IncBorderWidth, "click", "ST_INC_BORDER_WIDTH"); - this.oApp.registerBrowserEvent(this.oButton_DecBorderWidth, "click", "ST_DEC_BORDER_WIDTH"); - - this.oApp.registerBrowserEvent(this.oButton_BorderColorPreview, "click", "ST_TOGGLE_BORDER_COLOR_LAYER"); - this.oApp.registerBrowserEvent(this.oButton_BGColorPreview, "click", "ST_TOGGLE_BGCOLOR_LAYER"); - - this.oApp.registerBrowserEvent(this.oButton_BorderColor, "click", "ST_TOGGLE_BORDER_COLOR_LAYER"); - this.oApp.registerBrowserEvent(this.oButton_BGColor, "click", "ST_TOGGLE_BGCOLOR_LAYER"); - - this.oApp.registerBrowserEvent(this.oButton_Insert, "click", "ST_INSERT_TABLE"); - this.oApp.registerBrowserEvent(this.oButton_Cancel, "click", "ST_CLOSE"); - - this.oApp.exec("ST_SET_BORDER_COLOR", ["#CCCCCC"]); - this.oApp.exec("ST_SET_BGCOLOR", ["#FFFFFF"]); - }, - - $ON_ST_TOGGLE_TOOLBAR_LAYER : function(){ - this.oApp.exec("RECORD_UNDO_ACTION_FORCED", ["KEYPRESS"]); - - this._showNewTable(); - this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER", [this.elDropdownLayer]); - }, - - $ON_ST_ADD_ROW : function(){ - this.oApp.exec("ST_SET_ROW_NUM", [null, 1]); - }, - - $ON_ST_REMOVE_ROW : function(){ - this.oApp.exec("ST_SET_ROW_NUM", [null, -1]); - }, - - $ON_ST_ADD_COLUMN : function(){ - this.oApp.exec("ST_SET_COLUMN_NUM", [null, 1]); - }, - - $ON_ST_REMOVE_COLUMN : function(){ - this.oApp.exec("ST_SET_COLUMN_NUM", [null, -1]); - }, - - $ON_ST_SET_ROW_NUM : function(iRows, iRowDiff){ - iRows = iRows || parseInt(this.oRowInput.value); - iRowDiff = iRowDiff || 0; - - iRows += iRowDiff; - - if(iRows < this.iMinRows) iRows = this.iMinRows; - if(iRows > this.iMaxRows) iRows = this.iMaxRows; - - this.oRowInput.value = iRows; - this._showNewTable(); - }, - - $ON_ST_SET_COLUMN_NUM : function(iColumns, iColumnDiff){ - iColumns = iColumns || parseInt(this.oColumnInput.value); - iColumnDiff = iColumnDiff || 0; - - iColumns += iColumnDiff; - - if(iColumns < this.iMinColumns) iColumns = this.iMinColumns; - if(iColumns > this.iMaxColumns) iColumns = this.iMaxColumns; - - this.oColumnInput.value = iColumns; - this._showNewTable(); - }, - - $ON_ST_INSERT_TABLE : function(){ - var sTable = this._getTableString(); - - this.oApp.exec("PASTE_HTML", [sTable]); - - this.oApp.exec("ST_CLOSE", []); - }, - - $ON_ST_CLOSE : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }, - - $ON_ST_SET_BORDER_WIDTH : function(iBorderWidth, iBorderWidthDiff){ - iBorderWidth = iBorderWidth || parseInt(this.oBorderWidthInput.value); - iBorderWidthDiff = iBorderWidthDiff || 0; - - iBorderWidth += iBorderWidthDiff; - - if(iBorderWidth < this.iMinBorderWidth) iBorderWidth = this.iMinBorderWidth; - if(iBorderWidth > this.iMaxBorderWidth) iBorderWidth = this.iMaxBorderWidth; - - this.oBorderWidthInput.value = iBorderWidth; - this._showNewTable(); - }, - - $ON_ST_INC_BORDER_WIDTH : function(){ - this.oApp.exec("ST_SET_BORDER_WIDTH", [null, 1]); - }, - - $ON_ST_DEC_BORDER_WIDTH : function(){ - this.oApp.exec("ST_SET_BORDER_WIDTH", [null, -1]); - }, - - $ON_ST_TOGGLE_BORDER_COLOR_LAYER : function(){ - if(this.welDropdownLayer.hasClass("p1")) - this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); - else - this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER", []); - }, - - $ON_ST_SHOW_BORDER_COLOR_LAYER : function(){ - this.welDropdownLayer.addClass("p1"); - this.welDropdownLayer.removeClass("p2"); - - this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BORDER_COLOR_FROM_PALETTE", this.elDropdownLayer]); - }, - - $ON_ST_HIDE_BORDER_COLOR_LAYER : function(){ - this.welDropdownLayer.removeClass("p1"); - - this.oApp.exec("HIDE_COLOR_PALETTE", []); - }, - - $ON_ST_TOGGLE_BGCOLOR_LAYER : function(){ - if(this.welDropdownLayer.hasClass("p2")) - this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); - else - this.oApp.exec("ST_SHOW_BGCOLOR_LAYER", []); - }, - - $ON_ST_SHOW_BGCOLOR_LAYER : function(){ - this.welDropdownLayer.removeClass("p1"); - this.welDropdownLayer.addClass("p2"); - - this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BGCOLOR_FROM_PALETTE", this.elDropdownLayer]); - }, - - $ON_ST_HIDE_BGCOLOR_LAYER : function(){ - this.welDropdownLayer.removeClass("p2"); - - this.oApp.exec("HIDE_COLOR_PALETTE", []); - }, - - $ON_ST_SET_BORDER_COLOR_FROM_PALETTE : function(sColorCode){ - this.oApp.exec("ST_SET_BORDER_COLOR", [sColorCode]); - this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); - }, - - $ON_ST_SET_BORDER_COLOR : function(sColorCode){ - this.oBorderColorInput.value = sColorCode; - this.oButton_BorderColorPreview.style.backgroundColor = sColorCode; - - this._showNewTable(); - }, - - $ON_ST_SET_BGCOLOR_FROM_PALETTE : function(sColorCode){ - this.oApp.exec("ST_SET_BGCOLOR", [sColorCode]); - this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); - }, - - $ON_ST_SET_BGCOLOR : function(sColorCode){ - this.oBGColorInput.value = sColorCode; - this.oButton_BGColorPreview.style.backgroundColor = sColorCode; - - this._showNewTable(); - }, - - _showNewTable : function(){ - var oTmp = document.createElement("DIV"); - oTmp.innerHTML = this._getTableString(); - var oNewTable = oTmp.firstChild; - this.oSampleTable.parentNode.insertBefore(oNewTable, this.oSampleTable); - this.oSampleTable.parentNode.removeChild(this.oSampleTable); - this.oSampleTable = oNewTable; - }, - - // need to do something about the table width as the same HTML code is being used to the actual table and the preview table - _getTableString : function(){ - var sBorderColorCode = this.oBorderColorInput.value; - var sBGColorCode = this.oBGColorInput.value; - var iBorderWidth = this.oBorderWidthInput.value; - var sTD = ""; - if($.browser.msie){ - sTD = "

"; - }else{ - if($.browser.firefox){ - sTD = "


"; - }else{ - sTD = "

 

"; - } - } - - var sTable = ''; - var sRow = ''; - var iColumns = this.oColumnInput.value; - for(var i=0; i/ig, - regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig, - regex_class = /<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig, - regex_class2 = /xe_selected_cell/g; - regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig, - //regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig, - //regex_script = //ig, - regex_font_color = /color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_face = /face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_size = /size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i, - regex_style = /style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_weight = /font-weight\s*:\s*([a-z]+);?/i, - regex_font_style = /font-style\s*:\s*italic;?/i, - regex_font_decoration = /text-decoration\s*:\s*([a-z -]+);?/i, - regex_jquery = /jQuery\d+\s*=(\s*"\d+"|\d+)/ig, - regex_quote_attr = /([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g; //" - -var - allow_tags = 'a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style'.split(','), - no_closing_tags = 'area,br,col,embed,hr,img,input,param,base,meta,link,basefont,isindex'.split(','); - - -var - replace_tags = { - 'b' : 'strong', - 'i' : 'em', - 's' : 'del', - 'strike' : 'del' - }; - -xe.XE_XHTMLFormatter = $.Class({ - name : "XE_XHTMLFormatter", - - $ON_MSG_APP_READY : function() { - this.oApp.addConverter("WYSIWYG_TO_IR", this.TO_IR); - this.oApp.addConverter("HTMLSrc_TO_IR", this.TO_IR); - this.oApp.addConverter("IR_TO_HTMLSrc", this.IR_TO); - this.oApp.addConverter("IR_TO_WYSIWYG", this.IR_TO); - }, - - TO_IR : function(sContent) { - var stack = []; - // remove xeHandled attrs - /* - sContent = sContent.replace(/xeHandled="YES"/ig,''); - */ - - - // remove all useless styles - /* - sContent = sContent.replace(regex_meanless_css1, function(m0,m1,m2,m3){ - m2 = m2.replace(regex_meanless_css2, ''); - - return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>'; - }); - */ - - // remove all useless classes - /* - sContent = sContent.replace(regex_class, function(m0,m1,m2,m3,m4,m5){ - var cls = $.trim((m2 || m3 || m4 || "").replace(regex_class2, '')); - - return '<'+(m1||"")+(cls?' class="'+cls+'"':'')+(m5||"")+'>'; - }); - */ - - // remove all event handler - //sContent = sContent.replace(regex_handler, '<$1$2>'); - - // remove all id - //sContent = sContent.replace(regex_id, '<$1$2>'); - - // remove all scripts - //sContent = sContent.replace(regex_script, ''); - - if ($.browser.msie) { - // remove $ attributes - sContent = sContent.replace(regex_jquery, ''); - - // quote all attrs - sContent = sContent.replace(/<(\w+) ([^>]+)>/g, function(m0,m1,m2){ - return '<'+m1+' '+ - m2.replace(regex_quote_attr, function(s0,s1,s2,s3){ - if(s1) return s1; - if(/^"/.test(s3)||/"$/.test(s3)) return s2+'='+s3; - return s2+'="'+(s3||s2)+'"'; - }) + '>'; - }); - } - - // remove all useless tag and enclose tags - regex = /<(\/)?([:\w\/-]+)(.*?)>/ig; - sContent = sContent.replace(regex, function(m0,closing,tag,attrs){ - var m3s = []; - var state = ''; - - closing = closing || ''; - tag = tag.toLowerCase(); - attrs = $.trim(attrs || ''); - - if(replace_tags[tag]!=undefined) tag = replace_tags[tag]; - - if (!closing) { - if ($.inArray(tag,no_closing_tags) >= 0) { - var len = attrs.length; - if (tag == 'br') attrs = ''; - if (!attrs || attrs.substring(len-1,len) != '/') attrs += ' /'; - - return '<'+tag+' '+$.trim(attrs)+'>'; - } else { - stack.push({tag:tag, state:state}); - } - } else { - var tags = [], t = ''; - - // if the tag does not require a closing tag, simply remove the closing tag - if ($.inArray(tag,no_closing_tags) >= 0) { - return ''; - } - - // if the matching opening tag was not found, remove this closing tag - if (!stack.length){ - return ''; - } - - do { - t = stack.pop(); - if (t.tag != tag) continue; - if (t.state != 'deleted') tags.push(''); - } while(stack.length && t.tag != tag); - - return tags.join(''); - } - - return '<'+closing+tag+(attrs?' '+attrs:'')+'>'; - }); - - if(stack.length) { - var t = ''; - - do { - t = stack.pop(); - if (t.state != 'deleted') sContent += ''; - } while(stack.length); - - } - - // add new line after

- regex = /<\/p>[ \t]*(\n)?/ig; - sContent = sContent.replace(regex, "

\n"); - - return sContent; - }, - - IR_TO : function(sContent) { - return sContent; - } -}); -// center, font, b, i, s, strike - -/** - * Support XE extensions - * @author NAVER (developer@xpressengine.com) - */ -xe.XE_Extension = $.Class({ - name : "XE_Extension", - seq : '', - last_doc : '', - - $init : function(elAppContainer, editor_sequence) { - this.seq = editor_sequence; - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.elDropdownLayer = $('DIV.xpress_xeditor_extension_layer', elAppContainer).get(0); - }, - - _removeAttrs : function(sContent) { - return sContent; - }, - - _addEvent : function() { - if (this.oApp.getEditingMode() != 'WYSIWYG') return; - - var doc = this.oApp.getWYSIWYGDocument(); - var seq = this.seq; - var fn = function(){ - var obj = $(this); - var comp = obj.attr('editor_component'); - if (comp && $.isFunction(openComponent)) { - editorPrevNode = obj.get(0); - openComponent(comp, seq); - } - }; - - $(doc).find('img,div[editor_component]').each(function(){ - var obj = $(this); - if(this.nodeName == 'IMG' && !obj.attr('editor_component') && !obj.attr('widget')) { - obj.attr('editor_component','image_link'); - } - if(this.last_doc != doc) { - obj.unbind('dblclick.widget').bind('dblclick.widget',fn); - this.last_doc = doc; - } - }); - }, - - $ON_MSG_APP_READY : function() { - var oApp = this.oApp; - oApp.exec('REGISTER_UI_EVENT', ['extension', 'click', 'TOGGLE_EXTENSION_LAYER']); - var functn = function(){ - oApp.exec("HIDE_ACTIVE_LAYER", []); - }; - $('a', this.elDropdownLayer).each(function(){ - var obj = $(this); - if(!obj.attr('component_onclick_event_added')) { - obj.click(functn); - obj.attr('component_onclick_event_added','Y'); - } - }); - }, - - $ON_TOGGLE_EXTENSION_LAYER : function() { - this.oApp.exec('TOGGLE_TOOLBAR_ACTIVE_LAYER', [this.elDropdownLayer]); - }, - - $ON_CHANGE_EDITING_MODE : function(mode) { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_PASTE_HTML : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_LOAD_IR_FIELD : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_SET_IR : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - } -}); -/** - * Auto saving - * @author NAVER (developer@xpressengine.com) - */ -xe.XE_AutoSave = $.Class({ - name : "XE_AutoSave", - form : null, - textarea : null, - - $init : function(oIRTextarea, elAppContainer) { - this.form = oIRTextarea.form; - this.textarea = oIRTextarea; - - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.welMessageBox = $('autosave_message'); - }, - - $ON_MSG_APP_READY : function() { - var elTitle = $(this.form._saved_doc_title); - var elContent = $(this.form._saved_doc_content); - var elDocument_srl = $(this.form._saved_doc_document_srl); - - var title = $.trim(elTitle.val()); - var content = $.trim(elContent.val()); - var document_srl = $.trim(elDocument_srl.val()); - - if (title || content || document_srl) { - if (confirm(this.form._saved_doc_message.value)) { - $(this.form.title).val(title); - this.oApp.setIR(content); - if(typeof(editorGetAutoSavedDoc) == 'function') editorGetAutoSavedDoc(this.form); - } else { - editorRemoveSavedDoc(); - } - } - - editorEnableAutoSave(this.form, $(this.form).attr("editor_sequence")); - - // register hotkey - this.oApp.exec('REGISTER_HOTKEY', ['ctrl+shift+s','AUTO_SAVE']); - }, - - $ON_AUTO_SAVE : function() { - _editorAutoSave(); - } -}); -/** - * Format Block plugin - * @author NAVER (developer@xpressengine.com) - */ -xe.XE_FormatWithSelectUI = $.Class({ - name : "XE_FormatWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFormatSelect = $("SELECT.xpress_xeditor_ui_format_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFormatSelect, "change", "SET_FORMAT_FROM_SELECT_UI"); - this.elFormatSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - var blockName = this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock"); - - if (!blockName) return (this.elFormatSelect.selectedIndex = 0); - if ($.browser.msie && /([0-9])/.test(blockName)) blockName = 'h'+(RegExp.$1); - - this.elFormatSelect.value = blockName.toLowerCase(); - if(this.elFormatSelect.selectedIndex < 0) this.elFormatSelect.selectedIndex = 0; - if(this.elFormatSelect.value != blockName.toLowerCase()) this.elFormatSelect.selectedIndex = 0; - }, - - $ON_SET_FORMAT_FROM_SELECT_UI : function(){ - var sFormat = this.elFormatSelect.value; - if(!sFormat) return; - if($.browser.msie) sFormat = '<'+sFormat+'>'; - - this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, sFormat]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -/** - * Enhanced Table Fetures - * @author NAVER (developer@xpressengine.com) - */ - -// 표 편집 확장 기능 -xe.XE_Table = $.Class({ - _startSel : null, - _endSel : null, - - $ON_MSG_APP_READY : function() { - this._doc = $(this.oApp.getWYSIWYGDocument()); - - this.$FnMouseDown = $.fnBind(this._mousedown, this); - this.$FnMouseUp = $.fnBind(this._mouseup, this); - this.$FnMouseMove = $.fnBind(this._mousemove, this); - - this._doc.mousedown(this.$FnMouseDown); - - // initialize - this._startSel = null; - this._endSel = null; - - // register buttons - this.oApp.exec('REGISTER_UI_EVENT', ['merge_cells', 'click', 'MERGE_CELLS']); - this.oApp.exec('REGISTER_UI_EVENT', ['split_col', 'click', 'CELL_SPLIT_BY_COL']); - this.oApp.exec('REGISTER_UI_EVENT', ['split_row', 'click', 'CELL_SPLIT_BY_ROW']); - - // register hotkeys - this.oApp.exec('REGISTER_HOTKEY', ['ctrl+alt+m', 'MERGE_CELLS']); - - // perform default ready action - this.$super.$ON_MSG_APP_READY(); - }, - - $ON_MERGE_CELLS : function() { - var html = ""; - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var self = this; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Merge"]); - - // 선택한 모든 셀의 데이터를 첫번째 셀로 복사 - cell.each(function(){ html += $(this).html() }).eq(0).html(html); - - // 첫번째 셀 가로 확장 - var colspan = 0; - cell.eq(0).nextAll('td,th').addBack().filter('.xe_selected_cell').each(function(idx){ - colspan += self._getSpan(this, 'col'); - }); - - // 마지막 셀까지 줄의 갯수 계산 - var rect = this._getRect(cell.eq(0)); - var start_tr = cell.eq(0).parent('tr'); - var end_tr = cell.eq(cell.length-1).parent('tr'); - var all_rows = cell.parents('table').eq(0).find('tr'); - var rowspan = all_rows.index(end_tr.get(0)) - all_rows.index(start_tr.get(0)) + this._getSpan(cell.eq(cell.length-1), 'row'); - - // 첫번째 셀 colspan, rowspan 속성 지정 - cell.eq(0).attr('colSpan', colspan).attr('rowSpan', rowspan); - - // 첫번째 셀을 제외한 다른 모든 셀 제거 - cell.slice(1).remove(); - }, - - $ON_CELL_SPLIT_BY_ROW : function(many) { - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var table = cell.parents('table').eq(0); - var self = this; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Row"]); - - // 선택 영역의 상하 좌표 구함 - var _top = this._getRect(cell.eq(0)).top; - var _bottom = this._getRect(cell.eq(cell.length-1)).bottom; - - // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(상하 기준). - (cell = table.find('td,th').filter(function(){ - var rect = self._getRect($(this)); - - return !(rect.bottom <= _top || rect.top >= _bottom); - })).filter('.xe_selected_cell').each(function(){ - var t = $(this); - var row = t.parent('tr'); - var rowspan = self._getSpan(t, 'row'); - var rect = self._getRect(t); - var queue = []; - var clone = t.clone().html('
'); - var topspan = 1, botspan = 1; - - // rowspan > 1이면 현재 셀의 rowspan을 절반으로 분할한다. - if (rowspan > 1) { - - topspan = Math.ceil(rowspan/2); - botspan = rowspan - topspan; - - queue.push(function(){ - t.attr('rowSpan', topspan); - }); - - clone.attr('rowSpan', botspan); - } else { - // rowspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 rowspan을 추가 - cell.filter(function(){ - if (t.get(0) == this) return false; - - var tt = $(this); - var rc = self._getRect(tt); - - // 범위를 넘은 부분은 제외 - if (rc.bottom <= rect.top || rc.top >= rect.bottom) return false; - - return true; - }).each(function(){ - var tt = $(this); - var sp = self._getSpan(tt, 'row')+1; - - // rowspan 1 추가 - queue.push(function(){ - tt.attr('rowSpan', sp); - }); - }); - - // 새 줄을 추가한다. - if ($.browser.msie) { - // Fix bug for IE - row.after(row.clone().empty().get(0).outerHTML); - } else { - row.after(row.clone().empty()); - } - } - - var rows = row.nextAll('tr'); - - // 현재 셀이 마지막 줄에 있다면 한 줄 추가 후 새로운 셀 추가 - if (!rows.length) { - row.after(row.clone().empty().append(clone)); - } else { - var next_sib = rows.eq(topspan - 1).children('td,th').filter(function(){ - return ( self._getRect($(this)).left > rect.left ); - }); - - if ($.browser.msie) { - next_sib.length? - next_sib.eq(0).before(clone.get(0).outerHTML): - rows.eq(topspan-1).append(clone.get(0).outerHTML); - } else { - next_sib.length? - next_sib.slice(0,1).before(clone): - rows.slice(topspan-1,1).append(clone); - } - } - - // 함수를 바로 실행하면 좌표가 틀어지므로, 큐에 넣은 후 실행 - $.each(queue, function(){ this(); }); - - }); - }, - - $ON_CELL_SPLIT_BY_COL : function(many) { - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var table = cell.parents('table').slice(0,1); - var self = this; - var ie_bug = [], tmpId = (new Date).getTime(), tmpStr = ''; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Column"]); - - // 선택 영역의 좌우 좌표 구함 - var first_row = cell.eq(0).parent('tr'); - var _left = this._getRect(first_row.find('.xe_selected_cell:first')).left; - var _right = this._getRect(first_row.find('.xe_selected_cell:last')).right; - - // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(좌우 기준). - (cell = table.find('td,th').filter(function(){ - var rect = self._getRect($(this)); - - return !(rect.right <= _left || rect.left >= _right); - })).filter('.xe_selected_cell').each(function(idx){ - var t = $(this); - var colspan = self._getSpan(t, 'col'); - var clone = t.clone().html('
'); - - // colspan > 1 이면 colspan을 절반으로 분할한다. - if (colspan > 1) { - var leftspan = Math.ceil(colspan/2); - var rightspan = colspan - leftspan; - - t.attr('colSpan', leftspan); - clone.attr('colSpan', rightspan); - } else { - // colspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 colspan을 추가 - var rect = self._getRect(t); - - cell.filter(function(){ - if (t.get(0) == this) return false; - - var tt = $(this); - var rc = self._getRect(tt); - - // 범위를 넘은 부분은 제외 - if (rc.right <= rect.left || rc.left >= rect.right) return false; - - return true; - }).each(function(){ - var tt = $(this); - - // colspan 1 추가 - tt.attr('colSpan', self._getSpan(tt, 'col')+1); - }); - - clone.attr('colSpan', 1); - } - - if ($.browser.msie) { - // Fix for IE bug - t.after(clone.get(0).outerHTML); - } else { - t.after(clone); - } - }); - }, - - $ON_CHECK_STYLE_CHANGE : function(){ - var ui = ['merge_cells', 'split_col', 'split_row']; - var app = this.oApp; - var command = (this._startSel && this._startSel.is('.xe_selected_cell'))?'ENABLE_UI':'DISABLE_UI'; - - $.each(ui, function(){ app.exec(command, [this]); }); - }, - - _mousedown : function(event) { - var cur = $(event.target); - var sel = cur.parents().addBack().filter('td,th,table'); - var app = this.oApp; - var self = this; - - // 모든 선택영역 해제 - $('td.xe_selected_cell', this.oApp.getWYSIWYGDocument()).removeClass('xe_selected_cell'); - - this._startSel = null; - this._endSel = null; - - if (!sel.length || !this._isLeftClicked(event.button)) return; - - function delayed(){ - sel = app.getSelection().cloneRange(); - sel.collapseToStart(); - sel = $(sel.startContainer).parents().addBack().filter('td,th').eq(0); - - if (!sel.length) return self._removeAllListener()||true; - - // 좌표를 구한다 - self._getRect(self._startSel = sel); - - // 이벤트 바인딩 - self._doc.bind('mousemove', self.$FnMouseMove); - self._doc.bind('mouseup', self.$FnMouseUp); - } - - // mousedown이 일어난 후에 선택 영역이 설정되므로 실행을 지연시킨다. - setTimeout(delayed, 0); - }, - - _mouseup : function(event) { - // 선택된 셀 확인 - this._removeAllListener(); - - // 시작셀과 종료셀 제거 - this._startSel = this._endSel = null; - }, - - _mousemove : function(event) { - var cur = $(event.target); - var cell = cur.parents().addBack().filter('td,th').eq(0); - var self = this; - - // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 - if (!cell.length || !this._isLeftClicked(event.button)) return; - if (!this._endSel && cell.get(0) == this._startSel.get(0)) return; - if (this._endSel && cell.get(0) == this._endSel.get(0)) return; - - // 종료셀 && 종료셀의 좌표 - this._getRect(this._endSel = cell); - - // 선택 범위를 구한다 - var _top = Math.min(this._startSel.rect.top, this._endSel.rect.top); - var _left = Math.min(this._startSel.rect.left, this._endSel.rect.left); - var _bottom = Math.max(this._startSel.rect.bottom, this._endSel.rect.bottom); - var _right = Math.max(this._startSel.rect.right, this._endSel.rect.right); - - var table = cell.parents('table'); - var cells = table.find('td,th').removeClass('xe_selected_cell'); - var i = 0; - - // 복잡한 모양의 테이블을 위한 반복 처리 - var selected = $(); - do { - // 선택한 셀로 최대 영역 재계산 - selected.each(function(){ - var rect = self._getRect($(this)); - - // 영역 재계산 - if (rect.right > _right) _right = rect.right; - if (rect.left < _left) _left = rect.left; - if (rect.top < _top) _top = rect.top; - if (rect.bottom > _bottom) _bottom = rect.bottom; - }); - - // 좌표 범위 안에 있는 선택할 셀을 추린다. - cells = cells.filter(':not(.xe_selected_cell)'); - selected = cells.filter(function(){ - var rect = self._getRect($(this)); - - if (rect.right <= _left || rect.left >= _right || rect.bottom <= _top || rect.top >= _bottom) return false; - - return true; - }).addClass('xe_selected_cell'); - } while(selected.length); - - // 브라우저의 기본 선택영역 해제 : FF 제외 - 기본 기능이 충분히 좋아서 + 이 부분을 실행하면 오류가 발생해서 - if (!$.browser.mozilla) { - function delayed() { - var sel = self.oApp.getSelection(); - - if (!self._startSel) return; - if (!self._startSel.get(0).firstChild) self._startSel.text(" "); - - sel.selectNode(self._startSel.get(0).firstChild); - sel.collapseToStart(); - sel.select(); - } - - setTimeout(delayed, 0); - } - - return false; - }, - - _removeAllListener : function() { - // 이벤트 해제 - this._doc.unbind("mousemove", this.$FnMouseMove); - this._doc.unbind("mouseup", this.$FnMouseUp); - }, - - _isLeftClicked : function(value) { - return $.browser.msie?!!(value & 1):(value == 0); - }, - - _getRect : function(obj) { - var el = obj.get(0); - - obj.rect = {}; - obj.rect.top = el.offsetTop; - obj.rect.left = el.offsetLeft; - obj.rect.bottom = obj.rect.top + el.offsetHeight; - obj.rect.right = obj.rect.left + el.offsetWidth; - - return obj.rect; - }, - - _getSpan : function(obj, type) { - var span = parseInt($(obj).attr(type+'span')); - - return isNaN(span)?1:span; - } -}).extend(xe.XE_Table); - -})(jQuery); diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js deleted file mode 100644 index 2de25d180..000000000 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ /dev/null @@ -1,296 +0,0 @@ -if (!window.xe) xe = {}; - -xe.Editors = []; - -function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size, content_line_height, content_paragraph_spacing, content_word_break) { - if(typeof(colorset)=='undefined') colorset = 'white'; - if(typeof(content_style)=='undefined') content_style = 'xeStyle'; - if(typeof(content_font)=='undefined') content_font= ''; - if(typeof(content_font_size)=='undefined') content_font_size= ''; - if(typeof(content_line_height)=='undefined') content_line_height= ''; - if(typeof(content_paragraph_spacing)=='undefined') content_paragraph_spacing= ''; - if(typeof(content_word_break)=='undefined') content_word_break= ''; - - var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html'; - - var textarea = jQuery("#xpress-editor-"+editor_sequence); - var iframe = jQuery(''); - var htmlsrc = jQuery(''); - var form = textarea.get(0).form; - form.setAttribute('editor_sequence', editor_sequence); - textarea.css("display","none"); - - var saved_content = ''; - if(jQuery("input[name=content]",form).size()>0){ - saved_content=jQuery("input[name=content]",form).val().replace(/src=\"files\/attach/g,'src="'+request_uri+'files/attach'); //' - jQuery("#xpress-editor-"+editor_sequence).val(saved_content); - } - - // hide textarea - textarea.hide().css('width', '100%').before(iframe).after(htmlsrc); - - // create an editor - var oEditor = new xe.XpressCore(); - var oWYSIWYGIFrame = iframe.get(0); - var oIRTextarea = textarea.get(0); - var oHTMLSrcTextarea = htmlsrc.get(0); - var elAppContainer = jQuery('.xpress-editor', form).get(0); - - oEditor.getFrame = function(){ return oWYSIWYGIFrame;} - oEditor.getContent = function(){ - editorGetContentTextarea_xe(editor_sequence); - } - - var content = form[content_key].value; - if(xFF && !content) content = '
'; - - form[content_key].value = content; - jQuery("#xpress-editor-"+editor_sequence).val(content); - - // Set standard API - editorRelKeys[editor_sequence] = new Array(); - editorRelKeys[editor_sequence]["primary"] = form[primary_key]; - editorRelKeys[editor_sequence]["content"] = form[content_key]; - editorRelKeys[editor_sequence]["func"] = editorGetContentTextarea_xe; - editorRelKeys[editor_sequence]["editor"] = oEditor; - editorRelKeys[editor_sequence]["pasteHTML"] = function(text){ - oEditor.exec('PASTE_HTML',[text]); - } - xe.Editors[editor_sequence] = oEditor; - - // register plugins - oEditor.registerPlugin(new xe.CorePlugin(null)); - - oEditor.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+editor_sequence).val())); - oEditor.registerPlugin(new xe.StringConverterManager()); - oEditor.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG", oIRTextarea, {nHeight:parseInt(editor_height), nMinHeight:100}, null, elAppContainer)); - oEditor.registerPlugin(new xe.XE_EditingArea_HTMLSrc(oHTMLSrcTextarea)); - oEditor.registerPlugin(new xe.XE_EditingAreaVerticalResizer(elAppContainer)); - oEditor.registerPlugin(new xe.Utils()); - oEditor.registerPlugin(new xe.DialogLayerManager()); - oEditor.registerPlugin(new xe.ActiveLayerManager()); - oEditor.registerPlugin(new xe.Hotkey()); - oEditor.registerPlugin(new xe.XE_WYSIWYGStyler()); - oEditor.registerPlugin(new xe.XE_WYSIWYGStyleGetter()); - oEditor.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap)); - oEditor.registerPlugin(new xe.XE_Toolbar(elAppContainer)); - - oEditor.registerPlugin(new xe.XE_XHTMLFormatter); - oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(editor_sequence)); - - if(jQuery("ul.extra1").length) { - oEditor.registerPlugin(new xe.XE_ColorPalette(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FontColor(elAppContainer)); - oEditor.registerPlugin(new xe.XE_BGColor(elAppContainer)); - oEditor.registerPlugin(new xe.XE_Quote(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FontNameWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FontSizeWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_LineHeightWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_UndoRedo()); - oEditor.registerPlugin(new xe.XE_Table(elAppContainer)); - oEditor.registerPlugin(new xe.XE_Hyperlink(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FormatWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_SCharacter(elAppContainer)); - } - - if(jQuery("ul.extra2").length) { - oEditor.registerPlugin(new xe.XE_Extension(elAppContainer, editor_sequence)); - } - - if(jQuery("ul.extra3").length) { - oEditor.registerPlugin(new xe.XE_EditingModeToggler(elAppContainer)); - } - - if(jQuery("#editorresize").length) { - oEditor.registerPlugin(new xe.XE_Editorresize(elAppContainer, oWYSIWYGIFrame)); - } - //oEditor.registerPlugin(new xe.XE_Preview(elAppContainer)); - - if (!jQuery.browser.msie && !jQuery.browser.opera) { - oEditor.registerPlugin(new xe.XE_WYSIWYGEnterKey(oWYSIWYGIFrame)); - } - - // 자동 저장 사용 - if (s=form._saved_doc_title) { - oEditor.registerPlugin(new xe.XE_AutoSave(oIRTextarea, elAppContainer)); - } - - function load_proc() { - try { - var doc = oWYSIWYGIFrame.contentWindow.document, str; - if (doc.location == 'about:blank') throw 'blank'; - - // get innerHTML - doc.body.innerHTML = doc.body.innerHTML.trim(); - str = doc.body.innerHTML; - - // register plugin - oEditor.registerPlugin(new xe.XE_EditingArea_WYSIWYG(oWYSIWYGIFrame)); - oEditor.registerPlugin(new xe.XpressRangeManager(oWYSIWYGIFrame)); - oEditor.registerPlugin(new xe.XE_ExecCommand(oWYSIWYGIFrame)); - - if(content_font && !doc.body.style.fontFamily) { - doc.body.style.fontFamily = content_font; - } - if(content_font_size && !doc.body.style.fontSize) { - doc.body.style.fontSize = content_font_size; - } - if(content_line_height && !doc.body.style.lineHeight) { - doc.body.style.lineHeight = content_line_height; - } - if(content_word_break === "none") { - doc.body.style.whiteSpace = "nowrap"; - } else { - doc.body.style.wordBreak = content_word_break ? content_word_break : "normal"; - doc.body.style.wordWrap = "break-word"; - } - - var paragraph_css; - if(!content_paragraph_spacing) { - paragraph_css = '.xe_content.editable p { margin: 0; }'; - } else { - paragraph_css = '.xe_content.editable p { margin: 0 0 ' + content_paragraph_spacing + ' 0; }'; - } - var style = doc.createElement('style'); - style.type = 'text/css'; - if (style.styleSheet){ - style.styleSheet.cssText = paragraph_css; - } else { - style.appendChild(doc.createTextNode(paragraph_css)); - } - var head = doc.head || doc.getElementsByTagName('head')[0]; - head.appendChild(style); - - if(content_style === "ckeditor_light") { - doc.body.style.margin = "0"; - } - - // run - oEditor.run(); - } catch(e) { - setTimeout(load_proc, 0); - } - } - - load_proc(); - - return oEditor; -} - -function editorGetContentTextarea_xe(editor_sequence) { - var oEditor = xe.Editors[editor_sequence] || null; - - if (!oEditor) return ''; - - var str = oEditor.getIR(); - - if(!jQuery.trim(str.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/ig, ''))) return ''; - - // 파이어폭스의 경우 의미없는
이 컨텐트 마지막에 추가될 수 있다. - str = str.replace(/
$/i, ''); - - // 속도 문제가 있으므로 1024 문자 미만일 때만 첫 노드가 텍스트 노드인지 테스트 - // 그 이상이면 P 노드가 정상적으로 생성되었다고 가정한다. - if (str.length < 1024) { - var inline_elements = Array('#text','A','BR','IMG','EM','STRONG','SPAN','BIG','CITE','CODE','DD','DFN','HR','INS','KBD','LINK','Q','SAMP','SMALL','SUB','SUP','TT'); - var is_inline_contents = true; - var div = jQuery('
'+str+'
').eq(0); - var nodes = div.contents(); - jQuery.each(nodes, function() { - if (this.nodeType != 3) { - if(jQuery.inArray(this.nodeName, inline_elements ) == -1) { - is_inline_contents = false; - } - } - }); - if(is_inline_contents) str = '

'+str+'

'; - } - - // 이미지 경로를 수정한다. - 20091125 - str = str.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/ig, function(m0,m1,m2){ - return 'src='+(m1||'')+m2; - }); - - str = str.replace(/\<(\/)?([A-Z]+)([^>]*)\>/ig, function(m0,m1,m2,m3) { - if(m3) { - m3 = m3.replace(/ ([A-Z]+?)\=/ig, function(n0,n1) { - n1 = n1.toLowerCase(); - return ' '+n1+'='; - }); - } else { m3 = ''; } - m2 = m2.toLowerCase(); - if(!m1) m1=''; - return '<'+m1+m2+m3+'>'; - }); - str = str.replace('
','
'); - - return str; -} - -function editorGetIframe(srl) { - return jQuery('iframe#editor_iframe_'+srl).get(0); -} - -function editorReplaceHTML(iframe_obj, content) { - var srl = parseInt(iframe_obj.id.replace(/^.*_/,''),10); - editorRelKeys[srl]["pasteHTML"](content); -} - -function editorGetAutoSavedDoc(form) { - var param = new Array(); - param['mid'] = current_mid; - param['editor_sequence'] = form.getAttribute('editor_sequence') - setTimeout(function() { - var response_tags = new Array("error","message","editor_sequence","title","content","document_srl"); - exec_xml('editor',"procEditorLoadSavedDocument", param, function(a,b,c) { editorRelKeys[param['editor_sequence']]['primary'].value = a['document_srl']; if(typeof(uploadSettingObj[param['editor_sequence']]) == 'object') editorUploadInit(uploadSettingObj[param['editor_sequence']], true); }, response_tags); - }, 0); - -} - -// WYSIWYG 모드를 저장하는 확장기능 -xe.XE_GET_WYSYWYG_MODE = jQuery.Class({ - name : "XE_GET_WYSYWYG_MODE", - - $init : function(editor_sequence) { - this.editor_sequence = editor_sequence; - }, - - $ON_CHANGE_EDITING_MODE : function(mode) { - editorMode[this.editor_sequence] = (mode =='HTMLSrc') ? 'html' : 'wysiwyg'; - } -}); - -// 서식 기본 내용을 보존 -xe.XE_PreservTemplate = jQuery.Class({ - name : "XE_PreservTemplate", - isRun : false, - - $BEFORE_SET_IR : function(content) { - if(!this.isRun && !content) { - this.isRun = true; - return false; - } - } -}); - -// 미리보기 확장기능 -xe.XE_Preview = jQuery.Class({ - name : "XE_Preview", - elPreviewButton : null, - - $init : function(elAppContainer) { - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.elPreviewButton = jQuery("BUTTON.xpress_xeditor_preview_button", elAppContainer); - }, - - $ON_MSG_APP_READY : function() { - this.oApp.registerBrowserEvent(this.elPreviewButton.get(0), "click", "EVENT_PREVIEW", []); - }, - - $ON_EVENT_PREVIEW : function() { - // TODO : 버튼이 눌렸을 때의 동작 정의 - } -}); diff --git a/modules/editor/skins/xpresseditor/js/xe_textarea.js b/modules/editor/skins/xpresseditor/js/xe_textarea.js deleted file mode 100644 index 865d37f0d..000000000 --- a/modules/editor/skins/xpresseditor/js/xe_textarea.js +++ /dev/null @@ -1,40 +0,0 @@ -function editorStartTextarea(editor_sequence, content_key, primary_key) { - var obj = xGetElementById('editor_'+editor_sequence); - var use_html = xGetElementById('htm_'+editor_sequence).value; - obj.form.setAttribute('editor_sequence', editor_sequence); - - obj.style.width = '100%'; - - editorRelKeys[editor_sequence] = new Array(); - editorRelKeys[editor_sequence]["primary"] = obj.form[primary_key]; - editorRelKeys[editor_sequence]["content"] = obj.form[content_key]; - editorRelKeys[editor_sequence]["func"] = editorGetContentTextarea; - - var content = obj.form[content_key].value; - if(use_html) { - content = content.replace(/]*)>/ig,"\n"); - if(use_html!='br') { - content = content.replace(/</g, "<"); - content = content.replace(/>/g, ">"); - content = content.replace(/"/g, '"'); - content = content.replace(/&/g, "&"); - } - } - obj.value = content; -} - -function editorGetContentTextarea(editor_sequence) { - var obj = xGetElementById('editor_'+editor_sequence); - var use_html = xGetElementById('htm_'+editor_sequence).value; - var content = obj.value.trim(); - if(use_html) { - if(use_html!='br') { - content = content.replace(/&/g, "&"); - content = content.replace(//g, ">"); - content = content.replace(/\"/g, """); - } - content = content.replace(/(\r\n|\n)/g, "
"); - } - return content; -} \ No newline at end of file diff --git a/modules/editor/skins/xpresseditor/js/xe_textarea.min.js b/modules/editor/skins/xpresseditor/js/xe_textarea.min.js deleted file mode 100644 index 52fd46a34..000000000 --- a/modules/editor/skins/xpresseditor/js/xe_textarea.min.js +++ /dev/null @@ -1 +0,0 @@ -This file is not used in Rhymix. diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.js b/modules/editor/skins/xpresseditor/js/xpresseditor.js deleted file mode 100644 index e2f1d82ee..000000000 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.js +++ /dev/null @@ -1,6091 +0,0 @@ -/**! - * @concat Xpress_Editor.js + xe_interface.js - **/ -(function($){ - -// extends jQuery object -$.extend({ - Class : function(def) { - function c(){ - if (typeof this.$super != 'undefined') this.$super.$this = this; - if ($.isFunction(this.$init)) this.$init.apply(this, arguments); - } - c.prototype = def; - c.constructor = c; - c.extend = Class_extend; - - return c; - }, - $ : function(id) { - if(typeof id == 'string') { - if (id.substring(0,1) == '<') return $(id).get(0); - return $('#'+id).get(0); - } else { - return id; - } - }, - fnBind : function(fn, th/* , args... */) { - var args = $.makeArray(arguments); - args.shift(); args.shift(); - - return function() { - var a = args.concat($.makeArray(arguments)); - - return fn.apply(th, a); - }; - } -}); - -$.browser.nVersion = parseFloat($.browser.version); - -function Class_extend(superDef) { - var Super = superDef.prototype; - - this.prototype.$super = {}; - - function bind(fn) { - return function() { - return fn.apply(this.$this, arguments); - }; - } - - for(var x in Super) { - if (!Super.propertyIsEnumerable(x)) continue; - - if (typeof this.prototype[x] == 'undefined') this.prototype[x] = Super[x]; - this.prototype.$super[x] = $.isFunction(Super[x])?bind(Super[x]):Super[x]; - } - - return this; -} - -if (typeof window.xe == 'undefined') window.xe = {}; - -//{ - /** - * @fileOverview This file contains Xpress framework core - * @name XpressCore.js - */ -xe.XpressCore = $.Class({ - name : "XpressCore", - - $init : function(htOptions){ - htOptions = !htOptions?{}:$.Class({}).extend({ - oDebugger : null - }).extend(htOptions); - if(htOptions.oDebugger){ - this.oDebugger = htOptions.oDebugger; - this.oDebugger.oApp = this; - } - - // To prevent processing a Xpress command before all the plugins are registered and ready, - // Queue up all the commands here until the application's status is changed to READY - this.commandQueue = []; - - this.oCommandMap = {}; - this.oDisabledCommand = {}; - this.aPlugins = []; - - this.appStatus = xe.APP_STATUS["NOT_READY"]; - - // Register the core as a plugin so it can receive messages - this.registerPlugin(this); - }, - - exec : function(msg, args, oEvent){ - // If the application is not yet ready just queue the command - if(this.appStatus == xe.APP_STATUS["NOT_READY"]){ - this.commandQueue[this.commandQueue.length] = {'msg':msg, 'args':args, 'event':oEvent}; - return true; - } - - this.exec = this._exec; - this.exec(msg, args, oEvent); - }, - - delayedExec : function(msg, args, nDelay, oEvent){ - var fExec = $.fnBind(this.exec, this, msg, args, oEvent); - setTimeout(fExec, nDelay); - }, - - _exec : function(msg, args, oEvent){return (this._exec = this.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this, msg, args, oEvent);}, - _execWithDebugger : function(msg, args, oEvent){this.oDebugger.log_MessageStart(msg, args);var bResult = this._doExec(msg, args, oEvent);this.oDebugger.log_MessageEnd(msg, args);return bResult; }, - _execWithoutDebugger : function(msg, args, oEvent){return this._doExec(msg, args, oEvent);}, - _doExec : function(msg, args, oEvent){ - var bContinue = false; - - if(!this.oDisabledCommand[msg]){ - var allArgs = []; - if(args && args.length){ - var iLen = args.length; - for(var i=0; i= 0 && xe.DOMFix.parentNode(aAllNodes[iChildIdx]) == aAllNodes[iCurIdx]){ - iChildIdx = this._recurConstructClonedTree(aAllNodes, iChildIdx, aAllNodes[iCurIdx], oCurNodeCloneWithChildren, oClonedStartContainer, oClonedEndContainer); - } - - // this may trigger an error message in IE when an erroneous script is inserted - oClonedParentNode.insertBefore(oCurNodeCloneWithChildren, oClonedParentNode.firstChild); - - return iChildIdx; - }; - - aNodes[aNodes.length] = xe.DOMFix.parentNode(aNodes[aNodes.length-1]); - _recurConstructClonedTree(aNodes, aNodes.length-1, aNodes[aNodes.length-1], oClonedParentNode); - - return {oStartContainer: oClonedStartContainer, oEndContainer: oClonedEndContainer}; - }, - - cloneRange : function(){ - return this._copyRange(new xe.W3CDOMRange(this._document)); - }, - - _copyRange : function(oClonedRange){ - oClonedRange.collapsed = this.collapsed; - oClonedRange.commonAncestorContainer = this.commonAncestorContainer; - oClonedRange.endContainer = this.endContainer; - oClonedRange.endOffset = this.endOffset; - oClonedRange.startContainer = this.startContainer; - oClonedRange.startOffset = this.startOffset; - oClonedRange._document = this._document; - - return oClonedRange; - }, - - collapse : function(toStart){ - if(toStart){ - this.endContainer = this.startContainer; - this.endOffset = this.startOffset; - }else{ - this.startContainer = this.endContainer; - this.startOffset = this.endOffset; - } - - this._updateRangeInfo(); - }, - - compareBoundaryPoints : function(how, sourceRange){ - switch(how){ - case xe.W3CDOMRange.START_TO_START: - return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.startContainer, sourceRange.startOffset); - case xe.W3CDOMRange.START_TO_END: - return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.startContainer, sourceRange.startOffset); - case xe.W3CDOMRange.END_TO_END: - return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.endContainer, sourceRange.endOffset); - case xe.W3CDOMRange.END_TO_START: - return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.endContainer, sourceRange.endOffset); - } - }, - - _findBody : function(oNode){ - if(!oNode) return null; - while(oNode){ - if(oNode.tagName == "BODY") return oNode; - oNode = xe.DOMFix.parentNode(oNode); - } - return null; - }, - - _compareEndPoint : function(oContainerA, iOffsetA, oContainerB, iOffsetB){ - var iIdxA, iIdxB; - - if(!oContainerA || this._findBody(oContainerA) != this._document.body){ - oContainerA = this._document.body; - iOffsetA = 0; - } - - if(!oContainerB || this._findBody(oContainerB) != this._document.body){ - oContainerB = this._document.body; - iOffsetB = 0; - } - - var compareIdx = function(iIdxA, iIdxB){ - // iIdxX == -1 when the node is the commonAncestorNode - // if iIdxA == -1 - // -> [[...]]... - // if iIdxB == -1 - // -> ...[[...]] - if(iIdxB == -1) iIdxB = iIdxA+1; - if(iIdxA < iIdxB) return -1; - if(iIdxA == iIdxB) return 0; - return 1; - }; - - var oCommonAncestor = this._getCommonAncestorContainer(oContainerA, oContainerB); - - // ================================================================================================================================================ - // Move up both containers so that both containers are direct child nodes of the common ancestor node. From there, just compare the offset - // Add 0.5 for each contaienrs that has "moved up" since the actual node is wrapped by 1 or more parent nodes and therefore its position is somewhere between idx & idx+1 - // NODE1

NODE2

NODE3
- // The position of NODE2 in COMMON_ANCESTOR is somewhere between after NODE1(idx1) and before NODE3(idx2), so we let that be 1.5 - - // container node A in common ancestor container - var oNodeA = oContainerA; - if(oNodeA != oCommonAncestor){ - while((oTmpNode = xe.DOMFix.parentNode(oNodeA)) != oCommonAncestor){oNodeA = oTmpNode;} - - iIdxA = this._getPosIdx(oNodeA)+0.5; - }else iIdxA = iOffsetA; - - // container node B in common ancestor container - var oNodeB = oContainerB; - if(oNodeB != oCommonAncestor){ - while((oTmpNode = xe.DOMFix.parentNode(oNodeB)) != oCommonAncestor){oNodeB = oTmpNode;} - - iIdxB = this._getPosIdx(oNodeB)+0.5; - }else iIdxB = iOffsetB; - - return compareIdx(iIdxA, iIdxB); - }, - - _getCommonAncestorContainer : function(oNode1, oNode2){ - var oComparingNode = oNode2; - - while(oNode1){ - while(oComparingNode){ - if(oNode1 == oComparingNode) return oNode1; - oComparingNode = xe.DOMFix.parentNode(oComparingNode); - } - oComparingNode = oNode2; - oNode1 = xe.DOMFix.parentNode(oNode1); - } - - return this._document.body; - }, - - deleteContents : function(){ - if(this.collapsed) return; - - this._splitTextEndNodesOfTheRange(); - - var aNodes = this._getNodesInRange(); - - if(aNodes.length < 1) return; - - var oPrevNode = aNodes[0].previousSibling; - while(oPrevNode && this._isBlankTextNode(oPrevNode)) oPrevNode = oPrevNode.previousSibling; - - var oNewStartContainer, iNewOffset; - if(!oPrevNode){ - oNewStartContainer = xe.DOMFix.parentNode(aNodes[0]); - iNewOffset = 0; - } - - for(var i=0; i oNode.nodeValue.length) iOffset = oNode.nodeValue.length; - }else{ - if(iOffset > xe.DOMFix.childNodes(oNode).length) iOffset = xe.DOMFix.childNodes(oNode).length; - } - - return iOffset; - }, - - - setEnd : function(refNode, offset){ - offset = this._endsNodeValidation(refNode, offset); - - this.endContainer = refNode; - this.endOffset = offset; - if(!this.startContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(false); - - this._updateRangeInfo(); - }, - - setEndAfter : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter"); - - if(refNode.tagName == "BODY"){ - this.setEnd(refNode, xe.DOMFix.childNodes(refNode).length); - return; - } - this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); - }, - - setEndBefore : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore"); - - if(refNode.tagName == "BODY"){ - this.setEnd(refNode, 0); - return; - } - - this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); - }, - - setStart : function(refNode, offset){ - offset = this._endsNodeValidation(refNode, offset); - - this.startContainer = refNode; - this.startOffset = offset; - - if(!this.endContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(true); - this._updateRangeInfo(); - }, - - setStartAfter : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter"); - - if(refNode.tagName == "BODY"){ - this.setStart(refNode, xe.DOMFix.childNodes(refNode).length); - return; - } - - this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); - }, - - setStartBefore : function(refNode){ - if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore"); - - if(refNode.tagName == "BODY"){ - this.setStart(refNode, 0); - return; - } - this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); - }, - - surroundContents : function(newParent){ - newParent.appendChild(this.extractContents()); - this.insertNode(newParent); - this.selectNode(newParent); - }, - - toString : function(){ - var oTmpContainer = this._document.createElement("DIV"); - oTmpContainer.appendChild(this.cloneContents()); - - return oTmpContainer.textContent || oTmpContainer.innerText || ""; - }, - - _isBlankTextNode : function(oNode){ - if(oNode.nodeType == 3 && oNode.nodeValue == "") return true; - return false; - }, - - _getPosIdx : function(refNode){ - var idx = 0; - for(var node = refNode.previousSibling; node; node = node.previousSibling) idx++; - - return idx; - }, - - _updateRangeInfo : function(){ - if(!this.startContainer){ - this.init(this._document); - return; - } - - this.collapsed = this._isCollapsed(this.startContainer, this.startOffset, this.endContainer, this.endOffset); - - this.commonAncestorContainer = this._getCommonAncestorContainer(this.startContainer, this.endContainer); - }, - - _isCollapsed : function(oStartContainer, iStartOffset, oEndContainer, iEndOffset){ - var bCollapsed = false; - - if(oStartContainer == oEndContainer && iStartOffset == iEndOffset){ - bCollapsed = true; - }else{ - var oActualStartNode = this._getActualStartNode(oStartContainer, iStartOffset); - var oActualEndNode = this._getActualEndNode(oEndContainer, iEndOffset); - - // Take the parent nodes on the same level for easier comparison when they're next to each other - // eg) From - // - // - // - // - // - // - // - // - // - // - // - // - // , it's easier to compare the position of B and D rather than C and F because they are siblings - // - // If the range were collapsed, oActualEndNode will precede oActualStartNode by doing this - oActualStartNode = this._getNextNode(this._getPrevNode(oActualStartNode)); - oActualEndNode = this._getPrevNode(this._getNextNode(oActualEndNode)); - - if(oActualStartNode && oActualEndNode && oActualEndNode.tagName != "BODY" && - (this._getNextNode(oActualEndNode) == oActualStartNode || (oActualEndNode == oActualStartNode && this._isBlankTextNode(oActualEndNode))) - ) - bCollapsed = true; - } - - return bCollapsed; - }, - - _splitTextEndNodesOfTheRange : function(){ - var oEndPoints = this._splitTextEndNodes({oStartContainer: this.startContainer, iStartOffset: this.startOffset, - oEndContainer: this.endContainer, iEndOffset: this.endOffset}); - - this.startContainer = oEndPoints.oStartContainer; - this.startOffset = oEndPoints.iStartOffset; - - this.endContainer = oEndPoints.oEndContainer; - this.endOffset = oEndPoints.iEndOffset; - }, - - _splitTextEndNodes : function(oEndPoints){ - oEndPoints = this._splitStartTextNode(oEndPoints); - oEndPoints = this._splitEndTextNode(oEndPoints); - - return oEndPoints; - }, - - _splitStartTextNode : function(oEndPoints){ - var oStartContainer = oEndPoints.oStartContainer; - var iStartOffset = oEndPoints.iStartOffset; - - var oEndContainer = oEndPoints.oEndContainer; - var iEndOffset = oEndPoints.iEndOffset; - - if(!oStartContainer) return oEndPoints; - if(oStartContainer.nodeType != 3) return oEndPoints; - if(iStartOffset == 0) return oEndPoints; - - if(oStartContainer.nodeValue.length <= iStartOffset) return oEndPoints; - - var oLastPart = oStartContainer.splitText(iStartOffset); - - if(oStartContainer == oEndContainer){ - iEndOffset -= iStartOffset; - oEndContainer = oLastPart; - } - oStartContainer = oLastPart; - iStartOffset = 0; - - return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; - }, - - _splitEndTextNode : function(oEndPoints){ - var oStartContainer = oEndPoints.oStartContainer; - var iStartOffset = oEndPoints.iStartOffset; - - var oEndContainer = oEndPoints.oEndContainer; - var iEndOffset = oEndPoints.iEndOffset; - - if(!oEndContainer) return oEndPoints; - if(oEndContainer.nodeType != 3) return oEndPoints; - - if(iEndOffset >= oEndContainer.nodeValue.length) return oEndPoints; - if(iEndOffset == 0) return oEndPoints; - - oEndContainer.splitText(iEndOffset); - - return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; - }, - - _getNodesInRange : function(){ - if(this.collapsed) return []; - - var oStartNode = this._getActualStartNode(this.startContainer, this.startOffset); - var oEndNode = this._getActualEndNode(this.endContainer, this.endOffset); - - return this._getNodesBetween(oStartNode, oEndNode); - }, - - _getActualStartNode : function(oStartContainer, iStartOffset){ - var oStartNode = oStartContainer;; - - if(oStartContainer.nodeType == 3){ - if(iStartOffset >= oStartContainer.nodeValue.length){ - oStartNode = this._getNextNode(oStartContainer); - if(oStartNode.tagName == "BODY") oStartNode = null; - }else{ - oStartNode = oStartContainer; - } - }else{ - if(iStartOffset < xe.DOMFix.childNodes(oStartContainer).length){ - oStartNode = xe.DOMFix.childNodes(oStartContainer)[iStartOffset]; - }else{ - oStartNode = this._getNextNode(oStartContainer); - if(oStartNode.tagName == "BODY") oStartNode = null; - } - } - - return oStartNode; - }, - - _getActualEndNode : function(oEndContainer, iEndOffset){ - var oEndNode = oEndContainer; - - if(iEndOffset == 0){ - oEndNode = this._getPrevNode(oEndContainer); - if(oEndNode.tagName == "BODY") oEndNode = null; - }else if(oEndContainer.nodeType == 3){ - oEndNode = oEndContainer; - }else{ - oEndNode = xe.DOMFix.childNodes(oEndContainer)[iEndOffset-1]; - } - - return oEndNode; - }, - - _getNextNode : function(oNode){ - if(!oNode || oNode.tagName == "BODY") return this._document.body; - - if(oNode.nextSibling) return oNode.nextSibling; - - return this._getNextNode(xe.DOMFix.parentNode(oNode)); - }, - - _getPrevNode : function(oNode){ - if(!oNode || oNode.tagName == "BODY") return this._document.body; - - if(oNode.previousSibling) return oNode.previousSibling; - - return this._getPrevNode(xe.DOMFix.parentNode(oNode)); - }, - - // includes partially selected - // for
, _getNodesBetween(b, c) will yield to b, "a" and c - _getNodesBetween : function(oStartNode, oEndNode){ - var aNodesBetween = []; - this._nNodesBetweenLen = 0; - - if(!oStartNode || !oEndNode) return aNodesBetween; - - this._recurGetNextNodesUntil(oStartNode, oEndNode, aNodesBetween); - return aNodesBetween; - }, - - _recurGetNextNodesUntil : function(oNode, oEndNode, aNodesBetween){ - if(!oNode) return false; - - if(!this._recurGetChildNodesUntil(oNode, oEndNode, aNodesBetween)) return false; - - var oNextToChk = oNode.nextSibling; - - while(!oNextToChk){ - if(!(oNode = xe.DOMFix.parentNode(oNode))) return false; - - aNodesBetween[this._nNodesBetweenLen++] = oNode; - - if(oNode == oEndNode) return false; - - oNextToChk = oNode.nextSibling; - } - - return this._recurGetNextNodesUntil(oNextToChk, oEndNode, aNodesBetween); - }, - - _recurGetChildNodesUntil : function(oNode, oEndNode, aNodesBetween){ - if(!oNode) return false; - - var bEndFound = false; - var oCurNode = oNode; - if(oCurNode.firstChild){ - oCurNode = oCurNode.firstChild; - while(oCurNode){ - if(!this._recurGetChildNodesUntil(oCurNode, oEndNode, aNodesBetween)){ - bEndFound = true; - break; - } - oCurNode = oCurNode.nextSibling; - } - } - - aNodesBetween[this._nNodesBetweenLen++] = oNode; - - if(bEndFound) return false; - if(oNode == oEndNode) return false; - - return true; - } -}); - -xe.W3CDOMRange.START_TO_START = 0; -xe.W3CDOMRange.START_TO_END = 1; -xe.W3CDOMRange.END_TO_END = 2; -xe.W3CDOMRange.END_TO_START = 3; - - -/** - * @fileOverview This file contains a cross-browser function that implements all of the W3C's DOM Range specification and some more - * @name XpressRange.js - */ -xe.XpressRange = $.Class({ - setWindow : function(win){ - this._window = win; - this._document = win.document; - }, - - $init : function(win){ - this.HUSKY_BOOMARK_START_ID_PREFIX = "xpress_bookmark_start_"; - this.HUSKY_BOOMARK_END_ID_PREFIX = "xpress_bookmark_end_"; - - this.sBlockElement = "P|DIV|LI|H[1-6]|PRE"; - this.sBlockContainer = "BODY|TABLE|TH|TR|TD|UL|OL|BLOCKQUOTE|FORM"; - - this.rxBlockElement = new RegExp("^("+this.sBlockElement+")$"); - this.rxBlockContainer = new RegExp("^("+this.sBlockContainer+")$") - this.rxLineBreaker = new RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$") - - this.setWindow(win); - - this.oSimpleSelection = new xe.SimpleSelection(this._window); - this.selectionLoaded = this.oSimpleSelection.selectionLoaded; - - this.$super.$init(this._document); - }, - - select : function(){ - this.oSimpleSelection.selectRange(this); - }, - - setFromSelection : function(iNum){ - this.setRange(this.oSimpleSelection.getRangeAt(iNum)); - }, - - setRange : function(oW3CRange){ - this.setStart(oW3CRange.startContainer, oW3CRange.startOffset); - this.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); - }, - - setEndNodes : function(oSNode, oENode){ - this.setEndAfter(oENode); - this.setStartBefore(oSNode); - }, - - splitTextAtBothEnds : function(){ - this._splitTextEndNodesOfTheRange(); - }, - - getStartNode : function(){ - if(this.collapsed){ - if(this.startContainer.nodeType == 3){ - if(this.startOffset == 0) return null; - if(this.startContainer.nodeValue.length <= this.startOffset) return null; - return this.startContainer; - } - return null; - } - - if(this.startContainer.nodeType == 3){ - if(this.startOffset >= this.startContainer.nodeValue.length) return this._getNextNode(this.startContainer); - return this.startContainer; - }else{ - if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) return this._getNextNode(this.startContainer); - return xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; - } - }, - - getEndNode : function(){ - if(this.collapsed) return this.getStartNode(); - - if(this.endContainer.nodeType == 3){ - if(this.endOffset == 0) return this._getPrevNode(this.endContainer); - return this.endContainer; - }else{ - if(this.endOffset == 0) return this._getPrevNode(this.endContainer); - return xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; - } - }, - - getNodeAroundRange : function(bBefore, bStrict){ - if(this.collapsed && this.startContainer && this.startContainer.nodeType == 3) return this.startContainer; - if(!this.collapsed || (this.startContainer && this.startContainer.nodeType == 3)) return this.getStartNode(); - - var oBeforeRange, oAfterRange, oResult; - - if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) - oAfterRange = this._getNextNode(this.startContainer); - else - oAfterRange = xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; - - if(this.endOffset == 0) - oBeforeRange = this._getPrevNode(this.endContainer); - else - oBeforeRange = xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; - - if(bBefore){ - oResult = oBeforeRange; - if(!oResult && !bStrict) oResult = oAfterRange; - }else{ - oResult = oAfterRange; - if(!oResult && !bStrict) oResult = oBeforeRange; - } - - return oResult; - }, - - _getXPath : function(elNode){ - var sXPath = ""; - - while(elNode && elNode.nodeType == 1){ - sXPath = "/" + elNode.tagName+"["+this._getPosIdx4XPath(elNode)+"]" + sXPath; - elNode = xe.DOMFix.parentNode(elNode); - } - - return sXPath; - }, - - _getPosIdx4XPath : function(refNode){ - var idx = 0; - for(var node = refNode.previousSibling; node; node = node.previousSibling) - if(node.tagName == refNode.tagName) idx++; - - return idx; - }, - - // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes - _evaluateXPath : function(sXPath, oDoc){ - sXPath = sXPath.substring(1, sXPath.length-1); - var aXPath = sXPath.split(/\//); - var elNode = oDoc.body; - - for(var i=2; i -1 && elContainer){ - var aChildNodes = xe.DOMFix.childNodes(elContainer); - var elNode = null; - - var nIdx = nTextNodeIdx; - var nOffsetLeft = nOffset; - - while((elNode = aChildNodes[nIdx]) && elNode.nodeType == 3 && elNode.nodeValue.length < nOffsetLeft){ - nOffsetLeft -= elNode.nodeValue.length; - nIdx++; - } - - elContainer = xe.DOMFix.childNodes(elContainer)[nIdx]; - nOffset = nOffsetLeft; - } - - if(!elContainer){ - elContainer = this._document.body; - nOffset = 0; - } - return {elContainer: elContainer, nOffset: nOffset}; - }, - - // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes - getXPathBookmark : function(){ - var nTextNodeIdx1 = -1; - var htEndPt1 = {elContainer: this.startContainer, nOffset: this.startOffset}; - var elNode1 = this.startContainer; - if(elNode1.nodeType == 3){ - htEndPt1 = this._getFixedStartTextNode(); - nTextNodeIdx1 = this._getPosIdx(htEndPt1.elContainer); - elNode1 = xe.DOMFix.parentNode(elNode1); - } - var sXPathNode1 = this._getXPath(elNode1); - var oBookmark1 = {sXPath:sXPathNode1, nTextNodeIdx:nTextNodeIdx1, nOffset: htEndPt1.nOffset}; - - var nTextNodeIdx2 = -1; - var htEndPt2 = {elContainer: this.endContainer, nOffset: this.endOffset}; - var elNode2 = this.endContainer; - if(elNode2.nodeType == 3){ - htEndPt2 = this._getFixedEndTextNode(); - nTextNodeIdx2 = this._getPosIdx(htEndPt2.elContainer); - elNode2 = xe.DOMFix.parentNode(elNode2); - } - var sXPathNode2 = this._getXPath(elNode2); - var oBookmark2 = {sXPath:sXPathNode2, nTextNodeIdx:nTextNodeIdx2, nOffset: htEndPt2.nOffset}; - - return [oBookmark1, oBookmark2]; - }, - - moveToXPathBookmark : function(aBookmark){ - if(!aBookmark) return; - - var oBookmarkInfo1 = this._evaluateXPathBookmark(aBookmark[0]); - var oBookmarkInfo2 = this._evaluateXPathBookmark(aBookmark[1]); - - if(!oBookmarkInfo1["elContainer"] || !oBookmarkInfo2["elContainer"]) return; - - this.startContainer = oBookmarkInfo1["elContainer"]; - this.startOffset = oBookmarkInfo1["nOffset"]; - - this.endContainer = oBookmarkInfo2["elContainer"]; - this.endOffset = oBookmarkInfo2["nOffset"]; - }, - - _getFixedTextContainer : function(elNode, nOffset){ - while(elNode && elNode.nodeType == 3 && elNode.previousSibling && elNode.previousSibling.nodeType == 3){ - nOffset += elNode.previousSibling.nodeValue.length; - elNode = elNode.previousSibling; - } - - return {elContainer:elNode, nOffset:nOffset}; - }, - - _getFixedStartTextNode : function(){ - return this._getFixedTextContainer(this.startContainer, this.startOffset); - }, - - _getFixedEndTextNode : function(){ - return this._getFixedTextContainer(this.endContainer, this.endOffset); - }, - - placeStringBookmark : function(){ - var sTmpId = (new Date()).getTime(); - - var oInsertionPoint = this.cloneRange(); - oInsertionPoint.collapseToEnd(); - var oEndMarker = this._document.createElement("A"); - oEndMarker.id = this.HUSKY_BOOMARK_END_ID_PREFIX+sTmpId; - oInsertionPoint.insertNode(oEndMarker); - - var oInsertionPoint = this.cloneRange(); - oInsertionPoint.collapseToStart(); - var oStartMarker = this._document.createElement("A"); - oStartMarker.id = this.HUSKY_BOOMARK_START_ID_PREFIX+sTmpId; - oInsertionPoint.insertNode(oStartMarker); - - this.moveToBookmark(sTmpId); - - return sTmpId; - }, - - cloneRange : function(){ - return this._copyRange(new xe.XpressRange(this._window)); - }, - - moveToBookmark : function(vBookmark){ - if(typeof(vBookmark) != "object") - this.moveToStringBookmark(vBookmark); - else - this.moveToXPathBookmark(vBookmark); - }, - - moveToStringBookmark : function(sBookmarkID){ - var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); - var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); - - if(!oStartMarker || !oEndMarker) return; - - this.setEndBefore(oEndMarker); - this.setStartAfter(oStartMarker); - }, - - removeStringBookmark : function(sBookmarkID){ - var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); - var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); - - if(oStartMarker) xe.DOMFix.parentNode(oStartMarker).removeChild(oStartMarker); - if(oEndMarker) xe.DOMFix.parentNode(oEndMarker).removeChild(oEndMarker); - }, - - collapseToStart : function(){ - this.collapse(true); - }, - - collapseToEnd : function(){ - this.collapse(false); - }, - - createAndInsertNode : function(sTagName){ - tmpNode = this._document.createElement(tagName); - this.insertNode(tmpNode) - return tmpNode - }, - - getNodes : function(bSplitTextEndNodes, fnFilter){ - if(bSplitTextEndNodes) this._splitTextEndNodesOfTheRange(); - - var aAllNodes = this._getNodesInRange(); - var aFilteredNodes = []; - - if(!fnFilter) return aAllNodes; - - for(var i=0; i= 0) return true; - - if(bIncludePartlyIncluded){ - if(startToEnd == 1) return false; - if(endToStart == -1) return false; - return true; - } - - return false; - }, - - isNodeInRange : function(oNode, bIncludePartlySelected, bContentOnly){ - var oTmpRange = new xe.XpressRange(this._window); - - if(bContentOnly && oNode.firstChild){ - oTmpRange.setStartBefore(oNode.firstChild); - oTmpRange.setEndAfter(oNode.lastChild); - }else{ - oTmpRange.selectNode(oNode); - } - - return isRangeInRange(oTmpRange, bIncludePartlySelected); - }, - - pasteHTML : function(sHTML){ - if(sHTML == ""){ - this.deleteContents(); - return; - } - - var oTmpDiv = this._document.createElement("DIV"); - oTmpDiv.innerHTML = sHTML; - - var oFirstNode = oTmpDiv.firstChild; - var oLastNode = oTmpDiv.lastChild; - - var clone = this.cloneRange(); - var sBM = clone.placeStringBookmark(); - - while(oTmpDiv.lastChild) this.insertNode(oTmpDiv.lastChild); - - this.setEndNodes(oFirstNode, oLastNode); - - // delete the content later as deleting it first may mass up the insertion point - // eg)

[A]BCD

---paste O---> O

BCD

- clone.moveToBookmark(sBM); - clone.deleteContents(); - clone.removeStringBookmark(sBM); - }, - - toString : function(){ - this.toString = xe.W3CDOMRange.prototype.toString; - return this.toString(); - }, - - toHTMLString : function(){ - var oTmpContainer = this._document.createElement("DIV"); - oTmpContainer.appendChild(this.cloneContents()); - - return oTmpContainer.innerHTML; - }, - - findAncestorByTagName : function(sTagName){ - var oNode = this.commonAncestorContainer; - while(oNode && oNode.tagName != sTagName) oNode = xe.DOMFix.parentNode(oNode); - - return oNode; - }, - - selectNodeContents : function(oNode){ - if(!oNode) return; - - var oFirstNode = oNode.firstChild?oNode.firstChild:oNode; - var oLastNode = oNode.lastChild?oNode.lastChild:oNode; - - if(oFirstNode.nodeType == 3) - this.setStart(oFirstNode, 0); - else - this.setStartBefore(oFirstNode); - - if(oLastNode.nodeType == 3) - this.setEnd(oLastNode, oLastNode.nodeValue.length); - else - this.setEndAfter(oLastNode); - }, - - styleRange : function(oStyle, oAttribute, sNewSpanMarker){ - var aStyleParents = this._getStyleParentNodes(sNewSpanMarker); - if(aStyleParents.length < 1) return; - - var sName, sValue; - - for(var i=0; i= 0)){ - oSNode = this.getNodeAroundRange(false, true); - oENode = this.getNodeAroundRange(false, true); - oStart = this._getLineStartInfo(oSNode); - oEnd = this._getLineEndInfo(oENode); - } - - return {oStart: oStart, oEnd: oEnd}; - } -}).extend(xe.W3CDOMRange); - -/** - * @fileOverview This file contains cross-browser selection function - * @name SimpleSelection.js - */ -xe.SimpleSelection = function(win){ - this.init = function(win){ - this._window = win || window; - this._document = this._window.document; - }; - - this.init(win); - - if($.browser.msie) - xe.SimpleSelectionImpl_IE.apply(this); - else - xe.SimpleSelectionImpl_FF.apply(this); - - this.selectRange = function(oRng){ - this.selectNone(); - this.addRange(oRng); - }; - - this.selectionLoaded = true; - if(!this._oSelection) this.selectionLoaded = false; -}; - -xe.SimpleSelectionImpl_FF = function(){ - this._oSelection = this._window.getSelection(); - - this.getRangeAt = function(iNum){ - iNum = iNum || 0; - - try{ - var oFFRange = this._oSelection.getRangeAt(iNum); - }catch(e){return new xe.W3CDOMRange(this._document);} - - return this._FFRange2W3CRange(oFFRange); - }; - - this.addRange = function(oW3CRange){ - var oFFRange = this._W3CRange2FFRange(oW3CRange); - this._oSelection.addRange(oFFRange); - }; - - this.selectNone = function(){ - this._oSelection.removeAllRanges(); - }; - - this._FFRange2W3CRange = function(oFFRange){ - var oW3CRange = new xe.W3CDOMRange(this._document); - oW3CRange.setStart(oFFRange.startContainer, oFFRange.startOffset); - oW3CRange.setEnd(oFFRange.endContainer, oFFRange.endOffset); - return oW3CRange; - }; - - this._W3CRange2FFRange = function(oW3CRange){ - var oFFRange = this._document.createRange(); - oFFRange.setStart(oW3CRange.startContainer, oW3CRange.startOffset); - oFFRange.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); - - return oFFRange; - }; -}; - -xe.SimpleSelectionImpl_IE = function(){ - this._oSelection = this._document.selection; - - this.getRangeAt = function(iNum){ - iNum = iNum || 0; - - if(this._oSelection.type == "Control"){ - var oW3CRange = new xe.W3CDOMRange(this._document); - - var oSelectedNode = this._oSelection.createRange().item(iNum); - - // if the selction occurs in a different document, ignore - if(!oSelectedNode || oSelectedNode.ownerDocument != this._document) return oW3CRange; - - oW3CRange.selectNode(oSelectedNode); - - return oW3CRange; - }else{ - var oSelectedNode = this._oSelection.createRangeCollection().item(iNum).parentElement(); - - // if the selction occurs in a different document, ignore - if(!oSelectedNode || oSelectedNode.ownerDocument != this._document){ - var oW3CRange = new xe.W3CDOMRange(this._document); - return oW3CRange; - } - return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(iNum)); - } - }; - - this.addRange = function(oW3CRange){ - var oIERange = this._W3CRange2IERange(oW3CRange); - oIERange.select(); - }; - - this.selectNone = function(){ - this._oSelection.empty(); - }; - - this._W3CRange2IERange = function(oW3CRange){ - var oStartIERange = this._getIERangeAt(oW3CRange.startContainer, oW3CRange.startOffset); - var oEndIERange = this._getIERangeAt(oW3CRange.endContainer, oW3CRange.endOffset); - oStartIERange.setEndPoint("EndToEnd", oEndIERange); - - return oStartIERange; - }; - - this._getIERangeAt = function(oW3CContainer, iW3COffset){ - var oIERange = this._document.body.createTextRange(); - - var oEndPointInfoForIERange = this._getSelectableNodeAndOffsetForIE(oW3CContainer, iW3COffset); - - var oSelectableNode = oEndPointInfoForIERange.oSelectableNodeForIE; - var iIEOffset = oEndPointInfoForIERange.iOffsetForIE; - - oIERange.moveToElementText(oSelectableNode); - oIERange.collapse(oEndPointInfoForIERange.bCollapseToStart); - oIERange.moveStart("character", iIEOffset); - - return oIERange; - }; - - this._getSelectableNodeAndOffsetForIE = function(oW3CContainer, iW3COffset){ - var oIERange = this._document.body.createTextRange(); - - var oNonTextNode = null; - var aChildNodes = null; - var iNumOfLeftNodesToCount = 0; - - if(oW3CContainer.nodeType == 3){ - oNonTextNode = xe.DOMFix.parentNode(oW3CContainer); - aChildNodes = xe.DOMFix.childNodes(oNonTextNode); - iNumOfLeftNodesToCount = aChildNodes.length; - }else{ - oNonTextNode = oW3CContainer; - aChildNodes = xe.DOMFix.childNodes(oNonTextNode); - iNumOfLeftNodesToCount = iW3COffset; - } - - var oNodeTester = null; - - var iResultOffset = 0; - - var bCollapseToStart = true; - - for(var i=0; i=0) break; - - oPrevNonTextNode = aChildNodes[i]; - } - - var pointRangeIdx = i; - - if(pointRangeIdx != 0 && aChildNodes[pointRangeIdx-1].nodeType == 3){ - var oRgTextStart = this._document.body.createTextRange(); - var oCurTextNode = null; - if(oPrevNonTextNode){ - oRgTextStart.moveToElementText(oPrevNonTextNode); - oRgTextStart.collapse(false); - oCurTextNode = oPrevNonTextNode.nextSibling; - }else{ - oRgTextStart.moveToElementText(oContainer); - oRgTextStart.collapse(true); - oCurTextNode = oContainer.firstChild; - } - - var oRgTextsUpToThePoint = oRgOrigPoint.duplicate(); - oRgTextsUpToThePoint.setEndPoint("StartToStart", oRgTextStart); - - var textCount = oRgTextsUpToThePoint.text.length - - while(textCount > oCurTextNode.nodeValue.length && oCurTextNode.nextSibling){ - textCount -= oCurTextNode.nodeValue.length; - oCurTextNode = oCurTextNode.nextSibling; - } - - // this will enforce IE to re-reference oCurTextNode - var oTmp = oCurTextNode.nodeValue; - - if(bStartPt && oCurTextNode.nextSibling && oCurTextNode.nextSibling.nodeType == 3 && textCount == oCurTextNode.nodeValue.length){ - textCount -= oCurTextNode.nodeValue.length; - oCurTextNode = oCurTextNode.nextSibling; - } - - oContainer = oCurTextNode; - offset = textCount; - }else{ - oContainer = oRgOrigPoint.parentElement(); - offset = pointRangeIdx; - } - - return {"oContainer" : oContainer, "iOffset" : offset}; - }; -} - -xe.DOMFix = new ($.Class({ - $init : function(){ - if($.browser.msie || $.browser.opera){ - this.childNodes = this._childNodes_Fix; - this.parentNode = this._parentNode_Fix; - }else{ - this.childNodes = this._childNodes_Native; - this.parentNode = this._parentNode_Native; - } - }, - - _parentNode_Native : function(elNode){ - return elNode.parentNode; - }, - - _parentNode_Fix : function(elNode){ - if(!elNode) return elNode; - - while(elNode.previousSibling){elNode = elNode.previousSibling;} - - return elNode.parentNode; - }, - - _childNodes_Native : function(elNode){ - return elNode.childNodes; - }, - - _childNodes_Fix : function(elNode){ - var aResult = null; - var nCount = 0; - - if(elNode){ - var aResult = []; - elNode = elNode.firstChild; - while(elNode){ - aResult[nCount++] = elNode; - elNode=elNode.nextSibling; - } - } - - return aResult; - } -}))(); - -/** - * @fileOverview This file contains a function that takes care of the draggable layers - * @name N_DraggableLayer.js - */ -xe.DraggableLayer = $.Class({ - $init : function(oLayer, oOptions){ - this.oOptions = $.extend({ - bModal : "false", - oHandle : oLayer, - iMinX : -999999, - iMinY : -999999, - iMaxX : 999999, - iMaxY : 999999 - }, oOptions); - - this.oHandle = this.oOptions.oHandle; - - oLayer.style.display = "block"; - oLayer.style.position = "absolute"; - oLayer.style.zIndex = "9999"; - - this.aBasePosition = this.getBaseOffset(oLayer); - - // "number-ize" the position and set it as inline style. (the position could've been set as "auto" or set by css, not inline style) - oLayer.style.top = (this.toInt($(oLayer).offset().top) - this.aBasePosition.top)+"px"; - oLayer.style.left = (this.toInt($(oLayer).offset().left) - this.aBasePosition.left)+"px"; - - this.$FnMouseDown = $.fnBind(this._mousedown, this, oLayer); - this.$FnMouseMove = $.fnBind(this._mousemove, this, oLayer); - this.$FnMouseUp = $.fnBind(this._mouseup, this, oLayer); - - $(this.oHandle).bind("mousedown", this.$FnMouseDown); - }, - - _mousedown : function(oLayer, oEvent){ - if(oEvent.target.tagName == "INPUT") return; - - this.MouseOffsetY = (oEvent.pageY-this.toInt(oLayer.style.top)-this.aBasePosition['top']); - this.MouseOffsetX = (oEvent.pageX-this.toInt(oLayer.style.left)-this.aBasePosition['left']); - - $(oLayer).bind("mousemove", this.$FnMouseMove); - $(oLayer).bind("mouseup", this.$FnMouseUp); - }, - - _mousemove : function(oLayer, oEvent){ - var iTop = (oEvent.pageY-this.MouseOffsetY-this.aBasePosition['top']); - var iLeft = (oEvent.pageX-this.MouseOffsetX-this.aBasePosition['left']); - - if(iTopthis.oOptions.iMaxY) iTop = this.oOptions.iMaxY; - - if(iLeftthis.oOptions.iMaxX) iLeft = this.oOptions.iMaxX; - - oLayer.style.top = iTop + "px"; - oLayer.style.left = iLeft + "px"; - }, - - _mouseup : function(oLayer, oEvent){ - $(oLayer).unbind("mousemove", this.$FnMouseMove); - $(oLayer).unbind("mouseup", this.$FnMouseUp); - }, - - toInt : function(num){ - var result = parseInt(num); - return result || 0; - }, - - findNonStatic : function(oEl){ - if(!oEl) return null; - if(oEl.tagName == "BODY") return oEl; - - if($(oEl).css("position").match(/absolute|relative/i)) return oEl; - - return this.findNonStatic(oEl.offsetParent); - }, - - getBaseOffset : function(oEl){ - var oBase = this.findNonStatic(oEl.offsetParent); - var tmp = $(oBase).offset(); - - return {top: tmp.top, left: tmp.left}; - } -}); -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the messages related to core operations - * @name hp_CorePlugin.js - */ -xe.CorePlugin = $.Class({ - name : "CorePlugin", - - $init : function(funcOnReady){ - this.funcOnReady = funcOnReady; - }, - - $AFTER_MSG_APP_READY : function(){ - this.oApp.exec("EXEC_ON_READY_FUNCTION", []); - }, - - $ON_ADD_APP_PROPERTY : function(sPropertyName, oProperty){ - this.oApp[sPropertyName] = oProperty; - }, - - $ON_REGISTER_BROWSER_EVENT : function(obj, sEvent, sCMD, aParams, nDelay){ - this.oApp.registerBrowserEvent(obj, sEvent, sCMD, aParams, nDelay); - }, - - $ON_DISABLE_COMMAND : function(sCommand){ - this.oApp.disableCommand(sCommand, true); - }, - - $ON_ENABLE_COMMAND : function(sCommand){ - this.oApp.disableCommand(sCommand, false); - }, - - $ON_EXEC_ON_READY_FUNCTION : function(){ - if(typeof this.funcOnReady == "function") this.funcOnReady(); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that helps various operations. - * @name hp_Utils.js - */ - xe.Utils = $.Class({ - name : "Utils", - - $init : function(){ - if($.browser.msie && $.browser.nVersion == 6){ - try{ - document.execCommand('BackgroundImageCache', false, true); - }catch(e){} - } - }, - - $ON_ATTACH_HOVER_EVENTS : function(aElms, sHoverClass){ - sHoverClass = sHoverClass || "hover"; - - if(!aElms) return; - - $(aElms).hover( - function(){$(this).addClass(sHoverClass)}, - function(){$(this).removeClass(sHoverClass)} - ); - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that bridges the XpressRange function - * @name hp_XpressRangeManager.js - */ -xe.XpressRangeManager = $.Class({ - name : "XpressRangeManager", - - oWindow : null, - - $init : function(win){ - this.oWindow = win || window; - }, - - $BEFORE_MSG_APP_READY : function(){ - if(this.oWindow && this.oWindow.tagName == "IFRAME") - this.oWindow = this.oWindow.contentWindow; - - this.oApp.exec("ADD_APP_PROPERTY", ["getSelection", $.fnBind(this.getSelection, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["getEmptySelection", $.fnBind(this.getEmptySelection, this)]); - }, - - $ON_SET_EDITING_WINDOW : function(oWindow){ - this.oWindow = oWindow; - }, - - getEmptySelection : function(){ - var oXpressRange = new xe.XpressRange(this.oWindow); - return oXpressRange; - }, - - getSelection : function(){ - this.oApp.exec("RESTORE_IE_SELECTION", []); - - var oXpressRange = this.getEmptySelection(); - - // this may throw an exception if the selected is area is not yet shown - try{ - oXpressRange.setFromSelection(); - }catch(e){} - - return oXpressRange; - } -}); -//} -xe.Hotkey = $.Class({ - name : "Hotkey", - - storage : {}, - keyhash : {}, - - $init : function(){ - this.storage = {}; - - this.keyhash = { - backspace : 8, - tab : 9, - enter : 13, - shift : 16, - ctrl : 17, - alt : 18, - meta : 224, - esc : 27, - space : 32, - pageup : 33, - pagedown : 34, - end : 35, - home : 36, - left : 37, - up : 38, - right : 39, - down : 40, - del : 46, - comma : 188,//(,) - period : 190,//(.) - slash : 191,//(/) - hyphen : 109, - equal : 61 - }; - - if ($.browser.msie || $.browser.safari) { - this.keyhash.hyphen = 189; // (-) - this.keyhash.equal = 187; // (=) - this.keyhash.meta = 91; // meta - } - - - }, - - $ON_MSG_APP_READY : function(){ - $(this.oApp.getWYSIWYGDocument() || document).keydown($.fnBind(this.keydown, this)); - }, - - $ON_REGISTER_HOTKEY : function(sHotkey, sCMD, sArgs){ - if(!sArgs) sArgs = []; - var func = $.fnBind(this.oApp.exec, this.oApp, sCMD, sArgs); - - sHotkey = this.normalize(sHotkey); - if (!sHotkey) return false; - - this.add(sHotkey, func); - }, - - add : function(sHotkey, func) { - if (typeof this.storage[sHotkey] == 'undefined') { - this.storage[sHotkey] = [func]; - } else { - this.storage[sHotkey].push(func); - } - }, - - keydown : function(event) { - var key = [], kh = this.keyhash; - - if ($.inArray(event.keyCode, [kh.shift, kh.ctrl, kh.alt, kh.meta]) >= 0) return; - - if (event.shiftKey) key.push('shift'); - if (event.altKey) key.push('alt'); - if (event.ctrlKey) key.push('ctrl'); - if (event.metaKey) key.push('meta'); - if (!key.length) return; - if (key.length == 1 && event.metaKey) key = ['ctrl', 'meta']; - - key.push(event.keyCode); - - key = key.join('+'); - - if (!this.storage[key]) return; - - $.each(this.storage[key], function(){ this(); }); - - return false; - }, - - normalize : function(sHotkey) { - var shift, ctrl, alt, meta, key, keys = (sHotkey||"").toLowerCase().split('+'); - - shift = ctrl = alt = meta = key = false; - - $.each(keys, function(){ - var s = ""+this; - switch(s) { - case 'shift': shift = true; - case 'alt' : alt = true; - case 'ctrl' : ctrl = true; - case 'meta' : meta = true; - default: - key = s; - } - }); - - if (!key) return ''; - - keys = []; - if (shift) keys.push('shift'); - if (alt) keys.push('alt'); - if (ctrl) keys.push('ctrl'); - if (meta || (ctrl && !shift && !alt)) keys.push('meta'); - - keys.push(this.keyhash[key] || key.toUpperCase().charCodeAt(0)); - - return keys.join('+'); - } -}); - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the draggable layers - * @name hp_DialogLayerManager.js - */ -xe.DialogLayerManager = $.Class({ - name : "DialogLayerManager", - aMadeDraggable : null, - aOpenedLayers : null, - - $init : function(){ - this.aMadeDraggable = []; - this.aOpenedLayers = []; - }, - - $ON_SHOW_DIALOG_LAYER : function(oLayer, bModal){ - oLayer = $.$(oLayer); - bModal = $.$(bModal) || false; - if(!oLayer) return; - - if($.inArray(oLayer, this.aOpenedLayers) != -1) return; - - this.oApp.exec("POSITION_DIALOG_LAYER", [oLayer]); - - this.aOpenedLayers[this.aOpenedLayers.length] = oLayer; - - if($.inArray(oLayer, this.aMadeDraggable) == -1){ - new xe.DraggableLayer(oLayer, {bModal: bModal, iMinY: 0}); - this.aMadeDraggable[this.aMadeDraggable.length] = oLayer; - }else{ - oLayer.style.display = "block"; - } - }, - - $ON_HIDE_LAST_DIALOG_LAYER : function(){ - this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[this.aOpenedLayers.length-1]]); - }, - - $ON_HIDE_ALL_DIALOG_LAYER : function(){ - for(var i=this.aOpenedLayers.length-1; i>=0; i--) - this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[i]]); - }, - - $ON_HIDE_DIALOG_LAYER : function(oLayer){ - oLayer = $.$(oLayer); - - if(oLayer) oLayer.style.display = "none"; - this.aOpenedLayers = $.grep(this.aOpenedLayers, function(a){return a!=oLayer}); - }, - - $ON_SET_DIALOG_LAYER_POSITION : function(oLayer, iTop, iLeft){ - oLayer.style.top = iTop; - oLayer.style.left = iLeft; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the layers that should disappear when the focus is lost - * @name hp_ActiveLayerManager.js - */ -xe.ActiveLayerManager = $.Class({ - name : "ActiveLayerManager", - oCurrentLayer : null, - - $ON_TOGGLE_ACTIVE_LAYER : function(oLayer, sOnOpenCmd, aOnOpenParam, sOnCloseCmd, aOnCloseParam){ - if(oLayer == this.oCurrentLayer){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }else{ - this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sOnCloseCmd, aOnCloseParam]); - if(sOnOpenCmd) this.oApp.exec(sOnOpenCmd, aOnOpenParam); - } - }, - - $ON_SHOW_ACTIVE_LAYER : function(oLayer, sOnCloseCmd, aOnCloseParam){ - oLayer = $.$(oLayer); - this.sOnCloseCmd = sOnCloseCmd; - this.aOnCloseParam = aOnCloseParam; - - var oPrevLayer = this.oCurrentLayer; - - if(oLayer == oPrevLayer) return; - - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - - oLayer.style.display = "block"; - this.oCurrentLayer = oLayer; - }, - - $ON_HIDE_ACTIVE_LAYER : function(){ - var oLayer = this.oCurrentLayer; - if(!oLayer) return; - oLayer.style.display = "none"; - this.oCurrentLayer = null; - - if(this.sOnCloseCmd) - this.oApp.exec(this.sOnCloseCmd, this.aOnCloseParam); - }, - - // for backward compatibility only. - // use HIDE_ACTIVE_LAYER instead! - $ON_HIDE_CURRENT_ACTIVE_LAYER : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }, - - $ON_EVENT_EDITING_AREA_KEYDOWN : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }, - - $ON_EVENT_EDITING_AREA_MOUSEDOWN : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to string conversion. Ususally used to convert the IR value. - * @name hp_StringConverterManager.js - */ -xe.StringConverterManager = $.Class({ - name : "StringConverterManager", - - oConverters : null, - - $init : function(){ - this.oConverters = {}; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oApp.exec("ADD_APP_PROPERTY", ["applyConverter", $.fnBind(this.applyConverter, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["addConverter", $.fnBind(this.addConverter, this)]); - }, - - applyConverter : function(sRuleName, sContent){ - var aConverters = this.oConverters[sRuleName]; - if(!aConverters) return sContent; - - for(var i=0; i*:first-child", aAllLi[i]).get(0); - } - } - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.toolbarArea, "mouseover", "EVENT_TOOLBAR_MOUSEOVER", []); - this.oApp.registerBrowserEvent(this.toolbarArea, "mouseout", "EVENT_TOOLBAR_MOUSEOUT", []); - - this.oApp.exec("ADD_APP_PROPERTY", ["getToolbarButtonByUIName", $.fnBind(this.getToolbarButtonByUIName, this)]); - }, - - $ON_EVENT_TOOLBAR_MOUSEOVER : function(weEvent){ - if(weEvent.target.tagName == "BUTTON") $(weEvent.target).addClass("hover").parent("span").addClass("hover"); - }, - - $ON_EVENT_TOOLBAR_MOUSEOUT : function(weEvent){ - if(weEvent.target.tagName == "BUTTON") $(weEvent.target).removeClass("hover").parent("span").removeClass("hover"); - }, - - $ON_TOGGLE_TOOLBAR_ACTIVE_LAYER : function(oLayer, oBtn, sOpenCmd, aOpenArgs, sCloseCmd, aCloseArgs){ - this.oApp.exec("TOGGLE_ACTIVE_LAYER", [oLayer, "MSG_TOOLBAR_LAYER_SHOWN", [oLayer, oBtn, sOpenCmd, aOpenArgs], sCloseCmd, aCloseArgs]); - }, - - $ON_MSG_TOOLBAR_LAYER_SHOWN : function(oLayer, oBtn, aOpenCmd, aOpenArgs){ - this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); - if(aOpenCmd) this.oApp.exec(aOpenCmd, aOpenArgs); - }, - - $ON_SHOW_TOOLBAR_ACTIVE_LAYER : function(oLayer, sCmd, aArgs, oBtn){ - this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sCmd, aArgs]); - this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); - }, - - $ON_ENABLE_UI : function(sUIName){ - var elUI = this.htUIList[sUIName]; - if(!elUI) return; - $(elUI).removeClass("off"); - elUI.disabled = false; - - // enable related commands - var sCmd = ""; - if(this.aUICmdMap[sUIName]){ - for(var i=0; i nToolbarLeft) oLayer.style.left = (nToolbarLeft-nLayerLeft-5)+"px"; - }, - - getToolbarButtonByUIName : function(sUIName){ - return this.htUIList[sUIName]; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that manages multiple number editing area plugins and the IR value - * @name hp_XE_EditingAreaManager.js - */ -xe.XE_EditingAreaManager = $.Class({ - name : "XE_EditingAreaManager", - - // Currently active plugin instance(XE_EditingArea_???) - oActivePlugin : null, - - // Intermediate Representation of the content being edited. - // This should be a textarea element. - oIRField : null, - - bIsDirty : false, - - $init : function(sInitialMode, oIRField, oDimension, fOnBeforeUnload, oAppContainer){ - this.sInitialMode = sInitialMode; - this.oIRField = $.$(oIRField); - this._assignHTMLObjects(oAppContainer); - this.fOnBeforeUnload = fOnBeforeUnload; - - this.oEditingMode = {}; - - this.elEditingAreaContainer.style.height = parseInt(oDimension.nHeight || this.elEditingAreaContainer.offsetHeight)+"px"; - - this.nMinHeight = oDimension.nMinHeight || 10; - this.niMinWidth = oDimension.nMinWidth || 10; - }, - - _assignHTMLObjects : function(oAppContainer){ - oAppContainer = $.$(oAppContainer) || document; - this.elEditingAreaContainer = $("DIV.xpress_xeditor_editing_area_container", oAppContainer).get(0); - this.elEditingAreaSkipUI = $("A.skip", oAppContainer).get(0); - }, - - $BEFORE_MSG_APP_READY : function(msg){ - this.oApp.exec("ADD_APP_PROPERTY", ["elEditingAreaContainer", this.elEditingAreaContainer]); - this.oApp.exec("ADD_APP_PROPERTY", ["getIR", $.fnBind(this.getIR, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["setIR", this.setIR]); - this.oApp.exec("ADD_APP_PROPERTY", ["getEditingMode", $.fnBind(this.getEditingMode, this)]); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.exec("CHANGE_EDITING_MODE", [this.sInitialMode, true]); - this.oApp.exec("LOAD_IR_FIELD", [false]); - - this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "focus", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); - this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "blur", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); - -// var fOnBeforeUnload = this.fOnBeforeUnload||function(){if(this.getIR() != this.oIRField.value || this.bIsDirty) return this.oApp.$MSG("XE_EditingAreaManager.onExit")}; -// $(window).bind("beforeunload", $.fnBind(fOnBeforeUnload, this)); - }, - - $AFTER_MSG_APP_READY : function(){ - this.oApp.exec("UPDATE_IR_FIELD", []); - }, - - $ON_LOAD_IR_FIELD : function(bDontAddUndo){ - this.oApp.setIR(this.oIRField.value, bDontAddUndo); - }, - - $ON_UPDATE_IR_FIELD : function(){ - this.oIRField.value = this.oApp.getIR(); - }, - - $BEFORE_CHANGE_EDITING_MODE : function(sMode){ - this._oPrevActivePlugin = this.oActivePlugin; - this.oActivePlugin = this.oEditingMode[sMode]; - }, - - $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - if(this._oPrevActivePlugin){ - var sIR = this._oPrevActivePlugin.getIR(); - this.oApp.exec("SET_IR", [sIR]); - - this.oApp.exec("ENABLE_UI", [this._oPrevActivePlugin.sMode]); - - this._setEditingAreaDimension(); - } - this.oApp.exec("DISABLE_UI", [this.oActivePlugin.sMode]); - - if(!bNoFocus){ - this.oApp.exec("FOCUS", []); - } - }, - - $ON_SET_IS_DIRTY : function(bIsDirty){ - this.bIsDirty = bIsDirty; - }, - - $ON_FOCUS : function(){ - if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return - - this.oActivePlugin.focus(); - }, - - $BEFORE_SET_IR : function(sIR, bDontAddUndoHistory){ - bDontAddUndoHistory = bDontAddUndoHistory || false; - if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); - }, - - $ON_SET_IR : function(sIR){ - if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return - - this.oActivePlugin.setIR(sIR); - }, - - $AFTER_SET_IR : function(sIR, bDontAddUndoHistory){ - bDontAddUndoHistory = bDontAddUndoHistory || false; - if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); - }, - - $ON_REGISTER_EDITING_AREA : function(oEditingAreaPlugin){ - this.oEditingMode[oEditingAreaPlugin.sMode] = oEditingAreaPlugin; - this.attachDocumentEvents(oEditingAreaPlugin.oEditingArea); - }, - - $ON_MSG_EDITING_AREA_RESIZE_STARTED : function(){ - this.oActivePlugin.elEditingArea.style.display = "none"; - - this.iStartingHeight = parseInt(this.elEditingAreaContainer.style.height); - }, - - $ON_RESIZE_EDITING_AREA: function(ipNewWidth, ipNewHeight){ - var iNewWidth = parseInt(ipNewWidth); - var iNewHeight = parseInt(ipNewHeight); - - if(iNewWidth < this.niMinWidth) iNewWidth = this.niMinWidth; - if(iNewHeight < this.nMinHeight) iNewHeight = this.nMinHeight; - - if(ipNewWidth) this.elEditingAreaContainer.style.width = iNewWidth + "px"; - if(ipNewHeight) this.elEditingAreaContainer.style.height = iNewHeight + "px"; - }, - - $ON_RESIZE_EDITING_AREA_BY : function(ipWidthChange, ipHeightChange){ - var iWidthChange = parseInt(ipWidthChange); - var iHeightChange = parseInt(ipHeightChange); - - var iWidth = this.elEditingAreaContainer.style.width?parseInt(this.elEditingAreaContainer.style.width)+iWidthChange:null; - var iHeight = this.elEditingAreaContainer.style.height?this.iStartingHeight+iHeightChange:null; - - this.oApp.exec("RESIZE_EDITING_AREA", [iWidth, iHeight]); - }, - - $ON_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ - this.oActivePlugin.elEditingArea.style.display = "block"; - this._setEditingAreaDimension(); - }, - - _setEditingAreaDimension : function(){ - this.oActivePlugin.elEditingArea.style.height = this.elEditingAreaContainer.style.height; - this.oActivePlugin.elEditingArea.style.width = this.elEditingAreaContainer.style.width; - }, - - attachDocumentEvents : function(doc){ - this.oApp.registerBrowserEvent(doc, "click", "EVENT_EDITING_AREA_CLICK"); - this.oApp.registerBrowserEvent(doc, "mousedown", "EVENT_EDITING_AREA_MOUSEDOWN"); - this.oApp.registerBrowserEvent(doc, "mousemove", "EVENT_EDITING_AREA_MOUSEMOVE"); - this.oApp.registerBrowserEvent(doc, "mouseup", "EVENT_EDITING_AREA_MOUSEUP"); - this.oApp.registerBrowserEvent(doc, "keydown", "EVENT_EDITING_AREA_KEYDOWN"); - this.oApp.registerBrowserEvent(doc, "keypress", "EVENT_EDITING_AREA_KEYPRESS"); - this.oApp.registerBrowserEvent(doc, "keyup", "EVENT_EDITING_AREA_KEYUP"); - }, - - getIR : function(){ - return this.oActivePlugin.getIR(); - }, - - setIR : function(sIR, bDontAddUndo){ - this.oApp.exec("SET_IR", [sIR, bDontAddUndo]); - }, - - getEditingMode : function(){ - return this.oActivePlugin.sMode; - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to editing the HTML source code using Textarea element - * @name hp_XE_EditingArea_HTMLSrc.js - * @required XE_EditingAreaManager - */ -xe.XE_EditingArea_HTMLSrc = $.Class({ - name : "XE_EditingArea_HTMLSrc", - - sMode : "HTMLSrc", - textarea : null, - - $init : function(textarea){ - this.textarea = $.$(textarea); - this.elEditingArea = this.textarea; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oEditingArea = this.textarea; - this.oApp.exec("REGISTER_EDITING_AREA", [this]); - }, - - $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - if(sMode == this.sMode){ - this.textarea.style.display = "block"; - }else{ - this.textarea.style.display = "none"; - } - }, - - $ON_PASTE_HTML : function(sHTML, oPSelection){ - if(this.oApp.getEditingMode() != this.sMode) return; - - var o = new TextRange(this.textarea); - o.paste(sHTML); - this.textarea.focus(); - }, - - getIR : function(){ - var sIR; - var sContent = this.textarea.value; - - if(this.oApp.applyConverter) - sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); - else - sIR = sContent; - - return sIR; - }, - - setIR : function(sIR){ - var sContent; - - if(this.oApp.applyConverter) - sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); - else - sContent = sIR; - - this.textarea.value = sContent; - }, - - focus : function(){ - this.textarea.focus(); - } -}); - -var TextRange = function(oEl) { - this._o = oEl; -}; - -/** - * Selection for textfield - * @author NAVER (developer@xpressengine.com) - */ -TextRange.prototype.getSelection = function() { - var obj = this._o; - var ret = [ -1, -1 ]; - - if (isNaN(this._o.selectionStart)) { - obj.focus(); - - // textarea support added by nagoon97 - var range = document.body.createTextRange(); - var rangeField = null; - - rangeField = document.selection.createRange().duplicate(); - range.moveToElementText(obj); - rangeField.collapse(true); - range.setEndPoint("EndToEnd", rangeField); - ret[0] = range.text.length; - - rangeField = document.selection.createRange().duplicate(); - range.moveToElementText(obj); - rangeField.collapse(false); - range.setEndPoint("EndToEnd", rangeField); - ret[1] = range.text.length; - - obj.blur(); - } else { - ret[0] = obj.selectionStart; - ret[1] = obj.selectionEnd; - } - - return ret; -}; - -TextRange.prototype.setSelection = function(start, end) { - - var obj = this._o; - if (typeof end == 'undefined') end = start; - - if (obj.setSelectionRange) { - - obj.setSelectionRange(start, end); - - } else if (obj.createTextRange) { - - var range = obj.createTextRange(); - - range.collapse(true); - range.moveStart("character", start); - range.moveEnd("character", end - start); - range.select(); - - obj.blur(); - } - -}; - -TextRange.prototype.copy = function() { - - var r = this.getSelection(); - return this._o.value.substring(r[0], r[1]); - -}; - -TextRange.prototype.paste = function(sStr) { - - var obj = this._o; - var sel = this.getSelection(); - - var value = obj.value; - - var pre = value.substr(0, sel[0]); - var post = value.substr(sel[1]); - - value = pre + sStr + post; - obj.value = value; - - var n = 0; - if ( typeof document.body.style.maxHeight == "undefined" ) { - var a = pre.match( /\n/gi ); - n = ( a != null ? a.length : 0 ); - } - this.setSelection(sel[0] + sStr.length - n ); - -}; - -TextRange.prototype.cut = function() { - var r = this.copy(); - this.paste(''); - - return r; -}; -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to WYSIWYG iframe - * @name hp_XE_EditingArea_WYSIWYG.js - */ -xe.XE_EditingArea_WYSIWYG = $.Class({ - name : "XE_EditingArea_WYSIWYG", - status : xe.PLUGIN_STATUS["NOT_READY"], - - sMode : "WYSIWYG", - iframe : null, - doc : null, - - iLastUndoRecorded : 0, - iMinUndoInterval : 3000, - - _nIFrameReadyCount : 50, - - $init : function(iframe){ - this.iframe = $.$(iframe); - - this.initIframe(); - - this.elEditingArea = iframe; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oEditingArea = this.doc; - this.oApp.exec("REGISTER_EDITING_AREA", [this]); - this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGWindow", $.fnBind(this.getWindow, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGDocument", $.fnBind(this.getDocument, this)]); - }, - - $ON_MSG_APP_READY : function(){ - // uncomment this line if you wish to use the IE-style cursor in FF - // this.getDocument().body.style.cursor = "text"; - - if($.browser.msie){ - $(this.doc) - .unbind('keydown.ea') - .bind('keydown.ea', $.fnBind( - function(weEvent){ - if(this.doc.selection.type.toLowerCase() == 'control' && weEvent.keyCode == 8) { - this.oApp.exec("EXECCOMMAND", ['delete', false, false]); - weEvent.preventDefault(); weEvent.stopPropagation(); - } - } - , this)); - - $(this.doc.body) - .unbind('mousedown.ea') - .bind('mousedown.ea', $.fnBind( - function(weEvent){ - this._oIERange = null; - this._bIERangeReset = true; - } - , this)) - .unbind('beforedeactivate.ea') - .bind('beforedeactivate.ea', $.fnBind( - function(weEvent){ - // without this, cursor won't make it inside a table. - // mousedown(_oIERange gets reset) -> beforedeactivate(gets fired for table) -> RESTORE_IE_SELECTION - if(this._bIERangeReset) return; - - var tmpRange = this.getDocument().selection.createRange(0); - // Control range does not have parentElement - if(tmpRange.parentElement && tmpRange.parentElement() && tmpRange.parentElement().tagName == "INPUT"){ - this._oIERange = this._oPrevIERange; - }else{ - this._oIERange = tmpRange; - } - } - , this)) - .unbind('mouseup.ea') - .bind('mouseup.ea', $.fnBind( function(weEvent){ this._bIERangeReset = false;}, this)); - } - }, - - $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - if(sMode == this.sMode){ - this.iframe.style.display = "block"; - - this.oApp.exec("REFRESH_WYSIWYG", []); - this.oApp.exec("SET_EDITING_WINDOW", [this.getWindow()]); - }else{ - this.iframe.style.display = "none"; - } - }, - - $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ - this._oIERange = null; - }, - - $ON_REFRESH_WYSIWYG : function(){ - if(!$.browser.mozilla) return; - - this._disableWYSIWYG(); - this._enableWYSIWYG(); - }, - - $ON_ENABLE_WYSIWYG : function(){ - this._enableWYSIWYG(); - }, - - $ON_DISABLE_WYSIWYG : function(){ - this._disableWYSIWYG(); - }, - - $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent) { - // ctrl-left/right add/remove indent - if(!oEvent.ctrlKey) return; - - switch(oEvent.keyCode) { - // outdent - case 37 : - this.oApp.exec("EXECCOMMAND", ["outdent", false, false]); - break; - // indent - case 39 : - this.oApp.exec("EXECCOMMAND", ["indent", false, false]); - break; - // h1 ~ h6, normal - case 49 : - case 50 : - case 51 : - case 52 : - case 53 : - case 54 : - this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, '']); - break; - default : - return; - } - oEvent.preventDefault(); oEvent.stopPropagation(); - - }, - - $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ - // 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down - if(oEvent.keyCode == 229 || oEvent.keyCode == 13 || oEvent.altKey || oEvent.ctrlKey || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 16) return; - this._recordUndo(oEvent); - }, - - $ON_PASTE_HTML : function(sHTML, oPSelection){ - if(this.oApp.getEditingMode() != this.sMode) return; - - var oSelection = oPSelection || this.oApp.getSelection(); - oSelection.pasteHTML(sHTML); - - // every browser except for IE may modify the innerHTML when it is inserted - if(!$.browser.msie){ - var sTmpBookmark = oSelection.placeStringBookmark(); - this.oApp.getWYSIWYGDocument().body.innerHTML = this.oApp.getWYSIWYGDocument().body.innerHTML; - oSelection.moveToBookmark(sTmpBookmark); - oSelection.collapseToEnd(); - oSelection.select(); - oSelection.removeStringBookmark(sTmpBookmark); - } - - this.oApp.exec("RECORD_UNDO_ACTION", ["INSERT HTML"]); - }, - - $AFTER_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ - this.oApp.exec("REFRESH_WYSIWYG", []); - }, - - $ON_RESTORE_IE_SELECTION : function(){ - if(this._oIERange){ - this._oIERange.select(); - this._oPrevIERange = this._oIERange; - this._oIERange = null; - } - }, - - initIframe : function(){ - try { - this.doc = this.iframe.contentWindow.document; - if (this.doc == null || this.doc.location.href == 'about:blank') { - throw new Error('Access denied'); - } - - this._enableWYSIWYG(); - - this.status = xe.PLUGIN_STATUS["READY"]; - } catch(e) { - if(this._nIFrameReadyCount-- > 0){ - setTimeout($.fnBind(this.initIframe, this), 100); - }else{ - throw("iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). "); - } - } - }, - - getIR : function(){ - var sContent = this.doc.body.innerHTML; - var sIR; - - - if(this.oApp.applyConverter) - sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); - else - sIR = sContent; - - return sIR; - }, - - setIR : function(sIR){ - var sContent; - if(this.oApp.applyConverter) - sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); - else - sContent = sIR; - - this.doc.body.innerHTML = sContent; - - if($.browser.mozilla){ - if(this.doc.body.innerHTML == "") this.doc.body.innerHTML = "
"; - } - }, - - getWindow : function(){ - return this.iframe.contentWindow; - }, - - getDocument : function(){ - return this.iframe.contentWindow.document; - }, - - focus : function(){ - //this.getWindow().focus(); - //this.oApp.exec("RESTORE_IE_SELECTION", []); - }, - - _recordUndo : function(oKeyInfo){ - var curTime = new Date(); - if(curTime-this.iLastUndoRecorded < this.iMinUndoInterval) return; - this.oApp.exec("RECORD_UNDO_ACTION", ["KEYPRESS"]); - - this.iLastUndoRecorded = new Date(); - - this.prevKeyCode = oKeyInfo.keyCode; - }, - - _enableWYSIWYG : function(){ - if ($.browser.msie){ - this.doc.body.disabled = true; - this.doc.body.contentEditable = true; - this.doc.body.removeAttribute('disabled'); - } else { - this.doc.designMode = "on"; - } - }, - - _disableWYSIWYG : function(){ - if ($.browser.msie){ - this.doc.body.contentEditable = false; - } else { - this.doc.designMode = "off"; - } - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to resizing the editing area vertically - * @name hp_XE_EditingAreaVerticalResizer.js - */ -xe.XE_EditingAreaVerticalResizer = $.Class({ - name : "XE_EditingAreaVerticalResizer", - oResizeGrip : null, - - $init : function(oAppContainer){ - this._assignHTMLObjects(oAppContainer); - - this.$FnMouseDown = $.fnBind(this._mousedown, this); - this.$FnMouseMove = $.fnBind(this._mousemove, this); - this.$FnMouseUp = $.fnBind(this._mouseup, this); - - $(this.oResizeGrip).bind("mousedown", this.$FnMouseDown); - }, - - _assignHTMLObjects : function(oAppContainer){ - oAppContainer = $.$(oAppContainer) || document; - this.oResizeGrip = $(".xpress_xeditor_editingArea_verticalResizer", oAppContainer).get(0); - }, - - _mousedown : function(oEvent){ - this.iStartHeight = oEvent.clientY; - - $(document).bind("mousemove", this.$FnMouseMove); - $(document).bind("mouseup", this.$FnMouseUp); - - this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); - }, - - _mousemove : function(oEvent){ - var iHeightChange = oEvent.clientY - this.iStartHeight; - - this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]); - }, - - _mouseup : function(oEvent){ - $(document).unbind("mousemove", this.$FnMouseMove); - $(document).unbind("mouseup", this.$FnMouseUp); - - this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the basic editor commands - * @name hp_XE_ExecCommand.js - */ -xe.XE_ExecCommand = $.Class({ - name : "XE_ExecCommand", - oEditingArea : null, - - $init : function(oEditingArea){ - this.oEditingArea = oEditingArea; - }, - - $BEFORE_MSG_APP_READY : function(){ - // the right document will be available only when the src is completely loaded - if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") - this.oEditingArea = this.oEditingArea.contentWindow.document; - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+b", "EXECCOMMAND", ["bold", false, false]]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+u", "EXECCOMMAND", ["underline", false, false]]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+i", "EXECCOMMAND", ["italic", false, false]]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+d", "EXECCOMMAND", ["strikethrough", false, false]]); - - this.oApp.exec("REGISTER_UI_EVENT", ["bold", "click", "EXECCOMMAND", ["bold", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["underline", "click", "EXECCOMMAND", ["underline", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["italic", "click", "EXECCOMMAND", ["italic", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["lineThrough", "click", "EXECCOMMAND", ["strikethrough", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["superscript", "click", "EXECCOMMAND", ["superscript", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["subscript", "click", "EXECCOMMAND", ["subscript", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifyleft", "click", "EXECCOMMAND", ["justifyleft", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifycenter", "click", "EXECCOMMAND", ["justifycenter", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifyright", "click", "EXECCOMMAND", ["justifyright", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["justifyfull", "click", "EXECCOMMAND", ["justifyfull", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["orderedlist", "click", "EXECCOMMAND", ["insertorderedlist", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["unorderedlist", "click", "EXECCOMMAND", ["insertunorderedlist", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["outdent", "click", "EXECCOMMAND", ["outdent", false, false]]); - this.oApp.exec("REGISTER_UI_EVENT", ["indent", "click", "EXECCOMMAND", ["indent", false, false]]); - }, - - $BEFORE_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ - this._bOnlyCursorChanged = false; - - this.oApp.exec("FOCUS", []); - - if(sCommand.match(/^bold|underline|italic|strikethrough|superscript|subscript$/i)){ - var oSelection = this.oApp.getSelection(); - if(oSelection.collapsed) this._bOnlyCursorChanged = true; - } - - if(!this._bOnlyCursorChanged){ - this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", [sCommand]); - } - }, - - $ON_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ - bUserInterface = (bUserInterface == "" || bUserInterface)?bUserInterface:false; - vValue = (vValue == "" || vValue)?vValue:false; - - this.oEditingArea.execCommand(sCommand, bUserInterface, vValue); - }, - - $AFTER_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ - if(!this._bOnlyCursorChanged){ - this.oApp.exec("RECORD_UNDO_AFTER_ACTION", [sCommand]); - } - - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to wrapping the sentence around with a

tag when enter key is pressed - * @name hp_XE_WYSIWYGEnterKey.js - */ -xe.XE_WYSIWYGEnterKey = $.Class({ - name : "XE_WYSIWYGEnterKey", - // IE/Opera do not need this - unsupportedBrowser : ['ie', 'opera'], - oEditingArea : null, - - $init : function(oEditingArea){ - this.oEditingArea = oEditingArea; - }, - - $BEFORE_MSG_APP_READY : function(){ - // the right document will be available only when the src is completely loaded - if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") - this.oEditingArea = this.oEditingArea.contentWindow.document; - }, - - $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent){ - if(this.oApp.getEditingMode() != "WYSIWYG") return; - - if(oEvent.shiftKey) return; - - if(oEvent.keyCode == 13){ - var oSelection = this.oApp.getSelection(); - var sBM = oSelection.placeStringBookmark(); - var oLineInfo = oSelection.getLineInfo(); - var oStart = oLineInfo.oStart; - var oEnd = oLineInfo.oEnd; - - //top.document.title = oStart.oNode.tagName+":"+oStart.oNode.nodeValue+", "+oEnd.oNode.tagName+":"+oEnd.oNode.nodeValue+"::"+oStart.bParentBreak+", "+oStart.oLineBreaker.tagName; - - // line broke by sibling - // or - // the parent line breaker is just a block container - if(!oStart.bParentBreak || oSelection.rxBlockContainer.test(oStart.oLineBreaker.tagName)){ - oEvent.stopPropagation(); - oEvent.preventDefault(); - - var oSWrapper = this.oEditingArea.createElement("P"); - oSelection.moveToBookmark(sBM); - oSelection.setStartBefore(oStart.oNode); - oSelection.surroundContents(oSWrapper); - - oSelection.collapseToEnd(); - - var oEWrapper = this.oEditingArea.createElement("P"); - oSelection.setEndAfter(oEnd.oNode); - oSelection.surroundContents(oEWrapper); - - oSelection.removeStringBookmark(sBM); - - if(oSWrapper.innerHTML == "") oSWrapper.innerHTML = "
"; - if(oEWrapper.innerHTML == "") oEWrapper.innerHTML = "
"; - - if(oEWrapper.nextSibling && oEWrapper.nextSibling.tagName == "BR") oEWrapper.parentNode.removeChild(oEWrapper.nextSibling); - - oSelection.selectNodeContents(oEWrapper); - oSelection.collapseToStart(); - oSelection.select(); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }else{ - oSelection.removeStringBookmark(sBM); - } - } - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to styling the font - * @name hp_XE_WYSIWYGStyler.js - * @required XE_EditingArea_WYSIWYG, XpressRangeManager - */ -xe.XE_WYSIWYGStyler = $.Class({ - name : "XE_WYSIWYGStyler", - - $PRECONDITION : function(sFullCommand, aArgs){ - return (this.oApp.getEditingMode() == "WYSIWYG"); - }, - - $ON_SET_WYSIWYG_STYLE : function(oStyles){ - var oSelection = this.oApp.getSelection(); - - // style cursor - if(oSelection.collapsed){ - var oSpan = this.oApp.getWYSIWYGDocument().createElement("SPAN"); - oSelection.insertNode(oSpan); - oSpan.innerHTML = unescape("%uFEFF"); - - var sValue; - for(var sName in oStyles){ - sValue = oStyles[sName]; - - if(typeof sValue != "string") continue; - - oSpan.style[sName] = sValue; - } - - oSelection.selectNodeContents(oSpan); - oSelection.collapseToEnd(); - oSelection._window.focus(); - oSelection._window.document.body.focus(); - oSelection.select(); - - // FF3 will actually display %uFEFF when it is followed by a number AND certain font-family is used(like Gulim), so remove the chcaracter for FF3 - if($.browser.mozilla && $.browser.nVersion == 3) - oSpan.innerHTML = ""; - - return; - } - - this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", ["FONT STYLE"]); - - oSelection.styleRange(oStyles); - oSelection._window.focus(); - oSelection.select(); - - this.oApp.exec("RECORD_UNDO_AFTER_ACTION", ["FONT STYLE"]); - } -}); -//} - -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to detecting the style change - * @name hp_XE_WYSIWYGStyleGetter.js - */ -xe.XE_WYSIWYGStyleGetter = $.Class({ - name : "XE_WYSIWYGStyleGetter", - - hKeyUp : null, - - getStyleInterval : 200, - - oStyleMap : { - fontFamily : { - type : "Value", - css : "fontFamily" - }, - fontSize : { - type : "Value", - css : "fontSize" - }, - lineHeight : { - type : "Value", - css : "lineHeight", - converter : function(sValue, oStyle){ - if(!sValue.match(/px$/)) return sValue; - - return Math.ceil((parseInt(sValue)/parseInt(oStyle.fontSize))*10)/10; - } - }, - bold : { - command : "bold" - }, - underline : { - command : "underline" - }, - italic : { - command : "italic" - }, - lineThrough : { - command : "strikethrough" - }, - superscript : { - command : "superscript" - }, - subscript : { - command : "subscript" - }, - justifyleft : { - command : "justifyleft" - }, - justifycenter : { - command : "justifycenter" - }, - justifyright : { - command : "justifyright" - }, - justifyfull : { - command : "justifyfull" - }, - orderedlist : { - command : "insertorderedlist" - }, - unorderedlist : { - command : "insertunorderedlist" - } - }, - - $init : function(){ - this.oStyle = this._getBlankStyle(); - }, - - $PRECONDITION : function(){ - if(this.oApp.getEditingMode() != "WYSIWYG") return false; - - return true; - }, - - $ON_MSG_APP_READY : function(){ - this.oDocument = this.oApp.getWYSIWYGDocument(); - this.oApp.exec("ADD_APP_PROPERTY", ["getCurrentStyle", $.fnBind(this.getCurrentStyle, this)]); - }, - - $ON_EVENT_EDITING_AREA_MOUSEUP : function(oEvnet){ - if(this.hKeyUp) clearTimeout(this.hKeyUp); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ - /* - backspace 8 - page up 33 - page down 34 - end 35 - home 36 - left arrow 37 - up arrow 38 - right arrow 39 - down arrow 40 - insert 45 - delete 46 - */ - if(!(oEvent.keyCode == 8 || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 45 || oEvent.keyCode == 46)) return; - - if(this.hKeyUp) clearTimeout(this.hKeyUp); - - this.hKeyUp = setTimeout($.fnBind(this.oApp.exec, this.oApp, "CHECK_STYLE_CHANGE", []), this.getStyleInterval); - }, - - $ON_CHECK_STYLE_CHANGE : function(){ - this._getStyle(); - }, - - $ON_RESET_STYLE_STATUS : function(){ - var oBlankStyle = this._getBlankStyle(); - for(var sAttributeName in oBlankStyle) - this.oApp.exec("SET_STYLE_STATUS", [sAttributeName, oBlankStyle[sAttributeName]]); - }, - - getCurrentStyle : function(){ - return this.oStyle; - }, - - _check_style_change : function(){ - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - _getBlankStyle : function(){ - var oBlankStyle = {}; - for(var attributeName in this.oStyleMap){ - if(this.oStyleMap[attributeName].type == "Value") - oBlankStyle[attributeName] = ""; - else - oBlankStyle[attributeName] = 0; - } - - return oBlankStyle; - }, - - _getStyle : function(){ - var oSelection = this.oApp.getSelection(); - - var funcFilter = function(oNode){ - if (!oNode.childNodes || oNode.childNodes.length == 0) - return true; - else - return false; - } - - var aBottomNodes = oSelection.getNodes(false, funcFilter); - - var oStyle, oBaseStyle, oTmpStyle, attributeName; - if(aBottomNodes.length == 0){ - oStyle = this._getStyleOf(oSelection.commonAncestorContainer); - }else{ - oStyle = this._getStyleOf(aBottomNodes[0]); - } - - for(attributeName in oStyle){ - if(this.oStyleMap[attributeName].converter){ - oStyle[attributeName] = this.oStyleMap[attributeName].converter(oStyle[attributeName], oStyle); - } - - if(this.oStyle[attributeName] != oStyle[attributeName]) - this.oApp.exec("MSG_STYLE_CHANGED", [attributeName, oStyle[attributeName]]); - } - - this.oStyle = oStyle; - }, - - _getStyleOf : function(oNode){ - var oStyle = this._getBlankStyle(); - - // this must not happen - if(!oNode) return oStyle; - - if(oNode.nodeType == 3) oNode = oNode.parentNode; - - var welNode = $(oNode); - var attribute, cssName; - for(var styleName in this.oStyle){ - attribute = this.oStyleMap[styleName]; - - if(attribute.type && attribute.type == "Value"){ - if(attribute.css){ - var sValue = welNode.css(attribute.css); - - if(styleName == "fontFamily"){ - sValue = sValue.split(/,/)[0]; - } - - oStyle[styleName] = sValue; - }else{ - if(attribute.command){ - try{ - oStyle[styleName] = this.oDocument.queryCommandState(attribute.command); - }catch(e){} - }else{ - // todo - } - } - }else{ - if(attribute.command){ - try{ - if(this.oDocument.queryCommandState(attribute.command)){ - oStyle[styleName] = 1; - }else{ - oStyle[styleName] = 0; - } - }catch(e){} - }else{ - // todo - } - } - } - return oStyle; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font size using Select element - * @name hp_XE_FontSizeWithSelectUI.js - */ -xe.XE_FontSizeWithSelectUI = $.Class({ - name : "XE_FontSizeWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFontSizeSelect = $("SELECT.xpress_xeditor_ui_fontSize_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFontSizeSelect, "change", "SET_FONTSIZE_FROM_SELECT_UI"); - this.elFontSizeSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - if(sAttributeName == "fontSize"){ - this.elFontSizeSelect.value = sAttributeValue; - if(this.elFontSizeSelect.selectedIndex < 0) this.elFontSizeSelect.selectedIndex = 0; - } - }, - - $ON_SET_FONTSIZE_FROM_SELECT_UI : function(){ - var sFontSize = this.elFontSizeSelect.value; - if(!sFontSize) return; - - this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontSize":sFontSize}]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font name using Select element - * @name hp_XE_FontNameWithSelectUI.js - */ -xe.XE_FontNameWithSelectUI = $.Class({ - name : "XE_FontNameWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFontNameSelect = $("SELECT.xpress_xeditor_ui_fontName_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFontNameSelect, "change", "SET_FONTNAME_FROM_SELECT_UI"); - this.elFontNameSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - if(sAttributeName == "fontFamily"){ - this.elFontNameSelect.value = sAttributeValue.toLowerCase(); - if(this.elFontNameSelect.selectedIndex < 0) this.elFontNameSelect.selectedIndex = 0; - } - }, - - $ON_SET_FONTNAME_FROM_SELECT_UI : function(){ - var sFontName = this.elFontNameSelect.value; - if(!sFontName) return; - - this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontFamily":sFontName}]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to setting/changing the lineheight - * @name hp_XE_LineHeight.js - */ -xe.XE_LineHeight = $.Class({ - name : "XE_LineHeight", - - $init : function(oAppContainer){ - this._assignHTMLObjects(oAppContainer); - }, - - _assignHTMLObjects : function(oAppContainer){ - }, - - $ON_SET_LINEHEIGHT : function(nLineHeight){ - this.setLineHeight(nLineHeight); - }, - - getLineHeight : function(){ - var nodes = this._getSelectedNodes(false); - - var curWrapper, prevWrapper; - var iCurHeight, iHeight; - - if(nodes.length == 0) return -1; - - var iLength = nodes.length; - - if(iLength == 0){ - iHeight = -1; - }else{ - prevWrapper = this._getLineWrapper(nodes[0]); - iHeight = this._getWrapperLineheight(prevWrapper); - } - - var firstNode = this.oSelection.getStartNode(); - - if(iHeight > 0){ - for(var i=1; i=0; i--){ - if(aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR"){ - var oP = oSelection._document.createElement("P"); - oInsertionPoint = aNodes[i].nextSibling; - while(i>=0 && aNodes[i] && (aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR")){ - oP.insertBefore(aNodes[i--], oP.firstChild); - } - oFormattingNode.insertBefore(oP, oInsertionPoint); - i++; - } - } - - if(oFormattingNode && oFormattingNode.parentNode){ - var oP = oSelection._document.createElement("P"); - oP.innerHTML = unescape("
"); - oFormattingNode.parentNode.insertBefore(oP, oFormattingNode.nextSibling); - } - - this.oApp.exec("RECORD_UNDO_ACTION", ["Block Quote"]); - - return oFormattingNode; - }, - - _expandToTableStart : function(oSelection, oNode){ - var oC = oSelection.commonAncestorContainer; - var oResultNode = null; - - var bLastIteration = false; - while(oNode && !bLastIteration){ - if(oNode == oC) bLastIteration = true; - - if(/TBODY|TFOOT|THEAD|TR/i.test(oNode.tagName)){ - oResultNode = this._getTableRoot(oNode); - break; - } - oNode = oNode.parentNode; - } - - return oResultNode; - }, - - _getTableRoot : function(oNode){ - while(oNode && oNode.tagName != "TABLE") oNode = oNode.parentNode; - - return oNode; - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to inserting special characters - * @name hp_XE_SCharacter.js - * @required XpressRangeManager - */ -xe.XE_SCharacter = $.Class({ - name : "XE_SCharacter", - - $init : function(oAppContainer){ - this.bIE = $.browser.msie; - - this._assignHTMLObjects(oAppContainer); - - this.charSet = []; - this.charSet[0] = unescape('FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[1] = unescape('%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[2] = unescape('3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[3] = unescape('3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[4] = unescape('0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - this.charSet[5] = unescape('3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); - }, - - _assignHTMLObjects : function(oAppContainer){ - oAppContainer = $.$(oAppContainer) || document; - - this.elDropdownLayer = $("DIV.xpress_xeditor_sCharacter_layer", oAppContainer).get(0); - - this.oTextField = $("INPUT", this.elDropdownLayer).get(0); - this.oInsertButton = $("+ BUTTON", this.oTextField).get(0); - this.aCloseButton = $("BUTTON.close", this.elDropdownLayer).get(); - this.aSCharList = $(".list", this.elDropdownLayer).get(); - var oLabelUL = $(">UL", this.elDropdownLayer).get(0); - this.aLabelA = $("A", oLabelUL).get(); - }, - - $ON_MSG_APP_READY : function(){ - var funcInsert = $.fnBind(this.oApp.exec, this.oApp, "INSERT_SCHARACTERS", [this.oTextField.value]); - $(this.oInsertButton).click(funcInsert); - - this.oApp.exec("SET_SCHARACTER_LIST", [this.charSet]); - - for(var i=0; i'; - this.aSCharList[i].appendChild(aLI[ii]); - } - - // enable this after Jindo framework is updated -// this.oApp.exec("ATTACH_HOVER_EVENTS", [$(">LI>BUTTON", this.aSCharList[i])]).get(); - }, - - _stopBrowserEvent : function(obj, sEvent){ - $(obj).bind(sEvent, function(e){e.stopPropagation();e.preventDefault();} ) - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to Undo/Redo - * @name hp_XE_UndoRedo.js - * @required XE_EditingAreaManager, XpressRangeManager - */ -xe.XE_UndoRedo = $.Class({ - name : "XE_UndoRedo", - actionHistory : null, - // this may also be called, lastAdded/lastRestored - oCurStateIdx : null, - iMinimumSizeChange : 10, - sBlankContentsForFF : "
", - - $init : function(){ - this.aUndoHistory = []; - this.oCurStateIdx = {nIdx: 0, nStep: 0}; - }, - - $PRECONDITION : function(sCmd){ - if(sCmd.match(/_DO_RECORD_UNDO_HISTORY_AT$/)) return true; - - try{ - if(this.oApp.getEditingMode() != "WYSIWYG") return false; - }catch(e){ - return false; - } - - return true; - }, - - $BEFORE_MSG_APP_READY : function(){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT", [this.oCurStateIdx, "", "", null]); - }, - - $ON_MSG_APP_READY : function(){ - this.bFF = $.browser.mozilla; - - this.oApp.exec("ADD_APP_PROPERTY", ["getUndoHistory", $.fnBind(this.getUndoHistory, this)]); - this.oApp.exec("ADD_APP_PROPERTY", ["getUndoStateIdx", $.fnBind(this.getUndoStateIdx, this)]); - - this.oApp.exec("REGISTER_UI_EVENT", ["undo", "click", "UNDO"]); - this.oApp.exec("REGISTER_UI_EVENT", ["redo", "click", "REDO"]); - - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+z", "UNDO"]); - this.oApp.exec("REGISTER_HOTKEY", ["ctrl+y", "REDO"]); - }, - - $ON_UNDO : function(){ - var oTmpStateIdx = {}; - this.oApp.exec("DO_RECORD_UNDO_HISTORY", ["KEYPRESS", false, false, 1]); - if(this.oCurStateIdx.nIdx == 0) return; - - if(this.oCurStateIdx.nStep > 0){ - this.oCurStateIdx.nStep--; - }else{ - var oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - - this.oCurStateIdx.nIdx--; - - if(oTmpHistory.nTotalSteps>1){ - this.oCurStateIdx.nStep = 0; - }else{ - oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - this.oCurStateIdx.nStep = oTmpHistory.nTotalSteps-1; - } - } - - this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); - - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - - $ON_REDO : function(){ - if(this.oCurStateIdx.nIdx >= this.aUndoHistory.length) return; - - var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - if(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1 && this.oCurStateIdx.nStep >= oCurHistory.nTotalSteps-1) return; - - if(this.oCurStateIdx.nStep < oCurHistory.nTotalSteps-1){ - this.oCurStateIdx.nStep++; - }else{ - this.oCurStateIdx.nIdx++; - oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - this.oCurStateIdx.nStep = oCurHistory.nTotalSteps-1; - } - - this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); - - this.oApp.exec("CHECK_STYLE_CHANGE", []); - }, - - $ON_RECORD_UNDO_ACTION : function(sAction){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction]); - }, - - $ON_RECORD_UNDO_BEFORE_ACTION : function(sAction){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, true]); - }, - - $ON_RECORD_UNDO_AFTER_ACTION : function(sAction){ - this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, false]); - }, - - $ON_RESTORE_UNDO_HISTORY : function(nUndoIdx, nUndoStateStep){ - this.oCurStateIdx.nIdx = nUndoIdx; - this.oCurStateIdx.nStep = nUndoStateStep; - - var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - var sContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; - var oBookmark = oCurHistory.oBookmark[this.oCurStateIdx.nStep]; - - this.oApp.setIR(sContent, true); - - // setting the innerHTML may change the internal DOM structure, so save the value again. - var sCurContent = this.oApp.getIR(); - if(this.bFF && sCurContent == this.sBlankContentsForFF){ - sCurContent = ""; - } - oCurHistory.sContent[this.oCurStateIdx.nStep] = sCurContent; - - var oSelection = this.oApp.getEmptySelection(); - if(oSelection.selectionLoaded){ - if(oBookmark){ - oSelection.moveToXPathBookmark(oBookmark); - }else{ - oSelection = this.oApp.getEmptySelection(); - } - - oSelection.select(); - } - }, - - $ON_DO_RECORD_UNDO_HISTORY : function(sAction, bTwoStepAction, bBeforeAction, nForceAddUnlessEqual){ - bTwoStepAction = bTwoStepAction || false; - bBeforeAction = bBeforeAction || false; - nForceAddUnlessEqual = nForceAddUnlessEqual || 0; - - // if we're in the middle of some action history, remove everything after current idx if any "little" change is made - if(!(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1)) nForceAddUnlessEqual = 1; - - var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; - - var sCurContent = this.oApp.getIR(); - var sHistoryContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; - - if(this.bFF && sCurContent == this.sBlankContentsForFF){ - sCurContent = ""; - } - - // every TwoStepAction needs to be recorded - if(!bTwoStepAction){ - switch(nForceAddUnlessEqual){ - case 0: - if(Math.abs(sHistoryContent.length - sCurContent.length)" + sURL + ""; - this.oSelection.pasteHTML(str); - }else{ - var nSession = Math.ceil(Math.random()*10000); - var sMarker = this.sATagMarker+nSession; - var arg = ( sURL == "" ? ["unlink"] : ["createLink", false, sMarker+sURL] ); - this.oApp.exec("EXECCOMMAND", arg); - - try { this.oSelection.setFromSelection() }catch(e){}; - var oDoc = this.oApp.getWYSIWYGDocument(); - $(oDoc.body.getElementsByTagName("A")) - .filter('[href^="'+sMarker+'"]') - .attr('href', function(){ - var rx = new RegExp('^'+sMarker.replace(/([\.\\])/g, '\\$1'), 'i'); - - if (sTarget) $(this).attr('target', sTarget); - else $(this).removeAttr('target'); - - return this.href.replace(rx, ''); - }); - } - this.oApp.exec("HIDE_ACTIVE_LAYER"); - - setTimeout($.fnBind(function(){try{this.oSelection.select()}catch(e){}}, this), 0); - }, - - _validateURL : function(sURL){ - return /^(http|https|ftp|mailto):(?:\/\/)?((\w|-)+(?:[\.:@](\w|-))+)(?:\/|@)?([^"\?]*?)(?:\?([^\?"]*?))?$/.test(sURL); - }, - - $ON_EVENT_XE_HYPERLINK_KEYDOWN : function(oEvent){ - if (oEvent.keyCode == 13){ - this.oApp.exec("XE_APPLY_HYPERLINK"); - oEvent.preventDefault(); oEvent.stopPropagation(); - } - } -}); -//} -//{ -/** - * @fileOverview This file contains Xpress plugin that takes care of the operations related to table creation - * @name hp_XE_Table.js - */ -xe.XE_Table = $.Class({ - name : "XE_Table", - iMinRows : 1, - iMaxRows : 20, - - iMinColumns : 1, - iMaxColumns : 10, - - iMinBorderWidth : 1, - iMaxBorderWidth : 10, - - oSelection : null, - - $init : function(oAppContainer){ - this._assignHTMLObjects(oAppContainer); - }, - - _assignHTMLObjects : function(oAppContainer){ - var tmp = null; - - this.elDropdownLayer = $("DIV.xpress_xeditor_table_layer", oAppContainer).get(0); - this.welDropdownLayer = $(this.elDropdownLayer); - - tmp = $("INPUT", this.elDropdownLayer).get(); - this.oRowInput = tmp[0]; - this.oColumnInput = tmp[1]; - this.oBorderWidthInput = tmp[2]; - this.oBorderColorInput = tmp[3]; - this.oBGColorInput = tmp[4]; - - tmp = $("BUTTON", this.elDropdownLayer).get(); - this.oButton_AddRow = tmp[0]; - this.oButton_RemoveRow = tmp[1]; - this.oButton_AddColumn = tmp[2]; - this.oButton_RemoveColumn = tmp[3]; - this.oButton_IncBorderWidth = tmp[4]; - this.oButton_DecBorderWidth = tmp[5]; - this.oButton_BorderColorPreview = tmp[6]; - this.oButton_BorderColor = tmp[7]; - this.oButton_BGColorPreview = tmp[8]; - this.oButton_BGColor = tmp[9]; - this.oButton_Insert = tmp[10]; - this.oButton_Cancel = tmp[11]; - - this.oSampleTable = $("TABLE", this.elDropdownLayer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.exec("REGISTER_UI_EVENT", ["table", "click", "ST_TOGGLE_TOOLBAR_LAYER"]); - - this.oApp.registerBrowserEvent(this.oRowInput, "change", "ST_SET_ROW_NUM", [null, 0]); - this.oApp.registerBrowserEvent(this.oColumnInput, "change", "ST_SET_COLUMN_NUM", [null, 0]); - this.oApp.registerBrowserEvent(this.oBorderWidthInput, "change", "ST_SET_BORDER_WIDTH", [null, 0]); - - this.oApp.registerBrowserEvent(this.oButton_AddRow, "click", "ST_ADD_ROW"); - this.oApp.registerBrowserEvent(this.oButton_RemoveRow, "click", "ST_REMOVE_ROW"); - this.oApp.registerBrowserEvent(this.oButton_AddColumn, "click", "ST_ADD_COLUMN"); - this.oApp.registerBrowserEvent(this.oButton_RemoveColumn, "click", "ST_REMOVE_COLUMN"); - - this.oApp.registerBrowserEvent(this.oButton_IncBorderWidth, "click", "ST_INC_BORDER_WIDTH"); - this.oApp.registerBrowserEvent(this.oButton_DecBorderWidth, "click", "ST_DEC_BORDER_WIDTH"); - - this.oApp.registerBrowserEvent(this.oButton_BorderColorPreview, "click", "ST_TOGGLE_BORDER_COLOR_LAYER"); - this.oApp.registerBrowserEvent(this.oButton_BGColorPreview, "click", "ST_TOGGLE_BGCOLOR_LAYER"); - - this.oApp.registerBrowserEvent(this.oButton_BorderColor, "click", "ST_TOGGLE_BORDER_COLOR_LAYER"); - this.oApp.registerBrowserEvent(this.oButton_BGColor, "click", "ST_TOGGLE_BGCOLOR_LAYER"); - - this.oApp.registerBrowserEvent(this.oButton_Insert, "click", "ST_INSERT_TABLE"); - this.oApp.registerBrowserEvent(this.oButton_Cancel, "click", "ST_CLOSE"); - - this.oApp.exec("ST_SET_BORDER_COLOR", ["#CCCCCC"]); - this.oApp.exec("ST_SET_BGCOLOR", ["#FFFFFF"]); - }, - - $ON_ST_TOGGLE_TOOLBAR_LAYER : function(){ - this.oApp.exec("RECORD_UNDO_ACTION_FORCED", ["KEYPRESS"]); - - this._showNewTable(); - this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER", [this.elDropdownLayer]); - }, - - $ON_ST_ADD_ROW : function(){ - this.oApp.exec("ST_SET_ROW_NUM", [null, 1]); - }, - - $ON_ST_REMOVE_ROW : function(){ - this.oApp.exec("ST_SET_ROW_NUM", [null, -1]); - }, - - $ON_ST_ADD_COLUMN : function(){ - this.oApp.exec("ST_SET_COLUMN_NUM", [null, 1]); - }, - - $ON_ST_REMOVE_COLUMN : function(){ - this.oApp.exec("ST_SET_COLUMN_NUM", [null, -1]); - }, - - $ON_ST_SET_ROW_NUM : function(iRows, iRowDiff){ - iRows = iRows || parseInt(this.oRowInput.value); - iRowDiff = iRowDiff || 0; - - iRows += iRowDiff; - - if(iRows < this.iMinRows) iRows = this.iMinRows; - if(iRows > this.iMaxRows) iRows = this.iMaxRows; - - this.oRowInput.value = iRows; - this._showNewTable(); - }, - - $ON_ST_SET_COLUMN_NUM : function(iColumns, iColumnDiff){ - iColumns = iColumns || parseInt(this.oColumnInput.value); - iColumnDiff = iColumnDiff || 0; - - iColumns += iColumnDiff; - - if(iColumns < this.iMinColumns) iColumns = this.iMinColumns; - if(iColumns > this.iMaxColumns) iColumns = this.iMaxColumns; - - this.oColumnInput.value = iColumns; - this._showNewTable(); - }, - - $ON_ST_INSERT_TABLE : function(){ - var sTable = this._getTableString(); - - this.oApp.exec("PASTE_HTML", [sTable]); - - this.oApp.exec("ST_CLOSE", []); - }, - - $ON_ST_CLOSE : function(){ - this.oApp.exec("HIDE_ACTIVE_LAYER", []); - }, - - $ON_ST_SET_BORDER_WIDTH : function(iBorderWidth, iBorderWidthDiff){ - iBorderWidth = iBorderWidth || parseInt(this.oBorderWidthInput.value); - iBorderWidthDiff = iBorderWidthDiff || 0; - - iBorderWidth += iBorderWidthDiff; - - if(iBorderWidth < this.iMinBorderWidth) iBorderWidth = this.iMinBorderWidth; - if(iBorderWidth > this.iMaxBorderWidth) iBorderWidth = this.iMaxBorderWidth; - - this.oBorderWidthInput.value = iBorderWidth; - this._showNewTable(); - }, - - $ON_ST_INC_BORDER_WIDTH : function(){ - this.oApp.exec("ST_SET_BORDER_WIDTH", [null, 1]); - }, - - $ON_ST_DEC_BORDER_WIDTH : function(){ - this.oApp.exec("ST_SET_BORDER_WIDTH", [null, -1]); - }, - - $ON_ST_TOGGLE_BORDER_COLOR_LAYER : function(){ - if(this.welDropdownLayer.hasClass("p1")) - this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); - else - this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER", []); - }, - - $ON_ST_SHOW_BORDER_COLOR_LAYER : function(){ - this.welDropdownLayer.addClass("p1"); - this.welDropdownLayer.removeClass("p2"); - - this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BORDER_COLOR_FROM_PALETTE", this.elDropdownLayer]); - }, - - $ON_ST_HIDE_BORDER_COLOR_LAYER : function(){ - this.welDropdownLayer.removeClass("p1"); - - this.oApp.exec("HIDE_COLOR_PALETTE", []); - }, - - $ON_ST_TOGGLE_BGCOLOR_LAYER : function(){ - if(this.welDropdownLayer.hasClass("p2")) - this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); - else - this.oApp.exec("ST_SHOW_BGCOLOR_LAYER", []); - }, - - $ON_ST_SHOW_BGCOLOR_LAYER : function(){ - this.welDropdownLayer.removeClass("p1"); - this.welDropdownLayer.addClass("p2"); - - this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BGCOLOR_FROM_PALETTE", this.elDropdownLayer]); - }, - - $ON_ST_HIDE_BGCOLOR_LAYER : function(){ - this.welDropdownLayer.removeClass("p2"); - - this.oApp.exec("HIDE_COLOR_PALETTE", []); - }, - - $ON_ST_SET_BORDER_COLOR_FROM_PALETTE : function(sColorCode){ - this.oApp.exec("ST_SET_BORDER_COLOR", [sColorCode]); - this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); - }, - - $ON_ST_SET_BORDER_COLOR : function(sColorCode){ - this.oBorderColorInput.value = sColorCode; - this.oButton_BorderColorPreview.style.backgroundColor = sColorCode; - - this._showNewTable(); - }, - - $ON_ST_SET_BGCOLOR_FROM_PALETTE : function(sColorCode){ - this.oApp.exec("ST_SET_BGCOLOR", [sColorCode]); - this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); - }, - - $ON_ST_SET_BGCOLOR : function(sColorCode){ - this.oBGColorInput.value = sColorCode; - this.oButton_BGColorPreview.style.backgroundColor = sColorCode; - - this._showNewTable(); - }, - - _showNewTable : function(){ - var oTmp = document.createElement("DIV"); - oTmp.innerHTML = this._getTableString(); - var oNewTable = oTmp.firstChild; - this.oSampleTable.parentNode.insertBefore(oNewTable, this.oSampleTable); - this.oSampleTable.parentNode.removeChild(this.oSampleTable); - this.oSampleTable = oNewTable; - }, - - // need to do something about the table width as the same HTML code is being used to the actual table and the preview table - _getTableString : function(){ - var sBorderColorCode = this.oBorderColorInput.value; - var sBGColorCode = this.oBGColorInput.value; - var iBorderWidth = this.oBorderWidthInput.value; - var sTD = ""; - if($.browser.msie){ - sTD = "

"; - }else{ - if($.browser.firefox){ - sTD = ""; - }else{ - sTD = ""; - } - } - - var sTable = '


 

'; - var sRow = ''; - var iColumns = this.oColumnInput.value; - for(var i=0; i/ig, - regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig, - regex_class = /<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig, - regex_class2 = /xe_selected_cell/g; - regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig, - //regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig, - //regex_script = //ig, - regex_font_color = /color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_face = /face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_size = /size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i, - regex_style = /style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_weight = /font-weight\s*:\s*([a-z]+);?/i, - regex_font_style = /font-style\s*:\s*italic;?/i, - regex_font_decoration = /text-decoration\s*:\s*([a-z -]+);?/i, - regex_jquery = /jQuery\d+\s*=(\s*"\d+"|\d+)/ig, - regex_quote_attr = /([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g; //" - -var - allow_tags = 'a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style'.split(','), - no_closing_tags = 'area,br,col,embed,hr,img,input,param,base,meta,link,basefont,isindex'.split(','); - - -var - replace_tags = { - 'b' : 'strong', - 'i' : 'em', - 's' : 'del', - 'strike' : 'del' - }; - -xe.XE_XHTMLFormatter = $.Class({ - name : "XE_XHTMLFormatter", - - $ON_MSG_APP_READY : function() { - this.oApp.addConverter("WYSIWYG_TO_IR", this.TO_IR); - this.oApp.addConverter("HTMLSrc_TO_IR", this.TO_IR); - this.oApp.addConverter("IR_TO_HTMLSrc", this.IR_TO); - this.oApp.addConverter("IR_TO_WYSIWYG", this.IR_TO); - }, - - TO_IR : function(sContent) { - var stack = []; - // remove xeHandled attrs - /* - sContent = sContent.replace(/xeHandled="YES"/ig,''); - */ - - - // remove all useless styles - /* - sContent = sContent.replace(regex_meanless_css1, function(m0,m1,m2,m3){ - m2 = m2.replace(regex_meanless_css2, ''); - - return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>'; - }); - */ - - // remove all useless classes - /* - sContent = sContent.replace(regex_class, function(m0,m1,m2,m3,m4,m5){ - var cls = $.trim((m2 || m3 || m4 || "").replace(regex_class2, '')); - - return '<'+(m1||"")+(cls?' class="'+cls+'"':'')+(m5||"")+'>'; - }); - */ - - // remove all event handler - //sContent = sContent.replace(regex_handler, '<$1$2>'); - - // remove all id - //sContent = sContent.replace(regex_id, '<$1$2>'); - - // remove all scripts - //sContent = sContent.replace(regex_script, ''); - - if ($.browser.msie) { - // remove $ attributes - sContent = sContent.replace(regex_jquery, ''); - - // quote all attrs - sContent = sContent.replace(/<(\w+) ([^>]+)>/g, function(m0,m1,m2){ - return '<'+m1+' '+ - m2.replace(regex_quote_attr, function(s0,s1,s2,s3){ - if(s1) return s1; - if(/^"/.test(s3)||/"$/.test(s3)) return s2+'='+s3; - return s2+'="'+(s3||s2)+'"'; - }) + '>'; - }); - } - - // remove all useless tag and enclose tags - regex = /<(\/)?([:\w\/-]+)(.*?)>/ig; - sContent = sContent.replace(regex, function(m0,closing,tag,attrs){ - var m3s = []; - var state = ''; - - closing = closing || ''; - tag = tag.toLowerCase(); - attrs = $.trim(attrs || ''); - - if(replace_tags[tag]!=undefined) tag = replace_tags[tag]; - - if (!closing) { - if ($.inArray(tag,no_closing_tags) >= 0) { - var len = attrs.length; - if (tag == 'br') attrs = ''; - if (!attrs || attrs.substring(len-1,len) != '/') attrs += ' /'; - - return '<'+tag+' '+$.trim(attrs)+'>'; - } else { - stack.push({tag:tag, state:state}); - } - } else { - var tags = [], t = ''; - - // if the tag does not require a closing tag, simply remove the closing tag - if ($.inArray(tag,no_closing_tags) >= 0) { - return ''; - } - - // if the matching opening tag was not found, remove this closing tag - if (!stack.length){ - return ''; - } - - do { - t = stack.pop(); - if (t.tag != tag) continue; - if (t.state != 'deleted') tags.push(''); - } while(stack.length && t.tag != tag); - - return tags.join(''); - } - - return '<'+closing+tag+(attrs?' '+attrs:'')+'>'; - }); - - if(stack.length) { - var t = ''; - - do { - t = stack.pop(); - if (t.state != 'deleted') sContent += ''; - } while(stack.length); - - } - - // add new line after

- regex = /<\/p>[ \t]*(\n)?/ig; - sContent = sContent.replace(regex, "

\n"); - - return sContent; - }, - - IR_TO : function(sContent) { - return sContent; - } -}); -// center, font, b, i, s, strike - -/** - * Support XE extensions - * @author NAVER (developer@xpressengine.com) - */ -xe.XE_Extension = $.Class({ - name : "XE_Extension", - seq : '', - last_doc : '', - - $init : function(elAppContainer, editor_sequence) { - this.seq = editor_sequence; - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.elDropdownLayer = $('DIV.xpress_xeditor_extension_layer', elAppContainer).get(0); - }, - - _removeAttrs : function(sContent) { - return sContent; - }, - - _addEvent : function() { - if (this.oApp.getEditingMode() != 'WYSIWYG') return; - - var doc = this.oApp.getWYSIWYGDocument(); - var seq = this.seq; - var fn = function(){ - var obj = $(this); - var comp = obj.attr('editor_component'); - if (comp && $.isFunction(openComponent)) { - editorPrevNode = obj.get(0); - openComponent(comp, seq); - } - }; - - $(doc).find('img,div[editor_component]').each(function(){ - var obj = $(this); - if(this.nodeName == 'IMG' && !obj.attr('editor_component') && !obj.attr('widget')) { - obj.attr('editor_component','image_link'); - } - if(this.last_doc != doc) { - obj.unbind('dblclick.widget').bind('dblclick.widget',fn); - this.last_doc = doc; - } - }); - }, - - $ON_MSG_APP_READY : function() { - var oApp = this.oApp; - oApp.exec('REGISTER_UI_EVENT', ['extension', 'click', 'TOGGLE_EXTENSION_LAYER']); - var functn = function(){ - oApp.exec("HIDE_ACTIVE_LAYER", []); - }; - $('a', this.elDropdownLayer).each(function(){ - var obj = $(this); - if(!obj.attr('component_onclick_event_added')) { - obj.click(functn); - obj.attr('component_onclick_event_added','Y'); - } - }); - }, - - $ON_TOGGLE_EXTENSION_LAYER : function() { - this.oApp.exec('TOGGLE_TOOLBAR_ACTIVE_LAYER', [this.elDropdownLayer]); - }, - - $ON_CHANGE_EDITING_MODE : function(mode) { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_PASTE_HTML : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_LOAD_IR_FIELD : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_SET_IR : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - } -}); -/** - * Auto saving - * @author NAVER (developer@xpressengine.com) - */ -xe.XE_AutoSave = $.Class({ - name : "XE_AutoSave", - form : null, - textarea : null, - - $init : function(oIRTextarea, elAppContainer) { - this.form = oIRTextarea.form; - this.textarea = oIRTextarea; - - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.welMessageBox = $('autosave_message'); - }, - - $ON_MSG_APP_READY : function() { - var elTitle = $(this.form._saved_doc_title); - var elContent = $(this.form._saved_doc_content); - var elDocument_srl = $(this.form._saved_doc_document_srl); - - var title = $.trim(elTitle.val()); - var content = $.trim(elContent.val()); - var document_srl = $.trim(elDocument_srl.val()); - - if (title || content || document_srl) { - if (confirm(this.form._saved_doc_message.value)) { - $(this.form.title).val(title); - this.oApp.setIR(content); - if(typeof(editorGetAutoSavedDoc) == 'function') editorGetAutoSavedDoc(this.form); - } else { - editorRemoveSavedDoc(); - } - } - - editorEnableAutoSave(this.form, $(this.form).attr("editor_sequence")); - - // register hotkey - this.oApp.exec('REGISTER_HOTKEY', ['ctrl+shift+s','AUTO_SAVE']); - }, - - $ON_AUTO_SAVE : function() { - _editorAutoSave(); - } -}); -/** - * Format Block plugin - * @author NAVER (developer@xpressengine.com) - */ -xe.XE_FormatWithSelectUI = $.Class({ - name : "XE_FormatWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFormatSelect = $("SELECT.xpress_xeditor_ui_format_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFormatSelect, "change", "SET_FORMAT_FROM_SELECT_UI"); - this.elFormatSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - var blockName = this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock"); - - if (!blockName) return (this.elFormatSelect.selectedIndex = 0); - if ($.browser.msie && /([0-9])/.test(blockName)) blockName = 'h'+(RegExp.$1); - - this.elFormatSelect.value = blockName.toLowerCase(); - if(this.elFormatSelect.selectedIndex < 0) this.elFormatSelect.selectedIndex = 0; - if(this.elFormatSelect.value != blockName.toLowerCase()) this.elFormatSelect.selectedIndex = 0; - }, - - $ON_SET_FORMAT_FROM_SELECT_UI : function(){ - var sFormat = this.elFormatSelect.value; - if(!sFormat) return; - if($.browser.msie) sFormat = '<'+sFormat+'>'; - - this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, sFormat]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -/** - * Enhanced Table Fetures - * @author NAVER (developer@xpressengine.com) - */ - -// 표 편집 확장 기능 -xe.XE_Table = $.Class({ - _startSel : null, - _endSel : null, - - $ON_MSG_APP_READY : function() { - this._doc = $(this.oApp.getWYSIWYGDocument()); - - this.$FnMouseDown = $.fnBind(this._mousedown, this); - this.$FnMouseUp = $.fnBind(this._mouseup, this); - this.$FnMouseMove = $.fnBind(this._mousemove, this); - - this._doc.mousedown(this.$FnMouseDown); - - // initialize - this._startSel = null; - this._endSel = null; - - // register buttons - this.oApp.exec('REGISTER_UI_EVENT', ['merge_cells', 'click', 'MERGE_CELLS']); - this.oApp.exec('REGISTER_UI_EVENT', ['split_col', 'click', 'CELL_SPLIT_BY_COL']); - this.oApp.exec('REGISTER_UI_EVENT', ['split_row', 'click', 'CELL_SPLIT_BY_ROW']); - - // register hotkeys - this.oApp.exec('REGISTER_HOTKEY', ['ctrl+alt+m', 'MERGE_CELLS']); - - // perform default ready action - this.$super.$ON_MSG_APP_READY(); - }, - - $ON_MERGE_CELLS : function() { - var html = ""; - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var self = this; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Merge"]); - - // 선택한 모든 셀의 데이터를 첫번째 셀로 복사 - cell.each(function(){ html += $(this).html() }).eq(0).html(html); - - // 첫번째 셀 가로 확장 - var colspan = 0; - cell.eq(0).nextAll('td,th').addBack().filter('.xe_selected_cell').each(function(idx){ - colspan += self._getSpan(this, 'col'); - }); - - // 마지막 셀까지 줄의 갯수 계산 - var rect = this._getRect(cell.eq(0)); - var start_tr = cell.eq(0).parent('tr'); - var end_tr = cell.eq(cell.length-1).parent('tr'); - var all_rows = cell.parents('table').eq(0).find('tr'); - var rowspan = all_rows.index(end_tr.get(0)) - all_rows.index(start_tr.get(0)) + this._getSpan(cell.eq(cell.length-1), 'row'); - - // 첫번째 셀 colspan, rowspan 속성 지정 - cell.eq(0).attr('colSpan', colspan).attr('rowSpan', rowspan); - - // 첫번째 셀을 제외한 다른 모든 셀 제거 - cell.slice(1).remove(); - }, - - $ON_CELL_SPLIT_BY_ROW : function(many) { - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var table = cell.parents('table').eq(0); - var self = this; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Row"]); - - // 선택 영역의 상하 좌표 구함 - var _top = this._getRect(cell.eq(0)).top; - var _bottom = this._getRect(cell.eq(cell.length-1)).bottom; - - // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(상하 기준). - (cell = table.find('td,th').filter(function(){ - var rect = self._getRect($(this)); - - return !(rect.bottom <= _top || rect.top >= _bottom); - })).filter('.xe_selected_cell').each(function(){ - var t = $(this); - var row = t.parent('tr'); - var rowspan = self._getSpan(t, 'row'); - var rect = self._getRect(t); - var queue = []; - var clone = t.clone().html('
'); - var topspan = 1, botspan = 1; - - // rowspan > 1이면 현재 셀의 rowspan을 절반으로 분할한다. - if (rowspan > 1) { - - topspan = Math.ceil(rowspan/2); - botspan = rowspan - topspan; - - queue.push(function(){ - t.attr('rowSpan', topspan); - }); - - clone.attr('rowSpan', botspan); - } else { - // rowspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 rowspan을 추가 - cell.filter(function(){ - if (t.get(0) == this) return false; - - var tt = $(this); - var rc = self._getRect(tt); - - // 범위를 넘은 부분은 제외 - if (rc.bottom <= rect.top || rc.top >= rect.bottom) return false; - - return true; - }).each(function(){ - var tt = $(this); - var sp = self._getSpan(tt, 'row')+1; - - // rowspan 1 추가 - queue.push(function(){ - tt.attr('rowSpan', sp); - }); - }); - - // 새 줄을 추가한다. - if ($.browser.msie) { - // Fix bug for IE - row.after(row.clone().empty().get(0).outerHTML); - } else { - row.after(row.clone().empty()); - } - } - - var rows = row.nextAll('tr'); - - // 현재 셀이 마지막 줄에 있다면 한 줄 추가 후 새로운 셀 추가 - if (!rows.length) { - row.after(row.clone().empty().append(clone)); - } else { - var next_sib = rows.eq(topspan - 1).children('td,th').filter(function(){ - return ( self._getRect($(this)).left > rect.left ); - }); - - if ($.browser.msie) { - next_sib.length? - next_sib.eq(0).before(clone.get(0).outerHTML): - rows.eq(topspan-1).append(clone.get(0).outerHTML); - } else { - next_sib.length? - next_sib.slice(0,1).before(clone): - rows.slice(topspan-1,1).append(clone); - } - } - - // 함수를 바로 실행하면 좌표가 틀어지므로, 큐에 넣은 후 실행 - $.each(queue, function(){ this(); }); - - }); - }, - - $ON_CELL_SPLIT_BY_COL : function(many) { - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var table = cell.parents('table').slice(0,1); - var self = this; - var ie_bug = [], tmpId = (new Date).getTime(), tmpStr = ''; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Column"]); - - // 선택 영역의 좌우 좌표 구함 - var first_row = cell.eq(0).parent('tr'); - var _left = this._getRect(first_row.find('.xe_selected_cell:first')).left; - var _right = this._getRect(first_row.find('.xe_selected_cell:last')).right; - - // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(좌우 기준). - (cell = table.find('td,th').filter(function(){ - var rect = self._getRect($(this)); - - return !(rect.right <= _left || rect.left >= _right); - })).filter('.xe_selected_cell').each(function(idx){ - var t = $(this); - var colspan = self._getSpan(t, 'col'); - var clone = t.clone().html('
'); - - // colspan > 1 이면 colspan을 절반으로 분할한다. - if (colspan > 1) { - var leftspan = Math.ceil(colspan/2); - var rightspan = colspan - leftspan; - - t.attr('colSpan', leftspan); - clone.attr('colSpan', rightspan); - } else { - // colspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 colspan을 추가 - var rect = self._getRect(t); - - cell.filter(function(){ - if (t.get(0) == this) return false; - - var tt = $(this); - var rc = self._getRect(tt); - - // 범위를 넘은 부분은 제외 - if (rc.right <= rect.left || rc.left >= rect.right) return false; - - return true; - }).each(function(){ - var tt = $(this); - - // colspan 1 추가 - tt.attr('colSpan', self._getSpan(tt, 'col')+1); - }); - - clone.attr('colSpan', 1); - } - - if ($.browser.msie) { - // Fix for IE bug - t.after(clone.get(0).outerHTML); - } else { - t.after(clone); - } - }); - }, - - $ON_CHECK_STYLE_CHANGE : function(){ - var ui = ['merge_cells', 'split_col', 'split_row']; - var app = this.oApp; - var command = (this._startSel && this._startSel.is('.xe_selected_cell'))?'ENABLE_UI':'DISABLE_UI'; - - $.each(ui, function(){ app.exec(command, [this]); }); - }, - - _mousedown : function(event) { - var cur = $(event.target); - var sel = cur.parents().addBack().filter('td,th,table'); - var app = this.oApp; - var self = this; - - // 모든 선택영역 해제 - $('td.xe_selected_cell', this.oApp.getWYSIWYGDocument()).removeClass('xe_selected_cell'); - - this._startSel = null; - this._endSel = null; - - if (!sel.length || !this._isLeftClicked(event.button)) return; - - function delayed(){ - sel = app.getSelection().cloneRange(); - sel.collapseToStart(); - sel = $(sel.startContainer).parents().addBack().filter('td,th').eq(0); - - if (!sel.length) return self._removeAllListener()||true; - - // 좌표를 구한다 - self._getRect(self._startSel = sel); - - // 이벤트 바인딩 - self._doc.bind('mousemove', self.$FnMouseMove); - self._doc.bind('mouseup', self.$FnMouseUp); - } - - // mousedown이 일어난 후에 선택 영역이 설정되므로 실행을 지연시킨다. - setTimeout(delayed, 0); - }, - - _mouseup : function(event) { - // 선택된 셀 확인 - this._removeAllListener(); - - // 시작셀과 종료셀 제거 - this._startSel = this._endSel = null; - }, - - _mousemove : function(event) { - var cur = $(event.target); - var cell = cur.parents().addBack().filter('td,th').eq(0); - var self = this; - - // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 - if (!cell.length || !this._isLeftClicked(event.button)) return; - if (!this._endSel && cell.get(0) == this._startSel.get(0)) return; - if (this._endSel && cell.get(0) == this._endSel.get(0)) return; - - // 종료셀 && 종료셀의 좌표 - this._getRect(this._endSel = cell); - - // 선택 범위를 구한다 - var _top = Math.min(this._startSel.rect.top, this._endSel.rect.top); - var _left = Math.min(this._startSel.rect.left, this._endSel.rect.left); - var _bottom = Math.max(this._startSel.rect.bottom, this._endSel.rect.bottom); - var _right = Math.max(this._startSel.rect.right, this._endSel.rect.right); - - var table = cell.parents('table'); - var cells = table.find('td,th').removeClass('xe_selected_cell'); - var i = 0; - - // 복잡한 모양의 테이블을 위한 반복 처리 - var selected = $(); - do { - // 선택한 셀로 최대 영역 재계산 - selected.each(function(){ - var rect = self._getRect($(this)); - - // 영역 재계산 - if (rect.right > _right) _right = rect.right; - if (rect.left < _left) _left = rect.left; - if (rect.top < _top) _top = rect.top; - if (rect.bottom > _bottom) _bottom = rect.bottom; - }); - - // 좌표 범위 안에 있는 선택할 셀을 추린다. - cells = cells.filter(':not(.xe_selected_cell)'); - selected = cells.filter(function(){ - var rect = self._getRect($(this)); - - if (rect.right <= _left || rect.left >= _right || rect.bottom <= _top || rect.top >= _bottom) return false; - - return true; - }).addClass('xe_selected_cell'); - } while(selected.length); - - // 브라우저의 기본 선택영역 해제 : FF 제외 - 기본 기능이 충분히 좋아서 + 이 부분을 실행하면 오류가 발생해서 - if (!$.browser.mozilla) { - function delayed() { - var sel = self.oApp.getSelection(); - - if (!self._startSel) return; - if (!self._startSel.get(0).firstChild) self._startSel.text(" "); - - sel.selectNode(self._startSel.get(0).firstChild); - sel.collapseToStart(); - sel.select(); - } - - setTimeout(delayed, 0); - } - - return false; - }, - - _removeAllListener : function() { - // 이벤트 해제 - this._doc.unbind("mousemove", this.$FnMouseMove); - this._doc.unbind("mouseup", this.$FnMouseUp); - }, - - _isLeftClicked : function(value) { - return $.browser.msie?!!(value & 1):(value == 0); - }, - - _getRect : function(obj) { - var el = obj.get(0); - - obj.rect = {}; - obj.rect.top = el.offsetTop; - obj.rect.left = el.offsetLeft; - obj.rect.bottom = obj.rect.top + el.offsetHeight; - obj.rect.right = obj.rect.left + el.offsetWidth; - - return obj.rect; - }, - - _getSpan : function(obj, type) { - var span = parseInt($(obj).attr(type+'span')); - - return isNaN(span)?1:span; - } -}).extend(xe.XE_Table); - -})(jQuery); - -if (!window.xe) xe = {}; - -xe.Editors = []; - -function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size) { - if(typeof(colorset)=='undefined') colorset = 'white'; - if(typeof(content_style)=='undefined') content_style = 'xeStyle'; - if(typeof(content_font)=='undefined') content_font= ''; - if(typeof(content_font_size)=='undefined') content_font_size= ''; - - var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html'; - - var textarea = jQuery("#xpress-editor-"+editor_sequence); - var iframe = jQuery(''); - var htmlsrc = jQuery(''); - var form = textarea.get(0).form; - form.setAttribute('editor_sequence', editor_sequence); - textarea.css("display","none"); - - var saved_content = ''; - if(jQuery("input[name=content]",form).size()>0){ - saved_content=jQuery("input[name=content]",form).val().replace(/src=\"files\/attach/g,'src="'+request_uri+'files/attach'); //' - jQuery("#xpress-editor-"+editor_sequence).val(saved_content); - } - - // hide textarea - textarea.hide().css('width', '100%').before(iframe).after(htmlsrc); - - // create an editor - var oEditor = new xe.XpressCore(); - var oWYSIWYGIFrame = iframe.get(0); - var oIRTextarea = textarea.get(0); - var oHTMLSrcTextarea = htmlsrc.get(0); - var elAppContainer = jQuery('.xpress-editor', form).get(0); - - oEditor.getFrame = function(){ return oWYSIWYGIFrame;} - oEditor.getContent = function(){ - editorGetContentTextarea_xe(editor_sequence); - } - - var content = form[content_key].value; - if(xFF && !content) content = '
'; - - form[content_key].value = content; - jQuery("#xpress-editor-"+editor_sequence).val(content); - - // Set standard API - editorRelKeys[editor_sequence] = new Array(); - editorRelKeys[editor_sequence]["primary"] = form[primary_key]; - editorRelKeys[editor_sequence]["content"] = form[content_key]; - editorRelKeys[editor_sequence]["func"] = editorGetContentTextarea_xe; - editorRelKeys[editor_sequence]["editor"] = oEditor; - editorRelKeys[editor_sequence]["pasteHTML"] = function(text){ - oEditor.exec('PASTE_HTML',[text]); - } - xe.Editors[editor_sequence] = oEditor; - - // register plugins - oEditor.registerPlugin(new xe.CorePlugin(null)); - - oEditor.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+editor_sequence).val())); - oEditor.registerPlugin(new xe.StringConverterManager()); - oEditor.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG", oIRTextarea, {nHeight:parseInt(editor_height), nMinHeight:100}, null, elAppContainer)); - oEditor.registerPlugin(new xe.XE_EditingArea_HTMLSrc(oHTMLSrcTextarea)); - oEditor.registerPlugin(new xe.XE_EditingAreaVerticalResizer(elAppContainer)); - oEditor.registerPlugin(new xe.Utils()); - oEditor.registerPlugin(new xe.DialogLayerManager()); - oEditor.registerPlugin(new xe.ActiveLayerManager()); - oEditor.registerPlugin(new xe.Hotkey()); - oEditor.registerPlugin(new xe.XE_WYSIWYGStyler()); - oEditor.registerPlugin(new xe.XE_WYSIWYGStyleGetter()); - oEditor.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap)); - oEditor.registerPlugin(new xe.XE_Toolbar(elAppContainer)); - - oEditor.registerPlugin(new xe.XE_XHTMLFormatter); - oEditor.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(editor_sequence)); - - if(jQuery("ul.extra1").length) { - oEditor.registerPlugin(new xe.XE_ColorPalette(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FontColor(elAppContainer)); - oEditor.registerPlugin(new xe.XE_BGColor(elAppContainer)); - oEditor.registerPlugin(new xe.XE_Quote(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FontNameWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FontSizeWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_LineHeightWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_UndoRedo()); - oEditor.registerPlugin(new xe.XE_Table(elAppContainer)); - oEditor.registerPlugin(new xe.XE_Hyperlink(elAppContainer)); - oEditor.registerPlugin(new xe.XE_FormatWithSelectUI(elAppContainer)); - oEditor.registerPlugin(new xe.XE_SCharacter(elAppContainer)); - } - - if(jQuery("ul.extra2").length) { - oEditor.registerPlugin(new xe.XE_Extension(elAppContainer, editor_sequence)); - } - - if(jQuery("ul.extra3").length) { - oEditor.registerPlugin(new xe.XE_EditingModeToggler(elAppContainer)); - } - - if(jQuery("#editorresize").length) { - oEditor.registerPlugin(new xe.XE_Editorresize(elAppContainer, oWYSIWYGIFrame)); - } - //oEditor.registerPlugin(new xe.XE_Preview(elAppContainer)); - - if (!jQuery.browser.msie && !jQuery.browser.opera) { - oEditor.registerPlugin(new xe.XE_WYSIWYGEnterKey(oWYSIWYGIFrame)); - } - - // 자동 저장 사용 - if (s=form._saved_doc_title) { - oEditor.registerPlugin(new xe.XE_AutoSave(oIRTextarea, elAppContainer)); - } - - function load_proc() { - try { - var doc = oWYSIWYGIFrame.contentWindow.document, str; - if (doc.location == 'about:blank') throw 'blank'; - - // get innerHTML - doc.body.innerHTML = doc.body.innerHTML.trim(); - str = doc.body.innerHTML; - - // register plugin - oEditor.registerPlugin(new xe.XE_EditingArea_WYSIWYG(oWYSIWYGIFrame)); - oEditor.registerPlugin(new xe.XpressRangeManager(oWYSIWYGIFrame)); - oEditor.registerPlugin(new xe.XE_ExecCommand(oWYSIWYGIFrame)); - - if(content_font && !doc.body.style.fontFamily) { - doc.body.style.fontFamily = content_font; - } - if(content_font_size && !doc.body.style.fontSize) { - doc.body.style.fontSize = content_font_size; - } - - // run - oEditor.run(); - } catch(e) { - setTimeout(load_proc, 0); - } - } - - load_proc(); - - return oEditor; -} - -function editorGetContentTextarea_xe(editor_sequence) { - var oEditor = xe.Editors[editor_sequence] || null; - - if (!oEditor) return ''; - - var str = oEditor.getIR(); - - if(!jQuery.trim(str.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/ig, ''))) return ''; - - // 파이어폭스의 경우 의미없는
이 컨텐트 마지막에 추가될 수 있다. - str = str.replace(/
$/i, ''); - - // 속도 문제가 있으므로 1024 문자 미만일 때만 첫 노드가 텍스트 노드인지 테스트 - // 그 이상이면 P 노드가 정상적으로 생성되었다고 가정한다. - if (str.length < 1024) { - var inline_elements = Array('#text','A','BR','IMG','EM','STRONG','SPAN','BIG','CITE','CODE','DD','DFN','HR','INS','KBD','LINK','Q','SAMP','SMALL','SUB','SUP','TT'); - var is_inline_contents = true; - var div = jQuery('
'+str+'
').eq(0); - var nodes = div.contents(); - jQuery.each(nodes, function() { - if (this.nodeType != 3) { - if(jQuery.inArray(this.nodeName, inline_elements ) == -1) { - is_inline_contents = false; - } - } - }); - if(is_inline_contents) str = '

'+str+'

'; - } - - // 이미지 경로를 수정한다. - 20091125 - str = str.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/ig, function(m0,m1,m2){ - return 'src='+(m1||'')+m2; - }); - - str = str.replace(/\<(\/)?([A-Z]+)([^>]*)\>/ig, function(m0,m1,m2,m3) { - if(m3) { - m3 = m3.replace(/ ([A-Z]+?)\=/ig, function(n0,n1) { - n1 = n1.toLowerCase(); - return ' '+n1+'='; - }); - } else { m3 = ''; } - m2 = m2.toLowerCase(); - if(!m1) m1=''; - return '<'+m1+m2+m3+'>'; - }); - str = str.replace('
','
'); - - return str; -} - -function editorGetIframe(srl) { - return jQuery('iframe#editor_iframe_'+srl).get(0); -} - -function editorReplaceHTML(iframe_obj, content) { - var srl = parseInt(iframe_obj.id.replace(/^.*_/,''),10); - editorRelKeys[srl]["pasteHTML"](content); -} - -function editorGetAutoSavedDoc(form) { - var param = new Array(); - param['mid'] = current_mid; - param['editor_sequence'] = form.getAttribute('editor_sequence') - setTimeout(function() { - var response_tags = new Array("error","message","editor_sequence","title","content","document_srl"); - exec_xml('editor',"procEditorLoadSavedDocument", param, function(a,b,c) { editorRelKeys[param['editor_sequence']]['primary'].value = a['document_srl']; if(typeof(uploadSettingObj[param['editor_sequence']]) == 'object') editorUploadInit(uploadSettingObj[param['editor_sequence']], true); }, response_tags); - }, 0); - -} - -// WYSIWYG 모드를 저장하는 확장기능 -xe.XE_GET_WYSYWYG_MODE = jQuery.Class({ - name : "XE_GET_WYSYWYG_MODE", - - $init : function(editor_sequence) { - this.editor_sequence = editor_sequence; - }, - - $ON_CHANGE_EDITING_MODE : function(mode) { - editorMode[this.editor_sequence] = (mode =='HTMLSrc') ? 'html' : 'wysiwyg'; - } -}); - -// 서식 기본 내용을 보존 -xe.XE_PreservTemplate = jQuery.Class({ - name : "XE_PreservTemplate", - isRun : false, - - $BEFORE_SET_IR : function(content) { - if(!this.isRun && !content) { - this.isRun = true; - return false; - } - } -}); - -// 미리보기 확장기능 -xe.XE_Preview = jQuery.Class({ - name : "XE_Preview", - elPreviewButton : null, - - $init : function(elAppContainer) { - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.elPreviewButton = jQuery("BUTTON.xpress_xeditor_preview_button", elAppContainer); - }, - - $ON_MSG_APP_READY : function() { - this.oApp.registerBrowserEvent(this.elPreviewButton.get(0), "click", "EVENT_PREVIEW", []); - }, - - $ON_EVENT_PREVIEW : function() { - // TODO : 버튼이 눌렸을 때의 동작 정의 - } -}); diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js b/modules/editor/skins/xpresseditor/js/xpresseditor.min.js deleted file mode 100644 index 52fd46a34..000000000 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.min.js +++ /dev/null @@ -1 +0,0 @@ -This file is not used in Rhymix. diff --git a/modules/editor/skins/xpresseditor/skin.xml b/modules/editor/skins/xpresseditor/skin.xml deleted file mode 100644 index e6828ec26..000000000 --- a/modules/editor/skins/xpresseditor/skin.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - XpressEditor Skin - XpressEditor Skin - XpressEditor Skin - XpressEditor Skin - XpressEditorスキン - XpressEditor皮肤 - XpressEditor面板 - XpressEditor Dış Görünümü - - XpressEditor based on SmartEditor Basic by NAVER - - - XpressEditor based on SmartEditor Basic by NAVER - - - XpressEditor dựa trên SmartEditor cơ bản, được tạo bởi NAVER - - - XpressEditor based on SmartEditor Basic by NAVER - - - XpressEditor based on SmartEditor Basic by NAVER - - - XpressEditor based on SmartEditor Basic by NAVER - - - XpressEditor based on SmartEditor Basic by NAVER - - - XpressEditor, SmartEditor 'e dayanmaktadır. - - 1.7 - 2013-11-27 - - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - - - - 하얀색 위지윅(기본) - 白 WYSIWYG(デフォルト) - 白色 WYSIWYG(默认) - White WYSIWYG(default) - White WYSIWYG(Mặc định) - Blanco WYSIWYG(por defecto) - 白色 WYSIWYG(預設) - Beyaz WYSIWYG(varsayılan) - - - 검은색 위지윅 - 黒 WYSIWYG - Black WYSIWYG - Black WYSIWYG - Черного WYSIWYG - Negro WYSIWYG - 黑色 WYSIWYG - 黑色 WYSIWYG - Siyah WYSIWYG - - - 하얀색 텍스트(HTML 사용) - 白色テキスト(HTMLタグを使う) - White Text(Use HTML) - White Text(Sử dụng HTML) - White Text(Use HTML) - Editor de texto en blanco (Uso de HTML) - 白色文本编辑器(使用HTML,不自动换行) - 白色文字編輯器(使用HTML,不自動換行) - Beyaz Metin Editörü(HTML Kullan) - - - 검은색 텍스트(HTML 사용) - 黒色テキスト(HTMLタグを使う) - Black Text(Use HTML) - Black Text(Sử dụng HTML) - Black Text(Use HTML) - Editor de texto negro (Uso de HTML) - 黑色文本编辑器(使用HTML,不自动换行) - 黑色文字編輯器(使用HTML,不自動換行) - Siyah Metin Editörü(HTML kullan) - - - 하얀색 텍스트(HTML 사용 안함) - 白色テキスト(HTMLタグを使わない) - White Text(No HTML) - White Text(Không có HTML) - White Text(No HTML) - Editor de texto en blanco (no HTML) - 白色文本编辑器(不使用HTML,自动换行) - 白色文字編輯器(不使用HTML,自動換行) - Beyaz Metin Editörü(HTML yok) - - - 검은색 텍스트(HTML 사용 안함) - 黒色テキスト(HTMLタグを使わない) - Black Text(No HTML) - Black Text(Không có HTML) - Black Text(No HTML) - Editor de texto negro (no HTML) - 黑色文本编辑器(不使用HTML,自动换行) - 黑色文字編輯器(不使用HTML,自動換行) - Siyah Metin Editörü(HTML yok) - - - From e3b48d2604eb7b275fa06d5a47b87cc1f1aebe32 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 28 Sep 2017 18:01:58 +0900 Subject: [PATCH 2/5] Remove supporting files for xpresseditor --- modules/editor/tpl/js/editor.js | 568 -------------- modules/editor/tpl/js/editor.min.js | 1 - modules/editor/tpl/js/swfupload.js | 980 ------------------------- modules/editor/tpl/js/swfupload.min.js | 1 - modules/editor/tpl/js/uploader.js | 455 ------------ modules/editor/tpl/js/uploader.min.js | 1 - 6 files changed, 2006 deletions(-) delete mode 100755 modules/editor/tpl/js/editor.js delete mode 100644 modules/editor/tpl/js/editor.min.js delete mode 100644 modules/editor/tpl/js/swfupload.js delete mode 100644 modules/editor/tpl/js/swfupload.min.js delete mode 100644 modules/editor/tpl/js/uploader.js delete mode 100644 modules/editor/tpl/js/uploader.min.js diff --git a/modules/editor/tpl/js/editor.js b/modules/editor/tpl/js/editor.js deleted file mode 100755 index 670a299ab..000000000 --- a/modules/editor/tpl/js/editor.js +++ /dev/null @@ -1,568 +0,0 @@ -/** - * @author NAVER (developers@xpressengine.com) - * @version 0.1 - * @brief 에디터 관련 스크립트 - */ - -/** - * 에디터 사용시 사용되는 이벤트 연결 함수 호출 - **/ - -/** - * 에디터의 상태나 객체를 구하기 위한 함수 - **/ - -// editor_sequence값에 해당하는 textarea object를 return -function editorGetTextArea(editor_sequence) { - return jQuery('#editor_textarea_' + editor_sequence)[0]; -} - -function editorGetPreviewArea(editor_sequence) { - return jQuery( '#editor_preview_' + editor_sequence )[0]; -} - -// editor_sequence에 해당하는 form문 구함 -function editorGetForm(editor_sequence) { - var iframe_obj = editorGetIFrame(editor_sequence); - if(!iframe_obj) return; - - var fo_obj = iframe_obj.parentNode; - while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; } - if(fo_obj.nodeName == 'FORM') return fo_obj; - return; -} - -// 에디터의 전체 내용 return -function editorGetContent_xe(editor_sequence) { - var html = ""; - if(editorMode[editor_sequence]=='html') { - var textarea_obj = editorGetTextArea(editor_sequence); - if(!textarea_obj) return ""; - html = textarea_obj.value; - } else { - var iframe_obj = editorGetIFrame(editor_sequence); - if(!iframe_obj) return ""; - html = jQuery(iframe_obj.contentWindow.document.body).html().replace(/^]*)>$/i,''); - } - return html; -} - -// 에디터 내의 선택된 부분의 NODE를 return -function editorGetSelectedNode(editor_sequence) { - var iframe_obj = editorGetIFrame(editor_sequence), w, range; - - w = iframe_obj.contentWindow; - - if(w.document.selection) { - range = w.document.selection.createRange(); - return jQuery('
').html(range.htmlText)[0].firstChild; - } else { - range = w.getSelection().getRangeAt(0); - return jQuery('
').append(range.cloneContents())[0].firstChild; - } -} - -/** - * editor 시작 (editor_sequence로 iframe객체를 얻어서 쓰기 모드로 전환) - **/ -var _editorFontColor = []; -function editorStart(editor_sequence, primary_key, content_key, editor_height, font_color) { - - if(typeof(font_color)=='undefined') font_color = '#000'; - _editorFontColor[editor_sequence] = font_color; - - // iframe obj를 찾음 - var iframe_obj = editorGetIFrame(editor_sequence); - if(!iframe_obj) return; - jQuery(iframe_obj).css('width', '100%').parent().css('width', '100%'); - - // 현 에디터를 감싸고 있는 form문을 찾음 - var fo_obj = editorGetForm(editor_sequence); - if(!fo_obj) return; - - // fo_obj에 editor_sequence 값 지정 - fo_obj.setAttribute('editor_sequence', editor_sequence); - - // 모듈 연관 키 값을 세팅 - editorRelKeys[editor_sequence] = []; - editorRelKeys[editor_sequence].primary = fo_obj[primary_key]; - editorRelKeys[editor_sequence].content = fo_obj[content_key]; - editorRelKeys[editor_sequence].func = editorGetContent_xe; - - // saved document(자동저장 문서)에 대한 확인 - if(typeof(fo_obj._saved_doc_title)!= "undefined") { ///<< _saved_doc_title field가 없으면 자동저장 하지 않음 - var saved_title = fo_obj._saved_doc_title.value; - var saved_content = fo_obj._saved_doc_content.value; - - if(saved_title || saved_content) { - // 자동저장된 문서 활용여부를 물은 후 사용하지 않는다면 자동저장된 문서 삭제 - if(confirm(fo_obj._saved_doc_message.value)) { - if(typeof(fo_obj.title)!='undefined') fo_obj.title.value = saved_title; - editorRelKeys[editor_sequence].content.value = saved_content; - - var param = []; - param.editor_sequence = editor_sequence; - param.primary_key = primary_key; - param.mid = current_mid; - var response_tags = new Array("error","message","editor_sequence","key","title","content","document_srl"); - exec_xml('editor',"procEditorLoadSavedDocument", param, getAutoSavedSrl, response_tags); - } else { - editorRemoveSavedDoc(); - } - } - } - - // 대상 form의 content element에서 데이터를 구함 - var content = editorRelKeys[editor_sequence].content.value; - - // IE가 아니고 내용이 없으면
추가 (FF등에서 iframe 선택시 focus를 주기 위한 꽁수) - if(!content && !xIE4Up) content = "
"; - - // IE일 경우 ctrl-Enter 안내 문구를 노출 - var ieHelpObj = xGetElementById("for_ie_help_"+editor_sequence); - if(xIE4Up && ieHelpObj) { - ieHelpObj.style.display = "block"; - } - - // content 생성 - editor_path = editor_path.replace(/^\.\//ig, ''); - var contentHtml = ''+ - ''+ - ''+ - ''+ - ''+ - content+ - ''+ - ''; - iframe_obj.contentWindow.document.open("text/html","replace"); - iframe_obj.contentWindow.document.write(contentHtml); - iframe_obj.contentWindow.document.close(); - - // editorMode를 기본으로 설정 - editorMode[editor_sequence] = null; - - // 에디터를 시작 시킴 - try { - iframe_obj.contentWindow.document.designMode = 'On'; - } catch(e) { - } - - try { - iframe_obj.contentWindow.document.execCommand("undo", false, null); - iframe_obj.contentWindow.document.execCommand("useCSS", false, true); - } catch (e) { - } - - /** - * 더블클릭이나 키눌림등의 각종 이벤트에 대해 listener 추가 - * 작성시 필요한 이벤트 체크 - * 이 이벤트의 경우 윈도우 sp1 (NT or xp sp1) 에서 iframe_obj.contentWindow.document에 대한 권한이 없기에 try 문으로 감싸서 - * 에러를 무시하도록 해야 함. - **/ - - // 위젯 감시를 위한 더블클릭 이벤트 걸기 - try { - jQuery(iframe_obj.contentWindow.document) - .unbind('dblclick.widget') - .bind('dblclick.widget', editorSearchComponent); - } catch(e) { - } - - // 에디터에서 키가 눌러질때마다 이벤트를 체크함 (enter키의 처리나 FF에서 alt-s등을 처리) - try { - if(xIE4Up) xAddEventListener(iframe_obj.contentWindow.document, 'keydown',editorKeyPress); - else xAddEventListener(iframe_obj.contentWindow.document, 'keypress',editorKeyPress); - } catch(e) { - } - - // 자동저장 필드가 있다면 자동 저장 기능 활성화 - if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, editor_sequence); - - - // 좋지는 않으나;; 스타일 변형을 막기 위해 start 할때 html이면 바꿔주자 - if (xGetCookie('editor_mode') == 'html'){ - iframe_obj = editorGetIFrame(editor_sequence); - if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='block'; - - textarea_obj = editorGetTextArea(editor_sequence); - textarea_obj.value = content; - xWidth(textarea_obj, xWidth(iframe_obj.parentNode)); - xHeight(textarea_obj, xHeight(iframe_obj.parentNode)); - editorMode[editor_sequence] = 'html'; - - if(xGetElementById('xeEditor_'+editor_sequence)) { - xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor html'; - xGetElementById('use_rich_'+editor_sequence).className = ''; - xGetElementById('preview_html_'+editor_sequence).className = ''; - xGetElementById('use_html_'+editor_sequence).className = 'active'; - } - } -} - - -/** - * 에디터의 세부 설정과 데이터 핸들링을 정의한 함수들 - **/ - - - -/** - * 키 또는 마우스 이벤트 핸들링 정의 함수 - **/ - -// 입력 키에 대한 이벤트 체크 -function editorKeyPress(evt) { - var e = new xEvent(evt); - - // 대상을 구함 - var obj = e.target; - var body_obj = null; - if(obj.nodeName == "BODY") body_obj = obj; - else body_obj = obj.firstChild.nextSibling; - - if(!body_obj) return; - - // editor_sequence는 에디터의 body에 attribute로 정의되어 있음 - var editor_sequence = body_obj.getAttribute("editor_sequence"); - if(!editor_sequence) return; - - // IE에서 enter키를 눌렀을때 P 태그 대신 BR 태그 입력 - if (xIE4Up && !e.ctrlKey && !e.shiftKey && e.keyCode == 13 && !editorMode[editor_sequence]) { - var iframe_obj = editorGetIFrame(editor_sequence); - if(!iframe_obj) return; - - obj = contentDocument.selection.createRange(); - var contentDocument = iframe_obj.contentWindow.document; - var pTag = obj.parentElement().tagName.toLowerCase(); - - switch(pTag) { - case 'li' : - return; - default : - obj.pasteHTML("
"); - break; - } - obj.select(); - evt.cancelBubble = true; - evt.returnValue = false; - - return; - } - - // ctrl-S, alt-S 클릭시 submit하기 - if( e.keyCode == 115 && (e.altKey || e.ctrlKey) ) { - // iframe 에디터를 찾음 - if(!editorGetIFrame(editor_sequence)) return; - - // 대상 form을 찾음 - var fo_obj = editorGetForm(editor_sequence); - if(!fo_obj) return; - - // 데이터 동기화 - editorRelKeys[editor_sequence].content.value = editorGetContent(editor_sequence); - - // form문 전송 - if(fo_obj.onsubmit) fo_obj.onsubmit(); - - // 이벤트 중단 - evt.cancelBubble = true; - evt.returnValue = false; - xPreventDefault(evt); - xStopPropagation(evt); - return; - } - - // ctrl-b, i, u, s 키에 대한 처리 (파이어폭스에서도 에디터 상태에서 단축키 쓰도록) - if (e.ctrlKey) { - // iframe 에디터를 찾음 - if(!editorGetIFrame(editor_sequence)) return; - - // html 에디터 모드일 경우 이벤트 취소 시킴 - if(editorMode[editor_sequence]) { - evt.cancelBubble = true; - evt.returnValue = false; - xPreventDefault(evt); - xStopPropagation(evt); - - return; - } - - switch(e.keyCode) { - // ctrl+1~6 - case 49 : - case 50 : - case 51 : - case 52 : - case 53 : - case 54 : - editorDo('formatblock',"",e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - // ctrl+7 - case 55 : - editorDo('formatblock',"

",e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - // ie에서 ctrlKey + enter일 경우 P 태그 입력 - case 13 : - if(xIE4Up) { - if(e.target.parentElement.document.designMode!="On") return; - - obj = e.target.parentElement.document.selection.createRange(); - obj.pasteHTML('

'); - obj.select(); - evt.cancelBubble = true; - evt.returnValue = false; - - return; - } - break; - // bold - case 98 : - editorDo('Bold',null,e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - // italic - case 105 : - editorDo('Italic',null,e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - // underline - case 117 : - editorDo('Underline',null,e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - //RemoveFormat - case 100 : - editorDo('RemoveFormat',null,e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - - - // strike - /* - case 83 : - case 115 : - editorDo('StrikeThrough',null,e.target); - xPreventDefault(evt); - xStopPropagation(evt); - break; - */ - } - } -} - -// 편집 기능 실행 -function editorDo(command, value, target) { - - var doc = null; - - // target이 object인지 editor_sequence인지에 따라 document를 구함 - if(typeof(target)=="object") { - if(xIE4Up) doc = target.parentElement.document; - else doc = target.parentNode; - } else { - var iframe_obj = editorGetIFrame(target); - doc = iframe_obj.contentWindow.document; - } - - var editor_sequence = doc.body.getAttribute('editor_sequence'); - if(editorMode[editor_sequence]) return; - - // 포커스 - if(typeof(target)=="object") target.focus(); - else editorFocus(target); - - // 실행 - doc.execCommand(command, false, value); - - // 포커스 - if(typeof(target)=="object") target.focus(); - else editorFocus(target); -} - -// 폰트를 변경 -function editorChangeFontName(obj,srl) { - var value = obj.options[obj.selectedIndex].value; - if(!value) return; - editorDo('FontName',value,srl); - obj.selectedIndex = 0; -} - -function editorChangeFontSize(obj,srl) { - var value = obj.options[obj.selectedIndex].value; - if(!value) return; - editorDo('FontSize',value,srl); - obj.selectedIndex = 0; -} - -function editorUnDo(obj,srl) { - editorDo('undo','',srl); - obj.selectedIndex = 0; -} - -function editorReDo(obj,srl) { - editorDo('redo','',srl); - obj.selectedIndex = 0; -} - -function editorChangeHeader(obj,srl) { - var value = obj.options[obj.selectedIndex].value; - if(!value) return; - value = "<"+value+">"; - editorDo('formatblock',value,srl); - obj.selectedIndex = 0; -} - -/** - * HTML 편집 기능 활성/비활성 - **/ - -function editorChangeMode(mode, editor_sequence) { - /* jshint -W041 */ - if(mode == 'html' || mode == ''){ - var expire = new Date(); - expire.setTime(expire.getTime()+ (7000 * 24 * 3600000)); - xSetCookie('editor_mode', mode, expire); - } - - var iframe_obj = editorGetIFrame(editor_sequence); - if(!iframe_obj) return; - - var textarea_obj = editorGetTextArea(editor_sequence); - var preview_obj = editorGetPreviewArea(editor_sequence); - var contentDocument = iframe_obj.contentWindow.document; - - var html = null; - if(editorMode[editor_sequence]=='html') { - html = textarea_obj.value; - contentDocument.body.innerHTML = textarea_obj.value; - } else if (editorMode[editor_sequence]=='preview') { -// html = xInnerHtml(preview_obj); - html = textarea_obj.value; - preview_obj.contentWindow.document.body.innerHTML = ''; -// xAddEventListener(xGetElementById('editor_preview_'+editor_sequence), 'load', function(){setPreviewHeight(editor_sequence)}); - } else { - html = contentDocument.body.innerHTML; - textarea_obj.value = html; - html = html.replace(/
/ig,"
\n"); - html = html.replace(/
\n\n/ig,"
\n"); - } - - // html 편집 사용시 - if(mode == 'html' && textarea_obj) { - preview_obj.style.display='none'; - if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='block'; - textarea_obj.value = html; - xWidth(textarea_obj, xWidth(iframe_obj.parentNode)); - xHeight(textarea_obj, xHeight(iframe_obj.parentNode)); - editorMode[editor_sequence] = 'html'; - - if(xGetElementById('xeEditor_'+editor_sequence)) { - xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor html'; - xGetElementById('use_rich_'+editor_sequence).className = ''; - xGetElementById('preview_html_'+editor_sequence).className = ''; - xGetElementById('use_html_'+editor_sequence).className = 'active'; - } - // 미리보기 - } else if(mode == 'preview' && preview_obj) { - preview_obj.style.display=''; - if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='none'; - - var fo_obj = xGetElementById("preview_form"); - if(!fo_obj) { - fo_obj = xCreateElement('form'); - fo_obj.id = "preview_form"; - fo_obj.method = "post"; - fo_obj.action = request_uri; - fo_obj.target = "editor_preview_"+editor_sequence; - xInnerHtml(fo_obj,''); - document.body.appendChild(fo_obj); - } - fo_obj.content.value = html; - fo_obj.submit(); - - xWidth(preview_obj, xWidth(iframe_obj.parentNode)); - editorMode[editor_sequence] = 'preview'; - - if(xGetElementById('xeEditor_'+editor_sequence)) { - xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor preview'; - xGetElementById('use_rich_'+editor_sequence).className = ''; - xGetElementById('preview_html_'+editor_sequence).className = 'active'; - if(xGetElementById('use_html_'+editor_sequence)) xGetElementById('use_html_'+editor_sequence).className = ''; - } - // 위지윅 모드 사용시 - } else { - preview_obj.style.display='none'; - if(xGetElementById('fileUploader_'+editor_sequence)) xGetElementById('fileUploader_'+editor_sequence).style.display='block'; - contentDocument.body.innerHTML = html; - editorMode[editor_sequence] = null; - - if(xGetElementById('xeEditor_'+editor_sequence)) { - xGetElementById('xeEditor_'+editor_sequence).className = 'xeEditor rich'; - xGetElementById('use_rich_'+editor_sequence).className = 'active'; - xGetElementById('preview_html_'+editor_sequence).className = ''; - if(xGetElementById('use_html_'+editor_sequence)) xGetElementById('use_html_'+editor_sequence).className = ''; - } - } - -} - -// Editor Info Close -function closeEditorInfo(editor_sequence) { - xGetElementById('editorInfo_'+editor_sequence).style.display='none'; - var expire = new Date(); - expire.setTime(expire.getTime()+ (7000 * 24 * 3600000)); - xSetCookie('EditorInfo', '1', expire); -} - - -function showEditorHelp(e,editor_sequence){ - jQuery('#helpList_'+editor_sequence).toggleClass('open'); -} - -function showEditorExtension(evt,editor_sequence){ - var oid = '#editorExtension_'+editor_sequence; - var e = new xEvent(evt); - if(jQuery(oid).hasClass('extension2')){ - jQuery(oid).addClass('open'); - - if(e.pageX <= xWidth('editor_component_'+editor_sequence)){ - jQuery('#editor_component_'+editor_sequence).css('right','auto').css('left', 0); - }else{ - jQuery('#editor_component_'+editor_sequence).css('right', 0).css('left', 'auto'); - } - }else{ - jQuery(oid).attr('class', 'extension2'); - } -} - -function showPreviewContent(editor_sequence) { - if(typeof(editor_sequence)=='undefined') return; - if(typeof(_editorFontColor[editor_sequence])=='undefined') return; - var preview_obj = editorGetPreviewArea(editor_sequence); - preview_obj.contentWindow.document.body.style.color = _editorFontColor[editor_sequence]; -} - -function setPreviewHeight(editor_sequence){ - var h = xGetElementById('editor_preview_'+editor_sequence).contentWindow.document.body.scrollHeight; - if(h < 400) h=400; - xHeight('editor_preview_'+editor_sequence,h+20); -} - -function getAutoSavedSrl(ret_obj, response_tags, c) { - var editor_sequence = ret_obj.editor_sequence; - var primary_key = ret_obj.key; - var fo_obj = editorGetForm(editor_sequence); - - fo_obj[primary_key].value = ret_obj.document_srl; - if(uploadSettingObj[editor_sequence]) editorUploadInit(uploadSettingObj[editor_sequence], true); -} diff --git a/modules/editor/tpl/js/editor.min.js b/modules/editor/tpl/js/editor.min.js deleted file mode 100644 index 52fd46a34..000000000 --- a/modules/editor/tpl/js/editor.min.js +++ /dev/null @@ -1 +0,0 @@ -This file is not used in Rhymix. diff --git a/modules/editor/tpl/js/swfupload.js b/modules/editor/tpl/js/swfupload.js deleted file mode 100644 index 15e15fd66..000000000 --- a/modules/editor/tpl/js/swfupload.js +++ /dev/null @@ -1,980 +0,0 @@ -/** - * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com - * - * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/ - * - * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzn and Mammon Media and is released under the MIT License: - * http://www.opensource.org/licenses/mit-license.php - * - * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License: - * http://www.opensource.org/licenses/mit-license.php - * - */ - - -/* ******************* */ -/* Constructor & Init */ -/* ******************* */ -var SWFUpload; - -if (SWFUpload == undefined) { - SWFUpload = function (settings) { - this.initSWFUpload(settings); - }; -} - -SWFUpload.prototype.initSWFUpload = function (settings) { - try { - this.customSettings = {}; // A container where developers can place their own settings associated with this instance. - this.settings = settings; - this.eventQueue = []; - this.movieName = "SWFUpload_" + SWFUpload.movieCount++; - this.movieElement = null; - - - // Setup global control tracking - SWFUpload.instances[this.movieName] = this; - - // Load the settings. Load the Flash movie. - this.initSettings(); - this.loadFlash(); - this.displayDebugInfo(); - } catch (ex) { - delete SWFUpload.instances[this.movieName]; - throw ex; - } -}; - -/* *************** */ -/* Static Members */ -/* *************** */ -SWFUpload.instances = {}; -SWFUpload.movieCount = 0; -SWFUpload.version = "2.2.0 2009-03-25"; -SWFUpload.QUEUE_ERROR = { - QUEUE_LIMIT_EXCEEDED : -100, - FILE_EXCEEDS_SIZE_LIMIT : -110, - ZERO_BYTE_FILE : -120, - INVALID_FILETYPE : -130 -}; -SWFUpload.UPLOAD_ERROR = { - HTTP_ERROR : -200, - MISSING_UPLOAD_URL : -210, - IO_ERROR : -220, - SECURITY_ERROR : -230, - UPLOAD_LIMIT_EXCEEDED : -240, - UPLOAD_FAILED : -250, - SPECIFIED_FILE_ID_NOT_FOUND : -260, - FILE_VALIDATION_FAILED : -270, - FILE_CANCELLED : -280, - UPLOAD_STOPPED : -290 -}; -SWFUpload.FILE_STATUS = { - QUEUED : -1, - IN_PROGRESS : -2, - ERROR : -3, - COMPLETE : -4, - CANCELLED : -5 -}; -SWFUpload.BUTTON_ACTION = { - SELECT_FILE : -100, - SELECT_FILES : -110, - START_UPLOAD : -120 -}; -SWFUpload.CURSOR = { - ARROW : -1, - HAND : -2 -}; -SWFUpload.WINDOW_MODE = { - WINDOW : "window", - TRANSPARENT : "transparent", - OPAQUE : "opaque" -}; - -// Private: takes a URL, determines if it is relative and converts to an absolute URL -// using the current site. Only processes the URL if it can, otherwise returns the URL untouched -SWFUpload.completeURL = function(url) { - if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) { - return url; - } - - var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); - - var indexSlash = window.location.pathname.lastIndexOf("/"); - if (indexSlash <= 0) { - path = "/"; - } else { - path = window.location.pathname.substr(0, indexSlash) + "/"; - } - - return /*currentURL +*/ path + url; - -}; - - -/* ******************** */ -/* Instance Members */ -/* ******************** */ - -// Private: initSettings ensures that all the -// settings are set, getting a default value if one was not assigned. -SWFUpload.prototype.initSettings = function () { - this.ensureDefault = function (settingName, defaultValue) { - this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; - }; - - // Upload backend settings - this.ensureDefault("upload_url", ""); - this.ensureDefault("preserve_relative_urls", false); - this.ensureDefault("file_post_name", "Filedata"); - this.ensureDefault("post_params", {}); - this.ensureDefault("use_query_string", false); - this.ensureDefault("requeue_on_error", false); - this.ensureDefault("http_success", []); - this.ensureDefault("assume_success_timeout", 0); - - // File Settings - this.ensureDefault("file_types", "*.*"); - this.ensureDefault("file_types_description", "All Files"); - this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited" - this.ensureDefault("file_upload_limit", 0); - this.ensureDefault("file_queue_limit", 0); - - // Flash Settings - this.ensureDefault("flash_url", "swfupload.swf"); - this.ensureDefault("prevent_swf_caching", true); - - // Button Settings - this.ensureDefault("button_image_url", ""); - this.ensureDefault("button_width", 1); - this.ensureDefault("button_height", 1); - this.ensureDefault("button_text", ""); - this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;"); - this.ensureDefault("button_text_top_padding", 0); - this.ensureDefault("button_text_left_padding", 0); - this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); - this.ensureDefault("button_disabled", false); - this.ensureDefault("button_placeholder_id", ""); - this.ensureDefault("button_placeholder", null); - this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW); - this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW); - - // Debug Settings - this.ensureDefault("debug", false); - this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API - - // Event Handlers - this.settings.return_upload_start_handler = this.returnUploadStart; - this.ensureDefault("swfupload_loaded_handler", null); - this.ensureDefault("file_dialog_start_handler", null); - this.ensureDefault("file_queued_handler", null); - this.ensureDefault("file_queue_error_handler", null); - this.ensureDefault("file_dialog_complete_handler", null); - - this.ensureDefault("upload_start_handler", null); - this.ensureDefault("upload_progress_handler", null); - this.ensureDefault("upload_error_handler", null); - this.ensureDefault("upload_success_handler", null); - this.ensureDefault("upload_complete_handler", null); - - this.ensureDefault("debug_handler", this.debugMessage); - - this.ensureDefault("custom_settings", {}); - - // Other settings - this.customSettings = this.settings.custom_settings; - - // Update the flash url if needed - if (!!this.settings.prevent_swf_caching) { - this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime(); - } - - if (!this.settings.preserve_relative_urls) { - //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it - this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); - this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url); - } - - delete this.ensureDefault; -}; - -// Private: loadFlash replaces the button_placeholder element with the flash movie. -SWFUpload.prototype.loadFlash = function () { - var targetElement, tempParent; - - // Make sure an element with the ID we are going to use doesn't already exist - if (document.getElementById(this.movieName) !== null) { - throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; - } - - // Get the element where we will be placing the flash movie - targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder; - - if (targetElement == undefined) { - throw "Could not find the placeholder element: " + this.settings.button_placeholder_id; - } - - // Append the container and load the flash - tempParent = document.createElement("div"); - tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers) - targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement); - - // Fix IE Flash/Form bug - if (window[this.movieName] == undefined) { - window[this.movieName] = this.getMovieElement(); - } - -}; - -// Private: getFlashHTML generates the object tag needed to embed the flash in to the document -SWFUpload.prototype.getFlashHTML = function () { - // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay - return ['', - '', - '', - '', - '', - '', - '', - ''].join(""); -}; - -// Private: getFlashVars builds the parameter string that will be passed -// to flash in the flashvars param. -SWFUpload.prototype.getFlashVars = function () { - // Build a string from the post param object - var paramString = this.buildParamString(); - var httpSuccessString = this.settings.http_success.join(","); - - // Build the parameter string - return ["movieName=", encodeURIComponent(this.movieName), - "&uploadURL=", encodeURIComponent(this.settings.upload_url), - "&useQueryString=", encodeURIComponent(this.settings.use_query_string), - "&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), - "&httpSuccess=", encodeURIComponent(httpSuccessString), - "&assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), - "&params=", encodeURIComponent(paramString), - "&filePostName=", encodeURIComponent(this.settings.file_post_name), - "&fileTypes=", encodeURIComponent(this.settings.file_types), - "&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), - "&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), - "&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), - "&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), - "&debugEnabled=", encodeURIComponent(this.settings.debug_enabled), - "&buttonImageURL=", encodeURIComponent(this.settings.button_image_url), - "&buttonWidth=", encodeURIComponent(this.settings.button_width), - "&buttonHeight=", encodeURIComponent(this.settings.button_height), - "&buttonText=", encodeURIComponent(this.settings.button_text), - "&buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), - "&buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), - "&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), - "&buttonAction=", encodeURIComponent(this.settings.button_action), - "&buttonDisabled=", encodeURIComponent(this.settings.button_disabled), - "&buttonCursor=", encodeURIComponent(this.settings.button_cursor) - ].join(""); -}; - -// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload -// The element is cached after the first lookup -SWFUpload.prototype.getMovieElement = function () { - if (this.movieElement == undefined) { - this.movieElement = document.getElementById(this.movieName); - } - - if (this.movieElement === null) { - throw "Could not find Flash element"; - } - - return this.movieElement; -}; - -// Private: buildParamString takes the name/value pairs in the post_params setting object -// and joins them up in to a string formatted "name=value&name=value" -SWFUpload.prototype.buildParamString = function () { - var postParams = this.settings.post_params; - var paramStringPairs = []; - - if (typeof(postParams) === "object") { - for (var name in postParams) { - if (postParams.hasOwnProperty(name)) { - paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString())); - } - } - } - - return paramStringPairs.join("&"); -}; - -// Public: Used to remove a SWFUpload instance from the page. This method strives to remove -// all references to the SWF, and other objects so memory is properly freed. -// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state. -// Credits: Major improvements provided by steffen -SWFUpload.prototype.destroy = function () { - try { - // Make sure Flash is done before we try to remove it - this.cancelUpload(null, false); - - - // Remove the SWFUpload DOM nodes - var movieElement = null; - movieElement = this.getMovieElement(); - - if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE - // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround) - for (var i in movieElement) { - try { - if (typeof(movieElement[i]) === "function") { - movieElement[i] = null; - } - } catch (ex1) {} - } - - // Remove the Movie Element from the page - try { - movieElement.parentNode.removeChild(movieElement); - } catch (ex) {} - } - - // Remove IE form fix reference - window[this.movieName] = null; - - // Destroy other references - SWFUpload.instances[this.movieName] = null; - delete SWFUpload.instances[this.movieName]; - - this.movieElement = null; - this.settings = null; - this.customSettings = null; - this.eventQueue = null; - this.movieName = null; - - - return true; - } catch (ex2) { - return false; - } -}; - - -// Public: displayDebugInfo prints out settings and configuration -// information about this SWFUpload instance. -// This function (and any references to it) can be deleted when placing -// SWFUpload in production. -SWFUpload.prototype.displayDebugInfo = function () { - this.debug( - [ - "---SWFUpload Instance Info---\n", - "Version: ", SWFUpload.version, "\n", - "Movie Name: ", this.movieName, "\n", - "Settings:\n", - "\t", "upload_url: ", this.settings.upload_url, "\n", - "\t", "flash_url: ", this.settings.flash_url, "\n", - "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", - "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n", - "\t", "http_success: ", this.settings.http_success.join(", "), "\n", - "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n", - "\t", "file_post_name: ", this.settings.file_post_name, "\n", - "\t", "post_params: ", this.settings.post_params.toString(), "\n", - "\t", "file_types: ", this.settings.file_types, "\n", - "\t", "file_types_description: ", this.settings.file_types_description, "\n", - "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", - "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n", - "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n", - "\t", "debug: ", this.settings.debug.toString(), "\n", - - "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n", - - "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n", - "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n", - "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n", - "\t", "button_width: ", this.settings.button_width.toString(), "\n", - "\t", "button_height: ", this.settings.button_height.toString(), "\n", - "\t", "button_text: ", this.settings.button_text.toString(), "\n", - "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n", - "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n", - "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n", - "\t", "button_action: ", this.settings.button_action.toString(), "\n", - "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n", - - "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n", - "Event Handlers:\n", - "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n", - "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n", - "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n", - "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n", - "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n", - "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n", - "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n", - "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n", - "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n", - "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n" - ].join("") - ); -}; - -/* Note: addSetting and getSetting are no longer used by SWFUpload but are included - the maintain v2 API compatibility -*/ -// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used. -SWFUpload.prototype.addSetting = function (name, value, default_value) { - if (value == undefined) { - return (this.settings[name] = default_value); - } else { - return (this.settings[name] = value); - } -}; - -// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found. -SWFUpload.prototype.getSetting = function (name) { - if (this.settings[name] != undefined) { - return this.settings[name]; - } - - return ""; -}; - - - -// Private: callFlash handles function calls made to the Flash element. -// Calls are made with a setTimeout for some functions to work around -// bugs in the ExternalInterface library. -SWFUpload.prototype.callFlash = function (functionName, argumentArray) { - argumentArray = argumentArray || []; - - var movieElement = this.getMovieElement(); - var returnValue, returnString; - - // Flash's method if calling ExternalInterface methods (code adapted from MooTools). - try { - returnString = movieElement.CallFunction('' + __flash__argumentsToXML(argumentArray, 0) + ''); - returnValue = eval(returnString); - } catch (ex) { - throw "Call to " + functionName + " failed"; - } - - // Unescape file post param values - if (returnValue != undefined && typeof returnValue.post === "object") { - returnValue = this.unescapeFilePostParams(returnValue); - } - - return returnValue; -}; - -/* ***************************** - -- Flash control methods -- - Your UI should use these - to operate SWFUpload - ***************************** */ - -// WARNING: this function does not work in Flash Player 10 -// Public: selectFile causes a File Selection Dialog window to appear. This -// dialog only allows 1 file to be selected. -SWFUpload.prototype.selectFile = function () { - this.callFlash("SelectFile"); -}; - -// WARNING: this function does not work in Flash Player 10 -// Public: selectFiles causes a File Selection Dialog window to appear/ This -// dialog allows the user to select any number of files -// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names. -// If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around -// for this bug. -SWFUpload.prototype.selectFiles = function () { - this.callFlash("SelectFiles"); -}; - - -// Public: startUpload starts uploading the first file in the queue unless -// the optional parameter 'fileID' specifies the ID -SWFUpload.prototype.startUpload = function (fileID) { - this.callFlash("StartUpload", [fileID]); -}; - -// Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index. -// If you do not specify a fileID the current uploading file or first file in the queue is cancelled. -// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter. -SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) { - if (triggerErrorEvent !== false) { - triggerErrorEvent = true; - } - this.callFlash("CancelUpload", [fileID, triggerErrorEvent]); -}; - -// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue. -// If nothing is currently uploading then nothing happens. -SWFUpload.prototype.stopUpload = function () { - this.callFlash("StopUpload"); -}; - -/* ************************ - * Settings methods - * These methods change the SWFUpload settings. - * SWFUpload settings should not be changed directly on the settings object - * since many of the settings need to be passed to Flash in order to take - * effect. - * *********************** */ - -// Public: getStats gets the file statistics object. -SWFUpload.prototype.getStats = function () { - return this.callFlash("GetStats"); -}; - -// Public: setStats changes the SWFUpload statistics. You shouldn't need to -// change the statistics but you can. Changing the statistics does not -// affect SWFUpload accept for the successful_uploads count which is used -// by the upload_limit setting to determine how many files the user may upload. -SWFUpload.prototype.setStats = function (statsObject) { - this.callFlash("SetStats", [statsObject]); -}; - -// Public: getFile retrieves a File object by ID or Index. If the file is -// not found then 'null' is returned. -SWFUpload.prototype.getFile = function (fileID) { - if (typeof(fileID) === "number") { - return this.callFlash("GetFileByIndex", [fileID]); - } else { - return this.callFlash("GetFile", [fileID]); - } -}; - -// Public: addFileParam sets a name/value pair that will be posted with the -// file specified by the Files ID. If the name already exists then the -// exiting value will be overwritten. -SWFUpload.prototype.addFileParam = function (fileID, name, value) { - return this.callFlash("AddFileParam", [fileID, name, value]); -}; - -// Public: removeFileParam removes a previously set (by addFileParam) name/value -// pair from the specified file. -SWFUpload.prototype.removeFileParam = function (fileID, name) { - this.callFlash("RemoveFileParam", [fileID, name]); -}; - -// Public: setUploadUrl changes the upload_url setting. -SWFUpload.prototype.setUploadURL = function (url) { - this.settings.upload_url = url.toString(); - this.callFlash("SetUploadURL", [url]); -}; - -// Public: setPostParams changes the post_params setting -SWFUpload.prototype.setPostParams = function (paramsObject) { - this.settings.post_params = paramsObject; - this.callFlash("SetPostParams", [paramsObject]); -}; - -// Public: addPostParam adds post name/value pair. Each name can have only one value. -SWFUpload.prototype.addPostParam = function (name, value) { - this.settings.post_params[name] = value; - this.callFlash("SetPostParams", [this.settings.post_params]); -}; - -// Public: removePostParam deletes post name/value pair. -SWFUpload.prototype.removePostParam = function (name) { - delete this.settings.post_params[name]; - this.callFlash("SetPostParams", [this.settings.post_params]); -}; - -// Public: setFileTypes changes the file_types setting and the file_types_description setting -SWFUpload.prototype.setFileTypes = function (types, description) { - this.settings.file_types = types; - this.settings.file_types_description = description; - this.callFlash("SetFileTypes", [types, description]); -}; - -// Public: setFileSizeLimit changes the file_size_limit setting -SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) { - this.settings.file_size_limit = fileSizeLimit; - this.callFlash("SetFileSizeLimit", [fileSizeLimit]); -}; - -// Public: setFileUploadLimit changes the file_upload_limit setting -SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) { - this.settings.file_upload_limit = fileUploadLimit; - this.callFlash("SetFileUploadLimit", [fileUploadLimit]); -}; - -// Public: setFileQueueLimit changes the file_queue_limit setting -SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) { - this.settings.file_queue_limit = fileQueueLimit; - this.callFlash("SetFileQueueLimit", [fileQueueLimit]); -}; - -// Public: setFilePostName changes the file_post_name setting -SWFUpload.prototype.setFilePostName = function (filePostName) { - this.settings.file_post_name = filePostName; - this.callFlash("SetFilePostName", [filePostName]); -}; - -// Public: setUseQueryString changes the use_query_string setting -SWFUpload.prototype.setUseQueryString = function (useQueryString) { - this.settings.use_query_string = useQueryString; - this.callFlash("SetUseQueryString", [useQueryString]); -}; - -// Public: setRequeueOnError changes the requeue_on_error setting -SWFUpload.prototype.setRequeueOnError = function (requeueOnError) { - this.settings.requeue_on_error = requeueOnError; - this.callFlash("SetRequeueOnError", [requeueOnError]); -}; - -// Public: setHTTPSuccess changes the http_success setting -SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) { - if (typeof http_status_codes === "string") { - http_status_codes = http_status_codes.replace(" ", "").split(","); - } - - this.settings.http_success = http_status_codes; - this.callFlash("SetHTTPSuccess", [http_status_codes]); -}; - -// Public: setHTTPSuccess changes the http_success setting -SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) { - this.settings.assume_success_timeout = timeout_seconds; - this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]); -}; - -// Public: setDebugEnabled changes the debug_enabled setting -SWFUpload.prototype.setDebugEnabled = function (debugEnabled) { - this.settings.debug_enabled = debugEnabled; - this.callFlash("SetDebugEnabled", [debugEnabled]); -}; - -// Public: setButtonImageURL loads a button image sprite -SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) { - if (buttonImageURL == undefined) { - buttonImageURL = ""; - } - - this.settings.button_image_url = buttonImageURL; - this.callFlash("SetButtonImageURL", [buttonImageURL]); -}; - -// Public: setButtonDimensions resizes the Flash Movie and button -SWFUpload.prototype.setButtonDimensions = function (width, height) { - this.settings.button_width = width; - this.settings.button_height = height; - - var movie = this.getMovieElement(); - if (movie != undefined) { - movie.style.width = width + "px"; - movie.style.height = height + "px"; - } - - this.callFlash("SetButtonDimensions", [width, height]); -}; -// Public: setButtonText Changes the text overlaid on the button -SWFUpload.prototype.setButtonText = function (html) { - this.settings.button_text = html; - this.callFlash("SetButtonText", [html]); -}; -// Public: setButtonTextPadding changes the top and left padding of the text overlay -SWFUpload.prototype.setButtonTextPadding = function (left, top) { - this.settings.button_text_top_padding = top; - this.settings.button_text_left_padding = left; - this.callFlash("SetButtonTextPadding", [left, top]); -}; - -// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button -SWFUpload.prototype.setButtonTextStyle = function (css) { - this.settings.button_text_style = css; - this.callFlash("SetButtonTextStyle", [css]); -}; -// Public: setButtonDisabled disables/enables the button -SWFUpload.prototype.setButtonDisabled = function (isDisabled) { - this.settings.button_disabled = isDisabled; - this.callFlash("SetButtonDisabled", [isDisabled]); -}; -// Public: setButtonAction sets the action that occurs when the button is clicked -SWFUpload.prototype.setButtonAction = function (buttonAction) { - this.settings.button_action = buttonAction; - this.callFlash("SetButtonAction", [buttonAction]); -}; - -// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button -SWFUpload.prototype.setButtonCursor = function (cursor) { - this.settings.button_cursor = cursor; - this.callFlash("SetButtonCursor", [cursor]); -}; - -/* ******************************* - Flash Event Interfaces - These functions are used by Flash to trigger the various - events. - - All these functions a Private. - - Because the ExternalInterface library is buggy the event calls - are added to a queue and the queue then executed by a setTimeout. - This ensures that events are executed in a determinate order and that - the ExternalInterface bugs are avoided. -******************************* */ - -SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) { - // Warning: Don't call this.debug inside here or you'll create an infinite loop - - if (argumentArray == undefined) { - argumentArray = []; - } else if (!(argumentArray instanceof Array)) { - argumentArray = [argumentArray]; - } - - var self = this; - if (typeof this.settings[handlerName] === "function") { - // Queue the event - this.eventQueue.push(function () { - this.settings[handlerName].apply(this, argumentArray); - }); - - // Execute the next queued event - setTimeout(function () { - self.executeNextEvent(); - }, 0); - - } else if (this.settings[handlerName] !== null) { - throw "Event handler " + handlerName + " is unknown or is not a function"; - } -}; - -// Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout -// we must queue them in order to garentee that they are executed in order. -SWFUpload.prototype.executeNextEvent = function () { - // Warning: Don't call this.debug inside here or you'll create an infinite loop - - var f = this.eventQueue ? this.eventQueue.shift() : null; - if (typeof(f) === "function") { - f.apply(this); - } -}; - -// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have -// properties that contain characters that are not valid for JavaScript identifiers. To work around this -// the Flash Component escapes the parameter names and we must unescape again before passing them along. -SWFUpload.prototype.unescapeFilePostParams = function (file) { - var reg = /[$]([0-9a-f]{4})/i; - var unescapedPost = {}; - var uk; - - if (file != undefined) { - for (var k in file.post) { - if (file.post.hasOwnProperty(k)) { - uk = k; - var match; - while ((match = reg.exec(uk)) !== null) { - uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16))); - } - unescapedPost[uk] = file.post[k]; - } - } - - file.post = unescapedPost; - } - - return file; -}; - -// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working) -SWFUpload.prototype.testExternalInterface = function () { - try { - return this.callFlash("TestExternalInterface"); - } catch (ex) { - return false; - } -}; - -// Private: This event is called by Flash when it has finished loading. Don't modify this. -// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded. -SWFUpload.prototype.flashReady = function () { - // Check that the movie element is loaded correctly with its ExternalInterface methods defined - var movieElement = this.getMovieElement(); - - if (!movieElement) { - this.debug("Flash called back ready but the flash movie can't be found."); - return; - } - - this.cleanUp(movieElement); - - this.queueEvent("swfupload_loaded_handler"); -}; - -// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE. -// This function is called by Flash each time the ExternalInterface functions are created. -SWFUpload.prototype.cleanUp = function (movieElement) { - // Pro-actively unhook all the Flash functions - try { - if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE - this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"); - for (var key in movieElement) { - try { - if (typeof(movieElement[key]) === "function") { - movieElement[key] = null; - } - } catch (ex) { - } - } - } - } catch (ex1) { - - } - - // Fix Flashes own cleanup code so if the SWFMovie was removed from the page - // it doesn't display errors. - window["__flash__removeCallback"] = function (instance, name) { - try { - if (instance) { - instance[name] = null; - } - } catch (flashEx) { - - } - }; - -}; - - -/* This is a chance to do something before the browse window opens */ -SWFUpload.prototype.fileDialogStart = function () { - this.queueEvent("file_dialog_start_handler"); -}; - - -/* Called when a file is successfully added to the queue. */ -SWFUpload.prototype.fileQueued = function (file) { - file = this.unescapeFilePostParams(file); - this.queueEvent("file_queued_handler", file); -}; - - -/* Handle errors that occur when an attempt to queue a file fails. */ -SWFUpload.prototype.fileQueueError = function (file, errorCode, message) { - file = this.unescapeFilePostParams(file); - this.queueEvent("file_queue_error_handler", [file, errorCode, message]); -}; - -/* Called after the file dialog has closed and the selected files have been queued. - You could call startUpload here if you want the queued files to begin uploading immediately. */ -SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) { - this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]); -}; - -SWFUpload.prototype.uploadStart = function (file) { - file = this.unescapeFilePostParams(file); - this.queueEvent("return_upload_start_handler", file); -}; - -SWFUpload.prototype.returnUploadStart = function (file) { - var returnValue; - if (typeof this.settings.upload_start_handler === "function") { - file = this.unescapeFilePostParams(file); - returnValue = this.settings.upload_start_handler.call(this, file); - } else if (this.settings.upload_start_handler != undefined) { - throw "upload_start_handler must be a function"; - } - - // Convert undefined to true so if nothing is returned from the upload_start_handler it is - // interpretted as 'true'. - if (returnValue === undefined) { - returnValue = true; - } - - returnValue = !!returnValue; - - this.callFlash("ReturnUploadStart", [returnValue]); -}; - - - -SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) { - file = this.unescapeFilePostParams(file); - this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]); -}; - -SWFUpload.prototype.uploadError = function (file, errorCode, message) { - file = this.unescapeFilePostParams(file); - this.queueEvent("upload_error_handler", [file, errorCode, message]); -}; - -SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) { - file = this.unescapeFilePostParams(file); - this.queueEvent("upload_success_handler", [file, serverData, responseReceived]); -}; - -SWFUpload.prototype.uploadComplete = function (file) { - file = this.unescapeFilePostParams(file); - this.queueEvent("upload_complete_handler", file); -}; - -/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the - internal debug console. You can override this event and have messages written where you want. */ -SWFUpload.prototype.debug = function (message) { - this.queueEvent("debug_handler", message); -}; - - -/* ********************************** - Debug Console - The debug console is a self contained, in page location - for debug message to be sent. The Debug Console adds - itself to the body if necessary. - - The console is automatically scrolled as messages appear. - - If you are using your own debug handler or when you deploy to production and - have debug disabled you can remove these functions to reduce the file size - and complexity. -********************************** */ - -// Private: debugMessage is the default debug_handler. If you want to print debug messages -// call the debug() function. When overriding the function your own function should -// check to see if the debug setting is true before outputting debug information. -SWFUpload.prototype.debugMessage = function (message) { - if (this.settings.debug) { - var exceptionMessage, exceptionValues = []; - - // Check for an exception object and print it nicely - if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") { - for (var key in message) { - if (message.hasOwnProperty(key)) { - exceptionValues.push(key + ": " + message[key]); - } - } - exceptionMessage = exceptionValues.join("\n") || ""; - exceptionValues = exceptionMessage.split("\n"); - exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: "); - SWFUpload.Console.writeLine(exceptionMessage); - } else { - SWFUpload.Console.writeLine(message); - } - } -}; - -SWFUpload.Console = {}; -SWFUpload.Console.writeLine = function (message) { - var console, documentForm; - - try { - console = document.getElementById("SWFUpload_Console"); - - if (!console) { - documentForm = document.createElement("form"); - document.getElementsByTagName("body")[0].appendChild(documentForm); - - console = document.createElement("textarea"); - console.id = "SWFUpload_Console"; - console.style.fontFamily = "monospace"; - console.setAttribute("wrap", "off"); - console.wrap = "off"; - console.style.overflow = "auto"; - console.style.width = "700px"; - console.style.height = "350px"; - console.style.margin = "5px"; - documentForm.appendChild(console); - } - - console.value += message + "\n"; - - console.scrollTop = console.scrollHeight - console.clientHeight; - } catch (ex) { - alert("Exception: " + ex.name + " Message: " + ex.message); - } -}; diff --git a/modules/editor/tpl/js/swfupload.min.js b/modules/editor/tpl/js/swfupload.min.js deleted file mode 100644 index 52fd46a34..000000000 --- a/modules/editor/tpl/js/swfupload.min.js +++ /dev/null @@ -1 +0,0 @@ -This file is not used in Rhymix. diff --git a/modules/editor/tpl/js/uploader.js b/modules/editor/tpl/js/uploader.js deleted file mode 100644 index eadbfe052..000000000 --- a/modules/editor/tpl/js/uploader.js +++ /dev/null @@ -1,455 +0,0 @@ -/** - * @author NAVER (developers@xpressengine.com) - * @version 0.1.1 - * @brief 파일 업로드 관련 - **/ -var uploadedFiles = []; -var uploaderSettings = []; -var loaded_images = []; -var swfUploadObjs = []; -var uploadSettingObj = []; -var uploadAutosaveChecker = false; - -/** - * 업로드를 하기 위한 준비 시작 - * 이 함수는 editor.html 에서 파일 업로드 가능할 경우 호출됨 - **/ -// window.load 이벤트일 경우 && 문서 번호가 가상의 번호가 아니면 기존에 저장되어 있을지도 모르는 파일 목록을 가져옴 -(function($){ - var defaultHandlers; - - function init(cfg, exe) { - var seq = cfg.editorSequence; - - if(!is_def(seq)) return; - - cfg = $.extend({ - sessionName : 'PHPSESSID', - allowedFileSize : 2097152, // byte. 2*1024*1024 - allowedFileTypes : '*.*', - allowedFileTypesDescription : 'All Files', - replaceButtonID : 'swfUploadButton'+cfg.editorSequence, - insertedFiles : 0 - }, cfg); - - uploadSettingObj[seq] = cfg; - $(function(){ start(cfg); }); - - } - - function start(cfg) { - var $button, width, height, $span, seq, id, settings, handlers, name, fn, swfu, $swf; - - seq = cfg.editorSequence; - id = cfg.replaceButtonID; - $button = $('#'+id).wrap(''); - width = $button.width(); - height = $button.height(); - $span = $('').insertAfter($button); - - settings = { - flash_url : request_uri + 'modules/editor/tpl/images/SWFUpload.swf', - upload_url : request_uri + 'index.php', - post_params : { - mid : current_mid, - act : 'procFileUpload', - editor_sequence : seq, - uploadTargetSrl : editorRelKeys[seq].primary.value, - _rx_csrf_token : getCSRFToken() - }, - http_success : [302], - file_size_limit : Math.floor( (parseInt(cfg.allowedFileSize,10)||1024) / 1024 ), - file_queue_limit : 0, - file_upload_limit : 0, - file_types : cfg.allowedFileTypes, - file_types_description : cfg.allowedFileTypesDescription, - custom_settings : { - progressTarget : null, - cancelButtonId : null - }, - debug : false, - - // Button settings - button_window_mode : 'transparent', - button_placeholder_id : $span.attr('id'), - button_text : null, - button_image_url : request_uri+'common/img/blank.gif', - button_width : width, - button_height : height, - button_text_style : null, - button_text_left_padding : 0, - button_text_top_padding : 0, - button_cursor : -2, - - editorSequence : seq, - uploadTargetSrl : editorRelKeys[seq].primary.value, - fileListAreaID : cfg.fileListAreaID, - previewAreaID : cfg.previewAreaID, - uploaderStatusID : cfg.uploaderStatusID - }; - - if(typeof(enforce_ssl)!=="undefined" && enforce_ssl) - { - settings.upload_url = request_uri+'index.php'; - } - - // preview - $('#'+cfg.fileListAreaID).click(previewFiles); - - // The event handler functions are defined in handlers.js - handlers = { - file_queued : 'FileQueued', - file_queue_error : 'FileQueueError', - file_dialog_complete : 'FileDialogComplete', - upload_start : 'UploadStart', - upload_progress : 'UploadProgress', - upload_error : 'UploadError', - upload_success : 'UploadSuccess', - upload_complete : 'UploadComplete', - queue_complete : 'QueueComplete' - }; - - for(name in handlers) { - if(!handlers.hasOwnProperty(name)) continue; - fn = 'on'+handlers[name]; - settings[name+'_handler'] = cfg['on'+fn] || defaultHandlers[fn]; - } - - if(is_def(window.xeVid)) settings.post_params.vid = xeVid; - settings.sessionName = cfg.sessionName; - if(getCookie(cfg.sessionName)) settings.post_params[cfg.sessionName] = getCookie(cfg.sessionName); - - uploaderSettings[seq] = settings; - - swfu = new SWFUpload(settings); - $swf = $('#'+swfu.movieName); - swfUploadObjs[seq] = swfu.movieName; - if(!$swf.length) return; - - $swf.css({ - display : 'block', - cursor : 'pointer', - position : 'absolute', - left : 0, - top : 0, - width : width + 'px', - height : height + 'px' - }); - - if(cfg.insertedFiles || editorRelKeys[seq].primary.value) reloadFileList(cfg); - } - - function _true(){ return true; } - - defaultHandlers = { - onFileQueued : _true, - onFileQueueError : function(file, errorCode, message) { - try { - switch(errorCode) { - case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED : - alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file."))); - break; - case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: - alert("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); - break; - case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: - alert("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); - break; - case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: - alert("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); - break; - default: - alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message); - break; - } - } catch(e) { - this.debug(e); - } - }, - onFileDialogComplete : function(numFilesSelected, numFilesQueued) { - try { - if(getCookie(this.settings.sessionName)) this.addPostParam(this.settings.sessionName, getCookie(this.settings.sessionName)); - this.startUpload(); - } catch (e) { - this.debug(e); - } - }, - onUploadStart : _true, - onUploadProgress : function(file, bytesLoaded, bytesTotal) { - if(getCookie(this.settings.sessionName)) this.addPostParam(this.settings.sessionName, getCookie(this.settings.sessionName)); - try { - var $list, $lastopt, percent, filename; - - $list = $('#'+this.settings.fileListAreaID); - percent = Math.ceil((bytesLoaded / bytesTotal) * 100); - filename = file.name; - $lastopt = $list.find('>option:last'); - - if(filename.length>20) filename = filename.substr(0,20)+'...'; - if(!$lastopt.length || $lastopt.attr('value') != file.id) { - $lastopt = $('