Ver a proveniência

Use URL property from upload response

This updates the extension to work with the latest Snap.as API and fixes
the copy-to-clipboard functionality that broke with recent API changes.
tags/v1.0.1
Matt Baer há 3 anos
ascendente
cometimento
feb27007eb
1 ficheiros alterados com 2 adições e 8 eliminações
  1. +2
    -8
      uploader.js

+ 2
- 8
uploader.js Ver ficheiro

@@ -41,14 +41,8 @@ Dropzone.options.uploader = {
dictDefaultMessage: 'Drop a file here',
init: function() {
this.on("success", function(file, resp) {
var fp = file.name.split(/\./);
var ext = '';
if (fp.length > 0) {
ext = '.' + fp[fp.length - 1];
}
var env = JSON.parse(resp);
var url = 'https://i.snap.as/' + env.data + ext;
copyToClipboard('![](' + url + ')');
var data = resp;
copyToClipboard('![](' + data.data.url + ')');
chrome.runtime.sendMessage({success: true}, function(response) { });
window.close();
});


Carregando…
Cancelar
Guardar