Greasy Fork is available in English.

Upload img

Upload image quickly for vozforums.com

À partir de 2014-12-24. Voir la dernière version.

// ==UserScript==
// @name         Upload img
// @version      0.0
// @description  Upload image quickly for  vozforums.com
// @namespace    idmresettrial
// @author       idmresettrial
// @run-at       document-end
// @grant        none

// Website list

// @match        *://*.vozforums.com/*
// @match        http://upanh.vietdesigner.net/?quickupload

// End list


// ==/UserScript==

editor = document.getElementsByClassName("vBulletin_editor");
pikvn_link = '<a href="http://pik.vn/" title="Upload ảnh nhanh tại pik.vn" target="_blank" onclick="return pikvn_popup();">pik.vn</a>';
imgur_link = '<a id="imgur_link" href="http://upanh.vietdesigner.net/" title="Upload ảnh nhanh tại vietdesigner.net" target="_blank">upanh.vietdesigner.net</a>';

if (editor.length) {
    editor[0].innerHTML = editor[0].innerHTML.replace(pikvn_link,pikvn_link + " | " + imgur_link);
    imgur = document.getElementById("imgur_link");
    imgur.addEventListener('click',imgur_popup,true);
}
function imgur_popup(width, height, url){
    var leftPosition, topPosition;
    height=450;
    width=700;
    if (typeof width == 'undefined') width = window.screen.width*0.8;
    if (typeof height == 'undefined') height = window.screen.height*0.8;
    if (typeof url == 'undefined') url = 'http://upanh.vietdesigner.net/?quickupload';
    //Allow for borders.
    leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
    //Allow for title and status bars.
    topPosition = (window.screen.height / 2) - ((height / 2) + 50);
    //Open the window.
    window.open(url, "imgur.com", "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
    return false;
}