diff --git a/plugin/editor/smarteditor2/SmartEditor2Skin.html b/plugin/editor/smarteditor2/SmartEditor2Skin.html index 03c99f4eb..febc72e54 100644 --- a/plugin/editor/smarteditor2/SmartEditor2Skin.html +++ b/plugin/editor/smarteditor2/SmartEditor2Skin.html @@ -15,7 +15,7 @@ - +
diff --git a/plugin/editor/smarteditor2/js/smarteditor2.js b/plugin/editor/smarteditor2/js/smarteditor2.js index 45585d59a..4151b3999 100644 --- a/plugin/editor/smarteditor2/js/smarteditor2.js +++ b/plugin/editor/smarteditor2/js/smarteditor2.js @@ -12138,9 +12138,19 @@ nhn.husky.SE2M_Hyperlink = jindo.$Class({ var sResult; if (sWWWURL){ - sResult = ''+sURL+''; + var exp = /([-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)/gi; + if( sWWWURL.match(exp) ){ + sResult = sWWWURL.replace(exp, '$1'); + } else { + sResult = ''+sURL+''; + } } else { - sResult = ''+sURL+''; + var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; + if( sHTTPURL.match(exp) ){ + sResult = sHTTPURL.replace(exp,"$1"); + } else { + sResult = ''+sURL+''; + } } return sBreaker+sResult; diff --git a/plugin/editor/smarteditor2/js/smarteditor2.min.js b/plugin/editor/smarteditor2/js/smarteditor2.min.js index 310d882f3..66b6517ad 100644 --- a/plugin/editor/smarteditor2/js/smarteditor2.min.js +++ b/plugin/editor/smarteditor2/js/smarteditor2.min.js @@ -1 +1 @@ -var nSE2Version=11329;if(typeof window.nhn=="undefined"){window.nhn={}}nhn.FindReplace=jindo.$Class({sKeyword:"",window:null,document:null,bBrowserSupported:false,bEOC:false,$init:function(c){this.sInlineContainer="SPAN|B|U|I|S|STRIKE";this.rxInlineContainer=new RegExp("^("+this.sInlineContainer+")$");this.window=c;this.document=this.window.document;if(this.document.domain!=this.document.location.hostname){var a=jindo.$Agent();var b=a.navigator();if(b.firefox&&b.version<3){this.bBrowserSupported=false;this.find=function(){return 3};return}}this.bBrowserSupported=true},_findNextElement:function(b){if(!b||b.tagName=="BODY"){return null}var a=b.nextSibling;if(a){return(a.nodeType==1?a:this._findNextElement(a))}else{return this._findNextElement(b.parentNode)}},find:function(a,c,d,e){var f,b;this.window.focus();if(!a){return 2}this.bEOC=false;f=this.findNext(a,c,d,e);if(f){return 0}this.bEOC=true;f=this.findNew(a,c,d,e);if(f){return 0}return 1},findNew:function(a,b,c,d){this.findReset();return this.findNext(a,b,c,d)},findNext:function(g,f,b,a){var c;f=f||false;a=a||false;b=b||false;if(this.window.find){var k=false;return this.window.find(g,f,b,k,a)}if(this.document.body.createTextRange){try{var j=0;if(b){j+=1}if(a){j+=2}if(f){j+=4}this.window.focus();if(this.document.selection){this._range=this.document.selection.createRangeCollection().item(0);this._range.collapse(false)}else{this._range=this.document.body.createTextRange();var d=this._findNextElement(this.window.getSelection().focusNode);if(d){this._range.moveToElementText(d)}}c=this._range.findText(g,1,j);this._range.select();return c}catch(h){return false}}return false},findReset:function(){if(this.window.find){this.window.getSelection().removeAllRanges();return}if(this.document.body.createTextRange){if(this.document.selection){this._range=this.document.body.createTextRange();this._range.collapse(true);this._range.select()}else{if(this.window.getSelection){var a=this.window.getSelection();a.removeAllRanges();a.selectAllChildren(this.document.body);a.collapseToStart()}}}},replace:function(b,d,a,c,e){return this._replace(b,d,a,c,e)},_replace:function(c,f,b,d,g,e){if(!c){return 4}e=e||new nhn.HuskyRange(this.window);e.setFromSelection();b=b||false;var a,h=e.toString();if(b){a=(h==c)}else{a=(h.toLowerCase()==c.toLowerCase())}if(!a){return this.find(c,b,d,g)+2}if(typeof f=="function"){e=f(e)}else{e.pasteText(f)}e.select();return this.find(c,b,d,g)},replaceAll:function(e,h,j,b){if(!e){return -1}var c=false;var l;var a=0;var k=this.window;if(this.find(e,j,c,b)!==0){return a}var g=new nhn.HuskyRange(this.window);g.setFromSelection();g.collapseToStart();var m=this.window.document.createElement("SPAN");m.innerHTML=unescape("%uFEFF");g.insertNode(m);g.select();var d=g.placeStringBookmark();this.bEOC=false;while(!this.bEOC){l=this._replace(e,h,j,c,b,g);if(l==0||l==1){a++}}var f=function(){var n=new nhn.HuskyRange(k);n.setFromSelection();g.moveToBookmark(d);var o=g.compareBoundaryPoints(nhn.W3CDOMRange.START_TO_END,n);if(o==1){return false}return true};l=0;this.bEOC=false;while(!f()&&l==0&&!this.bEOC){l=this._replace(e,h,j,c,b,g);if(l==0||l==1){a++}}g.moveToBookmark(d);g.deleteContents();g.removeStringBookmark(d);setTimeout(function(){m.parentNode.removeChild(m)},0);return a},_isBlankTextNode:function(a){if(a.nodeType==3&&a.nodeValue==""){return true}return false},_getNextNode:function(a,b){if(!a||a.tagName=="BODY"){return{elNextNode:null,bDisconnected:false}}if(a.nextSibling){a=a.nextSibling;while(a.firstChild){if(a.tagName&&!this.rxInlineContainer.test(a.tagName)){b=true}a=a.firstChild}return{elNextNode:a,bDisconnected:b}}return this._getNextNode(nhn.DOMFix.parentNode(a),b)},_getNextTextNode:function(a,b){var c,a;while(true){c=this._getNextNode(a,b);a=c.elNextNode;b=c.bDisconnected;if(a&&a.nodeType!=3&&!this.rxInlineContainer.test(a.tagName)){b=true}if(!a||(a.nodeType==3&&!this._isBlankTextNode(a))){break}}return{elNextText:a,bDisconnected:b}},_getFirstTextNode:function(){var b=this.document.body.firstChild;while(!!b&&b.firstChild){b=b.firstChild}if(!b){return null}if(b.nodeType!=3||this._isBlankTextNode(b)){var a=this._getNextTextNode(b,false);b=a.elNextText}return b},_addToTextMap:function(b,d,g,f){var e=d[f].length;for(var c=0,a=b.nodeValue.length;c=0;q--){var d=o.substring(q,q+a);if(u&&(q>0&&o.charAt(q-1).match(/[a-zA-Z가-힣]/))){continue}if(d==t){h++;var b=new nhn.HuskyRange(this.window);var p,m;if(q+a"||c.toLowerCase()==="
<\/p>/gi,"\n");a=a.replace(/
<\/P>/gi,"\n");a=a.replace(/
/gi,"\n");a=a.replace(/
/gi,"\n");a=a.replace(/<\/p(\s[^\/]*)?>/gi,"\n");a=a.replace(/<\/li(\s[^\/]*)?>/gi,"\n");a=a.replace(/<\/tr(\s[^\/]*)?>/gi,"\n");b=a.lastIndexOf("\n");if(b>-1&&a.substring(b)=="\n"){a=a.substring(0,b)}a=jindo.$S(a).stripTags().toString();a=this.unhtmlSpecialChars(a);if(c!==null){a=c[0]+a}return a},textToIr:function(c){if(!c){return}var a=c,b=null;b=a.match(new RegExp(this.sRxConverter));if(b!==null){a=a.replace(b[0],"")}a=this.htmlSpecialChars(a);a=this._addLineBreaker(a);if(b!==null){a=b[0]+a}return a},_addLineBreaker:function(b){if(this.oApp.sLineBreaker==="BR"){return b.replace(/\r?\n/g,"
")}var c=new StringBuffer(),f=b.split("\n"),e=f.length,d="";for(var a=0;a
")}}}return c.toString()},startAutoResize:function(){var a={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};if(this.oNavigator.msafari){a.wfnCallback=function(){}}this.bAutoResize=true;this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,a);this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var a=this.getRawContents();if(this.oApp.applyConverter){a=this.oApp.applyConverter(this.sMode+"_TO_IR",a,this.oApp.getWYSIWYGDocument())}return a},setIR:function(b){var a=b;if(this.oApp.applyConverter){a=this.oApp.applyConverter("IR_TO_"+this.sMode,a,this.oApp.getWYSIWYGDocument())}this.setRawContents(a)},setRawContents:function(a){if(typeof a!=="undefined"){this.elEditingArea.value=a}},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()},htmlSpecialChars:function(a){return a.replace(/&/g,"&").replace(/
"+j+"
"}this.iframe.contentWindow.document.body.innerHTML=j}if(d&&this.oApp.getEditingMode()===this.sMode){var c=this.oApp.getWYSIWYGDocument().body.getElementsByTagName("P");for(var e=0,b=c.length;e=33&&a.keyCode<=40){this.oApp.saveSnapShot();return}if(a.alt||a.ctrl||a.keyCode===16){return}if(this.oApp.getLastKey()===a.keyCode){return}this.oApp.setLastKey(a.keyCode);if(!a.enter&&a.keyCode!==46&&a.keyCode!==8){return}this.oApp.exec("RECORD_UNDO_ACTION",["KEYPRESS("+a.keyCode+")",{bMustBlockContainer:true}])},_enableWYSIWYG:function(){if(this.iframe.contentWindow.document.body.contentEditable!==null){this.iframe.contentWindow.document.body.contentEditable=true}else{this.iframe.contentWindow.document.designMode="on"}this.bWYSIWYGEnabled=true;if(jindo.$Agent().navigator().firefox){setTimeout(jindo.$Fn(function(){this.iframe.contentWindow.document.execCommand("enableInlineTableEditing",false,false)},this).bind(),0)}},_disableWYSIWYG:function(){if(this.iframe.contentWindow.document.body.contentEditable!==null){this.iframe.contentWindow.document.body.contentEditable=false}else{this.iframe.contentWindow.document.designMode="off"}this.bWYSIWYGEnabled=false},isWYSIWYGEnabled:function(){return this.bWYSIWYGEnabled}});nhn.husky.SE_PasteHandler=jindo.$Class({name:"SE_PasteHandler",$init:function(a){this.sParagraphContainer=a||"P";this.aConversionTarget=["TABLE"];this.htBrowser=jindo.$Agent().navigator()},$ON_MSG_APP_READY:function(){if(!this.htBrowser.safari||(this.htBrowser.safari&&this.htBrowser.version>=6)){this.elBody=this.oApp.getWYSIWYGDocument().body;this.wfnPasteHandler=jindo.$Fn(this._handlePaste,this);this.wfnPasteHandler.attach(this.elBody,"paste");this.elEditingAreaContainer=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container",null,{oneTimeOffCache:true});if(this.htBrowser.ie&&this.htBrowser.nativeVersion<=10&&this.htBrowser.version<=10){this.wfnBeforePasteHandler=jindo.$Fn(this._handleBeforePaste,this);this.wfnBeforePasteHandler.attach(this.elBody,"beforePaste")}}},_handleBeforePaste:function(d){if(!d){var d=window.event}var f=d.key(),b=this.oApp.getSelection();if(!b.collapsed&&f.ctrl!=false){b.deleteContents()}this._sBM_IE=b.placeStringBookmark();var c=b.getStringBookmark(this._sBM_IE,true);var a=document.createTextNode("");this.zwspStart=a.cloneNode(true);this.zwspStart.nodeValue="\u200b";this.zwspEnd=this.zwspStart.cloneNode(true);c.parentNode.insertBefore(this.zwspEnd,c);c.parentNode.insertBefore(this.zwspStart,this.zwspEnd);b.setEndBefore(this.zwspEnd);b.collapseToEnd();if(f.ctrl){b.select()}},_handlePaste:function(c){if(this.htBrowser.chrome||(this.htBrowser.safari&&this.htBrowser.version>=6)){var b=c._event.clipboardData.getData("text/html");var d=document.createElement("DIV");d.innerHTML=b;var a=jindo.$$.getSingle("style",d,{oneTimeOffCache:true});if(a){var e=a.innerHTML;e=e.replace(/"/g,"'");this._sStyleFromClipboard=e}}this._preparePaste();setTimeout(jindo.$Fn(function(){var m=new RegExp("^[\u200b]");if(!!this.zwspStart&&!!this.zwspStart.nodeValue){this.zwspStart.nodeValue=this.zwspStart.nodeValue.replace(m,"");if(this.zwspStart.nodeValue==""&&!!this.zwspStart.paretNode){this.zwspStart.parentNode.removeChild(this.zwspStart)}}var g=new RegExp("[\u200b]$");if(!!this.zwspEnd&&!!this.zwspEnd.nodeValue){this.zwspEnd.nodeValue=this.zwspEnd.nodeValue.replace(g,"");if(this.zwspEnd.nodeValue==""&&!!this.zwspEnd.parentNode){this.zwspEnd.parentNode.removeChild(this.zwspEnd)}}try{this._processPaste()}catch(l){if(typeof(JEagleEyeClient)!="undefined"){var f=l.lineNumber;if(!f){f=0}var j="hp_SE_PasteHandler.js/_handlePaste";if(j){var h="http://blog.naver.com/";h+=j;j=h}JEagleEyeClient.sendError(l,j,f)}}var k=this.oApp.getSelection();this._moveToStringBookmark(k);k.collapseToEnd();k.select();this._removeStringBookmark(k)},this).bind(),0)},_preparePaste:function(){this._saveOriginalContents()},_saveOriginalContents:function(){var b=this.oApp.getSelection();if(!b.isCollapsed){b.deleteContents()}if(!this._sBM_IE){this._sBM=b.placeStringBookmark();var c=b.getStringBookmark(this._sBM,true);var d=b.getStringBookmark(this._sBM);var a=document.createTextNode("");this.zwspStart=a.cloneNode(true);this.zwspStart.nodeValue="\u200b";this.zwspEnd=this.zwspStart.cloneNode(true);c.parentNode.insertBefore(this.zwspEnd,c);c.parentNode.insertBefore(this.zwspStart,this.zwspEnd);b.setEndBefore(this.zwspEnd);b.collapseToEnd();b.select();if(this.htBrowser.ie&&this.htBrowser.nativeVersion==11&&this.htBrowser.version==11){}}},_processPaste:function(){this._savePastedContents();try{if(!!this.elPasteHelper){this._clearPasteHelper();this._showPasteHelper()}else{this._createPasteHelper()}this._loadToPasteHelper();this._loadToBody();this._hidePasteHelper()}catch(a){this._hidePasteHelper();throw a}this._hidePasteHelper()},_savePastedContents:function(){var c=this.oApp.getSelection();this._moveToStringBookmark(c);c.select();this.oSelectionClone=c.cloneContents();c.collapseToEnd();c.select();var a=this._outerHTML(this.oSelectionClone);this._isPastedContentsEmpty=true;if(a!=""){this._isPastedContentsEmpty=false;if(this.htBrowser.firefox||(this.htBrowser.safari&&this.htBrowser.version>=6)){var b=a.match(/