Advertisement
KiberInfinity

VkOpt Plugin: UserMenu add item example

Jan 2nd, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          VkOpt Plugin: UserMenu add item example
  3. // @description   (by KiberInfinity id13391307)
  4. // @include       http://*vkontakte.ru/*
  5. // @include       http://*vk.com/*
  6. // ==/UserScript==
  7.  
  8. function vkUserNewsMenuItem(uid,gid){
  9.    if (uid) return ['<a href="/feed?owner='+uid+'&section=owner">News!</a>'];
  10. }
  11.  
  12. if (!window.vkopt_plugins) vkopt_plugins={};
  13. (function(){
  14.     var PLUGIN_ID = 'vkumenuex';
  15.     var PLUGIN_NAME = 'vk my test plugin'; 
  16.     var ADDITIONAL_CSS='';
  17.  
  18.     vkopt_plugins[PLUGIN_ID]={
  19.         Name:PLUGIN_NAME,
  20.         css:ADDITIONAL_CSS,
  21.     // FUNCTIONS
  22.       init:             null,                    // function();                        //run on connect plugin to vkopt
  23.         onLocation:       null,                    // function(nav_obj,cur_module_name); //On new location
  24.         onLibFiles:       null,                    // function(file_name);               //On connect new vk script
  25.         onStorage :       null,                    // function(command_id,command_obj);
  26.         processLinks:     null,                    // function(link);
  27.         processNode:      null,                    // function(node);
  28.         pvActions:        null,                    // function(photo_data); ||  String    //PHOTOVIEWER_ACTIONS
  29.         albumActions:     null,                    // function(oid,aid); || Array with items. Example  [{l:'Link1', onClick:Link1Func},{l:'Link2', onClick:Link2Func}]
  30.         vidActLinks:      null,                    // function(video_data,links_array); ||  String.   video_data may contain iframe url
  31.         onResponseAnswer: null,                    // function(answer,url,params); 'answer' is array. modify only array items
  32.       UserMenuItems:    vkUserNewsMenuItem       // function(uid) || string
  33.     };
  34.     if (window.vkopt_ready) vkopt_plugin_run(PLUGIN_ID);
  35. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement