From ff155c1abc81e3aadfda5dd408c53a51340fc7e1 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 7 Jan 2016 11:35:06 +0900 Subject: [PATCH] Remove most minified CSS and JS files --- addons/autolink/autolink.addon.php | 5 - addons/captcha/captcha.addon.php | 11 +- addons/captcha/captcha.min.js | 1 - addons/captcha_member/captcha.min.js | 1 - .../captcha_member/captcha_member.addon.php | 11 +- addons/oembed/jquery.oembed.min.css | 1 - addons/oembed/jquery.oembed.min.js | 2 - addons/oembed/oembed.min.js | 1 - addons/resize_image/js/resize_image.min.js | 1 - addons/resize_image/resize_image.addon.php | 2 +- classes/display/HTMLDisplayHandler.php | 65 +- common/css/mobile.min.css | 1 - common/css/xe.min.css | 1 - .../plugins/jquery.fileupload/js/main.min.js | 1 - common/js/x.min.js | 1 - common/js/xe.js | 3065 --------- common/js/xe.min.js | 7 - common/tpl/popup_layout.html | 4 +- layouts/xedition/css/layout.min.css | 1 - layouts/xedition/css/webfont.min.css | 1 - layouts/xedition/css/welcome.min.css | 1 - layouts/xedition/css/widget.login.min.css | 1 - layouts/xedition/css/xeicon.min.css | 1 - layouts/xedition/js/layout.min.js | 1 - layouts/xedition/js/welcome.min.js | 1 - modules/admin/tpl/css/admin.bootstrap.min.css | 13 - modules/admin/tpl/css/admin.min.css | 1 - modules/admin/tpl/js/admin.min.js | 2 - modules/admin/tpl/js/config.min.js | 1 - modules/admin/tpl/js/menu_setup.min.js | 1 - .../board/m.skins/default/css/mboard.min.css | 1 - .../board/m.skins/default/js/mboard.min.js | 1 - .../m.skins/simpleGray/css/mboard.min.css | 1 - .../board/m.skins/simpleGray/js/mboard.min.js | 1 - .../board/skins/default/board.default.min.css | 1 - .../board/skins/default/board.default.min.js | 1 - .../skins/xedition/board.default.min.css | 1 - .../board/skins/xedition/board.default.min.js | 1 - modules/board/tpl/js/board.min.js | 1 - modules/board/tpl/js/board_admin.min.js | 1 - .../m.skins/default/read_message.html | 2 - .../m.skins/default/send_message.html | 2 - .../image_gallery/tpl/gallery.min.js | 1 - .../image_gallery/tpl/list_gallery.html | 8 +- .../image_gallery/tpl/list_gallery.min.js | 1 - .../image_gallery/tpl/popup.min.css | 1 - .../components/image_gallery/tpl/popup.min.js | 1 - .../image_gallery/tpl/slide_gallery.html | 12 +- .../image_gallery/tpl/slide_gallery.min.css | 1 - .../image_gallery/tpl/slide_gallery.min.js | 1 - .../editor/skins/ckeditor/js/default.min.js | 1 - .../skins/ckeditor/js/xe_interface.min.js | 1 - .../skins/ckeditor/js/xe_textarea.min.js | 1 - .../skins/xpresseditor/css/default.min.css | 1 - modules/editor/skins/xpresseditor/editor.html | 11 +- .../skins/xpresseditor/js/xe_textarea.min.js | 1 - .../skins/xpresseditor/js/xpresseditor.js | 6108 ----------------- .../skins/xpresseditor/js/xpresseditor.min.js | 4 - modules/editor/tpl/js/editor.app.min.js | 1 - modules/editor/tpl/js/editor.min.js | 1 - modules/editor/tpl/js/editor_common.min.js | 1 - .../editor/tpl/js/editor_module_config.min.js | 1 - modules/editor/tpl/js/swfupload.min.js | 1 - modules/editor/tpl/js/uploader.min.js | 1 - modules/importer/tpl/header.html | 3 +- modules/importer/tpl/js/importer_admin.min.js | 1 - .../m.skins/default/find_member_account.html | 4 +- .../member/m.skins/default/leave_form.html | 2 - .../member/m.skins/default/login_form.html | 1 - .../m.skins/default/modify_email_address.html | 2 - .../m.skins/default/modify_password.html | 2 - .../member/m.skins/default/signup_form.html | 2 - modules/widget/tpl/css/widget.min.css | 1 - modules/widget/tpl/js/generate_code.min.js | 1 - modules/widget/tpl/js/widget.min.js | 1 - modules/widget/tpl/js/widget_admin.min.js | 1 - 76 files changed, 43 insertions(+), 9358 deletions(-) delete mode 100644 addons/captcha/captcha.min.js delete mode 100644 addons/captcha_member/captcha.min.js delete mode 100644 addons/oembed/jquery.oembed.min.css delete mode 100644 addons/oembed/jquery.oembed.min.js delete mode 100644 addons/oembed/oembed.min.js delete mode 100644 addons/resize_image/js/resize_image.min.js delete mode 100644 common/css/mobile.min.css delete mode 100644 common/css/xe.min.css delete mode 100644 common/js/plugins/jquery.fileupload/js/main.min.js delete mode 100644 common/js/x.min.js delete mode 100644 common/js/xe.js delete mode 100644 common/js/xe.min.js delete mode 100644 layouts/xedition/css/layout.min.css delete mode 100644 layouts/xedition/css/webfont.min.css delete mode 100644 layouts/xedition/css/welcome.min.css delete mode 100644 layouts/xedition/css/widget.login.min.css delete mode 100644 layouts/xedition/css/xeicon.min.css delete mode 100644 layouts/xedition/js/layout.min.js delete mode 100644 layouts/xedition/js/welcome.min.js delete mode 100644 modules/admin/tpl/css/admin.bootstrap.min.css delete mode 100644 modules/admin/tpl/css/admin.min.css delete mode 100644 modules/admin/tpl/js/admin.min.js delete mode 100644 modules/admin/tpl/js/config.min.js delete mode 100644 modules/admin/tpl/js/menu_setup.min.js delete mode 100644 modules/board/m.skins/default/css/mboard.min.css delete mode 100644 modules/board/m.skins/default/js/mboard.min.js delete mode 100644 modules/board/m.skins/simpleGray/css/mboard.min.css delete mode 100644 modules/board/m.skins/simpleGray/js/mboard.min.js delete mode 100644 modules/board/skins/default/board.default.min.css delete mode 100644 modules/board/skins/default/board.default.min.js delete mode 100644 modules/board/skins/xedition/board.default.min.css delete mode 100644 modules/board/skins/xedition/board.default.min.js delete mode 100644 modules/board/tpl/js/board.min.js delete mode 100644 modules/board/tpl/js/board_admin.min.js delete mode 100644 modules/editor/components/image_gallery/tpl/gallery.min.js delete mode 100644 modules/editor/components/image_gallery/tpl/list_gallery.min.js delete mode 100644 modules/editor/components/image_gallery/tpl/popup.min.css delete mode 100644 modules/editor/components/image_gallery/tpl/popup.min.js delete mode 100644 modules/editor/components/image_gallery/tpl/slide_gallery.min.css delete mode 100644 modules/editor/components/image_gallery/tpl/slide_gallery.min.js delete mode 100644 modules/editor/skins/ckeditor/js/default.min.js delete mode 100644 modules/editor/skins/ckeditor/js/xe_interface.min.js delete mode 100644 modules/editor/skins/ckeditor/js/xe_textarea.min.js delete mode 100644 modules/editor/skins/xpresseditor/css/default.min.css 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/tpl/js/editor.app.min.js delete mode 100644 modules/editor/tpl/js/editor.min.js delete mode 100644 modules/editor/tpl/js/editor_common.min.js delete mode 100644 modules/editor/tpl/js/editor_module_config.min.js delete mode 100644 modules/editor/tpl/js/swfupload.min.js delete mode 100644 modules/editor/tpl/js/uploader.min.js delete mode 100644 modules/importer/tpl/js/importer_admin.min.js delete mode 100644 modules/widget/tpl/css/widget.min.css delete mode 100644 modules/widget/tpl/js/generate_code.min.js delete mode 100644 modules/widget/tpl/js/widget.min.js delete mode 100644 modules/widget/tpl/js/widget_admin.min.js diff --git a/addons/autolink/autolink.addon.php b/addons/autolink/autolink.addon.php index 9339fafec..7b3e597a5 100644 --- a/addons/autolink/autolink.addon.php +++ b/addons/autolink/autolink.addon.php @@ -11,11 +11,6 @@ if(!defined('__XE__')) */ if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML") { - if(Mobile::isFromMobilePhone()) - { - Context::addJsFile('./common/js/jquery.min.js', false, '', -1000000); - Context::addJsFile('./common/js/xe.min.js', false, '', -1000000); - } Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true); } /* End of file autolink.addon.php */ diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php index f57024704..128aa917d 100644 --- a/addons/captcha/captcha.addon.php +++ b/addons/captcha/captcha.addon.php @@ -11,13 +11,6 @@ if(!defined("__XE__")) exit(); * */ if(!class_exists('AddonCaptcha', false)) { - // On the mobile mode, XE Core does not load jquery and xe.js as normal. - if(Mobile::isFromMobilePhone()) - { - Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true); - Context::loadFile(array('./common/js/xe.min.js', 'head', NULL, -100000), true); - } - class AddonCaptcha { @@ -81,7 +74,7 @@ if(!class_exists('AddonCaptcha', false)) if(!captchaTargetAct) {var captchaTargetAct = [];} captchaTargetAct.push("' . implode('","', $this->target_acts) . '"); '); - Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true); + Context::loadFile(array('./addons/captcha/captcha.js', 'body', '', null), true); } } @@ -347,7 +340,7 @@ if(!class_exists('AddonCaptcha', false)) $this->createKeyword(); $swfURL = getUrl() . 'addons/captcha/swf/play.swf'; - Context::unloadFile('./addons/captcha/captcha.min.js'); + Context::unloadFile('./addons/captcha/captcha.js'); Context::loadFile(array('./addons/captcha/inline_captcha.js', 'body')); global $lang; diff --git a/addons/captcha/captcha.min.js b/addons/captcha/captcha.min.js deleted file mode 100644 index fd05f65fe..000000000 --- a/addons/captcha/captcha.min.js +++ /dev/null @@ -1 +0,0 @@ -var calledArgs=null;!function(a){a(function(){function b(){a("form").each(function(b){var d=!1;if(!a(this).attr("onsubmit")||a(this).attr("onsubmit").indexOf("procFilter")<0)for(var e=a(this).find("input[name=act]").val(),b=0;b'),a(this).find("input[name=error_return_url]")||a(this).append(''),a(this).submit(function(b){if(a(this).find("input[name=secret_text]").val())return!0;b.preventDefault();var d=this;a("#captcha_layer form").submit(function(b){return b.preventDefault(),a("#secret_text").val()?(a(d).append(''),void a(d).submit()):(a(this).find("input[type=text]").val("").focus(),!1)});var e=new Array;e.captcha_action="setCaptchaSession",e.mid=current_mid,window.oldExecXml("","",e,c.show,new Array("error","message","about_captcha","captcha_reload","captcha_play","cmd_input","cmd_cancel"))}))});a(document.body);if(!c){var b=-1!=navigator.appVersion.indexOf("MSIE")?!0:!1,d=-1!=navigator.appVersion.toLowerCase().indexOf("win")?!0:!1,e=-1!=navigator.userAgent.indexOf("Opera")?!0:!1,f=request_uri+"addons/captcha/swf/play.swf";b&&d&&!e?(_object_='',_object_+='',_object_+='',_object_+='',_object_+='',_object_+='',_object_+='',_object_+=""):_object_='',c=a('":!1}}),new a.fn.oembed.OEmbedProvider("livejournal","rich",["livejournal.com/"],"http://ljpic.seacrow.com/json/$2$4?jsonp=?",{templateRegex:/(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/,templateData:function(a){return a.username?'
[info]'+a.username+"
"+a.name+"
":!1}}),new a.fn.oembed.OEmbedProvider("circuitbee","rich",["circuitbee\\.com/circuit/view/.+"],"http://c.circuitbee.com/build/r/schematic-embed.html?id=$1",{templateRegex:/.*circuit\/view\/(\d+).*/,embedtag:{tag:"iframe",width:"500",height:"350"}}),new a.fn.oembed.OEmbedProvider("googlecalendar","rich",["www.google.com/calendar/embed?.+"],"$1",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"800",height:"600"}}),new a.fn.oembed.OEmbedProvider("jsfiddle","rich",["jsfiddle.net/[^/]+/?"],"http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?",{templateRegex:/.*net\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"300"}}),new a.fn.oembed.OEmbedProvider("jsbin","rich",["jsbin.com/.+"],"http://jsbin.com/$1/?",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"300"}}),new a.fn.oembed.OEmbedProvider("jotform","rich",["form.jotform.co/form/.+"],"$1?",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"100%",height:"507"}}),new a.fn.oembed.OEmbedProvider("reelapp","rich",["reelapp\\.com/.+"],"http://www.reelapp.com/$1/embed",{templateRegex:/.*com\/(\S{6}).*/,embedtag:{tag:"iframe",width:"400",height:"338"}}),new a.fn.oembed.OEmbedProvider("linkedin","rich",["linkedin.com/pub/.+"],"https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"368px",height:"auto"}}),new a.fn.oembed.OEmbedProvider("timetoast","rich",["timetoast.com/timelines/[0-9]+"],"http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1",{templateRegex:/.*timelines\/([0-9]*)/,embedtag:{width:550,height:400,nocache:1}}),new a.fn.oembed.OEmbedProvider("pastebin","rich",["pastebin\\.com/[\\S]{8}"],"http://pastebin.com/embed_iframe.php?i=$1",{templateRegex:/.*\/(\S{8}).*/,embedtag:{tag:"iframe",width:"100%",height:"auto"}}),new a.fn.oembed.OEmbedProvider("mixlr","rich",["mixlr.com/.+"],"http://mixlr.com/embed/$1?autoplay=ae",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"auto"}}),new a.fn.oembed.OEmbedProvider("pastie","rich",["pastie\\.org/pastes/.+"],null,{yql:{xpath:'//pre[@class="textmate-source"]'}}),new a.fn.oembed.OEmbedProvider("github","rich",["gist.github.com/.+"],"https://github.com/api/oembed"),new a.fn.oembed.OEmbedProvider("github","rich",["github.com/[-.\\w@]+/[-.\\w@]+"],"https://api.github.com/repos/$1/$2?callback=?",{templateRegex:/.*\/([^\/]+)\/([^\/]+).*/,templateData:function(a){return a.data.html_url?'

'+a.data.name+'

'+a.data.description+'

Last updated: '+a.data.pushed_at+"

":!1}}),new a.fn.oembed.OEmbedProvider("facebook","rich",["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"],"https://graph.facebook.com/$2$3/?callback=?",{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/,templateData:function(a){if(!a.id)return!1;var b='
facebook ';return b+=a.from?''+a.from.name+"":a.link?''+a.name+"":a.username?''+a.name+"":''+a.name+"",b+='
',b+=a.picture?'':'',a.from&&(b+=''+a.name+""),a.founded&&(b+="Founded: "+a.founded+"
"),a.category&&(b+="Category: "+a.category+"
"),a.website&&(b+='Website: '+a.website+"
"),a.gender&&(b+="Gender: "+a.gender+"
"),a.description&&(b+=a.description+"
"),b+="
"}}),new a.fn.oembed.OEmbedProvider("stackoverflow","rich",["stackoverflow.com/questions/[\\d]+"],"http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?",{templateRegex:/.*questions\/([\d]+).*/,templateData:function(b){if(!b.questions)return!1;var c=b.questions[0],d=a(c.body).text(),e='
'+(c.up_vote_count-c.down_vote_count)+'
vote(s)
'+c.answer_count+'answer
'+c.view_count+' view(s)

'+c.title+'

'+d.substring(0,100)+'...
';for(i in c.tags)e+='";return e+='
"; -}}),new a.fn.oembed.OEmbedProvider("wordpress","rich",["wordpress\\.com/.+","blogs\\.cnn\\.com/.+","techcrunch\\.com/.+","wp\\.me/.+"],"http://public-api.wordpress.com/oembed/1.0/?for=jquery-oembed-all"),new a.fn.oembed.OEmbedProvider("screenr","rich",["screenr.com"],"http://www.screenr.com/embed/$1",{templateRegex:/.*\/([^\/]+).*/,embedtag:{tag:"iframe",width:"650",height:396}}),new a.fn.oembed.OEmbedProvider("gigpans","rich",["gigapan\\.org/[-.\\w@]+/\\d+"],"http://gigapan.org/gigapans/$1/options/nosnapshots/iframe/flash.html",{templateRegex:/.*\/(\d+)\/?.*/,embedtag:{tag:"iframe",width:"100%",height:400}}),new a.fn.oembed.OEmbedProvider("scribd","rich",["scribd\\.com/.+"],"http://www.scribd.com/embeds/$1/content?start_page=1&view_mode=list",{templateRegex:/.*doc\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:600}}),new a.fn.oembed.OEmbedProvider("kickstarter","rich",["kickstarter\\.com/projects/.+"],"$1/widget/card.html",{templateRegex:/([^\?]+).*/,embedtag:{tag:"iframe",width:"220",height:380}}),new a.fn.oembed.OEmbedProvider("amazon","rich",["amzn.com/B+","amazon.com.*/(B\\S+)($|\\/.*)"],"http://rcm.amazon.com/e/cm?t=_APIKEY_&o=1&p=8&l=as1&asins=$1&ref=qf_br_asin_til&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr",{apikey:!0,templateRegex:/.*\/(B[0-9A-Z]+)($|\/.*)/,embedtag:{tag:"iframe",width:"120px",height:"240px"}}),new a.fn.oembed.OEmbedProvider("slideshare","rich",["slideshare.net"],"http://www.slideshare.net/api/oembed/2",{format:"jsonp"}),new a.fn.oembed.OEmbedProvider("roomsharejp","rich",["roomshare\\.jp/(en/)?post/.*"],"http://roomshare.jp/oembed.json"),new a.fn.oembed.OEmbedProvider("lanyard","rich",["lanyrd.com/\\d+/.+"],null,{yql:{xpath:'(//div[@class="primary"])[1]',from:"htmlstring",datareturn:function(a){return a.result?'
'+a.result+"
":!1}}}),new a.fn.oembed.OEmbedProvider("asciiartfarts","rich",["asciiartfarts.com/\\d+.html"],null,{yql:{xpath:"//pre/font",from:"htmlstring",datareturn:function(a){return a.result?'
'+a.result+"
":!1}}})]}(jQuery); \ No newline at end of file diff --git a/addons/oembed/oembed.min.js b/addons/oembed/oembed.min.js deleted file mode 100644 index 03a110fdf..000000000 --- a/addons/oembed/oembed.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(a,b){var c=this;c.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("");e=e.replace(//g,">"),e=e.replace(j,'$1'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(b,c){if(!this.castedOembedA){var d=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){d.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery); \ No newline at end of file diff --git a/addons/resize_image/js/resize_image.min.js b/addons/resize_image/js/resize_image.min.js deleted file mode 100644 index 2c66d18e2..000000000 --- a/addons/resize_image/js/resize_image.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){function b(){var b,c,e,f,g,h=a(document.body);return d?(b=a("#xe_gallery_controls"),c=a("#xe_gallery_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("
").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("
").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a(''},c=["fileList","actSelectedInsertContent","actSelectedDeleteFile","actDeleteFile","actSetCover","controll","dropZone","filelist","filelistImages","progressbar","progressbarGraph","progressPercent","progressStatus"],d=xe.createApp("XeUploader",{settings:{},init:function(){},deactivate:function(){},createInstance:function(d,e){var f=this,g=d,h=g.data();a.extend(h,{files:{},selected_files:{},settings:{},last_selected_file:null});var i={url:request_uri.setQuery("module","file").setQuery("act","procFileUpload").setQuery("mid",window.current_mid),formData:{editor_sequence:h.editorSequence,upload_target_srl:h.uploadTargetSrl,mid:window.current_mid,act:"procFileUpload"},dropZone:g,add:function(b,c){var d=jQuery.Deferred();a.each(c.files,function(a,b){return h.settings.maxFileSize<=b.size?(d.reject(),alert(window.xe.msg_exceeds_limit_size),!1):void d.resolve()}),d.done(function(){c.submit()})},done:function(a,b){var c=b.response().result;c&&(jQuery.isPlainObject(c)||(c=jQuery.parseJSON(c)),c&&(0==c.error||alert(c.message)))},stop:function(){f.loadFilelist(g)},start:function(){h.settings.progressbarGraph.width(0),h.settings.progressStatus.show(),h.settings.progressbar.show()},progressall:function(a,b){var c=parseInt(b.loaded/b.total*100,10);h.settings.progressbarGraph.width(c+"%"),h.settings.progressPercent.text(c+"%"),c>=100&&(h.settings.progressbar.delay(3e3).slideUp(),h.settings.progressStatus.delay(3e3).slideUp())}};h.settings=a.extend({},b,i,e||{}),g.data(h),a.each(c,function(a,b){"string"==typeof h.settings[b]&&(h.settings[b]=g.find(h.settings[b]))});g.fileupload(h.settings).prop("disabled",!a.support.fileInput).parent().addClass(a.support.fileInput?void 0:"disabled");g.data("xefu-instance",this),this.loadFilelist(g),h.settings.actSelectedInsertContent.on("click",function(){f.insertToContent(g)}),h.settings.actSelectedDeleteFile.on("click",function(){f.deleteFile(g)});var j=h.settings.fileList.finderSelect({children:"li",enableDesktopCtrlDefault:!0});h.settings.fileList.on("mousedown","img",function(a){a.preventDefault()}),j.finderSelect("addHook","highlight:after",function(a){a.find("input").prop("checked",!0);var b=h.settings.fileList.find("input:checked");h.selected_files=b}),j.finderSelect("addHook","unHighlight:after",function(a){a.find("input").prop("checked",!1);var b=h.settings.fileList.find("input:checked");h.selected_files=b}),j.on("click",":checkbox",function(a){a.preventDefault()}),j.on("click",".xefu-act-set-cover",function(a){a.preventDefault(),f.setCover(g,a.currentTarget)}),a(document).bind("dragover",function(a){var b=window.dropZoneTimeout,c=h.settings.dropZone;b?clearTimeout(b):c.addClass("in");var d=!1,e=a.target;do{if(e===c[0]){d=!0;break}e=e.parentNode}while(null!=e);d?c.addClass("hover"):c.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,c.removeClass("in hover")},100)}),g.data(h)},done:function(){},selectAllFiles:function(){},selectImageFiles:function(){},selectNonImageFiles:function(){},unselectAllFiles:function(){},unselectImageFiles:function(){},unselectNonImageFiles:function(){},insertToContent:function(b){var c="",d=b.data();a.each(d.selected_files,function(b,e){var f=a(e).data().fileSrl,g=d.files[f];g&&(/\.(jpe?g|png|gif)$/i.test(g.download_url)?(c+=''+g.source_filename+'',c+="\r\n


\r\n"):c+=''+g.source_filename+"\n")}),_getCkeInstance(d.editorSequence).insertHtml(c,"unfiltered_html")},deleteFile:function(b,c){var d=this,e=[],f=b.data();c?e.push(c):a.each(f.selected_files,function(b,c){if(c){var d=a(c).data().fileSrl;e.push(d)}}),e=e.join(","),exec_json("file.procFileDelete",{file_srls:e,editor_sequence:f.editorSequence},function(){e=e.split(","),a.each(e,function(a,b){f.settings.fileList.find("ul").find("li[data-file-srl="+b+"]").remove()}),d.loadFilelist(b)})},loadFilelist:function(b){var c=b.data(),d={};d.mid=window.current_mid,d.editor_sequence=c.editorSequence,a.exec_json("file.getFileList",d,function(d){console.log(d),c.uploadTargetSrl=d.upload_target_srl,editorRelKeys[c.editorSequence].primary.value=d.upload_target_srl,c.uploadTargetSrl=d.uploadTargetSrl,b.find(".allowed_filetypes").text(d.allowed_filetypes),b.find(".allowed_filesize").text(d.allowed_filesize),b.find(".allowed_attach_size").text(d.allowed_attach_size),b.find(".attached_size").text(d.attached_size),b.find(".file_count").text(d.files.length);var e=c.settings.tmplXeUploaderFileitem,f=c.settings.tmplXeUploaderFileitemImage,g=Handlebars.compile(e),h=Handlebars.compile(f),i=[],j=[];return d.files.length?(a.each(d.files,function(a,d){c.files[d.file_srl]||(c.files[d.file_srl]=d,b.data(c),/\.(jpe?g|png|gif)$/i.test(d.source_filename)?i.push(h(d)):j.push(g(d)))}),c.settings.filelistImages.append(i.join("")),c.settings.filelist.append(j.join("")),c.settings.controll.show(),void c.settings.fileList.show()):(c.settings.fileList.hide(),void c.settings.controll.hide())})},setCover:function(b,c){var d=b.data(),e=a(c),f=e.data().fileSrl;exec_json("file.procFileSetCoverImage",{file_srl:f,mid:window.current_mid,editor_sequence:d.editorSequence},function(a){if(0==a.error){d.settings.filelistImages.find("li").removeClass("xefu-is-cover-image");var b=e.closest("li");b.addClass("xefu-is-cover-image")}})}});a.fn.xeUploader=function(a){var b=new d;return b&&(xe.registerApp(b),b.createInstance(this.eq(0),a)),b},xe.unregisterApp()}(jQuery); \ No newline at end of file diff --git a/common/js/x.min.js b/common/js/x.min.js deleted file mode 100644 index 6a1df753f..000000000 --- a/common/js/x.min.js +++ /dev/null @@ -1 +0,0 @@ -function xDeprecate(a){var b="DEPRECATED : "+a+"() is deprecated function.";"object"==typeof console&&"function"==typeof console.log&&console.log(b)}function xAddEventListener(e,eT,eL,cap){if(xDeprecate("xAddEventListener"),e=xGetElementById(e)){if(eT=eT.toLowerCase(),!xIE4Up&&!xOp7Up&&e==window){if("resize"==eT)return window.xPCW=xClientWidth(),window.xPCH=xClientHeight(),window.xREL=eL,void xResizeEvent();if("scroll"==eT)return window.xPSL=xScrollLeft(),window.xPST=xScrollTop(),window.xSEL=eL,void xScrollEvent()}var eh="e.on"+eT+"=eL";e.addEventListener?e.addEventListener(eT,eL,cap):e.attachEvent?e.attachEvent("on"+eT,eL):eval(eh)}}function xResizeEvent(){xDeprecate("xResizeEvent"),window.xREL&&setTimeout("xResizeEvent()",250);var a=xClientWidth(),b=xClientHeight();(window.xPCW!=a||window.xPCH!=b)&&(window.xPCW=a,window.xPCH=b,window.xREL&&window.xREL())}function xScrollEvent(){xDeprecate("xScrollEvent"),window.xSEL&&setTimeout("xScrollEvent()",250);var a=xScrollLeft(),b=xScrollTop();(window.xPSL!=a||window.xPST!=b)&&(window.xPSL=a,window.xPST=b,window.xSEL&&window.xSEL())}function xAppendChild(a,b){return xDeprecate("xAppendChild"),a.appendChild?a.appendChild(b):null}function xClientHeight(){xDeprecate("xClientHeight");var a=0;return xOp6Dn?a=window.innerHeight:"CSS1Compat"==document.compatMode&&!window.opera&&document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientHeight:document.body&&document.body.clientHeight?a=document.body.clientHeight:xDef(window.innerWidth,window.innerHeight,document.width)&&(a=window.innerHeight,document.width>window.innerWidth&&(a-=16)),a}function xClientWidth(){xDeprecate("xClientWidth");var a=0;return xOp6Dn?a=window.innerWidth:"CSS1Compat"==document.compatMode&&!window.opera&&document.documentElement&&document.documentElement.clientWidth?a=document.documentElement.clientWidth:document.body&&document.body.clientWidth?a=document.body.clientWidth:xDef(window.innerWidth,window.innerHeight,document.height)&&(a=window.innerWidth,document.height>window.innerHeight&&(a-=16)),a}function xCreateElement(a){return xDeprecate("xCreateElement"),document.createElement?document.createElement(a):null}function xDef(){xDeprecate("xDef");for(var a=0;ab?a:b}function xGetBodyHeight(){xDeprecate("xGetBodyHeight");var a=xClientHeight(),b=window.document.body.scrollHeight;return a>b?a:b}function xGetComputedStyle(a,b,d){xDeprecate("xGetComputedStyle");var e,f="undefined",g=document.defaultView;if(g&&g.getComputedStyle)e=g.getComputedStyle(a,""),e&&(f=e.getPropertyValue(b));else{if(!a.currentStyle)return null;var h=b.split("-");b=h[0];for(var i=1;i0){var d=document.cookie.indexOf(c);if(-1!=d){d+=c.length;var e=document.cookie.indexOf(";",d);-1==e&&(e=document.cookie.length),b=unescape(document.cookie.substring(d,e))}}return b}function xGetElementById(a){return xDeprecate("xGetElementById"),"string"!=typeof a?a:a=document.getElementById?document.getElementById(a):document.all?document.all[a]:null}function xGetElementsByAttribute(a,b,c,d){xDeprecate("xGetElementsByAttribute");var e,f,g=new Array,h=new RegExp(c,"i");f=xGetElementsByTagName(a);for(var i=0;ib?0:Math.round(b):-1;var c=xDef(a.style);if(a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase())b=xClientHeight();else if(c&&xDef(a.offsetHeight)&&xStr(a.style.height)){if(b>=0){var d=0,e=0,f=0,g=0;if("CSS1Compat"==document.compatMode){var h=xGetComputedStyle;d=h(a,"padding-top",1),null!==d?(e=h(a,"padding-bottom",1),f=h(a,"border-top-width",1),g=h(a,"border-bottom-width",1)):xDef(a.offsetHeight,a.style.height)&&(a.style.height=b+"px",d=a.offsetHeight-b)}if(b-=d+e+f+g,isNaN(b)||0>b)return null;a.style.height=b+"px"}b=a.offsetHeight}else c&&xDef(a.style.pixelHeight)&&(b>=0&&(a.style.pixelHeight=b),b=a.style.pixelHeight);return b}function xHex(a,b,c){xDeprecate("xHex");var d="",e=Math.ceil(a);c&&(d=c),e=e.toString(16);for(var f=0;fe;++e)a=c+a;else for(e=a.length;b>e;++e)a+=c;return a}function xPageX(a){if(xDeprecate("xPageX"),!(a=xGetElementById(a)))return 0;for(var b=0;a;)xDef(a.offsetLeft)&&(b+=a.offsetLeft),a=xDef(a.offsetParent)?a.offsetParent:null;return b}function xPageY(a){if(xDeprecate("xPageY"),!(a=xGetElementById(a)))return 0;for(var b=0;a;)xDef(a.offsetTop)&&(b+=a.offsetTop),a=xDef(a.offsetParent)?a.offsetParent:null;return b}function xParent(a,b){if(xDeprecate("xParent"),!(a=xGetElementById(a)))return null;var c=null;return!b&&xDef(a.offsetParent)?c=a.offsetParent:xDef(a.parentNode)?c=a.parentNode:xDef(a.parentElement)&&(c=a.parentElement),c}function xPreventDefault(a){xDeprecate("xPreventDefault"),a&&a.preventDefault?a.preventDefault():window.event&&(window.event.returnValue=!1)}function xPrevSib(a,b){xDeprecate("xPrevSib");var c=a?a.previousSibling:null;if(b)for(;c&&c.nodeName!=b;)c=c.previousSibling;else for(;c&&1!=c.nodeType;)c=c.previousSibling;return c}function xRemoveEventListener(e,eT,eL,cap){if(xDeprecate("xRemoveEventListener"),e=xGetElementById(e)){if(eT=eT.toLowerCase(),!xIE4Up&&!xOp7Up&&e==window){if("resize"==eT)return void(window.xREL=null);if("scroll"==eT)return void(window.xSEL=null)}var eh="e.on"+eT+"=null";e.removeEventListener?e.removeEventListener(eT,eL,cap):e.detachEvent?e.detachEvent("on"+eT,eL):eval(eh)}}function xResizeTo(a,b,c){xDeprecate("xResizeTo"),xWidth(a,b),xHeight(a,c)}function xScrollLeft(a,b){xDeprecate("xScrollLeft");var c=0;if(!xDef(a)||b||a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase()){var d=window;b&&a&&(d=a),d.document.documentElement&&d.document.documentElement.scrollLeft?c=d.document.documentElement.scrollLeft:d.document.body&&xDef(d.document.body.scrollLeft)&&(c=d.document.body.scrollLeft)}else a=xGetElementById(a),a&&xNum(a.scrollLeft)&&(c=a.scrollLeft);return c}function xScrollTop(a,b){xDeprecate("xScrollTop");var c=0;if(!xDef(a)||b||a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase()){var d=window;b&&a&&(d=a),d.document.documentElement&&d.document.documentElement.scrollTop?c=d.document.documentElement.scrollTop:d.document.body&&xDef(d.document.body.scrollTop)&&(c=d.document.body.scrollTop)}else a=xGetElementById(a),a&&xNum(a.scrollTop)&&(c=a.scrollTop);return c}function xSetCookie(a,b,c,d){xDeprecate("xSetCookie"),document.cookie=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+"; path="+(d?d:"/")}function xShow(a){return xDeprecate("xShow"),xVisibility(a,1)}function xStr(a){xDeprecate("xStr");for(var b=0;bb?0:Math.round(b):-1;var c=xDef(a.style);if(a==document||"html"==a.tagName.toLowerCase()||"body"==a.tagName.toLowerCase())b=xClientWidth();else if(c&&xDef(a.offsetWidth)&&xStr(a.style.width)){if(b>=0){var d=0,e=0,f=0,g=0;if("CSS1Compat"==document.compatMode){var h=xGetComputedStyle;d=h(a,"padding-left",1),null!==d?(e=h(a,"padding-right",1),f=h(a,"border-left-width",1),g=h(a,"border-right-width",1)):xDef(a.offsetWidth,a.style.width)&&(a.style.width=b+"px",d=a.offsetWidth-b)}if(b-=d+e+f+g,isNaN(b)||0>b)return null;a.style.width=b+"px"}b=a.offsetWidth}else c&&xDef(a.style.pixelWidth)&&(b>=0&&(a.style.pixelWidth=b),b=a.style.pixelWidth);return b}function xZIndex(a,b){return xDeprecate("xZIndex"),(a=xGetElementById(a))?(a.style&&xDef(a.style.zIndex)&&(xNum(b)&&(a.style.zIndex=b),b=parseInt(a.style.zIndex)),b):0}function xStopPropagation(a){xDeprecate("xStopPropagation"),a&&a.stopPropagation?a.stopPropagation():window.event&&(window.event.cancelBubble=!0)}var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf("opera");if(-1!=i){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7,xOp6Dn=7>v}}else"KDE"!=navigator.vendor&&document.all&&-1!=xUA.indexOf("msie")?(xIE4Up=parseFloat(navigator.appVersion)>=4,xIE4=-1!=xUA.indexOf("msie 4"),xIE5=-1!=xUA.indexOf("msie 5"),xIE6=-1!=xUA.indexOf("msie 6")):document.layers&&(xNN4=!0);var xMac=-1!=xUA.indexOf("mac"),xFF=-1!=xUA.indexOf("firefox"); \ No newline at end of file diff --git a/common/js/xe.js b/common/js/xe.js deleted file mode 100644 index 80abf0923..000000000 --- a/common/js/xe.js +++ /dev/null @@ -1,3065 +0,0 @@ -/*! Copyright (C) NAVER */ -/**! - * @concat modernizr.js + common.js + js_app.js + xml_handler.js + xml_js_filter.js - * @brief XE Common JavaScript - **/ -; - - - -window.Modernizr = (function( window, document, undefined ) { - - var version = '2.8.3', - - Modernizr = {}, - - enableClasses = true, - - docElement = document.documentElement, - - mod = 'modernizr', - modElem = document.createElement(mod), - mStyle = modElem.style, - - inputElem = document.createElement('input') , - - smile = ':)', - - toString = {}.toString, - - prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), - - - - omPrefixes = 'Webkit Moz O ms', - - cssomPrefixes = omPrefixes.split(' '), - - domPrefixes = omPrefixes.toLowerCase().split(' '), - - ns = {'svg': 'http://www.w3.org/2000/svg'}, - - tests = {}, - inputs = {}, - attrs = {}, - - classes = [], - - slice = classes.slice, - - featureName, - - - injectElementWithStyles = function( rule, callback, nodes, testnames ) { - - var style, ret, node, docOverflow, - div = document.createElement('div'), - body = document.body, - fakeBody = body || document.createElement('body'); - - if ( parseInt(nodes, 10) ) { - while ( nodes-- ) { - node = document.createElement('div'); - node.id = testnames ? testnames[nodes] : mod + (nodes + 1); - div.appendChild(node); - } - } - - style = ['­',''].join(''); - div.id = mod; - (body ? div : fakeBody).innerHTML += style; - fakeBody.appendChild(div); - if ( !body ) { - fakeBody.style.background = ''; - fakeBody.style.overflow = 'hidden'; - docOverflow = docElement.style.overflow; - docElement.style.overflow = 'hidden'; - docElement.appendChild(fakeBody); - } - - ret = callback(div, rule); - if ( !body ) { - fakeBody.parentNode.removeChild(fakeBody); - docElement.style.overflow = docOverflow; - } else { - div.parentNode.removeChild(div); - } - - return !!ret; - - }, - - - - isEventSupported = (function() { - - var TAGNAMES = { - 'select': 'input', 'change': 'input', - 'submit': 'form', 'reset': 'form', - 'error': 'img', 'load': 'img', 'abort': 'img' - }; - - function isEventSupported( eventName, element ) { - - element = element || document.createElement(TAGNAMES[eventName] || 'div'); - eventName = 'on' + eventName; - - var isSupported = eventName in element; - - if ( !isSupported ) { - if ( !element.setAttribute ) { - element = document.createElement('div'); - } - if ( element.setAttribute && element.removeAttribute ) { - element.setAttribute(eventName, ''); - isSupported = is(element[eventName], 'function'); - - if ( !is(element[eventName], 'undefined') ) { - element[eventName] = undefined; - } - element.removeAttribute(eventName); - } - } - - element = null; - return isSupported; - } - return isEventSupported; - })(), - - - _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; - - if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { - hasOwnProp = function (object, property) { - return _hasOwnProperty.call(object, property); - }; - } - else { - hasOwnProp = function (object, property) { - return ((property in object) && is(object.constructor.prototype[property], 'undefined')); - }; - } - - - if (!Function.prototype.bind) { - Function.prototype.bind = function bind(that) { - - var target = this; - - if (typeof target != "function") { - throw new TypeError(); - } - - var args = slice.call(arguments, 1), - bound = function () { - - if (this instanceof bound) { - - var F = function(){}; - F.prototype = target.prototype; - var self = new F(); - - var result = target.apply( - self, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return self; - - } else { - - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - - } - - }; - - return bound; - }; - } - - function setCss( str ) { - mStyle.cssText = str; - } - - function setCssAll( str1, str2 ) { - return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); - } - - function is( obj, type ) { - return typeof obj === type; - } - - function contains( str, substr ) { - return !!~('' + str).indexOf(substr); - } - - function testProps( props, prefixed ) { - for ( var i in props ) { - var prop = props[i]; - if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { - return prefixed == 'pfx' ? prop : true; - } - } - return false; - } - - function testDOMProps( props, obj, elem ) { - for ( var i in props ) { - var item = obj[props[i]]; - if ( item !== undefined) { - - if (elem === false) return props[i]; - - if (is(item, 'function')){ - return item.bind(elem || obj); - } - - return item; - } - } - return false; - } - - function testPropsAll( prop, prefixed, elem ) { - - var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), - props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); - - if(is(prefixed, "string") || is(prefixed, "undefined")) { - return testProps(props, prefixed); - - } else { - props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); - return testDOMProps(props, prefixed, elem); - } - } tests['flexbox'] = function() { - return testPropsAll('flexWrap'); - }; - - - tests['flexboxlegacy'] = function() { - return testPropsAll('boxDirection'); - }; - - - tests['canvas'] = function() { - var elem = document.createElement('canvas'); - return !!(elem.getContext && elem.getContext('2d')); - }; - - tests['canvastext'] = function() { - return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); - }; - - - - tests['webgl'] = function() { - return !!window.WebGLRenderingContext; - }; - - - tests['touch'] = function() { - var bool; - - if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { - bool = true; - } else { - injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) { - bool = node.offsetTop === 9; - }); - } - - return bool; - }; - - - - tests['geolocation'] = function() { - return 'geolocation' in navigator; - }; - - - tests['postmessage'] = function() { - return !!window.postMessage; - }; - - - tests['websqldatabase'] = function() { - return !!window.openDatabase; - }; - - tests['indexedDB'] = function() { - return !!testPropsAll("indexedDB", window); - }; - - tests['hashchange'] = function() { - return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); - }; - - tests['history'] = function() { - return !!(window.history && history.pushState); - }; - - tests['draganddrop'] = function() { - var div = document.createElement('div'); - return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); - }; - - tests['websockets'] = function() { - return 'WebSocket' in window || 'MozWebSocket' in window; - }; - - - tests['rgba'] = function() { - setCss('background-color:rgba(150,255,150,.5)'); - - return contains(mStyle.backgroundColor, 'rgba'); - }; - - tests['hsla'] = function() { - setCss('background-color:hsla(120,40%,100%,.5)'); - - return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); - }; - - tests['multiplebgs'] = function() { - setCss('background:url(https://),url(https://),red url(https://)'); - - return (/(url\s*\(.*?){3}/).test(mStyle.background); - }; tests['backgroundsize'] = function() { - return testPropsAll('backgroundSize'); - }; - - tests['borderimage'] = function() { - return testPropsAll('borderImage'); - }; - - - - tests['borderradius'] = function() { - return testPropsAll('borderRadius'); - }; - - tests['boxshadow'] = function() { - return testPropsAll('boxShadow'); - }; - - tests['textshadow'] = function() { - return document.createElement('div').style.textShadow === ''; - }; - - - tests['opacity'] = function() { - setCssAll('opacity:.55'); - - return (/^0.55$/).test(mStyle.opacity); - }; - - - tests['cssanimations'] = function() { - return testPropsAll('animationName'); - }; - - - tests['csscolumns'] = function() { - return testPropsAll('columnCount'); - }; - - - tests['cssgradients'] = function() { - var str1 = 'background-image:', - str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', - str3 = 'linear-gradient(left top,#9f9, white);'; - - setCss( - (str1 + '-webkit- '.split(' ').join(str2 + str1) + - prefixes.join(str3 + str1)).slice(0, -str1.length) - ); - - return contains(mStyle.backgroundImage, 'gradient'); - }; - - - tests['cssreflections'] = function() { - return testPropsAll('boxReflect'); - }; - - - tests['csstransforms'] = function() { - return !!testPropsAll('transform'); - }; - - - tests['csstransforms3d'] = function() { - - var ret = !!testPropsAll('perspective'); - - if ( ret && 'webkitPerspective' in docElement.style ) { - - injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) { - ret = node.offsetLeft === 9 && node.offsetHeight === 3; - }); - } - return ret; - }; - - - tests['csstransitions'] = function() { - return testPropsAll('transition'); - }; - - - - tests['fontface'] = function() { - var bool; - - injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) { - var style = document.getElementById('smodernizr'), - sheet = style.sheet || style.styleSheet, - cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; - - bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; - }); - - return bool; - }; - - tests['generatedcontent'] = function() { - var bool; - - injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) { - bool = node.offsetHeight >= 3; - }); - - return bool; - }; - tests['video'] = function() { - var elem = document.createElement('video'), - bool = false; - - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); - - bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); - - bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); - } - - } catch(e) { } - - return bool; - }; - - tests['audio'] = function() { - var elem = document.createElement('audio'), - bool = false; - - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); - bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); - - bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); - bool.m4a = ( elem.canPlayType('audio/x-m4a;') || - elem.canPlayType('audio/aac;')) .replace(/^no$/,''); - } - } catch(e) { } - - return bool; - }; - - - tests['localstorage'] = function() { - try { - localStorage.setItem(mod, mod); - localStorage.removeItem(mod); - return true; - } catch(e) { - return false; - } - }; - - tests['sessionstorage'] = function() { - try { - sessionStorage.setItem(mod, mod); - sessionStorage.removeItem(mod); - return true; - } catch(e) { - return false; - } - }; - - - tests['webworkers'] = function() { - return !!window.Worker; - }; - - - tests['applicationcache'] = function() { - return !!window.applicationCache; - }; - - - tests['svg'] = function() { - return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; - }; - - tests['inlinesvg'] = function() { - var div = document.createElement('div'); - div.innerHTML = ''; - return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; - }; - - tests['smil'] = function() { - return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); - }; - - - tests['svgclippaths'] = function() { - return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); - }; - - function webforms() { - Modernizr['input'] = (function( props ) { - for ( var i = 0, len = props.length; i < len; i++ ) { - attrs[ props[i] ] = !!(props[i] in inputElem); - } - if (attrs.list){ - attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); - } - return attrs; - })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); - Modernizr['inputtypes'] = (function(props) { - - for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { - - inputElem.setAttribute('type', inputElemType = props[i]); - bool = inputElem.type !== 'text'; - - if ( bool ) { - - inputElem.value = smile; - inputElem.style.cssText = 'position:absolute;visibility:hidden;'; - - if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { - - docElement.appendChild(inputElem); - defaultView = document.defaultView; - - bool = defaultView.getComputedStyle && - defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && - (inputElem.offsetHeight !== 0); - - docElement.removeChild(inputElem); - - } else if ( /^(search|tel)$/.test(inputElemType) ){ - } else if ( /^(url|email)$/.test(inputElemType) ) { - bool = inputElem.checkValidity && inputElem.checkValidity() === false; - - } else { - bool = inputElem.value != smile; - } - } - - inputs[ props[i] ] = !!bool; - } - return inputs; - })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); - } - for ( var feature in tests ) { - if ( hasOwnProp(tests, feature) ) { - featureName = feature.toLowerCase(); - Modernizr[featureName] = tests[feature](); - - classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); - } - } - - Modernizr.input || webforms(); - - - Modernizr.addTest = function ( feature, test ) { - if ( typeof feature == 'object' ) { - for ( var key in feature ) { - if ( hasOwnProp( feature, key ) ) { - Modernizr.addTest( key, feature[ key ] ); - } - } - } else { - - feature = feature.toLowerCase(); - - if ( Modernizr[feature] !== undefined ) { - return Modernizr; - } - - test = typeof test == 'function' ? test() : test; - - if (typeof enableClasses !== "undefined" && enableClasses) { - docElement.className+=" modernizr-" + (test ? '' : 'no-') + feature; - } - Modernizr[feature] = test; - - } - - return Modernizr; - }; - - - setCss(''); - modElem = inputElem = null; - - ;(function(window, document) { - var version = '3.7.0'; - - var options = window.html5 || {}; - - var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; - - var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; - - var supportsHtml5Styles; - - var expando = '_html5shiv'; - - var expanID = 0; - - var expandoData = {}; - - var supportsUnknownElements; - - (function() { - try { - var a = document.createElement('a'); - a.innerHTML = ''; - supportsHtml5Styles = ('hidden' in a); - - supportsUnknownElements = a.childNodes.length == 1 || (function() { - (document.createElement)('a'); - var frag = document.createDocumentFragment(); - return ( - typeof frag.cloneNode == 'undefined' || - typeof frag.createDocumentFragment == 'undefined' || - typeof frag.createElement == 'undefined' - ); - }()); - } catch(e) { - supportsHtml5Styles = true; - supportsUnknownElements = true; - } - - }()); - - function addStyleSheet(ownerDocument, cssText) { - var p = ownerDocument.createElement('p'), - parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; - - p.innerHTML = 'x'; - return parent.insertBefore(p.lastChild, parent.firstChild); - } - - function getElements() { - var elements = html5.elements; - return typeof elements == 'string' ? elements.split(' ') : elements; - } - - function getExpandoData(ownerDocument) { - var data = expandoData[ownerDocument[expando]]; - if (!data) { - data = {}; - expanID++; - ownerDocument[expando] = expanID; - expandoData[expanID] = data; - } - return data; - } - - function createElement(nodeName, ownerDocument, data){ - if (!ownerDocument) { - ownerDocument = document; - } - if(supportsUnknownElements){ - return ownerDocument.createElement(nodeName); - } - if (!data) { - data = getExpandoData(ownerDocument); - } - var node; - - if (data.cache[nodeName]) { - node = data.cache[nodeName].cloneNode(); - } else if (saveClones.test(nodeName)) { - node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); - } else { - node = data.createElem(nodeName); - } - - return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; - } - - function createDocumentFragment(ownerDocument, data){ - if (!ownerDocument) { - ownerDocument = document; - } - if(supportsUnknownElements){ - return ownerDocument.createDocumentFragment(); - } - data = data || getExpandoData(ownerDocument); - var clone = data.frag.cloneNode(), - i = 0, - elems = getElements(), - l = elems.length; - for(;i'+str+' '; - } - } - } - this.loaded_popup_menus[menu_id] = html; - } - - /* 레이어 출력 */ - if(html) { - var area = $('#popup_menu_area').html('
    '+html+'
'); - var areaOffset = {top:params.page_y, left:params.page_x}; - - if(area.outerHeight()+areaOffset.top > $(window).height()+$(window).scrollTop()) - areaOffset.top = $(window).height() - area.outerHeight() + $(window).scrollTop(); - if(area.outerWidth()+areaOffset.left > $(window).width()+$(window).scrollLeft()) - areaOffset.left = $(window).width() - area.outerWidth() + $(window).scrollLeft(); - - area.css({ top:areaOffset.top, left:areaOffset.left }).show().focus(); - } - } - }; -}) (jQuery); - - - -/* jQuery(document).ready() */ -jQuery(function($) { - - /* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */ - if($.browser.msie) { - $('select').each(function(i, sels) { - var disabled_exists = false; - var first_enable = []; - - for(var j=0; j < sels.options.length; j++) { - if(sels.options[j].disabled) { - sels.options[j].style.color = '#CCCCCC'; - disabled_exists = true; - }else{ - first_enable[i] = (first_enable[i] > -1) ? first_enable[i] : j; - } - } - - if(!disabled_exists) return; - - sels.oldonchange = sels.onchange; - sels.onchange = function() { - if(this.options[this.selectedIndex].disabled) { - - this.selectedIndex = first_enable[i]; - /* - if(this.options.length<=1) this.selectedIndex = -1; - else if(this.selectedIndex < this.options.length - 1) this.selectedIndex++; - else this.selectedIndex--; - */ - - } else { - if(this.oldonchange) this.oldonchange(); - } - }; - - if(sels.selectedIndex >= 0 && sels.options[ sels.selectedIndex ].disabled) sels.onchange(); - - }); - } - - /* 단락에디터 fold 컴포넌트 펼치기/접기 */ - var drEditorFold = $('.xe_content .fold_button'); - if(drEditorFold.size()) { - var fold_container = $('div.fold_container', drEditorFold); - $('button.more', drEditorFold).click(function() { - $(this).hide().next('button').show().parent().next(fold_container).show(); - }); - $('button.less', drEditorFold).click(function() { - $(this).hide().prev('button').show().parent().next(fold_container).hide(); - }); - } - - jQuery('input[type="submit"],button[type="submit"]').click(function(ev){ - var $el = jQuery(ev.currentTarget); - - setTimeout(function(){ - return function(){ - $el.attr('disabled', 'disabled'); - }; - }(), 0); - - setTimeout(function(){ - return function(){ - $el.removeAttr('disabled'); - }; - }(), 3000); - }); -}); - -(function(){ // String extension methods - function isSameUrl(a,b) { - return (a.replace(/#.*$/, '') === b.replace(/#.*$/, '')); - } - var isArray = Array.isArray || function(obj){ return Object.prototype.toString.call(obj)=='[object Array]'; }; - - /** - * @brief location.href에서 특정 key의 값을 return - **/ - String.prototype.getQuery = function(key) { - var loc = isSameUrl(this, window.location.href) ? current_url : this; - var idx = loc.indexOf('?'); - if(idx == -1) return null; - var query_string = loc.substr(idx+1, this.length), args = {}; - query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; }); - - var q = args[key]; - if(typeof(q)=='undefined') q = ''; - - return q; - }; - - /** - * @brief location.href에서 특정 key의 값을 return - **/ - String.prototype.setQuery = function(key, val) { - var loc = isSameUrl(this, window.location.href) ? current_url : this; - var idx = loc.indexOf('?'); - var uri = loc.replace(/#$/, ''); - var act, re, v, toReplace, query_string; - - if (typeof(val)=='undefined') val = ''; - - if (idx != -1) { - var args = {}, q_list = []; - query_string = uri.substr(idx + 1, loc.length); - uri = loc.substr(0, idx); - query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function(all,key,val) { args[key] = val; }); - - args[key] = val; - - for (var prop in args) { - if (!args.hasOwnProperty(prop)) continue; - if (!(v = String(args[prop]).trim())) continue; - q_list.push(prop+'='+decodeURI(v)); - } - - query_string = q_list.join('&'); - uri = uri + (query_string ? '?' + encodeURI(query_string) : ''); - } else { - if (String(val).trim()) { - query_string = '?' + key + '=' + val; - uri = uri + encodeURI(query_string); - } - } - - re = /^https:\/\/([^:\/]+)(:\d+|)/i; - if (re.test(uri)) { - toReplace = 'http://'+RegExp.$1; - if (window.http_port && http_port != 80) toReplace += ':' + http_port; - uri = uri.replace(re, toReplace); - } - - var bUseSSL = !!window.enforce_ssl; - if (!bUseSSL && isArray(window.ssl_actions) && (act=uri.getQuery('act'))) { - for (var i=0,c=ssl_actions.length; i < c; i++) { - if (ssl_actions[i] === act) { - bUseSSL = true; - break; - } - } - } - - re = /http:\/\/([^:\/]+)(:\d+|)/i; - if (bUseSSL && re.test(uri)) { - toReplace = 'https://'+RegExp.$1; - if (window.https_port && https_port != 443) toReplace += ':' + https_port; - uri = uri.replace(re, toReplace); - } - - // insert index.php if it isn't included - uri = uri.replace(/\/(index\.php)?\?/, '/index.php?'); - - return uri; - }; - - /** - * @brief string prototype으로 trim 함수 추가 - **/ - String.prototype.trim = function() { - return this.replace(/(^\s*)|(\s*$)/g, ""); - }; - -})(); - -/** - * @brief xSleep(micro time) - **/ -function xSleep(sec) { - sec = sec / 1000; - var now = new Date(); - var sleep = new Date(); - while( sleep.getTime() - now.getTime() < sec) { - sleep = new Date(); - } -} - -/** - * @brief 주어진 인자가 하나라도 defined되어 있지 않으면 false return - **/ -function isDef() { - for(var i=0; i < arguments.length; ++i) { - if(typeof(arguments[i]) == "undefined") return false; - } - return true; -} - -/** - * @brief 윈도우 오픈 - * 열려진 윈도우의 관리를 통해 window.focus()등을 FF에서도 비슷하게 구현함 - **/ -var winopen_list = []; -function winopen(url, target, attribute) { - if(typeof(xeVid)!='undefined' && url.indexOf(request_uri)>-1 && !url.getQuery('vid')) url = url.setQuery('vid',xeVid); - try { - if(target != "_blank" && winopen_list[target]) { - winopen_list[target].close(); - winopen_list[target] = null; - } - } catch(e) { - } - - if(typeof(target) == 'undefined') target = '_blank'; - if(typeof(attribute) == 'undefined') attribute = ''; - var win = window.open(url, target, attribute); - win.focus(); - if(target != "_blank") winopen_list[target] = win; -} - -/** - * @brief 팝업으로만 띄우기 - * common/tpl/popup_layout.html이 요청되는 XE내의 팝업일 경우에 사용 - **/ -function popopen(url, target) { - if(typeof(target) == "undefined") target = "_blank"; - if(typeof(xeVid)!='undefined' && url.indexOf(request_uri)>-1 && !url.getQuery('vid')) url = url.setQuery('vid',xeVid); - winopen(url, target, "width=800,height=600,scrollbars=yes,resizable=yes,toolbars=no"); -} - -/** - * @brief 메일 보내기용 - **/ -function sendMailTo(to) { - location.href="mailto:"+to; -} - -/** - * @brief url이동 (open_window 값이 N 가 아니면 새창으로 띄움) - **/ -function move_url(url, open_window) { - if(!url) return false; - if(typeof(open_window) == 'undefined') open_window = 'N'; - if(open_window=='N') { - open_window = false; - } else { - open_window = true; - } - - if(/^\./.test(url)) url = request_uri+url; - - if(open_window) { - winopen(url); - } else { - location.href=url; - } - - return false; -} - -/** - * @brief 멀티미디어 출력용 (IE에서 플래쉬/동영상 주변에 점선 생김 방지용) - **/ -function displayMultimedia(src, width, height, options) { - /*jslint evil: true */ - var html = _displayMultimedia(src, width, height, options); - if(html) document.writeln(html); -} -function _displayMultimedia(src, width, height, options) { - if(src.indexOf('files') === 0) src = request_uri + src; - - var defaults = { - wmode : 'transparent', - allowScriptAccess : 'never', - quality : 'high', - flashvars : '', - autostart : false - }; - - var params = jQuery.extend(defaults, options || {}); - var autostart = (params.autostart && params.autostart != 'false') ? 'true' : 'false'; - delete(params.autostart); - - var clsid = ""; - var codebase = ""; - var html = ""; - - if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){ - html = ''; - } else if(/\.flv$/i.test(src) || /\.mov$/i.test(src) || /\.moov$/i.test(src) || /\.m4v$/i.test(src)) { - html = ''; - } else if(/\.swf/i.test(src)) { - clsid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; - - if(typeof(enforce_ssl)!='undefined' && enforce_ssl){ codebase = "https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"; } - else { codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"; } - html = ''; - html += ''; - for(var name in params) { - if(params[name] != 'undefined' && params[name] !== '') { - html += ''; - } - } - html += '' + '' + ''; - } else { - if (jQuery.browser.mozilla || jQuery.browser.opera) { - // firefox and opera uses 0 or 1 for autostart parameter. - autostart = (params.autostart && params.autostart != 'false') ? '1' : '0'; - } - - html = '.popup'), w, h, dw, dh, offset; - - offset = $pc.css({overflow:'scroll'}).offset(); - - w = $pc.width(10).height(10000).get(0).scrollWidth + offset.left*2; - h = $pc.height(10).width(10000).get(0).scrollHeight + offset.top*2; - - if(w < 800) w = 800 + offset.left*2; - - dw = $win.width(); - dh = $win.height(); - - if(w != dw) window.resizeBy(w - dw, 0); - if(h != dh) window.resizeBy(0, h - dh); - - $pc.width(w-offset.left*2).css({overflow:'',height:''}); -} - -/** - * @brief 추천/비추천,스크랩,신고기능등 특정 srl에 대한 특정 module/action을 호출하는 함수 - **/ -function doCallModuleAction(module, action, target_srl) { - var params = { - target_srl : target_srl, - cur_mid : current_mid, - mid : current_mid - }; - exec_xml(module, action, params, completeCallModuleAction); -} - -function completeCallModuleAction(ret_obj, response_tags) { - if(ret_obj.message!='success') alert(ret_obj.message); - location.reload(); -} - -function completeMessage(ret_obj) { - alert(ret_obj.message); - location.reload(); -} - - - -/* 언어코드 (lang_type) 쿠키값 변경 */ -function doChangeLangType(obj) { - if(typeof(obj) == "string") { - setLangType(obj); - } else { - var val = obj.options[obj.selectedIndex].value; - setLangType(val); - } - location.href = location.href.setQuery('l', ''); -} -function setLangType(lang_type) { - var expire = new Date(); - expire.setTime(expire.getTime()+ (7000 * 24 * 3600000)); - setCookie('lang_type', lang_type, expire, '/'); -} - -/* 미리보기 */ -function doDocumentPreview(obj) { - var fo_obj = obj; - while(fo_obj.nodeName != "FORM") { - fo_obj = fo_obj.parentNode; - } - if(fo_obj.nodeName != "FORM") return; - var editor_sequence = fo_obj.getAttribute('editor_sequence'); - - var content = editorGetContent(editor_sequence); - - var win = window.open("", "previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes"); - - var dummy_obj = jQuery("#previewDocument"); - - if(!dummy_obj.length) { - jQuery( - '
'+ - ''+ - ''+ - ''+ - '
' - ).appendTo(document.body); - - dummy_obj = jQuery("#previewDocument")[0]; - } else { - dummy_obj = dummy_obj[0]; - } - - if(dummy_obj) { - dummy_obj.content.value = content; - dummy_obj.submit(); - } -} - -/* 게시글 저장 */ -function doDocumentSave(obj) { - var editor_sequence = obj.form.getAttribute('editor_sequence'); - var prev_content = editorRelKeys[editor_sequence].content.value; - if(typeof(editor_sequence)!='undefined' && editor_sequence && typeof(editorRelKeys)!='undefined' && typeof(editorGetContent)=='function') { - var content = editorGetContent(editor_sequence); - editorRelKeys[editor_sequence].content.value = content; - } - - var params={}, responses=['error','message','document_srl'], elms=obj.form.elements, data=jQuery(obj.form).serializeArray(); - jQuery.each(data, function(i, field){ - var val = jQuery.trim(field.value); - if(!val) return true; - if(/\[\]$/.test(field.name)) field.name = field.name.replace(/\[\]$/, ''); - if(params[field.name]) params[field.name] += '|@|'+val; - else params[field.name] = field.value; - }); - - exec_xml('document','procDocumentTempSave', params, completeDocumentSave, responses, params, obj.form); - - editorRelKeys[editor_sequence].content.value = prev_content; - return false; -} - -function completeDocumentSave(ret_obj) { - jQuery('input[name=document_srl]').eq(0).val(ret_obj.document_srl); - alert(ret_obj.message); -} - -/* 저장된 게시글 불러오기 */ -var objForSavedDoc = null; -function doDocumentLoad(obj) { - // 저장된 게시글 목록 불러오기 - objForSavedDoc = obj.form; - popopen(request_uri.setQuery('module','document').setQuery('act','dispTempSavedList')); -} - -/* 저장된 게시글의 선택 */ -function doDocumentSelect(document_srl, module) { - if(!opener || !opener.objForSavedDoc) { - window.close(); - return; - } - - if(module===undefined) { - module = 'document'; - } - - // 게시글을 가져와서 등록하기 - switch(module) { - case 'page' : - var url = opener.current_url; - url = url.setQuery('document_srl', document_srl); - - if(url.getQuery('act') === 'dispPageAdminMobileContentModify') - { - url = url.setQuery('act', 'dispPageAdminMobileContentModify'); - } - else - { - url = url.setQuery('act', 'dispPageAdminContentModify'); - } - opener.location.href = url; - break; - default : - opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite'); - break; - } - window.close(); -} - - -/* 스킨 정보 */ -function viewSkinInfo(module, skin) { - popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+module+"&skin="+skin, 'SkinInfo'); -} - - -/* 관리자가 문서를 관리하기 위해서 선택시 세션에 넣음 */ -var addedDocument = []; -function doAddDocumentCart(obj) { - var srl = obj.value; - addedDocument[addedDocument.length] = srl; - setTimeout(function() { callAddDocumentCart(addedDocument.length); }, 100); -} - -function callAddDocumentCart(document_length) { - if(addedDocument.length<1 || document_length != addedDocument.length) return; - var params = []; - params.srls = addedDocument.join(","); - exec_xml("document","procDocumentAddCart", params, null); - addedDocument = []; -} - -/* ff의 rgb(a,b,c)를 #... 로 변경 */ -function transRGB2Hex(value) { - if(!value) return value; - if(value.indexOf('#') > -1) return value.replace(/^#/, ''); - - if(value.toLowerCase().indexOf('rgb') < 0) return value; - value = value.replace(/^rgb\(/i, '').replace(/\)$/, ''); - value_list = value.split(','); - - var hex = ''; - for(var i = 0; i < value_list.length; i++) { - var color = parseInt(value_list[i], 10).toString(16); - if(color.length == 1) color = '0'+color; - hex += color; - } - return hex; -} - -/* 보안 로그인 모드로 전환 */ -function toggleSecuritySignIn() { - var href = location.href; - if(/https:\/\//i.test(href)) location.href = href.replace(/^https/i,'http'); - else location.href = href.replace(/^http/i,'https'); -} - -function reloadDocument() { - location.reload(); -} - - -/** -* -* Base64 encode / decode -* http://www.webtoolkit.info/ -* -**/ - -var Base64 = { - - // private property - _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", - - // public method for encoding - encode : function (input) { - var output = ""; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0; - - input = Base64._utf8_encode(input); - - while (i < input.length) { - - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - - output = output + - this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + - this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); - - } - - return output; - }, - - // public method for decoding - decode : function (input) { - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - - while (i < input.length) { - enc1 = this._keyStr.indexOf(input.charAt(i++)); - enc2 = this._keyStr.indexOf(input.charAt(i++)); - enc3 = this._keyStr.indexOf(input.charAt(i++)); - enc4 = this._keyStr.indexOf(input.charAt(i++)); - - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - - output = output + String.fromCharCode(chr1); - - if (enc3 != 64) { - output = output + String.fromCharCode(chr2); - } - if (enc4 != 64) { - output = output + String.fromCharCode(chr3); - } - } - - output = Base64._utf8_decode(output); - - return output; - - }, - - // private method for UTF-8 encoding - _utf8_encode : function (string) { - string = string.replace(/\r\n/g,"\n"); - var utftext = ""; - - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } - else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - } - - return utftext; - }, - - // private method for UTF-8 decoding - _utf8_decode : function (utftext) { - var string = ""; - var i = 0; - var c = 0, c1 = 0, c2 = 0, c3 = 0; - - while ( i < utftext.length ) { - c = utftext.charCodeAt(i); - - if (c < 128) { - string += String.fromCharCode(c); - i++; - } - else if((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i+1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; - } - else { - c2 = utftext.charCodeAt(i+1); - c3 = utftext.charCodeAt(i+2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; - } - } - - return string; - } -}; - - - - - - -/* ---------------------------------------------- - * DEPRECATED - * 하위호환용으로 남겨 놓음 - * ------------------------------------------- */ - -if(typeof(resizeImageContents) == 'undefined') { - window.resizeImageContents = function() {}; -} - -if(typeof(activateOptionDisabled) == 'undefined') { - window.activateOptionDisabled = function() {}; -} - -objectExtend = jQuery.extend; - -/** - * @brief 특정 Element의 display 옵션 토글 - **/ -function toggleDisplay(objId) { - jQuery('#'+objId).toggle(); -} - -/** - * @brief 에디터에서 사용하되 내용 여닫는 코드 (zb5beta beta 호환용으로 남겨 놓음) - **/ -function svc_folder_open(id) { - jQuery("#_folder_open_"+id).hide(); - jQuery("#_folder_close_"+id).show(); - jQuery("#_folder_"+id).show(); -} -function svc_folder_close(id) { - jQuery("#_folder_open_"+id).show(); - jQuery("#_folder_close_"+id).hide(); - jQuery("#_folder_"+id).hide(); -} - -/** - * @brief 날짜 선택 (달력 열기) - **/ -function open_calendar(fo_id, day_str, callback_func) { - if(typeof(day_str)=="undefined") day_str = ""; - - var url = "./common/tpl/calendar.php?"; - if(fo_id) url+="fo_id="+fo_id; - if(day_str) url+="&day_str="+day_str; - if(callback_func) url+="&callback_func="+callback_func; - - popopen(url, 'Calendar'); -} - -var loaded_popup_menus = XE.loaded_popup_menus; -function createPopupMenu() {} -function chkPopupMenu() {} -function displayPopupMenu(ret_obj, response_tags, params) { - XE.displayPopupMenu(ret_obj, response_tags, params); -} - -function GetObjLeft(obj) { - return jQuery(obj).offset().left; -} -function GetObjTop(obj) { - return jQuery(obj).offset().top; -} - -function replaceOuterHTML(obj, html) { - jQuery(obj).replaceWith(html); -} - -function getOuterHTML(obj) { - return jQuery(obj).html().trim(); -} - -function setCookie(name, value, expire, path) { - var s_cookie = name + "=" + escape(value) + - ((!expire) ? "" : ("; expires=" + expire.toGMTString())) + - "; path=" + ((!path) ? "/" : path); - - document.cookie = s_cookie; -} - -function getCookie(name) { - var match = document.cookie.match(new RegExp(name+'=(.*?)(?:;|$)')); - if(match) return unescape(match[1]); -} - -function is_def(v) { - return (typeof(v)!='undefined'); -} - -function ucfirst(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -} - -function get_by_id(id) { - return document.getElementById(id); -} - -jQuery(function($){ - // display popup menu that contains member actions and document actions - $(document).on('click', function(evt) { - var $area = $('#popup_menu_area'); - if(!$area.length) $area = $('