Greasy Fork

WME UI

UI Library for Waze Map Editor Greasy Fork scripts

目前为 2022-08-28 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.cloud/scripts/450320/1086732/WME%20UI.js

作者
Anton Shevchuk
版本
0.0.1
创建于
2022-08-28
更新于
2022-08-28
大小
4.7 KB
许可证
MIT

WME UI

UI Library for Waze Map Editor Greasy Fork scripts

Examples

(function () {
  'use strict'

  const NAME = 'Script Name'

  // translation structure
  const TRANSLATION = {
    'en': {
      title: 'Copy address',
    },
    'uk': {
      title: 'Копіювати адресу',
    },
    'ru': {
      title: 'Копировать адреc',
    }
  }

  const STYLE = '.script-name { border: 1px solid #ccc }'

  // Add translation
  WMEUI.addTranslation(NAME, TRANSLATION)
  // Add custom style
  WMEUI.addStyle(STYLE)
  // Create shortcut
  new WMEUIShortcut(
    NAME + '-script',        // unique name
    I18n.t(NAME).title,      // description
    NAME,                    // group (use the same group for all shortcuts of the script)
    I18n.t(NAME).title,      // title shortcut section
    'C+D',                   // shortcut
    () => console.log('ok'), // callback
    null                     // scope
  )
})();

Links

Author homepage: http://anton.shevchuk.name/
Script homepage: https://github.com/AntonShevchuk/wme-ui GreasyFork: https://greasyfork.org/uk/scripts/389577-apihelperui/