Initial YakPanel commit
This commit is contained in:
1
YakPanel/static/codemirror/addon/scroll/annotatescrollbar.js
vendored
Normal file
1
YakPanel/static/codemirror/addon/scroll/annotatescrollbar.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineExtension("annotateScrollbar",function(c){if(typeof c=="string"){c={className:c}}return new b(this,c)});a.defineOption("scrollButtonHeight",0);function b(c,e){this.cm=c;this.options=e;this.buttonHeight=e.scrollButtonHeight||c.getOption("scrollButtonHeight");this.annotations=[];this.doRedraw=this.doUpdate=null;this.div=c.getWrapperElement().appendChild(document.createElement("div"));this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none";this.computeScale();function f(g){clearTimeout(d.doRedraw);d.doRedraw=setTimeout(function(){d.redraw()},g)}var d=this;c.on("refresh",this.resizeHandler=function(){clearTimeout(d.doUpdate);d.doUpdate=setTimeout(function(){if(d.computeScale()){f(20)}},100)});c.on("markerAdded",this.resizeHandler);c.on("markerCleared",this.resizeHandler);if(e.listenForChanges!==false){c.on("change",this.changeHandler=function(){f(250)})}}b.prototype.computeScale=function(){var c=this.cm;var d=(c.getWrapperElement().clientHeight-c.display.barHeight-this.buttonHeight*2)/c.getScrollerElement().scrollHeight;if(d!=this.hScale){this.hScale=d;return true}};b.prototype.update=function(c){this.annotations=c;this.redraw()};b.prototype.redraw=function(o){if(o!==false){this.computeScale()}var p=this.cm,t=this.hScale;var s=document.createDocumentFragment(),g=this.annotations;var k=p.getOption("lineWrapping");var j=k&&p.defaultTextHeight()*1.5;var e=null,n=null;function q(v,u){if(e!=v.line){e=v.line;n=p.getLineHandle(e)}if(k&&n.height>j){return p.charCoords(v,"local")[u?"top":"bottom"]}var i=p.heightAtLine(n,"local");return i+(u?0:n.height)}if(p.display.barWidth){for(var h=0,l;h<g.length;h++){var d=g[h];var m=l||q(d.from,true)*t;var c=q(d.to,false)*t;while(h<g.length-1){l=q(g[h+1].from,true)*t;if(l>c+0.9){break}d=g[++h];c=q(d.to,false)*t}if(c==m){continue}var r=Math.max(c-m,3);var f=s.appendChild(document.createElement("div"));f.style.cssText="position: absolute; right: 0px; width: "+Math.max(p.display.barWidth-1,2)+"px; top: "+(m+this.buttonHeight)+"px; height: "+r+"px";f.className=this.options.className;if(d.id){f.setAttribute("annotation-id",d.id)}}}this.div.textContent="";this.div.appendChild(s)};b.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler);this.cm.off("markerAdded",this.resizeHandler);this.cm.off("markerCleared",this.resizeHandler);if(this.changeHandler){this.cm.off("change",this.changeHandler)}this.div.parentNode.removeChild(this.div)}});
|
||||
13
YakPanel/static/codemirror/addon/scroll/index.html
vendored
Normal file
13
YakPanel/static/codemirror/addon/scroll/index.html
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<div>
|
||||
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">目标URL</span><input class="bt-input-text" type="text" name="toUrl" value="http://" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="请填写完整URL,例:http://www.test.com"></p>
|
||||
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">发送域名</span><input class="bt-input-text" type="text" name="toDomain" value="$host" style="margin-left: 5px;width: 380px;height: 30px;margin-right:10px;" placeholder="发送到目标服务器的域名,例:www.test.com"></p>
|
||||
<p style="margin-bottom:8px"><span style="display: inline-block; width: 104px;">内容替换</span><input class="bt-input-text" type="text" name="sub1" value="" style="margin-left: 5px;width: 182px;height: 30px;margin-right:10px;" placeholder="被替换的文本,可留空"><input class="bt-input-text" type="text" name="sub2" value="" style="margin-left: 5px;width: 183px;height: 30px;margin-right:10px;" placeholder="替换为,可留空"></p>
|
||||
<div class="label-input-group ptb10"><label style="font-weight:normal"><input type="checkbox" name="status" onclick="Proxy('w6.hao.com',1)">启用反向代理</label><label style="margin-left: 18px;"><input type="checkbox" name="status" onclick="OpenCache('w6.hao.com',1)">开启缓存</label></div>
|
||||
<ul class="help-info-text c7 ptb10">
|
||||
<li>目标Url必需是可以访问的,否则将直接502</li>
|
||||
<li>默认本站点所有域名访问将被传递到目标服务器,请确保目标服务器已绑定域名</li>
|
||||
<li>若您是被动代理,请在发送域名处填写上目标站点的域名</li>
|
||||
<li>若您不需要内容替换功能,请直接留空</li>
|
||||
<li>可通过purge清理指定URL的缓存,示例:http://test.com/purge/test.png</li>
|
||||
</ul>
|
||||
</div>
|
||||
1
YakPanel/static/codemirror/addon/scroll/scrollpastend.js
vendored
Normal file
1
YakPanel/static/codemirror/addon/scroll/scrollpastend.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(b){b.defineOption("scrollPastEnd",false,function(d,f,e){if(e&&e!=b.Init){d.off("change",a);d.off("refresh",c);d.display.lineSpace.parentNode.style.paddingBottom="";d.state.scrollPastEndPadding=null}if(f){d.on("change",a);d.on("refresh",c);c(d)}});function a(d,e){if(b.changeEnd(e).line==d.lastLine()){c(d)}}function c(d){var g="";if(d.lineCount()>1){var e=d.display.scroller.clientHeight-30,f=d.getLineHandle(d.lastLine()).height;g=(e-f)+"px"}if(d.state.scrollPastEndPadding!=g){d.state.scrollPastEndPadding=g;d.display.lineSpace.parentNode.style.paddingBottom=g;d.off("refresh",c);d.setSize();d.on("refresh",c)}}});
|
||||
1
YakPanel/static/codemirror/addon/scroll/simplescrollbars.css
vendored
Normal file
1
YakPanel/static/codemirror/addon/scroll/simplescrollbars.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%}
|
||||
1
YakPanel/static/codemirror/addon/scroll/simplescrollbars.js
vendored
Normal file
1
YakPanel/static/codemirror/addon/scroll/simplescrollbars.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(b){function a(f,h,e){this.orientation=h;this.scroll=e;this.screen=this.total=this.size=1;this.pos=0;this.node=document.createElement("div");this.node.className=f+"-"+h;this.inner=this.node.appendChild(document.createElement("div"));var g=this;b.on(this.inner,"mousedown",function(n){if(n.which!=1){return}b.e_preventDefault(n);var l=g.orientation=="horizontal"?"pageX":"pageY";var o=n[l],m=g.pos;function k(){b.off(document,"mousemove",j);b.off(document,"mouseup",k)}function j(p){if(p.which!=1){return k()}g.moveTo(m+(p[l]-o)*(g.total/g.size))}b.on(document,"mousemove",j);b.on(document,"mouseup",k)});b.on(this.node,"click",function(l){b.e_preventDefault(l);var j=g.inner.getBoundingClientRect(),k;if(g.orientation=="horizontal"){k=l.clientX<j.left?-1:l.clientX>j.right?1:0}else{k=l.clientY<j.top?-1:l.clientY>j.bottom?1:0}g.moveTo(g.pos+k*g.screen)});function i(l){var k=b.wheelEventPixels(l)[g.orientation=="horizontal"?"x":"y"];var j=g.pos;g.moveTo(g.pos+k);if(g.pos!=j){b.e_preventDefault(l)}}b.on(this.node,"mousewheel",i);b.on(this.node,"DOMMouseScroll",i)}a.prototype.setPos=function(f,e){if(f<0){f=0}if(f>this.total-this.screen){f=this.total-this.screen}if(!e&&f==this.pos){return false}this.pos=f;this.inner.style[this.orientation=="horizontal"?"left":"top"]=(f*(this.size/this.total))+"px";return true};a.prototype.moveTo=function(e){if(this.setPos(e)){this.scroll(e,this.orientation)}};var d=10;a.prototype.update=function(g,h,i){var f=this.screen!=h||this.total!=g||this.size!=i;if(f){this.screen=h;this.total=g;this.size=i}var e=this.screen*(this.size/this.total);if(e<d){this.size-=d-e;e=d}this.inner.style[this.orientation=="horizontal"?"width":"height"]=e+"px";this.setPos(this.pos,f)};function c(g,f,e){this.addClass=g;this.horiz=new a(g,"horizontal",e);f(this.horiz.node);this.vert=new a(g,"vertical",e);f(this.vert.node);this.width=null}c.prototype.update=function(h){if(this.width==null){var g=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;if(g){this.width=parseInt(g.height)}}var f=this.width||0;var i=h.scrollWidth>h.clientWidth+1;var e=h.scrollHeight>h.clientHeight+1;this.vert.node.style.display=e?"block":"none";this.horiz.node.style.display=i?"block":"none";if(e){this.vert.update(h.scrollHeight,h.clientHeight,h.viewHeight-(i?f:0));this.vert.node.style.bottom=i?f+"px":"0"}if(i){this.horiz.update(h.scrollWidth,h.clientWidth,h.viewWidth-(e?f:0)-h.barLeft);this.horiz.node.style.right=e?f+"px":"0";this.horiz.node.style.left=h.barLeft+"px"}return{right:e?f:0,bottom:i?f:0}};c.prototype.setScrollTop=function(e){this.vert.setPos(e)};c.prototype.setScrollLeft=function(e){this.horiz.setPos(e)};c.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node);e.removeChild(this.vert.node)};b.scrollbarModel.simple=function(f,e){return new c("CodeMirror-simplescroll",f,e)};b.scrollbarModel.overlay=function(f,e){return new c("CodeMirror-overlayscroll",f,e)}});
|
||||
Reference in New Issue
Block a user