basic cloudinary integration

This commit is contained in:
Sacha Greif 2015-11-20 14:30:13 +09:00
parent 4bffa60adf
commit 9d4bc8fc90
12 changed files with 63 additions and 16 deletions

View file

@ -40,7 +40,7 @@ telescope:tags
telescope:theme-base
telescope:theme-hubble
telescope:update-prompt
telescope:upload
telescope:cloudinary
############ Your Custom Packages ############

View file

@ -71,7 +71,6 @@ kadira:flow-router@2.7.0
kestanous:herald@1.3.0
kestanous:herald-email@0.5.0
launch-screen@1.0.4
lepozepo:s3@5.1.5
less@2.5.1
livedata@1.0.15
localstorage@1.0.5

View file

@ -0,0 +1 @@
node_modules

View file

@ -0,0 +1,7 @@
This directory and the files immediately inside it are automatically generated
when you change this package's NPM dependencies. Commit the files in this
directory (npm-shrinkwrap.json, .gitignore, and this README) to source control
so that others run the same versions of sub-dependencies.
You should NOT check in the node_modules directory that Meteor automatically
creates; if you are using git, the .gitignore file tells git to ignore it.

View file

@ -0,0 +1,18 @@
{
"dependencies": {
"cloudinary": {
"version": "1.2.5",
"dependencies": {
"q": {
"version": "1.4.1"
},
"lodash": {
"version": "3.10.1"
},
"chunking-streams": {
"version": "0.0.8"
}
}
}
}
}

View file

@ -16,7 +16,8 @@ Settings.addField([
optional: true,
private: true,
autoform: {
group: 'cloudinary'
group: 'cloudinary',
class: 'private-field'
}
}
},
@ -27,7 +28,8 @@ Settings.addField([
optional: true,
private: true,
autoform: {
group: 'cloudinary'
group: 'cloudinary',
class: 'private-field'
}
}
}

View file

@ -0,0 +1,23 @@
Cloudinary = Npm.require("cloudinary").v2;
Meteor.methods({
testUpload: function () {
// Cloudinary.config = {
// cloud_name: "telescope",
// api_key: "245566491779592",
// api_secret: "3tcjgv9Gir4lU6-GeI4M6Bd3hFM"
// }
Cloudinary.uploader.upload("http://bjjbot.com/bjjbot.png", {
cloud_name: Settings.get("cloudinaryCloudName"),
api_key: Settings.get("cloudinaryAPIKey"),
api_secret: Settings.get("cloudinaryAPISecret")
}, function(result, error) {
console.log(result)
console.log(error)
});
}
});

View file

@ -5,19 +5,23 @@ Package.describe({
git: "https://github.com/TelescopeJS/Telescope.git"
});
Npm.depends({
cloudinary: "1.2.5"
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@1.0']);
api.use([
'telescope:core@0.25.5',
// 'lepozepo:cloudinary@4.1.1',
'lepozepo:s3@5.1.5'
// 'lepozepo:cloudinary@4.1.1'
// 'lepozepo:s3@5.1.5'
]);
api.addFiles([
'package-tap.i18n',
'lib/upload.js'
'lib/cloudinary.js'
], ['client', 'server']);
api.addFiles([
@ -25,6 +29,7 @@ Package.onUse(function (api) {
], ['client']);
api.addFiles([
'lib/server/config.js'
], ['server']);
// var languages = ["ar", "bg", "cs", "da", "de", "el", "en", "es", "et", "fr", "hu", "id", "it", "ja", "kk", "ko", "nl", "pl", "pt-BR", "ro", "ru", "sl", "sv", "th", "tr", "vi", "zh-CN"];
@ -33,6 +38,6 @@ Package.onUse(function (api) {
// });
// api.addFiles(languagesPaths, ["client", "server"]);
// api.export('Users');
api.export('Cloudinary');
});

View file

@ -1,3 +0,0 @@
$.cloudinary.config = {
cloud_name: Settings.get("cloudinaryCloudName")
}

View file

@ -1,5 +0,0 @@
Cloudinary.config = {
cloud_name: Settings.get("cloudinaryCloudName"),
api_key: Settings.get("cloudinaryAPIKey"),
api_secret: Settings.get("cloudinaryAPISecret")
}