1/** 2 * created by WEVEN on 2020-03-02 3 * ìëì ìì¤ë WEVENì ì ìê¶ì´ ìì¼ë¯ë¡ ë¬´ë¨ ì¬ì© ë° ì¬ ë°°í¬ë¥¼ ê¸í©ëë¤. 4 */ 5var ToolOpTextLinkSmall = function() { 6 /* 7 ìµì ìì±ì ìë 2ê°ì ë³ìë ë°ëì ì²ì ìì±í´ì¤ì¼ í¨. 8 */ 9 this.type = "ToolOpTextLinkSmall"; 10 this.element = $("[data-wv-tool-option=ToolOpTextLinkSmall]"); 11 var _this = this; 12 13 this.inputList = []; 14 this.radioList = []; 15 16 this.radioList.push(this.element.find('[data-wv-tool-option-btn="_self"]').parent()[0]); 17 this.radioList.push(this.element.find('[data-wv-tool-option-btn="_blank"]').parent()[0]); 18 this.inputList.push(this.element.find('[data-wv-tool-option-btn="url"]')[0]); 19 this.inputList.push(this.element.find('[data-wv-tool-option-btn="title"]')[0]); 20 21 //this.onWindowDown = function(e){ 22 // e.stopImmediatePropagation(); 23 // bm.selectionManager.restoreRange(); 24 //} 25 26 this.onTextInputDown = function(e){ 27 e.stopImmediatePropagation(); 28 if( bm.selectionManager.getRange() && $(bm.selectionManager.getRange().startContainer).closest(".wveditor_text").length > 0 ){ 29 bm.selectionManager.saveRange(); 30 } 31 } 32 33 this.getUrl = function () { 34 return $(this.optionBtnList["url"]).val(); 35 } 36 37 this.getTitle = function () { 38 return $(this.optionBtnList["title"]).val(); 39 } 40 41 this.getTarget = function () { 42 return $(this.optionBtnList["_self"]).is(":checked") ? "_self" : "_blank"; 43 } 44 45 this.applyLink = function ( type ) { 46 47 var url = this.getUrl(); 48 49 if(type === "apply" && !url) { 50 alert(systemLangPack.getMessage('SLSATTB0025')); //ë§í¬ì£¼ì를 ì ë ¥í´ì£¼ì¸ì. 51 $(this.optionBtnList["url"]).focus(); 52 return; 53 } else if(type === "home"){ 54 url = WEB_ROOT.replace("webadm/", "web/"); 55 if( WEB_ROOT.indexOf(SITE_ID+".weven") > -1 ){ 56 url = WEB_ROOT.replace("webadm/", ""); 57 } 58 } 59 60 var checkUrl = url.split('?')[0]; 61 var isValidUrl = bm.valid.isValidUrl(checkUrl); 62 if(type === "apply" && !isValidUrl && !url.includes('[WEB_ROOT]')) { 63 alert(systemLangPack.getMessage('SLSATTB0026')); //ë§í¬ì£¼ì íìì´ ì못 ëììµëë¤. ë¤ì ì ë ¥í´ì£¼ì¸ì. 64 $(this.optionBtnList["url"]).focus(); 65 return; 66 } 67 68 var title = this.getTitle(); 69 /*if(!title) { 70 alert("íì´íì ì ë ¥í´ì£¼ì¸ì."); 71 $(this.optionBtnList["title"]).focus(); 72 return; 73 }*/ 74 75 _this.onOptionChange( _this.type, { type : "apply", url :url, title: title, target : _this.getTarget() } ); 76 } 77 78 this.removeLink = function () { 79 this.onOptionChange( _this.type, { type : "remove" } ); 80 } 81 82 this.findPage = function () { 83 this.onOptionChange( _this.type, { type : "page" } ); 84 } 85 86 this.onOptionBtnClick = function( data ){ 87 switch (data){ 88 case "home": 89 case "apply": 90 this.applyLink( data ); 91 break; 92 case "remove": 93 this.removeLink(); 94 break; 95 case "page": 96 this.findPage(); 97 break; 98 } 99 } 100} 101 102bm.extend(ToolOpBase , ToolOpTextLinkSmall); 103 104ToolOpTextLinkSmall.prototype.addEvent = function() { 105 var _this = this; 106 107 $(_this.inputList).on("focus", function() { 108 $(this).select(); 109 }); 110 111 $(_this.inputList).on("focusout", function() { 112 var val = $(this).val(); 113 $(this).val($.trim(val)); 114 }); 115 116 $(_this.radioList).on("mousedown", function(e) { 117 _this.onTextInputDown(e); 118 }); 119 120 $(_this.inputList).on("mousedown", function(e) { 121 _this.onTextInputDown(e); 122 $(this).select(); 123 }); 124 125 126 $(_this.inputList).on("keydown", function(e) { 127 if(e.keyCode == 13) { 128 _this.setLink("apply"); 129 130 e.preventDefault(); 131 } 132 });
133 134 //$(window).on("mousedown", this.onWindowDown); 135} 136 137ToolOpTextLinkSmall.prototype.removeEvent = function() { 138 var _this = this; 139 140 $(_this.inputList).off("focus"); 141 $(_this.inputList).off("focusout"); 142 $(_this.inputList).off("mousedown"); 143 $(_this.radioList).off("mousedown"); 144 $(_this.inputList).off("keydown"); 145 146 //$(window).off("mousedown", this.onWindowDown); 147}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.