1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Drop privilege

This commit is contained in:
sam 2012-04-29 04:51:54 +07:00
parent ea93fcf35e
commit 1a4c5d399b
6 changed files with 80 additions and 73 deletions

View File

@ -16,3 +16,14 @@ DEBUG = True
# default in projectdirectory/static/content/
# use "/" even under Windows
PASTE_FILES_ROOT = os.path.join(STATIC_FILES_ROOT, 'content')
# Port and host the embeded python server should be using in prod and in dev
PROD_HOST = "0.0.0.0"
PROD_PORT= "80"
DEV_HOST = "127.0.0.1"
DEV_PORT= "8000"
# User and group the server should run as. Set to None if it should be the
# current user
USER = None
GROUP = None

View File

@ -156,10 +156,9 @@ li.L5, li.L6, li.L7, li.L8, li.L9
background: inherit;
}
#clip-container div:hover,
#clip-button:hover,
#clip-button a:hover{
a#clip-button.hover{
cursor:pointer;
text-decoration:underline;
}
#copy-success, #short-url-success {

View File

@ -134,7 +134,7 @@ ZeroClipboard.Client.prototype = {
}
}
// style.backgroundColor = '#f00'; // debug
//style.backgroundColor = '#f00'; // debug
appendElem.appendChild(this.div);

View File

@ -81,6 +81,13 @@ zerobin = {
}else{
return 'Sorry your browser does not support LocalStorage, We cannot display your previous pastes.';
}
},
get_paste_content: function(){
var content_clone = '' ;
$("#paste-content li").each(function(index) {
content_clone = content_clone + $(this).text() + '\n';
});
return content_clone;
}
};
@ -152,17 +159,15 @@ if (content && key) {
/* Setup flash clipboard button */
ZeroClipboard.setMoviePath('/static/js/ZeroClipboard.swf' );
var clip = new ZeroClipboard.Client();
clip.addEventListener('onMouseUp', function(){
clip.setText($('#paste-content').text());
var clip = new ZeroClipboard.Client();
clip.addEventListener('mouseup', function(){
clip.setText(zerobin.get_paste_content());
});
clip.addEventListener('complete', function(){
$('#copy-success').show('fadeUp');
$('#copy-success').show('fadeUp', function(){clip.reposition()});
});
clip.addEventListener('onLoad', function(){
});
clip.glue('clip-button', 'clip-container' );
clip.glue('clip-button');
window.onresize = clip.reposition;
}
@ -200,10 +205,7 @@ $('.previous-pastes .items').html(zerobin.get_pastes());
/* clone a paste */
$('.btn-clone').click(function(e){
e.preventDefault();
var content_clone = '' ;
$("#paste-content li").each(function(index) {
content_clone = content_clone + $(this).text() + '\n';
});
var content_clone = zerobin.get_paste_content();
$('.submit-form').show();
$('.paste-form').remove();
$('#content').val(content_clone);

File diff suppressed because one or more lines are too long

View File

@ -22,9 +22,8 @@
<div class="well paste-form">
<form action="/" method="get" accept-charset="utf-8">
<p>
<span id="clip-container" style="position:relative">
<a id="clip-button">Copy To Clipboard</a>
</span> |
|
<a id="short-url" href=""
target="_blank">Get short url</a>