Commits

ben...@pollen.nymphormation.net  committed a173783

regenerate files

  • Participants
  • Parent commits 4a6cdd2
  • Tags v2.5

Comments (0)

Files changed (2)

File static/css/screen.css

 form li * {vertical-align:middle;}
 form label {display:block;width:14em;height:12px;float:left;padding:0 1em 3px 0;}
 input[type='text'], select {width:174px;border:1px solid;margin:0;}
-textarea {width:99%;border:1px solid;height:450px;z-index:0;}
+textarea {width:99%;border:1px solid;height:300px;z-index:0;}
 .wed {width:99%;height:450px;}
 .wed iframe {width:100%;}
 input[type='submit'], input[type='reset'], input[type='button'], button {border-width:0 1px 1px 0;padding:0.3em 0.5em 0.3em 0.5em;}
 p.copyright {display:block;margin:0pt auto 0pt auto;width:855px;}
 p.copyright span.brand {float:left;width:400px;}
 p.copyright span.powered {float:right;width:auto;position:relative;}
-div.grippie {position:absolute;cursor:se-resize;width:13px;height:13px;right:0px;bottom:13px;background:url(../images/resize.gif) no-repeat 0 0;}
-.grippie {background-position:50% 50%;}
+div.grippie {background:#E9E9E9 url(../images/resize2.gif) no-repeat scroll 50% 50%;min-height:3px;height:3px;}
 body {background-color:#e5f1f4;color:#000;}
 h1, h2, h3, h4, h5, h6 {color:#111;}
 a:link {color:#2e8696;}

File static/js/friendpaste.js

-var Resizeable=base2.Base.extend({constructor:function(C){var B=this;var A=document.createElement("div");A.className="grippie";A.style.cursor="row-resize";base2.DOM.bind(A);document.querySelectorAll(C).forEach(function(D){D.parentNode.appendChild(A);A.addEventListener("mousedown",function(E){E.preventDefault();E.stopPropagation();B.handleResize(E,D);return false},false)})},handleResize:function(E,B){var F=B;var G={x:E.screenX,y:E.screenY};var C={width:F.offsetWidth,height:F.offsetHeight};var D=function(I){I.preventDefault();var J=I.screenY-G.y;if(J){var H=C.height+J;F.style.height=H+"px";C.height=H;G.y=I.screenY}return false};var A=function(H){document.removeEventListener("mousemove",D,false);this.removeEventListener("mouseup",arguments.callee,false);return false};document.addEventListener("mousemove",D,false);document.addEventListener("mouseup",A,false)}});var Friendpaste=base2.Base.extend({snippet:null,snippet_edit:null,constructor:function(){var A=this;var C=document.querySelector(".e");var B=document.querySelectorAll(".cancel");var D=document.querySelector(".show-history");if(C){C.addEventListener("click",this.do_edit.bindAsEventListener(this),false)}if(B){B.forEach(function(E){E.addEventListener("click",A.do_cancel.bindAsEventListener(A),false)})}if(D){D.addEventListener("click",this.do_history.bindAsEventListener(this),false)}this.snippet=document.querySelector("#snippet_view");this.snippet_edit=document.querySelector("#snippet_edit");this.revisions=document.querySelector("#revisions");this.editing=false;this.show_history=false;this.setSettings();document.querySelector("#change-theme").addEventListener("change",this.setTheme.bindAsEventListener(this),false);document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},do_edit:function(A){A.preventDefault();this._edit();return false},_edit:function(){this.snippet.classList.add("hidden");this.snippet_edit.classList.remove("hidden");this.editing=true},do_cancel:function(A){A.preventDefault();this._cancel();return false},_cancel:function(){this.editing=false;if(!this.snippet_edit.classList.has("hidden")){this.snippet_edit.classList.add("hidden")}if(!this.revisions.classList.has("hidden")){this.revisions.classList.add("hidden")}this.snippet.classList.remove("hidden")},toggleLineNumber:function(A){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(A){document.querySelector("#show-linenos").checked=A.settings["showlinenos"];if(!A.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}document.querySelector("#change-theme").value=A.settings["theme"];document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(B){if(B.getAttribute("title")=="syntax_theme"){B.href="/static/css/"+A.settings["theme"]+".css"}})}})},saveSettings:function(){var C=document.querySelector("#factions");var B=true;var A=document.querySelector("#show-linenos:checked");if(!A){B=false}Ajax.request({url:C.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({theme:document.querySelector("#change-theme").value,showlinenos:B}),success:function(D){}})},setTheme:function(B){var A=B.target.value;document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(C){if(C.getAttribute("title")=="syntax_theme"){C.href="/static/css/"+A+".css"}});this.saveSettings()},do_history:function(B){B.preventDefault();this.show_history=true;url="/"+snippet_id+"/revisions";if(typeof (revid)!="undefined"){url=url+"?rev="+revid}var A=this;Ajax.get(url,null,function(E,C){document.querySelector(".pasteHistory").innerHTML="";var D="";E.forEach(function(G,F){D+='<tr><td><time title="GMT" datetime="'+G.updated+'">'+G.updated+'</time></td><td class="rev">rev. <a href=\'/'+G.pasteid+"?rev="+G.revid+"'>"+G.revid+'</a></td><td class="changeset"><a href=\'/'+G.pasteid+"/changeset?rev="+G.revid+"'>Diff</a></td><td class=\"view-rev\"><a href='/"+G.pasteid+"?rev="+G.revid+"'>View</a></td></tr>"});D='<table class="revisionstable">'+D+"</table>";document.querySelector(".pasteHistory").innerHTML=D;A.snippet.classList.add("hidden");A.revisions.classList.remove("hidden")},"json");return false},toJSON:function(A){return A!==null?JSON.stringify(A):null}});var Diff=base2.Base.extend({constructor:function(){this.sourcetable=document.querySelector(".sourceTable");this.difftabular=document.querySelector(".difftabular");this.switcher=document.querySelector("#switch");this.sourcetable.classList.add("hidden");this.switcher.innerHTML='<span class="stab active">Tabular</span><span class="suni">Unified</span>';this.stab=this.switcher.querySelector(".stab");this.suni=this.switcher.querySelector(".suni");var A=this;this.stab.addEventListener("click",this.setTabular.bindAsEventListener(this),false);this.suni.addEventListener("click",this.setUnified.bindAsEventListener(this),false);this.setSettings();document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},setTabular:function(A){A.preventDefault();if(!this.sourcetable.classList.has("hidden")){this.sourcetable.classList.add("hidden")}this.difftabular.classList.remove("hidden");this.suni.classList.remove("active");this.stab.classList.add("active")},setUnified:function(A){A.preventDefault();if(!this.difftabular.classList.has("hidden")){this.difftabular.classList.add("hidden")}this.sourcetable.classList.remove("hidden");this.stab.classList.remove("active");this.suni.classList.add("active")},toggleLineNumber:function(A){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(A){document.querySelector("#show-linenos").checked=A.settings["showlinenos"];if(!A.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}}})},saveSettings:function(){var C=document.querySelector("#factions");var B=true;var A=document.querySelector("#show-linenos:checked");if(!A){B=false}Ajax.request({url:C.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({showlinenos:B}),success:function(D){}})},});
+var Resizeable=base2.Base.extend({min_height:300,constructor:function(C){var B=this;var A=document.createElement("div");A.className="grippie";A.style.cursor="row-resize";base2.DOM.bind(A);document.querySelectorAll(C).forEach(function(D){D.parentNode.appendChild(A);A.addEventListener("mousedown",function(E){E.preventDefault();E.stopPropagation();B.handleResize(E,D);return false},false)})},handleResize:function(F,C){var A=this;var G=C;var H={x:F.screenX,y:F.screenY};var D={width:G.offsetWidth,height:G.offsetHeight};var E=function(J){J.preventDefault();var K=J.screenY-H.y;if(K){var I=D.height+K;if(I>A.min_height){G.style.height=I+"px";D.height=I;H.y=J.screenY}}return false};var B=function(I){document.removeEventListener("mousemove",E,false);this.removeEventListener("mouseup",arguments.callee,false);return false};document.addEventListener("mousemove",E,false);document.addEventListener("mouseup",B,false)}});var Friendpaste=base2.Base.extend({snippet:null,snippet_edit:null,constructor:function(){var A=this;var C=document.querySelector(".e");var B=document.querySelectorAll(".cancel");var D=document.querySelector(".show-history");if(C){C.addEventListener("click",this.do_edit.bindAsEventListener(this),false)}if(B){B.forEach(function(E){E.addEventListener("click",A.do_cancel.bindAsEventListener(A),false)})}if(D){D.addEventListener("click",this.do_history.bindAsEventListener(this),false)}this.snippet=document.querySelector("#snippet_view");this.snippet_edit=document.querySelector("#snippet_edit");this.revisions=document.querySelector("#revisions");this.editing=false;this.show_history=false;if(!base2.detect("webkit")){new Resizeable("#paste_snippet")}this.setSettings();document.querySelector("#change-theme").addEventListener("change",this.setTheme.bindAsEventListener(this),false);document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},do_edit:function(A){A.preventDefault();this._edit();return false},_edit:function(){this.snippet.classList.add("hidden");this.snippet_edit.classList.remove("hidden");this.editing=true},do_cancel:function(A){A.preventDefault();this._cancel();return false},_cancel:function(){this.editing=false;if(!this.snippet_edit.classList.has("hidden")){this.snippet_edit.classList.add("hidden")}if(!this.revisions.classList.has("hidden")){this.revisions.classList.add("hidden")}this.snippet.classList.remove("hidden")},toggleLineNumber:function(A){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(A){document.querySelector("#show-linenos").checked=A.settings["showlinenos"];if(!A.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}document.querySelector("#change-theme").value=A.settings["theme"];document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(B){if(B.getAttribute("title")=="syntax_theme"){B.href="/static/css/"+A.settings["theme"]+".css"}})}})},saveSettings:function(){var C=document.querySelector("#factions");var B=true;var A=document.querySelector("#show-linenos:checked");if(!A){B=false}Ajax.request({url:C.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({theme:document.querySelector("#change-theme").value,showlinenos:B}),success:function(D){}})},setTheme:function(B){var A=B.target.value;document.querySelectorAll('link[rel="stylesheet"][title]').forEach(function(C){if(C.getAttribute("title")=="syntax_theme"){C.href="/static/css/"+A+".css"}});this.saveSettings()},do_history:function(B){B.preventDefault();this.show_history=true;url="/"+snippet_id+"/revisions";if(typeof (revid)!="undefined"){url=url+"?rev="+revid}var A=this;Ajax.get(url,null,function(E,C){document.querySelector(".pasteHistory").innerHTML="";var D="";E.forEach(function(G,F){D+='<tr><td><time title="GMT" datetime="'+G.updated+'">'+G.updated+'</time></td><td class="rev">rev. <a href=\'/'+G.pasteid+"?rev="+G.revid+"'>"+G.revid+'</a></td><td class="changeset"><a href=\'/'+G.pasteid+"/changeset?rev="+G.revid+"'>Diff</a></td><td class=\"view-rev\"><a href='/"+G.pasteid+"?rev="+G.revid+"'>View</a></td></tr>"});D='<table class="revisionstable">'+D+"</table>";document.querySelector(".pasteHistory").innerHTML=D;A.snippet.classList.add("hidden");A.revisions.classList.remove("hidden")},"json");return false},toJSON:function(A){return A!==null?JSON.stringify(A):null}});var Diff=base2.Base.extend({constructor:function(){this.sourcetable=document.querySelector(".sourceTable");this.difftabular=document.querySelector(".difftabular");this.switcher=document.querySelector("#switch");this.sourcetable.classList.add("hidden");this.switcher.innerHTML='<span class="stab active">Tabular</span><span class="suni">Unified</span>';this.stab=this.switcher.querySelector(".stab");this.suni=this.switcher.querySelector(".suni");var A=this;this.stab.addEventListener("click",this.setTabular.bindAsEventListener(this),false);this.suni.addEventListener("click",this.setUnified.bindAsEventListener(this),false);this.setSettings();document.querySelector("#show-linenos").addEventListener("click",this.toggleLineNumber.bindAsEventListener(this),false)},setTabular:function(A){A.preventDefault();if(!this.sourcetable.classList.has("hidden")){this.sourcetable.classList.add("hidden")}this.difftabular.classList.remove("hidden");this.suni.classList.remove("active");this.stab.classList.add("active")},setUnified:function(A){A.preventDefault();if(!this.difftabular.classList.has("hidden")){this.difftabular.classList.add("hidden")}this.sourcetable.classList.remove("hidden");this.stab.classList.remove("active");this.suni.classList.add("active")},toggleLineNumber:function(A){document.querySelector("#paste").classList.toggle("hidenos");this.saveSettings()},setSettings:function(){Ajax.request({url:"/settings",dataType:"json",contentType:"application/json",method:"GET",success:function(A){document.querySelector("#show-linenos").checked=A.settings["showlinenos"];if(!A.settings["showlinenos"]){document.querySelector("#paste").classList.add("hidenos")}}})},saveSettings:function(){var C=document.querySelector("#factions");var B=true;var A=document.querySelector("#show-linenos:checked");if(!A){B=false}Ajax.request({url:C.action,dataType:"json",contentType:"application/json",method:"POST",data:this.toJSON({showlinenos:B}),success:function(D){}})},});