added vk library

This commit is contained in:
coderaiser 2013-01-16 03:11:05 -05:00
parent f06d2fce24
commit 5f28ffb1d9
2 changed files with 1768 additions and 0 deletions

65
lib/client/storage/_vk.js Normal file
View file

@ -0,0 +1,65 @@
var CloudCommander, Util, DOM, VK;
(function(CloudCmd, Util, DOM){
'use strict';
var VKStorage = {};
/* PRIVATE FUNCTIONS */
/**
* load google api library
*/
function load(pCallBack){
console.time('vk');
var lUrl = 'http://vkontakte.ru/js/api/openapi.js',
lLocal = CloudCmd.LIBDIRCLIENT + 'storage/vk/open.js',
lOnload = function(){
console.timeEnd('vk load');
DOM.Images.hideLoad();
Util.exec(pCallBack);
};
DOM.jsload(lUrl, {
onload : lOnload,
error : DOM.retJSLoad(lLocal, lOnload)
});
}
function auth(){
CloudCmd.getConfig(function(pConfig){
VK.init({ apiId: pConfig.vk_id});
VK.Auth.login(function(pResponse){
console.log(pResponse);
}, 131072); /* Доступ к документам пользователя */
});
}
/**
* Insert new file.
*
* @param {File} fileData {name, data} File object to read data from.
* @param {Function} callback Function to call when the request is complete.
*/
VKStorage.uploadFile = function(pParams, pCallBack) {
var lData = pParams.data,
lName = pParams.name;
};
VKStorage.init = function(pCallBack){
Util.loadOnLoad([
Util.retExec(pCallBack),
auth,
load
]);
};
CloudCmd.VK = VKStorage;
})(CloudCommander, Util, DOM);

File diff suppressed because it is too large Load diff