Advertisement
KiberInfinity

vkopt plugin "hello world"

Jun 26th, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // My Vk Hello World
  2. function MyVkHelloWorld(nav_obj,cur_module_name){
  3.    // function topMsg(text, seconds, color) - common.js
  4.    topMsg('Module: '+cur_module_name+'<br>'+'navObj: '+JSON.stringify(nav_obj));
  5. }
  6.  
  7.  
  8. // Кусок кода для подключения своих функций из "плагина":
  9. if (!window.vkopt_plugins) vkopt_plugins={};
  10. (function(){
  11.    var PLUGIN_ID = 'vkmyplugin';
  12.    var PLUGIN_NAME = 'vk my test plugin';  
  13.    var ADDITIONAL_CSS='';
  14.  
  15.    vkopt_plugins[PLUGIN_ID]={
  16.       Name:PLUGIN_NAME,
  17.       css:ADDITIONAL_CSS,
  18.    // FUNCTIONS
  19.       init:             null,                    // function();                        //run on connect plugin to vkopt
  20.       onLocation:       MyVkHelloWorld,                    // function(nav_obj,cur_module_name); //On new location
  21.       onLibFiles:       null,                    // function(file_name);               //On connect new vk script
  22.       onStorage :       null,                    // function(command_id,command_obj);
  23.       processLinks:     null,                    // function(link);
  24.       processNode:      null,                    // function(node);
  25.       pvActions:        null,                    // function(photo_data); ||  String    //PHOTOVIEWER_ACTIONS
  26.       albumActions:     null,                    // function(oid,aid); || Array with items. Example  [{l:'Link1', onClick:Link1Func},{l:'Link2', onClick:Link2Func}]
  27.       vidActLinks:      null,                    // function(video_data,links_array); ||  String.   video_data may contain iframe url
  28.       onResponseAnswer: null,                    // function(answer,url,params); 'answer' is array. modify only array items
  29.       UserMenuItems:    null                     // function(uid) || string
  30.    };
  31.    if (window.vkopt_ready) vkopt_plugin_run(PLUGIN_ID);
  32. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement