Dropbox Direct Links

Displays direct link to shared file for embedding purposes

05.08.2014 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Dropbox Direct Links
// @namespace    https://github.com/phracker
// @version      0.1
// @description  Displays direct link to shared file for embedding purposes
//
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.5/ZeroClipboard.js
// @match        http*://*.dropbox.com/s/*/*
// ==/UserScript==

// direct url
var durl = document.URL.replace('www.dropbox.com','dl.dropboxusercontent.com').replace('?m=','');

var div = document.createElement('div');
div.setAttribute('align','center');

div.setAttribute('style','font-size: 12px; vertical-align: middle;');
var a = document.createElement('a');
a.href = durl;
a.setAttribute('style','text-decoration: none;');
a.textContent = durl;

var b = document.createElement('button');
b.setAttribute('id','durl');
b.setAttribute('data-clipboard-text',durl);
b.setAttribute('title','Copy URL');
b.setAttribute('style','font-size: 10px; padding: 0px 6px; margin-left: 1em; font-weight: 800;');
b.setAttribute('class','freshbutton-lightblue');
b.appendChild(document.createTextNode('Copy'));
div.appendChild(document.createTextNode('Direct: '));
div.appendChild(a);
div.appendChild(b);
document.getElementById('page-content').appendChild(div);

ZeroClipboard.config( { swfPath: "https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.5/ZeroClipboard.swf" } );
var zc = new ZeroClipboard( $('#durl') );
zc.on( 'ready', function (event) {
  console.log('movie is loaded');
  zc.on('copy',function (event) {
    event.clipboardData.setData('text/plain', durl);
    console.log('Copied');
  } );
} );