Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added New/Clone feature when viewing a paste.

Added Toggle line numbers
Applied CSS styling to page to start making look a little nicer
Ability to store each paste to a unique crypto (allows alternating without breaking previous pastes) - Updated SQL schema
Added a simple pre-loader gif for people with slow connections or less powerful PCs when decrypting text
Fixed some bugs here and there and added some more comments where needed.
Added favicon
  • Loading branch information...
commit 835470aa8bc8f10eaf7f4bdf29899327b593ac2b 1 parent 5d81832
NovaKing authored
View
1  resources/ezcrypt.sql
@@ -19,6 +19,7 @@ CREATE TABLE IF NOT EXISTS `pastes` (
`password` varchar(100) DEFAULT NULL,
`data` longblob NOT NULL,
`syntax` enum('text/plain','application/x-aspx','text/x-csrc','text/x-java','text/x-cppsrc','text/x-clojure','text/x-coffeescript','text/css','text/x-diff','text/x-groovy','text/x-haskell','text/html','htmlmixed','application/x-jsp','text/javascript','application/json','jinja2','text/less','text/x-lua','text/x-markdown','text/n-triples','text/x-pascal','text/x-perl','application/x-httpd-php','text/x-plsql','text/x-python','text/x-rsc','text/x-rst','text/x-ruby','text/x-rust','text/x-scheme','text/x-stsrc','application/sparql','text/x-stex','text/x-tiddlywiki','text/velocity','text/x-verilog','application/xml','text/x-yaml','text/x-bash') NOT NULL DEFAULT 'text/plain',
+ `crypto` varchar(20) NOT NULL DEFAULT 'CRYPTO_JS',
`added` int(15) DEFAULT NULL,
`ttl` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
View
BIN  www/css/decrypting.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
186 www/css/ezcrypt.css
@@ -108,6 +108,62 @@ a:hover
text-decoration: underline;
}
+#menu a:not(:last-child)
+{
+ background-color: #d7e5f5;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d7e5f5), color-stop(100%, #cbe0f5));
+ background-image: -webkit-linear-gradient(top, #d7e5f5, #cbe0f5);
+ background-image: -moz-linear-gradient(top, #d7e5f5, #cbe0f5);
+ background-image: -ms-linear-gradient(top, #d7e5f5, #cbe0f5);
+ background-image: -o-linear-gradient(top, #d7e5f5, #cbe0f5);
+ background-image: linear-gradient(top, #d7e5f5, #cbe0f5);
+ border-top: 1px solid #abbbcc;
+ border-left: 1px solid #a7b6c7;
+ border-bottom: 1px solid #a1afbf;
+ border-right: 1px solid #a7b6c7;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 1px 0 0 white;
+ -moz-box-shadow: inset 0 1px 0 0 white;
+ box-shadow: inset 0 1px 0 0 white;
+ color: #1a3e66;
+ font: normal 11px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
+ line-height: 1;
+ padding: 1px 5px 2px 5px;
+ text-align: center;
+ text-shadow: 0 1px 1px #fff;
+ width: 150px;
+}
+
+#menu a:not(:last-child):hover
+{
+ background-color: #ccd9e8;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ccd9e8), color-stop(100%, #c1d4e8));
+ background-image: -webkit-linear-gradient(top, #ccd9e8, #c1d4e8);
+ background-image: -moz-linear-gradient(top, #ccd9e8, #c1d4e8);
+ background-image: -ms-linear-gradient(top, #ccd9e8, #c1d4e8);
+ background-image: -o-linear-gradient(top, #ccd9e8, #c1d4e8);
+ background-image: linear-gradient(top, #ccd9e8, #c1d4e8);
+ border-top: 1px solid #a1afbf;
+ border-left: 1px solid #9caaba;
+ border-bottom: 1px solid #96a3b3;
+ border-right: 1px solid #9caaba;
+ -webkit-box-shadow: inset 0 1px 0 0 #f2f2f2;
+ -moz-box-shadow: inset 0 1px 0 0 #f2f2f2;
+ box-shadow: inset 0 1px 0 0 #f2f2f2;
+ color: #163659;
+ cursor: pointer;
+}
+
+#menu a:not(:last-child):active
+{
+ border: 1px solid #8c98a7;
+ -webkit-box-shadow: inset 0 0 4px 2px #abbccf, 0 0 1px 0 #eeeeee;
+ -moz-box-shadow: inset 0 0 4px 2px #abbccf, 0 0 1px 0 #eeeeee;
+ box-shadow: inset 0 0 4px 2px #abbccf, 0 0 1px 0 #eeeeee;
+}
+
textarea
{
width: 100%;
@@ -154,6 +210,7 @@ textarea
#menu
{
+ position: relative;
text-align: center;
padding: 7px 0px;
border-bottom: 1px SOLID #f2f2f2;
@@ -169,6 +226,9 @@ textarea
height: 100%;
width: 920px;
+ /* image preloader */
+ background: url(/css/padlock.png) no-repeat -9999px -9999px;
+ /* end image preloader */
background-color: #FAFAFA;
-moz-box-shadow: 0 0 10px 10px #fafafa;
-webkit-box-shadow: 0 0 10px 10px #fafafa;
@@ -191,7 +251,7 @@ textarea
-moz-box-shadow: inset 0 0 10px 10px #d6f4d8;
-webkit-box-shadow: inset 0 0 10px 10px #d6f4d8;
box-shadow: inset 0 0 10px 10px #d6f4d8;
- background: #f9fff9 url( /css/padlock.png ) 100% 2px no-repeat;
+ background: #f9fff9 url(/css/padlock.png) 100% 2px no-repeat;
color: #909090;
overflow: hidden;
}
@@ -212,6 +272,130 @@ textarea
text-align: center;
}
+#options
+{
+ margin-top: 5px;
+}
+
+#newpaste
+{
+ display: none;
+ padding-bottom: 20px;
+}
+
+#wrapholder
+{
+ height: 25px;
+ display: none;
+}
+
+#wrapholder a
+{
+ background-color: #7fbf4d;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7fbf4d), color-stop(100%, #63a62f));
+ background-image: -webkit-linear-gradient(top, #7fbf4d, #63a62f);
+ background-image: -moz-linear-gradient(top, #7fbf4d, #63a62f);
+ background-image: -ms-linear-gradient(top, #7fbf4d, #63a62f);
+ background-image: -o-linear-gradient(top, #7fbf4d, #63a62f);
+ background-image: linear-gradient(top, #7fbf4d, #63a62f);
+ border: 1px solid #63a62f;
+ border-bottom: 1px solid #5b992b;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 1px 0 0 #96ca6d;
+ -moz-box-shadow: inset 0 1px 0 0 #96ca6d;
+ box-shadow: inset 0 1px 0 0 #96ca6d;
+ color: #FFF;
+ font: normal 11px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
+ line-height: 1;
+ padding: 1px 5px 2px 5px;
+ text-align: center;
+ text-shadow: 0 1px 1px #4c9021;
+ width: 150px;
+}
+
+#wrapholder a:hover
+{
+ background-color: #76b347;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76b347), color-stop(100%, #5e9e2e));
+ background-image: -webkit-linear-gradient(top, #76b347, #5e9e2e);
+ background-image: -moz-linear-gradient(top, #76b347, #5e9e2e);
+ background-image: -ms-linear-gradient(top, #76b347, #5e9e2e);
+ background-image: -o-linear-gradient(top, #76b347, #5e9e2e);
+ background-image: linear-gradient(top, #76b347, #5e9e2e);
+ -webkit-box-shadow: inset 0 1px 0 0 #8dbf67;
+ -moz-box-shadow: inset 0 1px 0 0 #8dbf67;
+ box-shadow: inset 0 1px 0 0 #8dbf67;
+ cursor: pointer;
+}
+
+#wrapholder a:active
+{
+ border: 1px solid #5b992b;
+ border-bottom: 1px solid #538c27;
+ -webkit-box-shadow: inset 0 0 4px 2px #548c29, 0 0 1px 0 #eeeeee;
+ -moz-box-shadow: inset 0 0 4px 2px #548c29, 0 0 1px 0 #eeeeee;
+ box-shadow: inset 0 0 4px 2px #548c29, 0 0 1px 0 #eeeeee;
+}
+
+#tool-numbers, #tool-wrap
+{
+ display: none;
+}
+
+.tool-numbers
+{
+ display: block;
+ float: right;
+ width: 20px;
+ height: 18px;
+ margin-top: 2px;
+ margin-left: 2px;
+ background: #FFF url(/css/line-numbers.png) 0px 1px no-repeat;
+ border-width: 1px;
+ border-style: SOLID;
+ border-left-color: #dedede;
+ border-top-color: #dedede;
+ border-right-color: #777777;
+ border-bottom-color: #777777;
+}
+
+.tool-numbers-on
+{
+ background-position: 1px 2px;
+ border-left-color: #777777 !important;
+ border-top-color: #777777 !important;
+ border-right-color: #dedede !important;
+ border-bottom-color: #dedede !important;
+}
+
+.tool-wrap
+{
+ display: block;
+ float: right;
+ width: 20px;
+ height: 18px;
+ margin-top: 2px;
+ margin-left: 2px;
+ background: #FFF url(/css/wrap-lines.png) 0px 1px no-repeat;
+ border-width: 1px;
+ border-style: SOLID;
+ border-left-color: #dedede;
+ border-top-color: #dedede;
+ border-right-color: #777777;
+ border-bottom-color: #777777;
+}
+
+.tool-wrap-on
+{
+ background-position: 1px 2px;
+ border-left-color: #777777 !important;
+ border-top-color: #777777 !important;
+ border-right-color: #dedede !important;
+ border-bottom-color: #dedede !important;
+}
+
#execute
{
float: right;
View
BIN  www/css/line-numbers.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  www/css/styles.min.css
@@ -1 +1 @@
-@CHARSET "UTF-8";html,body{margin:0;padding:0;height:100%}body{font-family:'Trebuchet MS',Helvetica,sans-serif;font-size:13px;line-height:20px;height:100%;min-height:100%}input[type="checkbox"],input[type="radio"]{border:0;background:0;vertical-align:middle;margin:3px 2px}input[type="submit"],input[type="button"]{-moz-box-shadow:INSET 1px 1px 0 #f5f5f5,INSET -1px -1px 0 #c9c9c9;-webkit-box-shadow:INSET 1px 1px 0 #f5f5f5,INSET -1px -1px 0 #c9c9c9;box-shadow:INSET 1px 1px 0 #f5f5f5,INSET -1px -1px 0 #c9c9c9;background:-webkit-gradient(linear,left top,left bottom,color-stop(0.05,#ededed),color-stop(1,#dfdfdf));background:-moz-linear-gradient(center top,#ededed 5%,#dfdfdf 100%);background:-o-linear-gradient(#ededed,#dfdfdf);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed',endColorstr='#dfdfdf');background-color:#ededed;border-width:1px;border-style:SOLID;border-left-color:#dedede;border-top-color:#dedede;border-right-color:#777;border-bottom-color:#777;color:#4d4d4d;font-family:inherit;font-size:115%;text-decoration:none;text-shadow:1px 1px 0 #fff;height:29px;padding-left:8px;padding-right:8px}input[type="submit"]:hover,input[type="button"]:hover{background:-webkit-gradient(linear,left top,left bottom,color-stop(0.05,#e4e4e4),color-stop(1,#dbdbdb));background:-moz-linear-gradient(center top,#e4e4e4 5%,#dbdbdb 100%);background:-o-linear-gradient(#e4e4e4,#dbdbdb);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e4e4e4',endColorstr='#dbdbdb');background-color:#e4e4e4;color:#282828}input[type="submit"]:active,input[type="button"]:active{position:relative;top:1px;left:1px;-moz-box-shadow:INSET 1px 1px 0 #c9c9c9,INSET -1px -1px 0 #e8e8e8;-webkit-box-shadow:INSET 1px 1px 0 #c9c9c9,INSET -1px -1px 0 #e8e8e8;box-shadow:INSET 1px 1px 0 #c9c9c9,INSET -1px -1px 0 #e8e8e8;border-width:1px;border-style:SOLID;border-left-color:#777;border-top-color:#777;border-right-color:#dedede;border-bottom-color:#dedede}input[type="text"],input[type="password"]{background:-webkit-gradient(linear,left top,left bottom,color-stop(0.05,#f9f9f9),color-stop(1,#fff));background:-moz-linear-gradient(center top,#f9f9f9 5%,#fff 100%);background:-o-linear-gradient(top,#f9f9f9,#fff);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#ffffff');background-color:#fff;border:1px SOLID #d1c7ac;color:#333;padding:2px;margin:0}a{text-decoration:none;color:#27377d}a:hover{text-decoration:underline}textarea{width:100%;height:400px;border:1px SOLID #e0e0e0;padding:0;resize:none;outline:0;-webkit-appearance:none}#syntax>.header{text-align:center;background-color:#94cff5;color:#000}#header{font-size:18px;height:35px;padding-top:15px;text-align:center;color:#000;background:#fafafa;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZhZmFmYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmYWZhZmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-moz-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0%,#fafafa),color-stop(10%,#dcdcdc),color-stop(90%,#dcdcdc),color-stop(100%,#fafafa));background:-webkit-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-o-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-ms-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#fafafa',GradientType=1)}.small{font-size:10px;color:#666}#menu{text-align:center;padding:7px 0;border-bottom:1px SOLID #f2f2f2;margin-bottom:10px}#holder{position:relative;margin:0 auto -35px auto;min-height:100%;height:auto!important;height:100%;width:920px;background-color:#fafafa;-moz-box-shadow:0 0 10px 10px #fafafa;-webkit-box-shadow:0 0 10px 10px #fafafa;box-shadow:0 0 10px 10px #fafafa}#main{padding:5px}#result{display:none;position:absolute;top:0;left:0;width:910px;border:1px SOLID #c1e9c3!important;-moz-box-shadow:inset 0 0 10px 10px #d6f4d8;-webkit-box-shadow:inset 0 0 10px 10px #d6f4d8;box-shadow:inset 0 0 10px 10px #d6f4d8;background:#f9fff9 url(/css/padlock.png) 100% 2px no-repeat;color:#909090;overflow:hidden}#askpassword{display:none;padding-top:25px;margin:0 auto;text-align:center}#insertkey{display:none;padding-top:25px;margin:0 auto;text-align:center}#execute{float:right;height:15px;font-size:10px;color:#cecece}#push{height:40px;clear:both}#footer{position:absolute;height:25px;width:920px;margin:0 auto;padding-top:10px;text-align:center;color:#000;bottom:0;background:#fafafa;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZhZmFmYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmYWZhZmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-moz-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0%,#fafafa),color-stop(10%,#dcdcdc),color-stop(90%,#dcdcdc),color-stop(100%,#fafafa));background:-webkit-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-o-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-ms-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#fafafa',GradientType=1)}.CodeMirror{line-height:1em;font-family:monospace;background-color:#fff;border:1px SOLID #e0e0e0;padding:0;width:100%}.CodeMirror-scroll{overflow:auto;position:relative}.CodeMirror-gutter{position:absolute;left:0;top:0;z-index:10;background-color:#f7f7f7;border-right:1px solid #eee;min-width:2em;height:100%}.CodeMirror-gutter-text{color:#aaa;text-align:right;padding:.4em .2em .4em .4em;white-space:pre!important}.CodeMirror-lines{padding:.4em}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;border-radius:0;border-width:0;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;padding:0;margin:0;white-space:pre;word-wrap:normal}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror textarea{outline:none!important}.CodeMirror pre.CodeMirror-cursor{z-index:10;position:absolute;visibility:hidden;border-left:1px solid black}.CodeMirror-focused pre.CodeMirror-cursor{visibility:visible}div.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused div.CodeMirror-selected{background:#d7d4f0}.CodeMirror-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-s-default span.cm-keyword{color:#708}.cm-s-default span.cm-atom{color:#219}.cm-s-default span.cm-number{color:#164}.cm-s-default span.cm-def{color:#00f}.cm-s-default span.cm-variable{color:black}.cm-s-default span.cm-variable-2{color:#05a}.cm-s-default span.cm-variable-3{color:#085}.cm-s-default span.cm-property{color:black}.cm-s-default span.cm-operator{color:black}.cm-s-default span.cm-comment{color:#a50}.cm-s-default span.cm-string{color:#a11}.cm-s-default span.cm-string-2{color:#f50}.cm-s-default span.cm-meta{color:#555}.cm-s-default span.cm-error{color:#f00}.cm-s-default span.cm-qualifier{color:#555}.cm-s-default span.cm-builtin{color:#30a}.cm-s-default span.cm-bracket{color:#cc7}.cm-s-default span.cm-tag{color:#170}.cm-s-default span.cm-attribute{color:#00c}.cm-s-default span.cm-header{color:#a0a}.cm-s-default span.cm-quote{color:#090}.cm-s-default span.cm-hr{color:#999}.cm-s-default span.cm-link{color:#00c}span.cm-header,span.cm-strong{font-weight:bold}span.cm-em{font-style:italic}span.cm-emstrong{font-style:italic;font-weight:bold}span.cm-link{text-decoration:underline}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}
+@CHARSET "UTF-8";html,body{margin:0;padding:0;height:100%}body{font-family:'Trebuchet MS',Helvetica,sans-serif;font-size:13px;line-height:20px;height:100%;min-height:100%}input[type="checkbox"],input[type="radio"]{border:0;background:0;vertical-align:middle;margin:3px 2px}input[type="submit"],input[type="button"]{-moz-box-shadow:INSET 1px 1px 0 #f5f5f5,INSET -1px -1px 0 #c9c9c9;-webkit-box-shadow:INSET 1px 1px 0 #f5f5f5,INSET -1px -1px 0 #c9c9c9;box-shadow:INSET 1px 1px 0 #f5f5f5,INSET -1px -1px 0 #c9c9c9;background:-webkit-gradient(linear,left top,left bottom,color-stop(0.05,#ededed),color-stop(1,#dfdfdf));background:-moz-linear-gradient(center top,#ededed 5%,#dfdfdf 100%);background:-o-linear-gradient(#ededed,#dfdfdf);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed',endColorstr='#dfdfdf');background-color:#ededed;border-width:1px;border-style:SOLID;border-left-color:#dedede;border-top-color:#dedede;border-right-color:#777;border-bottom-color:#777;color:#4d4d4d;font-family:inherit;font-size:115%;text-decoration:none;text-shadow:1px 1px 0 #fff;height:29px;padding-left:8px;padding-right:8px}input[type="submit"]:hover,input[type="button"]:hover{background:-webkit-gradient(linear,left top,left bottom,color-stop(0.05,#e4e4e4),color-stop(1,#dbdbdb));background:-moz-linear-gradient(center top,#e4e4e4 5%,#dbdbdb 100%);background:-o-linear-gradient(#e4e4e4,#dbdbdb);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e4e4e4',endColorstr='#dbdbdb');background-color:#e4e4e4;color:#282828}input[type="submit"]:active,input[type="button"]:active{position:relative;top:1px;left:1px;-moz-box-shadow:INSET 1px 1px 0 #c9c9c9,INSET -1px -1px 0 #e8e8e8;-webkit-box-shadow:INSET 1px 1px 0 #c9c9c9,INSET -1px -1px 0 #e8e8e8;box-shadow:INSET 1px 1px 0 #c9c9c9,INSET -1px -1px 0 #e8e8e8;border-width:1px;border-style:SOLID;border-left-color:#777;border-top-color:#777;border-right-color:#dedede;border-bottom-color:#dedede}input[type="text"],input[type="password"]{background:-webkit-gradient(linear,left top,left bottom,color-stop(0.05,#f9f9f9),color-stop(1,#fff));background:-moz-linear-gradient(center top,#f9f9f9 5%,#fff 100%);background:-o-linear-gradient(top,#f9f9f9,#fff);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#ffffff');background-color:#fff;border:1px SOLID #d1c7ac;color:#333;padding:2px;margin:0}a{text-decoration:none;color:#27377d}a:hover{text-decoration:underline}#menu a:not(:last-child){background-color:#d7e5f5;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#d7e5f5),color-stop(100%,#cbe0f5));background-image:-webkit-linear-gradient(top,#d7e5f5,#cbe0f5);background-image:-moz-linear-gradient(top,#d7e5f5,#cbe0f5);background-image:-ms-linear-gradient(top,#d7e5f5,#cbe0f5);background-image:-o-linear-gradient(top,#d7e5f5,#cbe0f5);background-image:linear-gradient(top,#d7e5f5,#cbe0f5);border-top:1px solid #abbbcc;border-left:1px solid #a7b6c7;border-bottom:1px solid #a1afbf;border-right:1px solid #a7b6c7;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 0 white;-moz-box-shadow:inset 0 1px 0 0 white;box-shadow:inset 0 1px 0 0 white;color:#1a3e66;font:normal 11px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;line-height:1;padding:1px 5px 2px 5px;text-align:center;text-shadow:0 1px 1px #fff;width:150px}#menu a:not(:last-child):hover{background-color:#ccd9e8;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ccd9e8),color-stop(100%,#c1d4e8));background-image:-webkit-linear-gradient(top,#ccd9e8,#c1d4e8);background-image:-moz-linear-gradient(top,#ccd9e8,#c1d4e8);background-image:-ms-linear-gradient(top,#ccd9e8,#c1d4e8);background-image:-o-linear-gradient(top,#ccd9e8,#c1d4e8);background-image:linear-gradient(top,#ccd9e8,#c1d4e8);border-top:1px solid #a1afbf;border-left:1px solid #9caaba;border-bottom:1px solid #96a3b3;border-right:1px solid #9caaba;-webkit-box-shadow:inset 0 1px 0 0 #f2f2f2;-moz-box-shadow:inset 0 1px 0 0 #f2f2f2;box-shadow:inset 0 1px 0 0 #f2f2f2;color:#163659;cursor:pointer}#menu a:not(:last-child):active{border:1px solid #8c98a7;-webkit-box-shadow:inset 0 0 4px 2px #abbccf,0 0 1px 0 #eee;-moz-box-shadow:inset 0 0 4px 2px #abbccf,0 0 1px 0 #eee;box-shadow:inset 0 0 4px 2px #abbccf,0 0 1px 0 #eee}textarea{width:100%;height:400px;border:1px SOLID #e0e0e0;padding:0;resize:none;outline:0;-webkit-appearance:none}#syntax>.header{text-align:center;background-color:#94cff5;color:#000}#header{font-size:18px;height:35px;padding-top:15px;text-align:center;color:#000;background:#fafafa;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZhZmFmYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmYWZhZmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-moz-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0%,#fafafa),color-stop(10%,#dcdcdc),color-stop(90%,#dcdcdc),color-stop(100%,#fafafa));background:-webkit-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-o-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-ms-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#fafafa',GradientType=1)}.small{font-size:10px;color:#666}#menu{position:relative;text-align:center;padding:7px 0;border-bottom:1px SOLID #f2f2f2;margin-bottom:10px}#holder{position:relative;margin:0 auto -35px auto;min-height:100%;height:auto!important;height:100%;width:920px;background:url(/css/padlock.png) no-repeat -9999px -9999px;background-color:#fafafa;-moz-box-shadow:0 0 10px 10px #fafafa;-webkit-box-shadow:0 0 10px 10px #fafafa;box-shadow:0 0 10px 10px #fafafa}#main{padding:5px}#result{display:none;position:absolute;top:0;left:0;width:910px;border:1px SOLID #c1e9c3!important;-moz-box-shadow:inset 0 0 10px 10px #d6f4d8;-webkit-box-shadow:inset 0 0 10px 10px #d6f4d8;box-shadow:inset 0 0 10px 10px #d6f4d8;background:#f9fff9 url(/css/padlock.png) 100% 2px no-repeat;color:#909090;overflow:hidden}#askpassword{display:none;padding-top:25px;margin:0 auto;text-align:center}#insertkey{display:none;padding-top:25px;margin:0 auto;text-align:center}#options{margin-top:5px}#newpaste{display:none;padding-bottom:20px}#wrapholder{height:25px;display:none}#wrapholder a{background-color:#7fbf4d;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7fbf4d),color-stop(100%,#63a62f));background-image:-webkit-linear-gradient(top,#7fbf4d,#63a62f);background-image:-moz-linear-gradient(top,#7fbf4d,#63a62f);background-image:-ms-linear-gradient(top,#7fbf4d,#63a62f);background-image:-o-linear-gradient(top,#7fbf4d,#63a62f);background-image:linear-gradient(top,#7fbf4d,#63a62f);border:1px solid #63a62f;border-bottom:1px solid #5b992b;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 0 #96ca6d;-moz-box-shadow:inset 0 1px 0 0 #96ca6d;box-shadow:inset 0 1px 0 0 #96ca6d;color:#FFF;font:normal 11px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;line-height:1;padding:1px 5px 2px 5px;text-align:center;text-shadow:0 1px 1px #4c9021;width:150px}#wrapholder a:hover{background-color:#76b347;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#76b347),color-stop(100%,#5e9e2e));background-image:-webkit-linear-gradient(top,#76b347,#5e9e2e);background-image:-moz-linear-gradient(top,#76b347,#5e9e2e);background-image:-ms-linear-gradient(top,#76b347,#5e9e2e);background-image:-o-linear-gradient(top,#76b347,#5e9e2e);background-image:linear-gradient(top,#76b347,#5e9e2e);-webkit-box-shadow:inset 0 1px 0 0 #8dbf67;-moz-box-shadow:inset 0 1px 0 0 #8dbf67;box-shadow:inset 0 1px 0 0 #8dbf67;cursor:pointer}#wrapholder a:active{border:1px solid #5b992b;border-bottom:1px solid #538c27;-webkit-box-shadow:inset 0 0 4px 2px #548c29,0 0 1px 0 #eee;-moz-box-shadow:inset 0 0 4px 2px #548c29,0 0 1px 0 #eee;box-shadow:inset 0 0 4px 2px #548c29,0 0 1px 0 #eee}#tool-numbers,#tool-wrap{display:none}.tool-numbers{display:block;float:right;width:20px;height:18px;margin-top:2px;margin-left:2px;background:#FFF url(/css/line-numbers.png) 0 1px no-repeat;border-width:1px;border-style:SOLID;border-left-color:#dedede;border-top-color:#dedede;border-right-color:#777;border-bottom-color:#777}.tool-numbers-on{background-position:1px 2px;border-left-color:#777!important;border-top-color:#777!important;border-right-color:#dedede!important;border-bottom-color:#dedede!important}.tool-wrap{display:block;float:right;width:20px;height:18px;margin-top:2px;margin-left:2px;background:#FFF url(/css/wrap-lines.png) 0 1px no-repeat;border-width:1px;border-style:SOLID;border-left-color:#dedede;border-top-color:#dedede;border-right-color:#777;border-bottom-color:#777}.tool-wrap-on{background-position:1px 2px;border-left-color:#777!important;border-top-color:#777!important;border-right-color:#dedede!important;border-bottom-color:#dedede!important}#execute{float:right;height:15px;font-size:10px;color:#cecece}#push{height:40px;clear:both}#footer{position:absolute;height:25px;width:920px;margin:0 auto;padding-top:10px;text-align:center;color:#000;bottom:0;background:#fafafa;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZhZmFmYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkwJSIgc3RvcC1jb2xvcj0iI2RjZGNkYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmYWZhZmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);background:-moz-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0%,#fafafa),color-stop(10%,#dcdcdc),color-stop(90%,#dcdcdc),color-stop(100%,#fafafa));background:-webkit-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-o-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:-ms-linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);background:linear-gradient(left,#fafafa 0,#dcdcdc 10%,#dcdcdc 90%,#fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#fafafa',GradientType=1)}.CodeMirror{line-height:1em;font-family:monospace;background-color:#fff;border:1px SOLID #e0e0e0;padding:0;width:100%}.CodeMirror-scroll{overflow:auto;position:relative}.CodeMirror-gutter{position:absolute;left:0;top:0;z-index:10;background-color:#f7f7f7;border-right:1px solid #eee;min-width:2em;height:100%}.CodeMirror-gutter-text{color:#aaa;text-align:right;padding:.4em .2em .4em .4em;white-space:pre!important}.CodeMirror-lines{padding:.4em}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;border-radius:0;border-width:0;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;padding:0;margin:0;white-space:pre;word-wrap:normal}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror textarea{outline:none!important}.CodeMirror pre.CodeMirror-cursor{z-index:10;position:absolute;visibility:hidden;border-left:1px solid black}.CodeMirror-focused pre.CodeMirror-cursor{visibility:visible}div.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused div.CodeMirror-selected{background:#d7d4f0}.CodeMirror-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-s-default span.cm-keyword{color:#708}.cm-s-default span.cm-atom{color:#219}.cm-s-default span.cm-number{color:#164}.cm-s-default span.cm-def{color:#00f}.cm-s-default span.cm-variable{color:black}.cm-s-default span.cm-variable-2{color:#05a}.cm-s-default span.cm-variable-3{color:#085}.cm-s-default span.cm-property{color:black}.cm-s-default span.cm-operator{color:black}.cm-s-default span.cm-comment{color:#a50}.cm-s-default span.cm-string{color:#a11}.cm-s-default span.cm-string-2{color:#f50}.cm-s-default span.cm-meta{color:#555}.cm-s-default span.cm-error{color:#f00}.cm-s-default span.cm-qualifier{color:#555}.cm-s-default span.cm-builtin{color:#30a}.cm-s-default span.cm-bracket{color:#cc7}.cm-s-default span.cm-tag{color:#170}.cm-s-default span.cm-attribute{color:#00c}.cm-s-default span.cm-header{color:#a0a}.cm-s-default span.cm-quote{color:#090}.cm-s-default span.cm-hr{color:#999}.cm-s-default span.cm-link{color:#00c}span.cm-header,span.cm-strong{font-weight:bold}span.cm-em{font-style:italic}span.cm-emstrong{font-style:italic;font-weight:bold}span.cm-link{text-decoration:underline}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}
View
BIN  www/css/wrap-lines.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  www/favicon.ico
Binary file not shown
View
6 www/inc/jslibs/core-0.4.min.js
@@ -7,5 +7,7 @@
* General functions that get used within the website
*
**/
-var editor;var ez;var _encrypting=null;var lib='CRYPTO_JS';$LAB.setGlobalDefaults({UseLocalXHR:true,AlwaysPreserveOrder:false,AllowDuplicates:true});$(function(){if(document.getElementById('content')){editor=CodeMirror.fromTextArea(document.getElementById('content'),{lineNumbers:true,matchBrackets:false,lineWrapping:false,readOnly:true});editor.setOption('mode',$('#syntax').val());editor.focus();}$('#text').bind('textchange',function(){if(_encrypting!=null){clearTimeout(_encrypting);_encrypting=null;}_encrypting=setTimeout('$( \'#result\' ).val( ez.aes.encrypt( $( \'#key\' ).val(), $( \'#text\' ).val() ) ); _encrypting = null',500);});enableHover();});var timeDiff={time:undefined,setStartTime:function(){d=new Date();this.time=d.getTime();},getDiff:function(){d=new Date();return d.getTime()-this.time;}};function stringBreak(str,col){var result='';for(var i=0;i<str.length;i++){result+=str.charAt(i);if(((i+1)%col==0)&&(0<i)){result+="\n";}}return result;}function generateKey(){var index='abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';var key='';for(var i=1;i<25;i++){key+=index[Math.floor(Math.random()*index.length)]};return key;}function enableHover(){$('#en').hover(function(){$('#result').show();$('#result').focus();},function(){$('#result').hide();$('#text').focus();});}function decrypt(cipher,data){$('#insertkey').hide();timeDiff.setStartTime();var output=ez.aes.decrypt(cipher,data);var diff=timeDiff.getDiff();$('#execute').html('decryption: '+diff+'ms');$('.cm-s-default').parent().show();return output;}function encrypt(cipher,data){return stringBreak(ez.aes.decrypt(cipher,data),96);}function requestData(password){var url=window.location.href;var hash=window.location.hash;var index_of_hash=url.indexOf(hash)||url.length;var hashless_url=url.substr(0,index_of_hash);$.ajax({url:hashless_url,type:'POST',dataType:'json',data:'&p='+password,cache:false,success:function(json){$('#result').val(json.data);$('#syntax').val(json.syntax);editor.setOption('mode',$('#syntax').val());if(hash==''){$('#askpassword').hide();$('#insertkey').show();$('#typekey').focus();}else
-{$('#askpassword').hide();editor.setValue(decrypt(hash.substring(1),$('#result').val()));}},error:function(){alert('bad password!');}});}function submitData(){if($('#text').val()==''){return false;}else if(_encrypting==null&&$('#result').val()==''&&$('#text').val()!=''){ezcrypt(lib,function(){ez=this;$('#result').val(encrypt($('#key').val(),$('#text').val()));});}else if(_encrypting!=null&&$('#text').val()!=''){setTimeout('submitData()',100);return false;}$('#en').unbind('mouseenter mouseleave');$('#result').show();var data=$('#result').val();data=encodeURIComponent(data);var password='';if($('#usepassword').is(':checked')){ezcrypt(lib,function(){password=this.sha($('#typepassword').val());});}var ttl=$('#ttl option:selected').val();var syntax=$('#syntax option:selected').val();$.ajax({url:'/',type:'POST',dataType:'json',data:'&data='+data+'&p='+password+'&ttl='+ttl+'&syn='+syntax,cache:false,success:function(json){window.location='/'+json.id+'#'+$('#key').val();},error:function(){enableHover();alert('error submitting form');}});}
+var editor;var ez;var _encrypting=null;$LAB.setGlobalDefaults({UseLocalXHR:true,AlwaysPreserveOrder:false,AllowDuplicates:true});$(function(){if(document.getElementById('content')){editor=CodeMirror.fromTextArea(document.getElementById('content'),{lineNumbers:true,matchBrackets:false,lineWrapping:false,readOnly:true});editor.setOption('mode',$('#syntax').val());editor.focus();}$('#key').val(generateKey());$('#text').live('keydown',function(e){if(e.keyCode==13&&e.ctrlKey){$('#en').click();}});$('#usepassword').change(function(){if(this.checked){$('#typepassword').show();}else{$('#typepassword').hide();}});$('#text').bind('textchange',function(){if(_encrypting!=null){clearTimeout(_encrypting);_encrypting=null;}_encrypting=setTimeout('$( \'#result\' ).val( encrypt( $( \'#key\' ).val(), $( \'#text\' ).val() ) ); _encrypting = null',500);});$('#new').bind('click',function(){$('#text').html('');$('#result').val('');$('#newpaste').slideDown();});$('#clone').bind('click',function(){$('#text').html(editor.getValue()).trigger('textchange');$('#newpaste').slideDown();});$('#tool-wrap').bind('click',function(){var checked=$('#tool-wrap').is(':checked');if(checked==1){$('.tool-wrap').addClass('tool-wrap-on');editor.setOption('lineWrapping',true);}else
+{$('.tool-wrap').removeClass('tool-wrap-on');editor.setOption('lineWrapping',false);}});$('#tool-numbers').bind('click',function(){var checked=$('#tool-numbers').is(':checked');if(checked==1){$('.tool-numbers').addClass('tool-numbers-on');editor.setOption('lineNumbers',true);}else
+{$('.tool-numbers').removeClass('tool-numbers-on');editor.setOption('lineNumbers',false);}});enableHover();});var timeDiff={time:undefined,setStartTime:function(){d=new Date();this.time=d.getTime();},getDiff:function(){d=new Date();return d.getTime()-this.time;}};function stringBreak(str,col){var result='';for(var i=0;i<str.length;i++){result+=str.charAt(i);if(((i+1)%col==0)&&(0<i)){result+="\n";}}return result;}function generateKey(){var index='abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';var key='';for(var i=1;i<25;i++){key+=index[Math.floor(Math.random()*index.length)]};return key;}function enableHover(){$('#en').hover(function(){$('#result').show();$('#result').focus();},function(){$('#result').hide();$('#text').focus();});}function decrypt(cipher,data){$('#decrypting').show();$('#insertkey').hide();timeDiff.setStartTime();var output=ez.aes.decrypt(cipher,data);var diff=timeDiff.getDiff();$('#execute').html('decryption: '+diff+'ms');$('.cm-s-default').parent().show();$('#decrypting').hide();return output;}function encrypt(cipher,data){return stringBreak(ez.aes.encrypt(cipher,data),96);}function requestData(password){var url=window.location.href;var hash=window.location.hash;var index_of_hash=url.indexOf(hash)||url.length;var hashless_url=url.substr(0,index_of_hash);$.ajax({url:hashless_url,type:'POST',dataType:'json',data:'&p='+password,cache:false,success:function(json){$('#data').val(json.data);$('#syntax').val(json.syntax);editor.setOption('mode',$('#syntax').val());if(hash==''){$('#askpassword').hide();$('#insertkey').show();$('#typekey').focus();}else
+{$('#askpassword').hide();editor.setValue(decrypt(hash.substring(1),$('#data').val()));}},error:function(){alert('bad password!');}});}function submitData(){if($('#text').val()==''){return false;}else if(_encrypting==null&&$('#result').val()==''&&$('#text').val()!=''){ezcrypt(lib,function(){ez=this;$('#result').val(encrypt($('#key').val(),$('#text').val()));});}else if(_encrypting!=null&&$('#text').val()!=''){setTimeout('submitData()',100);return false;}$('#en').unbind('mouseenter mouseleave');$('#result').show();var data=$('#result').val();data=encodeURIComponent(data);var password='';if($('#usepassword').is(':checked')){ezcrypt(lib,function(){password=this.sha($('#typepassword').val());});}var ttl=$('#ttl option:selected').val();var syntax=$('#syntax option:selected').val();if(typeof(syntax)=='undefined'){syntax=$('#syntax').val();}$.ajax({url:'/',type:'POST',dataType:'json',data:'&data='+data+'&p='+password+'&ttl='+ttl+'&syn='+syntax,cache:false,success:function(json){window.location='/'+json.id+'#'+$('#key').val();},error:function(){enableHover();alert('error submitting form');}});}
View
55 www/inc/jslibs/core.js
@@ -10,7 +10,6 @@
var editor; // syntax highlighter
var ez; // object holder of ezcrypto library
var _encrypting = null; // used as flag state to determine if encryption is in mid-progress
-var lib = 'CRYPTO_JS';
// default options for our lazy loader
$LAB.setGlobalDefaults( {
@@ -34,11 +33,48 @@ $( function() {
editor.focus();
}
+ $( '#key' ).val( generateKey() );
+
+ // support ctrl+enter to send paste
+ $( '#text' ).live( 'keydown', function( e ) { if( e.keyCode == 13 && e.ctrlKey ) { $( '#en' ).click(); } } );
+
+ $( '#usepassword' ).change( function() { if( this.checked ) { $( '#typepassword' ).show(); } else { $( '#typepassword' ).hide(); } } );
+
// when we detect the text has changed we flag the encryption to trigger off 500ms afterwards
// if more text gets entered the trigger will continue resetting as not to cause unwanted CPU usage
$( '#text' ).bind( 'textchange', function() {
if( _encrypting != null ) { clearTimeout( _encrypting ); _encrypting = null; }
- _encrypting = setTimeout( '$( \'#result\' ).val( ez.aes.encrypt( $( \'#key\' ).val(), $( \'#text\' ).val() ) ); _encrypting = null', 500 );
+ _encrypting = setTimeout( '$( \'#result\' ).val( encrypt( $( \'#key\' ).val(), $( \'#text\' ).val() ) ); _encrypting = null', 500 );
+ } );
+
+ $( '#new' ).bind( 'click', function() { $( '#text' ).html( '' ); $( '#result' ).val( '' ); $( '#newpaste' ).slideDown(); } );
+ $( '#clone' ).bind( 'click', function() { $( '#text' ).html( editor.getValue() ).trigger( 'textchange' ); $( '#newpaste' ).slideDown(); } );
+
+ $( '#tool-wrap' ).bind( 'click', function() {
+ var checked = $( '#tool-wrap' ).is( ':checked' );
+ if( checked == 1 )
+ {
+ $( '.tool-wrap' ).addClass( 'tool-wrap-on' );
+ editor.setOption( 'lineWrapping', true );
+ }
+ else
+ {
+ $( '.tool-wrap' ).removeClass( 'tool-wrap-on' );
+ editor.setOption( 'lineWrapping', false );
+ }
+ } );
+ $( '#tool-numbers' ).bind( 'click', function() {
+ var checked = $( '#tool-numbers' ).is( ':checked' );
+ if( checked == 1 )
+ {
+ $( '.tool-numbers' ).addClass( 'tool-numbers-on' );
+ editor.setOption( 'lineNumbers', true );
+ }
+ else
+ {
+ $( '.tool-numbers' ).removeClass( 'tool-numbers-on' );
+ editor.setOption( 'lineNumbers', false );
+ }
} );
enableHover();
@@ -100,13 +136,18 @@ function enableHover()
// simple function wrapper to decryption time can be logged
function decrypt( cipher, data )
{
+ // display decrypt buffering image..
+ $( '#decrypting' ).show();
+ // hide key field
$( '#insertkey' ).hide();
+ // start timer and decrypt
timeDiff.setStartTime();
var output = ez.aes.decrypt( cipher, data );
var diff = timeDiff.getDiff();
-
+ // display duration
$( '#execute' ).html( 'decryption: ' + diff + 'ms');
$( '.cm-s-default' ).parent().show();
+ $( '#decrypting' ).hide();
return output;
}
@@ -114,7 +155,7 @@ function decrypt( cipher, data )
// @todo: add timestamp on encrypting?
function encrypt( cipher, data )
{
- return stringBreak( ez.aes.decrypt( cipher, data ), 96 );
+ return stringBreak( ez.aes.encrypt( cipher, data ), 96 );
}
// when a password is assigned to a paste
@@ -135,7 +176,7 @@ function requestData( password )
cache: false,
success: function( json ) {
// success, assign the data accordingly
- $( '#result' ).val( json.data );
+ $( '#data' ).val( json.data );
$( '#syntax' ).val( json.syntax );
editor.setOption( 'mode', $( '#syntax' ).val() );
if( hash == '' )
@@ -149,7 +190,7 @@ function requestData( password )
{
// decrypt our data
$( '#askpassword' ).hide();
- editor.setValue( decrypt( hash.substring( 1 ), $( '#result' ).val() ) );
+ editor.setValue( decrypt( hash.substring( 1 ), $( '#data' ).val() ) );
}
},
error: function() {
@@ -197,6 +238,8 @@ function submitData()
var ttl = $( '#ttl option:selected' ).val();
var syntax = $( '#syntax option:selected' ).val();
+ // if syntax is empty, try hidden element incase of clone feature
+ if( typeof( syntax ) == 'undefined' ) { syntax = $( '#syntax' ).val(); }
// send submission to server
$.ajax( {
View
2  www/inc/jslibs/crypt-0.4.min.js
@@ -9,7 +9,7 @@
* functions should work right out of the box
*
**/
-(function(window,undefined){try{if(typeof(jQuery)=='undefined'){throw'';}}catch(e){throw'ezcrypt depends on jQuery!';}try{if(typeof($LAB)=='undefined'){throw'';}}catch(e){throw'ezcrypt depends on $LAB!';}if(typeof(ezcrypt)=='undefined'){ezcrypt={};}var window=window,document=window.document,navigator=window.navigator,location=window.location;ezcrypt=function(type,func){if(typeof(window.ez)=='object'){return window.ez;}_this=this;_loaded=false;_aesobj=null;_type={};libs={ENCRYPT_TYPE:{'CLIPPERZ':{'lib':['inc/jslibs/clipperz/MochiKit/MochiKit.js','inc/jslibs/clipperz/MochiKit/Base.js','inc/jslibs/clipperz/MochiKit/Logging.js','inc/jslibs/clipperz/JSON/json2.js','inc/jslibs/clipperz/YUI/Utils.js','inc/jslibs/clipperz/Base.js','inc/jslibs/clipperz/ByteArray.js','inc/jslibs/clipperz/Crypto/SHA.js','inc/jslibs/clipperz/Crypto/AES.js'],'load':'','decrypt':{'func':'Clipperz.Crypto.AES.decrypt','params':{}},'encrypt':{'func':'Clipperz.Crypto.AES.encrypt','key':{'func':'Clipperz.Crypto.SHA.sha256','params':{'func':'Clipperz.ByteArray'}},'block':'Clipperz.ByteArray','params':{}},'sha':'Clipperz.Crypto.SHA.sha256'},'CRYPTO_JS':{'lib':['inc/jslibs/crypto-js/crypto/crypto.js','inc/jslibs/crypto-js/sha1/sha1.js','inc/jslibs/crypto-js/hmac/hmac.js','inc/jslibs/crypto-js/pbkdf2/pbkdf2.js','inc/jslibs/crypto-js/blockmodes/blockmodes.js','inc/jslibs/crypto-js/aes/aes.js'],'load':'','decrypt':{'func':'Crypto.AES.decrypt','params':{}},'encrypt':{'func':'Crypto.AES.encrypt','params':{}},'sha':'Crypto.SHA1'},'GIBBERISH_AES':{},'JSAES':{},'JSCRYPTOLIB':{},'MOVEABLE_TYPE':{},'PIDCRYPT':{'lib':['inc/jslibs/pidCrypt/pidcrypt_util.js','inc/jslibs/pidCrypt/pidcrypt.js','inc/jslibs/pidCrypt/md5.js','inc/jslibs/pidCrypt/aes_core.js','inc/jslibs/pidCrypt/aes_cbc.js'],'load':'pidCrypt.AES.CBC','decrypt':{'func':'decryptText','params':{nBits:128}},'encrypt':{'func':'encryptText','params':{nBits:128}},'sha':'pidCrypt.SHA1'},'SJCL':{},'SLOWAES':{},},type:function(name){try
+(function(window,undefined){try{if(typeof($LAB)=='undefined'){throw'';}}catch(e){throw'ezcrypt depends on $LAB!';}if(typeof(ezcrypt)=='undefined'){ezcrypt={};}var window=window,document=window.document,navigator=window.navigator,location=window.location;ezcrypt=function(type,func){if(typeof(window.ez)=='object'){return window.ez;}_this=this;_loaded=false;_aesobj=null;_type={};libs={ENCRYPT_TYPE:{'CLIPPERZ':{'lib':['inc/jslibs/clipperz/MochiKit/MochiKit.js','inc/jslibs/clipperz/MochiKit/Base.js','inc/jslibs/clipperz/MochiKit/Logging.js','inc/jslibs/clipperz/JSON/json2.js','inc/jslibs/clipperz/YUI/Utils.js','inc/jslibs/clipperz/Base.js','inc/jslibs/clipperz/ByteArray.js','inc/jslibs/clipperz/Crypto/SHA.js','inc/jslibs/clipperz/Crypto/AES.js'],'load':'','decrypt':{'func':'Clipperz.Crypto.AES.decrypt','params':{}},'encrypt':{'func':'Clipperz.Crypto.AES.encrypt','key':{'func':'Clipperz.Crypto.SHA.sha256','params':{'func':'Clipperz.ByteArray'}},'block':'Clipperz.ByteArray','params':{}},'sha':'Clipperz.Crypto.SHA.sha256'},'CRYPTO_JS':{'lib':['inc/jslibs/crypto-js/crypto/crypto.js','inc/jslibs/crypto-js/sha1/sha1.js','inc/jslibs/crypto-js/hmac/hmac.js','inc/jslibs/crypto-js/pbkdf2/pbkdf2.js','inc/jslibs/crypto-js/blockmodes/blockmodes.js','inc/jslibs/crypto-js/aes/aes.js'],'load':'','decrypt':{'func':'Crypto.AES.decrypt','params':{}},'encrypt':{'func':'Crypto.AES.encrypt','params':{}},'sha':'Crypto.SHA1'},'GIBBERISH_AES':{},'JSAES':{},'JSCRYPTOLIB':{},'MOVEABLE_TYPE':{},'PIDCRYPT':{'lib':['inc/jslibs/pidCrypt/pidcrypt_util.js','inc/jslibs/pidCrypt/pidcrypt.js','inc/jslibs/pidCrypt/md5.js','inc/jslibs/pidCrypt/aes_core.js','inc/jslibs/pidCrypt/aes_cbc.js'],'load':'pidCrypt.AES.CBC','decrypt':{'func':'decryptText','params':{nBits:128}},'encrypt':{'func':'encryptText','params':{nBits:128}},'sha':'pidCrypt.SHA1'},'SJCL':{},'SLOWAES':{},},type:function(name){try
{if(typeof(this.ENCRYPT_TYPE[name])!='undefined'){return true;}throw'';}catch(e){throw'Invalid encryption type specified!';}},get:function(name){if(this.type(name)==true){return this.ENCRYPT_TYPE[name];}},length:function(){var l=0;for(var enc in this.ENCRYPT_TYPE){if(this.ENCRYPT_TYPE.hasOwnProperty(enc)){l++}}return l;}};prep=function(func,context){var namespaces=func.split('.');for(var n=0;n<namespaces.length;n++){if(typeof(context[namespaces[n]])=='undefined'){throw'Unknown namespace: '+namespaces[n];}context=context[namespaces[n]];}return context;};load=function(func,context){try
{var args=Array.prototype.slice.call(arguments,2);context=_this.prep(func,context);return new context(args);}catch(e){throw e;}};call=function(func,context){try
{var args=Array.prototype.slice.call(arguments,2);context=_this.prep(func,context);return context.apply(_this,args);}catch(e){throw e;}};aes={encrypt:function(key,block){if(_type['encrypt']['block']){block=_this.load(_type['encrypt']['block'],window,block);}var result='';if(_aesobj){if(!jQuery.isEmptyObject(_type['encrypt']['params'])){return _aesobj[_type['encrypt']['func']](block,key,_type['encrypt']['params']);}else
View
1  www/inc/jslibs/crypt.js
@@ -10,7 +10,6 @@
*
**/
( function( window, undefined ) {
- try { if( typeof( jQuery ) == 'undefined' ) { throw ''; } } catch( e ) { throw 'ezcrypt depends on jQuery!'; }
try { if( typeof( $LAB ) == 'undefined' ) { throw ''; } } catch( e ) { throw 'ezcrypt depends on $LAB!'; }
if( typeof( ezcrypt ) == 'undefined' ) { ezcrypt = {}; }
View
9 www/inc/paste.class.php
@@ -169,6 +169,15 @@ function has_expired()
return false;
}
+ function get_crypto()
+ {
+ // default to crypto-js
+ if( empty( $this->paste ) ) { return 'CRYPTO_JS'; }
+
+ // return the type of crypto that was used for the paste
+ return $this->paste['crypto'];
+ }
+
function selected_syntax( $syntax )
{
// determine if syntax is the one selected
View
11 www/tpl/includes/header.tpl
@@ -9,6 +9,7 @@
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="stylesheet" href="/css/styles.min.css" />
+ <link rel="shortcut icon" href="/favicon.ico" />
<!--[if gte IE 9]>
<style type="text/css">
@@ -17,6 +18,8 @@
<![endif]-->
<script type="text/javascript">
+ var lib = '<?php echo ( !empty( $pastes ) ) ? $pastes->get_crypto() : 'CRYPTO_JS'; ?>';
+
// holder object to store jquery commands until jquery is loaded up
window.$ = ( function() {
var q = [], f = function( cb ) {
@@ -44,11 +47,11 @@
</div>
<div id="menu">
<a href="/">Home</a>
- <span class="small">&nbsp;&diams;&nbsp;</span>
+ <span class="small">&nbsp;</span>
<a href="/about">About</a>
- <span class="small">&nbsp;&diams;&nbsp;</span>
+ <span class="small">&nbsp;</span>
<a href="mailto:contact@ezcrypt.it">Contact</a>
- <span class="small">&nbsp;&diams;&nbsp;</span>
- <a href="https://github.com/novaking/ezcrypt" target="_blank">Code</a>
+ <span class="small">&nbsp;</span>
+ <a href="https://github.com/novaking/ezcrypt" target="_blank">Sourcecode</a>
</div>
<div id="main">
View
9 www/tpl/new.tpl
@@ -43,8 +43,6 @@ N0h5DmJUWq33D/BPdbpoHt0IFesJzsgt5dlXPF/zyFeJvDwlKCe3lqfym2f5fJG3YQRV1YqAtEKm9d9E
};
$( function() {
-
- $( '#key' ).val( generateKey() );
editor.setOption( 'readOnly', true );
editor.setOption( 'mode', 'application/x-httpd-php' );
@@ -54,11 +52,6 @@ N0h5DmJUWq33D/BPdbpoHt0IFesJzsgt5dlXPF/zyFeJvDwlKCe3lqfym2f5fJG3YQRV1YqAtEKm9d9E
ez = this;
editor.setValue( ez.aes.decrypt( 'MzksNTIsMTU5LDc4LDQ1LDQ1LDEwMSwxMjEsMTY2LDE4LDI4LDE3NSwyMzIsMTU1LDI5LDE1MSw4MCw1MSw1NCwxMTUsMTcsNTgsNjQsMjQxLDI0OSwxNDEsMTk1LDk3LDk0LDcsOSwyNDU=', welcome[lib] ) );
} );
-
- // support ctrl+enter to send paste
- $( '#text' ).live( 'keydown', function( e ) { if( e.keyCode == 13 && e.ctrlKey ) { $( '#en' ).click(); } } );
-
- $( '#usepassword' ).change( function() { if( this.checked ) { $( '#typepassword' ).show(); } else { $( '#typepassword' ).hide(); } } );
} );
</script>
@@ -121,7 +114,7 @@ N0h5DmJUWq33D/BPdbpoHt0IFesJzsgt5dlXPF/zyFeJvDwlKCe3lqfym2f5fJG3YQRV1YqAtEKm9d9E
<textarea id="result" name="result" readonly spellcheck="false"></textarea>
</div>
- <div style="margin-top: 5px;">
+ <div id="options">
<acronym title="Expire this paste after the period of time selected">Expire in</acronym>
<select id="ttl">
<option value="300">five minutes</option>
View
44 www/tpl/paste.tpl
@@ -10,12 +10,10 @@
ez = this;
var key = window.location.hash.substring( 1 );
- var data = $( '#result' ).val();
+ var data = $( '#data' ).val();
if( key != '' && data != '' )
{
- editor.setValue( decrypt( window.location.hash.substring( 1 ), $( '#result' ).val() ) );
-
- $( '#wrap' ).bind( 'click', function() { var checked = $( '#wrap' ).is( ':checked' ); if( checked == 1 ) { editor.setOption( 'lineWrapping', true ); } else { editor.setOption( 'lineWrapping', false ); } } );
+ editor.setValue( decrypt( window.location.hash.substring( 1 ), data ) );
$( '#wrapholder' ).show();
}
else
@@ -60,15 +58,45 @@ JS;
<div id="insertkey">
Enter key to decrypt:&nbsp;
<input type="text" id="typekey" style="width: 450px;" autocomplete="off" />&nbsp;
- <input type="button" value="Decrypt" onclick="window.location = '#' + $( '#typekey' ).val(); editor.setValue( decrypt( $( '#typekey' ).val(), $( '#result' ).val() ) );" />
+ <input type="button" value="Decrypt" onclick="window.location = '#' + $( '#typekey' ).val(); editor.setValue( decrypt( $( '#typekey' ).val(), $( '#data' ).val() ) );" />
</div>
<input type="hidden" name="syntax" id="syntax" value="<?=$syntax;?>" />
- <input type="hidden" name="result" id="result" value="<?=$paste;?>" />
+ <input type="hidden" name="data" id="data" value="<?=$paste;?>" />
- <div id="wrapholder" style="float: right; display: none;">
- <label for="wrap">Wrap Lines</label> <input type="checkbox" id="wrap" />
+ <div id="newpaste">
+ <div style="position: relative;">
+ <textarea id="text" name="text" spellcheck="false"></textarea>
+ <textarea id="result" name="result" readonly spellcheck="false"></textarea>
+ </div>
+ <div id="options">
+ <acronym title="Expire this paste after the period of time selected">Expire in</acronym>
+ <select id="ttl">
+ <option value="300">five minutes</option>
+ <option value="3600">an hour</option>
+ <option value="86400">a day</option>
+ <option value="604800" selected="selected">a week</option>
+ <option value="2592000">a month</option>
+ <option value="31536000">a year</option>
+ <option value="-1">indefinately</option>
+ </select>
+ &nbsp;|&nbsp;
+ <label for="usepassword"><acronym title="This password is not used to encrypt the paste">Assign password</acronym></label>&nbsp;<input id="usepassword" type="checkbox" name="usepassword" value="1" />
+ <input type="text" id="typepassword" name="password" style="display: none;" />
+
+ <input type="hidden" id="key" name="key" />
+ <input type="submit" id="en" value="Submit" onclick="return submitData();" style="float: right;" />
+ </div>
+ </div>
+
+ <div id="wrapholder">
+ <a id="new">New</a>
+ <a id="clone">Clone</a>
+ <label class="tool-numbers tool-numbers-on" for="tool-numbers" title="Toggle Numbers"></label> <input type="checkbox" checked="checked" id="tool-numbers" />
+ <label class="tool-wrap" for="tool-wrap" title="Wrap Lines"></label> <input type="checkbox" id="tool-wrap" />
</div>
<div id="wrap" style="clear: both;"></div>
+
+ <div id="decrypting" style="position: absolute; left: 40px; margin-top: 5px; z-index: 100; width: 875px; height: 15px; background: url(/css/decrypting.gif) top left no-repeat;"></div>
<input type="hidden" id="content" />
<div id="execute"></div>
Please sign in to comment.
Something went wrong with that request. Please try again.