Integrated stackedit-picasa-proxy service

This commit is contained in:
benweet 2014-08-20 00:24:23 +01:00
parent a037fb31a8
commit 3952ab6af1
4 changed files with 94 additions and 81 deletions

16
app/picasa.js Normal file
View File

@ -0,0 +1,16 @@
var request = require('request');
exports.importImg = function(req, res) {
var stream = req.pipe(request.post({
uri: 'https://picasaweb.google.com/data/feed/api/user/default/albumid/' + req.query.albumId,
headers: {
'Authorization': req.headers.authorization,
'Content-Type': req.headers['content-type'],
'Slug': req.headers.slug
}
}));
stream.on('error', function(err) {
res.send(400, err);
});
stream.pipe(res);
};

View File

@ -13,7 +13,8 @@
"dependencies": { "dependencies": {
"express": "~3.16.6", "express": "~3.16.6",
"ejs": "~0.8.4", "ejs": "~0.8.4",
"request": "~2.40.0" "request": "~2.40.0",
"ssh2": "^0.3.5"
}, },
"devDependencies": { "devDependencies": {
"grunt-contrib-requirejs": "~0.4.3", "grunt-contrib-requirejs": "~0.4.3",

View File

@ -145,8 +145,6 @@ define([
utils.setInputValue("#textarea-settings-pdf-template", settings.pdfTemplate); utils.setInputValue("#textarea-settings-pdf-template", settings.pdfTemplate);
// PDF options // PDF options
utils.setInputValue("#textarea-settings-pdf-options", settings.pdfOptions); utils.setInputValue("#textarea-settings-pdf-options", settings.pdfOptions);
// SSH proxy
utils.setInputValue("#input-settings-ssh-proxy", settings.sshProxy);
// Load extension settings // Load extension settings
eventMgr.onLoadSettings(); eventMgr.onLoadSettings();
@ -192,8 +190,6 @@ define([
newSettings.pdfTemplate = utils.getInputTextValue("#textarea-settings-pdf-template", event); newSettings.pdfTemplate = utils.getInputTextValue("#textarea-settings-pdf-template", event);
// PDF options // PDF options
newSettings.pdfOptions = utils.getInputJSONValue("#textarea-settings-pdf-options", event); newSettings.pdfOptions = utils.getInputJSONValue("#textarea-settings-pdf-options", event);
// SSH proxy
newSettings.sshProxy = utils.checkUrl(utils.getInputTextValue("#input-settings-ssh-proxy", event), true);
// Save extension settings // Save extension settings
newSettings.extensionSettings = {}; newSettings.extensionSettings = {};
@ -509,9 +505,9 @@ define([
storage.clear(); storage.clear();
var allowedKeys = /^file\.|^folder\.|^publish\.|^settings$|^sync\.|^google\.|^author\.|^themeV4$|^version$/; var allowedKeys = /^file\.|^folder\.|^publish\.|^settings$|^sync\.|^google\.|^author\.|^themeV4$|^version$/;
_.each(newstorage, function(value, key) { _.each(newstorage, function(value, key) {
//if(allowedKeys.test(key)) { if(allowedKeys.test(key)) {
storage[key] = value; storage[key] = value;
//} }
}); });
window.location.reload(); window.location.reload();
}); });

View File

@ -74,10 +74,10 @@ define([
evt.dataTransfer.dropEffect = 'copy'; evt.dataTransfer.dropEffect = 'copy';
} }
$('#wmd-input').each(function() { !window.viewerMode && (function(dragAndDropElt) {
this.addEventListener('dragover', handleDragOver, false); dragAndDropElt.addEventListener('dragover', handleDragOver, false);
this.addEventListener('drop', handleImgImport, false); dragAndDropElt.addEventListener('drop', handleImgImport, false);
}); })(document.querySelector('.layout-wrapper-l3'));
}); });