Giter Site home page Giter Site logo

mediamonkey-addonmenu's Introduction

Addon Menu for MediaMonkey

This addon adds an additional item to the MediaMonkey 5 main menu bar that allows addon developers to present an entry point or functionality of their addon in a central and consistent way to the user.

Installation

Download the latest release from the releases section and double click the downloaded mmip file. A MediaMonkey dialog will automatically pop up, prompting you to confirm the installation. Once installed, the addon menu will automatically look for actions exposed by installed addons and add them to a new Addons item in the main menu bar.

I don't see the addon menu after I installed the addon

The addon menu will only be displayed if addon actions were found. You can validate this by opening the addon configuration page for the addon menu.

I installed an addon, but the menu doesn't contain any actions for it

If an installed addon doesn't show up in the menu, it either doesn't expose any actions or the actions are not configured to work with the addon menu. If there is an addon you would like to see added to the menu, please point the maintainer of the addon to this page, menu support can usually be added with a few lines of code.

Developer information

Registering actions

The addon menu automatically imports all valid actions from the global actions object if they are in the addons category. The following properties are required for an action to be considered valid:

Name Type Description
title function Display name of the action
addon function Folder name to group actions
execute function Function to execute when calling the action

Example

To create new actions, simply add new actions to the global actions object.

// Make sure to keep this header as it's needed to properly discover and
// import addon actions
if(!window.actionCategories.hasOwnProperty('addons')){
  window.actionCategories.addons = () => _('Addons');
}

// Create the needed actions
window.actions.MyAddonAction = {
  title: () => _('&My Addon Action'),
  hotkeyAble: true, // If set to true, the action can be mapped to a hotkey in the settings screen under Options > General > Hotkeys.
  category: actionCategories.addons,
  icon: 'myAddonIcon',
  addon: () => _("My &Addon"),
  execute: () => alert('My Addon Action')
}

window.actions.MyOtherAddonAction = {
  title: () => _('My &Other Addon Action'),
  hotkeyAble: true,
  category: actionCategories.addons,
  icon: 'myOtherAddonIcon',
  addon: () => _("My &Addon"),
  execute: () => alert('My Other Addon Action')
}

// Refresh the addon menu to import new actions.
// No need to worry if the menu can't be refreshed at this point because it's not loaded yet.
// It will automatically import all actions as soon it gets loaded by MediaMonkey.
if(typeof window.addons != "undefined" && window.addons.addonMenu != null)
  window.addons.addonMenu.refresh();

Also see the SampleAddon folder for a full usage example.

mediamonkey-addonmenu's People

Contributors

mmuffins avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.