Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var root = "http://i1064.photobucket.com/albums/u361/Jaynabelle/";
- var folder = $('a.goalbum:contains(View)').html().split('View ')[1];
- if (folder.match(/library/gi)) {
- folder = "";
- } else {
- folder = folder + "/";
- }
- setInterval(button, 1000);
- function button() {
- if ($('#createlinks').length <= 0 && $('#filesUploading .completed').length > 0) {
- $('div.uploadThumbnails:last').after('<div id="createlinks"><input type="button" id="generatel" value="Generate Links" /></div><div id="link-group"></div>');
- }
- }
- setInterval(generatel, 1000);
- function generatel() {
- $('#generatel').click(function() {
- $('#filesUploading .completed').each(function() {
- var file = $(this).attr('title');
- if ($('.img-link:contains("' + file + '")').length <= 0) {
- $('#link-group').append('<div class="img-link" style="border: 1px dashed #555; border-radius: 5px; padding: 2px 4px 1px; margin: 2px 0; background-color: rgba(255, 255, 255, .3);">' + root + folder + file + '</div>');
- };
- });
- $('.img-link').click(function() {
- $(this).attr('id', 'link');
- selectAll('link');
- $(this).attr('id', '');
- });
- });
- }
- function selectAll(element) {
- var doc = document
- , text = doc.getElementById(element)
- , range, selection
- ;
- if (doc.body.createTextRange) {
- range = document.body.createTextRange();
- range.moveToElementText(text);
- range.select();
- } else if (window.getSelection) {
- selection = window.getSelection();
- range = document.createRange();
- range.selectNodeContents(text);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment