Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed title functionality and minor style updates

  • Loading branch information...
commit 3d572f4b035e076aae5a754788961bf0d4a5da50 1 parent 32ec833
Dale authored
View
12 _attachments/index.html
@@ -19,15 +19,12 @@
<div id="pastewrapper"><div id="pastearea">
- <input type="button" value="Edit Code" id="viewcode" class="btn" />
-
<form action="" id="form">
- <input type="text" id="title" tabindex="1" value="" />
+
<iframe id="paste"></iframe>
- <div id="wrapper">
- <div id="lines"></div>
- <textarea id="code" tabindex="2"></textarea>
- </div>
+ <div id="lines"></div>
+ <textarea id="code" tabindex="2"></textarea>
+
<div id="templates">
<strong>templates: </strong>
<ul>
@@ -46,6 +43,7 @@
</div></div>
<div id="toolbar">
+ <input class="btn disabled" id="viewcode" value="Edit This Paste" />
<div id="new">
<a class="btn">New Paste</a>
</div>
View
82 _attachments/paste.css
@@ -8,6 +8,10 @@ textarea {
font: 12px normal courier, monospace;
}
+input, textarea {
+ outline:none;
+}
+
p {
font: 10px normal arial, Sans-Serif;
}
@@ -18,6 +22,7 @@ em {
body {
background: #EEE;
+ overflow:hidden;
}
ul {
@@ -28,41 +33,42 @@ ul {
color: #666;
}
-#templates, #title, #save, #lines, #code, #paste, #error, #viewcode {
+#viewcode.disabled {
+ opacity:0.5;
+}
+#viewcode.disabled:hover {
+ color: #666;
+ border-color: #CCC #999 #999 #CCC;
+}
+
+#templates, #save, #lines, #code, #paste, #error {
display:none;
}
#pastewrapper {
- padding: 0px 270px 0px 0px;
+ padding: 0px 195px 0px 0px;
}
#pastearea {
position: relative;
- padding: 5px 10px 25px 10px;
+ padding: 10px 10px 0px 10px;
width: 100%;
}
#paste {
- width: 100%;
+ position:absolute;
padding-left:3px;
border: 1px solid #CCC;
background: white;
}
#code {
- width: 100%;
+ position:absolute;
margin-bottom: 4px;
- padding-left: 3px;
- border: 1px solid #9CFF00;
- z-index: 9999;
-}
-
-#viewcode {
- position: absolute;
- top: 6px;
- padding: 3px;
- right: 6px;
- z-index: 9999999;
+ padding-left: 29px;
+ border: 1px solid;
+ border-color: #9CFF00 #99BB33 #99BB33 #9CFF00;
+ z-index: 99;
}
#recent a {
@@ -78,20 +84,9 @@ ul {
color: #B6C0D2;
}
-#title {
- font: italic 18px arial, sans-serif;
- border: 0px solid #CCC;
- padding: 2px;
- background: transparent;
- margin-bottom: 2px;
- margin-right: 200px;
- width: 100%;
- z-index: 99999;
-}
-
#recent {
padding: 5px;
- width: 210px;
+ width: 150px;
}
#recent h3 {
@@ -101,8 +96,8 @@ ul {
#toolbar {
position: absolute;
- top: 23px;
- right: 20px;
+ top: 10px;
+ right: 10px;
}
#postlist a, #postlist span {
@@ -110,6 +105,10 @@ ul {
}
#templates {
+ position:absolute;
+ bottom:9px;
+ margin-left:2px;
+ width:400px;
height: 12px;
line-height: 12px;
}
@@ -174,30 +173,29 @@ ul {
}
#new a {
- display: block;
+ display:block;
margin: 10px 0px;
padding: 10px;
- font: 16px arial, sans-serif;
+ font: bold 12px arial, sans-serif;
}
+#viewcode { padding:10px 0px; width:100%; font: 12px arial, sans-serif;
+ cursor:default; }
+
#lines {
position: absolute;
font: 12px normal courier, monospace;
text-align: right;
- left: 0px;
+ margin: 1px 0px 1px 1px;
width: 22px;
color: #666;
padding-right: 3px;
overflow: hidden;
background: #E6E6E6;
- border-color: #9CFF00 #CCC #9CFF00 #9CFF00;
- border-width: 1px;
- border-style: solid;
-}
-
-#wrapper {
- position: relative;
- padding-left: 25px;
+ border-color: transparent #CCC transparent transparent;
+ border-width: 1px;
+ border-style: solid;
+ z-index:99999;
}
#error {
@@ -218,7 +216,7 @@ ul {
#save {
position: absolute;
- bottom: 10px;
+ bottom: 0px;
right: 5px;
padding: 4px;
font: bold 12px arial, sans-serif;
View
56 _attachments/paste.js
@@ -15,7 +15,6 @@ Paste = function() {
this.dom = {
textarea: $("#code"),
iframe: $("#paste"),
- title: $("#title"),
viewcode: $("#viewcode"),
form: $("#form"),
lines: $("#lines")
@@ -27,18 +26,17 @@ Paste = function() {
this.load_recent_posts();
this.add_events();
+ this.window_resize();
if( !this.state.NEW_POST ) {
this.retrieve_post(this.state_id);
} else {
document.title = "Pastebin.me - New Post";
- this.dom.title.val("[Enter Title Here]");
this.dom.textarea.show();
this.dom.lines.show();
- $("#title, #templates, #save").show();
+ $("#templates, #save").show();
}
- this.window_resize();
this.fill_lines();
};
@@ -48,8 +46,7 @@ Paste.prototype.save_paste = function()
var paste = {
date: d.getTime(),
- paste: this.dom.textarea.val(),
- title: this.dom.title.val()
+ paste: this.dom.textarea.val()
};
$("#save").attr("disabled", "disabled").val("Saving...");
@@ -77,17 +74,12 @@ Paste.prototype.show_error = function(reason)
}, 2000);
};
-Paste.prototype.view_code = function()
+Paste.prototype.toggle = function()
{
this.dom.textarea.show();
this.dom.lines.show();
this.dom.iframe.hide();
- this.dom.viewcode.hide();
-
- var that = this;
- setTimeout( function() {
- that.dom.textarea[0].focus();
- });
+ this.dom.viewcode.addClass("disabled");
};
Paste.prototype.add_events = function()
@@ -116,20 +108,24 @@ Paste.prototype.add_events = function()
checkTab(e);
});
- this.dom.viewcode.bind('mousedown', function() {
- that.view_code();
- });
-
- this.dom.title.bind('focus', function() {
- if( $(this).val() == "[Enter Title Here]" ) {
- $(this).val("");
- }
+ this.dom.viewcode.bind('mousedown', function(e) {
+ that.toggle();
+ e.preventDefault();
+ e.stopPropagation();
});
};
Paste.prototype.window_resize = function()
{
- $("#code, #paste, #lines").height($(window).height() - 116);
+ var winheight = $(window).height(),
+ winwidth = $(window).width();
+
+ $("#code, #paste, #lines").height(winheight - 93);
+ $("#pastearea").height(winheight - 60);
+ $("#lines").height(winheight - 95);
+
+ $("#code").width(winwidth-222);
+ $("#paste").width(winwidth-195);
};
Paste.prototype.load_template = function(tpl)
@@ -141,7 +137,7 @@ Paste.prototype.load_template = function(tpl)
that.dom.textarea.val(data);
if( that.state !== "CODE" ) {
- that.view_code();
+ that.toggle();
}
}, "text");
@@ -162,7 +158,7 @@ Paste.prototype.load_recent_posts = function()
var ndate = prettyDate(this.key) || "the future!";
var date = ' <span class="subtle">('+ ndate +')</span>';
var link = '<li><a href="'+root + this.value.id+'">'
- +this.value.title+'</a>'+date+'</li>';
+ +ndate+'</a></li>';
$("#postlist").append(link);
});
}, "json");
@@ -187,24 +183,22 @@ Paste.prototype.retrieve_post = function( id )
"url":"/pastebin/"+this.state._id,
"dataType": "json",
"success": function(data) {
- document.title = "Pastebin.me - "+data.title;
- that.dom.title.val( data.title );
+
that.dom.textarea.text( data.paste );
if(data.paste.match(/<html/)) {
that.dom.iframe.attr("src", show+that.state._id);
that.dom.iframe.show();
- that.dom.viewcode.show();
+ that.dom.viewcode.removeClass("disabled");
} else {
that.dom.textarea.show();
that.dom.lines.show();
}
- $("#title, #templates, #save").show();
+ $("#templates, #save").show();
},
"error" : function(data) {
- that.view_code();
- that.dom.title.val("[Enter Title Here]");
- $("#title, #templates, #save").show();
+ that.toggle();
+ $("#templates, #save").show();
}
});
};
View
2  validate_doc_update.js
@@ -10,7 +10,7 @@ function (newDoc, oldDoc, userCtx) {
};
}
- if( !(newDoc.date && newDoc.paste && newDoc.title) ) {
+ if( !(newDoc.date && newDoc.paste ) ) {
throw {
forbidden: "Cannot post empty paste"
};
View
2  views/recent/map.js
@@ -3,6 +3,6 @@
function(doc) {
if( doc.paste ) {
- emit(doc.date, {id:doc._id, title:doc.title});
+ emit(doc.date, {id:doc._id});
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.