Greasy Fork

Greasy Fork is available in English.

WME UI

UI Library for Waze Map Editor Greasy Fork scripts

当前为 2022-08-28 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/450320/1086735/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-api-helper-ui/
GreasyFork: http://greasyfork.icu/uk/scripts/389577-apihelperui/