mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Merge branch 'master' of github.com:sametmax/0bin
This commit is contained in:
commit
4c97f43a08
10
README.md
10
README.md
@ -1,13 +1,13 @@
|
||||
0bin
|
||||
====
|
||||
|
||||
Have try here: <a href="0bin.net">0bin.net</a>
|
||||
Have try here: <a href="http://0bin.net">0bin.net</a>
|
||||
|
||||
0bin is client side encrypted pastebin that can run without a database.
|
||||
|
||||
It allows anybody to host a pastebin while welcoming any type of content to be pasted in it. The idea is that one can (probably...) not be legally entitled to moderate the pastebin content (http://www.zdnet.com/blog/security/pastebin-to-hunt-for-hacker-pastes-anonymous-cries-censorship/11336) as one has no way to decrypt it.
|
||||
It allows anybody to host a pastebin while welcoming any type of content to be pasted in it. The idea is that one can (probably...) not be legally entitled to <a href="http://www.zdnet.com/blog/security/pastebin-to-hunt-for-hacker-pastes-anonymous-cries-censorship/11336">moderate the pastebin content</a> as he/she has no way to decrypt it.
|
||||
|
||||
It's an Python implementation of the zerobin project (https://github.com/sebsauvage/ZeroBin/).
|
||||
It's an Python implementation of the <a href="https://github.com/sebsauvage/ZeroBin/">zerobin project</a>.
|
||||
|
||||
How it works
|
||||
=============
|
||||
@ -56,5 +56,5 @@ What does 0bin not implement?
|
||||
=================================
|
||||
|
||||
* Request throttling. It would be inefficient to do it at the app level, and web servers have robust implementations.
|
||||
* Hash collision: the ratio "probability it happens/consequence seriousness" is not worth it (http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions)
|
||||
* Comments: for now. It's no the todo list.
|
||||
* Hash collision: the ratio "probability it happens/consequence seriousness" <a href="http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions">is not worth it</a>
|
||||
* Comments: for now. It's on the todo list.
|
@ -142,15 +142,10 @@ zerobin = {
|
||||
},
|
||||
/** Get a tinyurl using JSONP */
|
||||
getTinyURL: function(longURL, success) {
|
||||
|
||||
callback = 'zerobin_tiny_url_callback';
|
||||
window[callback] = function(response){
|
||||
success(response.tinyurl);
|
||||
delete window[callback];
|
||||
};
|
||||
|
||||
var api = 'http://json-tinyurl.appspot.com/?url=';
|
||||
$.getJSON(api + encodeURIComponent(longURL) + '&callback=' + callback);
|
||||
$.getJSON(api + encodeURIComponent(longURL) + '&callback=?', function(data){
|
||||
success(data.tinyurl);
|
||||
});
|
||||
},
|
||||
|
||||
support: {
|
||||
@ -227,7 +222,7 @@ zerobin = {
|
||||
message: function(type, message, title, flush, callback) {
|
||||
|
||||
$(window).scrollTop(0);
|
||||
|
||||
|
||||
if (flush) {$('.alert-'+type).remove()}
|
||||
|
||||
$message = $('#alert-template').clone().attr('id', null)
|
||||
@ -373,21 +368,6 @@ if (content && key) {
|
||||
/* Add a continuation to let the UI redraw */
|
||||
setTimeout(function(){
|
||||
|
||||
/* Setup link to get the paste short url*/
|
||||
$('#short-url').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#short-url').text('Loading short url...');
|
||||
zerobin.getTinyURL(window.location.toString(), function(tinyurl){
|
||||
clip.setText(tinyurl);
|
||||
$('#copy-success').hide();
|
||||
zerobin.message('success',
|
||||
'<a href="' + tinyurk + '">' + tinyurk + '</a>',
|
||||
'Short url'
|
||||
)
|
||||
$('#short-url').text('Get short url');
|
||||
});
|
||||
});
|
||||
|
||||
/* Setup flash clipboard button */
|
||||
ZeroClipboard.setMoviePath('/static/js/ZeroClipboard.swf');
|
||||
|
||||
@ -403,6 +383,29 @@ if (content && key) {
|
||||
|
||||
window.onresize = clip.reposition;
|
||||
|
||||
|
||||
/* Setup link to get the paste short url*/
|
||||
$('#short-url').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#short-url').text('Loading short url...');
|
||||
zerobin.getTinyURL(window.location.toString(), function(tinyurl){
|
||||
clip.setText(tinyurl);
|
||||
$('#copy-success').hide();
|
||||
zerobin.message('success',
|
||||
'<a href="' + tinyurl + '">' + tinyurl + '</a>',
|
||||
'Short url', true, function(){clip.reposition()}
|
||||
)
|
||||
$('#short-url').text('Get short url');
|
||||
});
|
||||
});
|
||||
|
||||
/* Remap the message close handler to include the clipboard
|
||||
flash reposition */
|
||||
$(".close").die().live('click', function(e){
|
||||
e.preventDefault();
|
||||
$(this).parent().fadeOut(function(){clip.reposition()});
|
||||
});
|
||||
|
||||
/** Syntaxic coloration */
|
||||
prettyPrint();
|
||||
|
||||
@ -488,7 +491,8 @@ $('#file-upload').mouseover(function(){
|
||||
|
||||
/* Alerts */
|
||||
|
||||
$(".close").live('click', function(){
|
||||
$(".close").live('click', function(e){
|
||||
e.preventDefault();
|
||||
$(this).parent().fadeOut();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user