├── .gitignore ├── asset └── icon.png ├── .vscodeignore ├── CHANGELOG.md ├── tsconfig.json ├── .vscode ├── tasks.json ├── settings.json └── launch.json ├── src ├── test │ ├── extension.test.ts │ └── index.ts └── extension.ts ├── README.md ├── vsc-extension-quickstart.md ├── package.json ├── syntaxes └── jsbox.json └── snippets └── jsbox.json /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | .vsix 5 | -------------------------------------------------------------------------------- /asset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyanzhong/vscode-jsbox/HEAD/asset/icon.png -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | out/**/*.map 5 | src/** 6 | .gitignore 7 | tsconfig.json 8 | vsc-extension-quickstart.md 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "JSBox" extension will be documented in this file. 3 | 4 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 5 | 6 | ## [Unreleased] 7 | - Initial release 8 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src" 11 | }, 12 | "exclude": [ 13 | "node_modules", 14 | ".vscode-test" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "editor.tabSize": 2, 4 | "editor.insertSpaces": true, 5 | "files.eol": "\n", 6 | "files.insertFinalNewline": true, 7 | "files.exclude": { 8 | "out": false // set this to true to hide the "out" folder with the compiled JS files 9 | }, 10 | "search.exclude": { 11 | "out": true // set this to false to include "out" folder in search results 12 | }, 13 | "npm.packageManager": "npm" 14 | } 15 | -------------------------------------------------------------------------------- /src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | // 2 | // Note: This example test is leveraging the Mocha test framework. 3 | // Please refer to their documentation on https://mochajs.org/ for help. 4 | // 5 | // The module 'assert' provides assertion methods from node 6 | import * as assert from 'assert'; 7 | 8 | // You can import and use all API from the 'vscode' module 9 | // as well as import your extension to test it 10 | import * as vscode from 'vscode'; 11 | import * as myExtension from '../extension'; 12 | 13 | // Defines a Mocha test suite to group tests of similar kind together 14 | suite("Extension Tests", () => { 15 | 16 | // Defines a Mocha unit test 17 | test("Something 1", () => { 18 | assert.equal(-1, [1, 2, 3].indexOf(5)); 19 | assert.equal(-1, [1, 2, 3].indexOf(0)); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by uncommenting the following lines 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 17 | testRunner.configure({ 18 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 19 | useColors: true // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; 23 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": [ 11 | "--extensionDevelopmentPath=${workspaceRoot}" 12 | ], 13 | "stopOnEntry": false, 14 | "sourceMaps": true, 15 | "outFiles": [ 16 | "${workspaceRoot}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | }, 20 | { 21 | "name": "Launch Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "runtimeExecutable": "${execPath}", 25 | "args": [ 26 | "--extensionDevelopmentPath=${workspaceRoot}", 27 | "--extensionTestsPath=${workspaceRoot}/out/test" 28 | ], 29 | "stopOnEntry": false, 30 | "sourceMaps": true, 31 | "outFiles": [ 32 | "${workspaceRoot}/out/test/**/*.js" 33 | ], 34 | "preLaunchTask": "npm: watch" 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JSBox 2 | 3 | JSBox Development Utilities on VSCode! 4 | 5 | This is a VSCode extension for [JSBox](https://docs.xteko.com), it provides useful features like `syntax highlighting`, `auto completion` etc. 6 | 7 | The most important is, when you save a script on VSCode, it runs on your iPhone automatically! 8 | 9 | ## Extension Settings 10 | 11 | Note: Make sure your iPhone and computer are on the same Wi-Fi. 12 | 13 | On iPhone, turn on debug mode of JSBox and restart the app, you can see the `Host` in the settings view. 14 | 15 | On VSCode, you need to set `jsBox.host`: 16 | 17 | * `JSBox configuration` -> `jsBox.host`: web server host 18 | 19 | There are also two super easy ways to setup host: 20 | 21 | - Click menu button at the top-right corner of your editor panel, there's a `Set Host` item 22 | - Trigger VSCode command with `command+shift+p`, type sethost then execute the command 23 | 24 | If you don't want to sync source file automatically, you can set `jsBox.autoUpload` to `false`. 25 | 26 | ## Don't like VSCode? 27 | 28 | Try [jsbox-cli](https://github.com/Dreamacro/jsbox-cli)! This is a cli tool which is made by [Dreamacro](https://github.com/Dreamacro). 29 | 30 | ## Contacts 31 | 32 | - [GitHub](https://github.com/cyanzhong/vscode-jsbox) 33 | - [Docs](https://docs.xteko.com) 34 | - [Email](mailto:log.e@qq.com) 35 | 36 | ## Release Notes 37 | 38 | ### 0.1.0 39 | 40 | Initial release 41 | -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension. 5 | * `package.json` - this is the manifest file in which you declare your extension and command. 6 | The sample plugin registers a command and defines its title and command name. With this information 7 | VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. 8 | * `src/extension.ts` - this is the main file where you will provide the implementation of your command. 9 | The file exports one function, `activate`, which is called the very first time your extension is 10 | activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. 11 | We pass the function containing the implementation of the command as the second parameter to 12 | `registerCommand`. 13 | 14 | ## Get up and running straight away 15 | * Press `F5` to open a new window with your extension loaded. 16 | * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. 17 | * Set breakpoints in your code inside `src/extension.ts` to debug your extension. 18 | * Find output from your extension in the debug console. 19 | 20 | ## Make changes 21 | * You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. 22 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. 23 | 24 | ## Explore the API 25 | * You can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`. 26 | 27 | ## Run tests 28 | * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`. 29 | * Press `F5` to run the tests in a new window with your extension loaded. 30 | * See the output of the test result in the debug console. 31 | * Make changes to `test/extension.test.ts` or create new test files inside the `test` folder. 32 | * By convention, the test runner will only consider files matching the name pattern `**.test.ts`. 33 | * You can create folders inside the `test` folder to structure your tests any way you want. 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsbox", 3 | "displayName": "JSBox", 4 | "description": "JSBox Development Utilities on VSCode", 5 | "author": "Cyan ", 6 | "icon": "asset/icon.png", 7 | "version": "0.0.20", 8 | "publisher": "Ying", 9 | "engines": { 10 | "vscode": "^1.17.0" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/cyanzhong/vscode-jsbox" 15 | }, 16 | "keywords": [ 17 | "JSBox", 18 | "jsbox", 19 | "xTeko", 20 | "xteko" 21 | ], 22 | "categories": [ 23 | "Other" 24 | ], 25 | "activationEvents": [ 26 | "onDebug", 27 | "onLanguage:javascript", 28 | "onLanguage:json", 29 | "onCommand:jsBox.setHost", 30 | "onCommand:jsBox.syncFile", 31 | "onCommand:jsBox.downloadFile" 32 | ], 33 | "main": "./out/extension", 34 | "scripts": { 35 | "vscode:prepublish": "npm run compile", 36 | "compile": "tsc -p ./", 37 | "watch": "tsc -watch -p ./", 38 | "postinstall": "node ./node_modules/vscode/bin/install", 39 | "test": "npm run compile && node ./node_modules/vscode/bin/test" 40 | }, 41 | "devDependencies": { 42 | "typescript": "^2.5.3", 43 | "vscode": "^1.1.5", 44 | "@types/node": "^7.0.43", 45 | "@types/mocha": "^2.2.42" 46 | }, 47 | "dependencies": { 48 | "request": "^2.79.0", 49 | "zip-folder": "1.0.0", 50 | "open": "0.0.5" 51 | }, 52 | "contributes": { 53 | "configuration": { 54 | "type": "object", 55 | "title": "JSBox configuration", 56 | "properties": { 57 | "jsBox.host": { 58 | "type": "string", 59 | "default": "", 60 | "description": "Fill this with your connect host." 61 | }, 62 | "jsBox.autoUpload": { 63 | "type": "boolean", 64 | "default": true, 65 | "description": "Whether to sync source file automatically." 66 | } 67 | } 68 | }, 69 | "commands": [ 70 | { 71 | "command": "jsBox.setHost", 72 | "title": "JSBox: Set Host" 73 | }, 74 | { 75 | "command": "jsBox.syncFile", 76 | "title": "JSBox: Sync File" 77 | }, 78 | { 79 | "command": "jsBox.downloadFile", 80 | "title": "JSBox: Download File" 81 | } 82 | ], 83 | "menus": { 84 | "editor/title": [ 85 | { 86 | "command": "jsBox.setHost" 87 | }, 88 | { 89 | "command": "jsBox.syncFile" 90 | }, 91 | { 92 | "command": "jsBox.downloadFile" 93 | } 94 | ] 95 | }, 96 | "keybindings": [ 97 | { 98 | "command": "jsBox.syncFile", 99 | "key": "ctrl+shift+r", 100 | "mac": "cmd+shift+r", 101 | "when": "editorTextFocus" 102 | }, 103 | { 104 | "command": "jsBox.downloadFile", 105 | "key": "ctrl+shift+d", 106 | "mac": "cmd+shift+d", 107 | "when": "editorTextFocus" 108 | } 109 | ], 110 | "grammars": [ 111 | { 112 | "scopeName": "source.jsbox", 113 | "path": "./syntaxes/jsbox.json", 114 | "injectTo": [ 115 | "source.js", 116 | "source.ts" 117 | ] 118 | } 119 | ], 120 | "snippets": [ 121 | { 122 | "language": "javascript", 123 | "path": "./snippets/jsbox.json" 124 | } 125 | ] 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import * as vscode from 'vscode'; 4 | import * as path from 'path'; 5 | 6 | const watchers = {}; 7 | 8 | // Extension activate 9 | export function activate(context: vscode.ExtensionContext) { 10 | 11 | // Observe command to setup host 12 | context.subscriptions.push(vscode.commands.registerCommand('jsBox.setHost', setHost)); 13 | 14 | // Observe command to sync file 15 | context.subscriptions.push(vscode.commands.registerCommand('jsBox.syncFile', syncWorkspace)); 16 | 17 | // Observe command to download file 18 | context.subscriptions.push(vscode.commands.registerCommand('jsBox.downloadFile', downloadFile)); 19 | 20 | // Observe file changes 21 | bindWatcher(); 22 | vscode.window.onDidChangeActiveTextEditor(bindWatcher); 23 | } 24 | 25 | function bindWatcher() { 26 | if (!vscode.window.activeTextEditor) { 27 | return 28 | } 29 | let path = vscode.window.activeTextEditor.document.fileName; 30 | if (path.search(/\.js$|\.json$/i) > 0 && !watchers[path]) { 31 | let watcher = vscode.workspace.createFileSystemWatcher(path); 32 | watcher.onDidChange(syncFileIfNeeded); 33 | watchers[path] = watcher; 34 | } 35 | } 36 | 37 | // Configure the host 38 | function setHost() { 39 | const config = vscode.workspace.getConfiguration('jsBox'); 40 | vscode.window.showInputBox({ 41 | placeHolder: 'Example: 10.106.144.196', 42 | value: config.get('host') 43 | }).then((value) => { 44 | if (value && value.length > 0) { 45 | config.update('host', value, true); 46 | showMessage(`Host: ${value}`); 47 | } 48 | }); 49 | } 50 | 51 | // Show info message 52 | function showMessage(msg) { 53 | console.log(msg); 54 | vscode.window.showInformationMessage(`[JSBox] ${msg}`); 55 | } 56 | 57 | // Show error message 58 | function showError(error) { 59 | console.error(error); 60 | if (vscode.debug) { 61 | vscode.window.showErrorMessage(`[JSBox] ${error}`); 62 | } 63 | } 64 | 65 | // Sync file only if needed 66 | function syncFileIfNeeded() { 67 | if (vscode.workspace.getConfiguration('jsBox').get('autoUpload')) { 68 | syncWorkspace(); 69 | } 70 | } 71 | 72 | // Find the parent folder 73 | function parentFolder(filePath) { 74 | return path.dirname(filePath) 75 | } 76 | 77 | // Sync workspace (file or folder) 78 | function syncWorkspace() { 79 | 80 | // console.log('[JSBox]', vscode.window.activeTextEditor.document.fileName); 81 | 82 | // Check host is available 83 | const host = vscode.workspace.getConfiguration('jsBox').get('host'); 84 | 85 | if (!host) { 86 | showError('Host is unavailable'); 87 | return; 88 | } 89 | 90 | // Upload file to server 91 | const request = require('request'); 92 | const fs = require('fs'); 93 | 94 | function syncFile(path) { 95 | request.post({ 96 | url: `http://${host}/upload`, 97 | formData: {'files[]': fs.createReadStream(path)} 98 | }, (error) => { 99 | if (error) { 100 | showError(error); 101 | } 102 | }); 103 | } 104 | 105 | var filePath = path.resolve(vscode.window.activeTextEditor.document.fileName); 106 | var directory = parentFolder(filePath); 107 | var directoryRoot = path.parse(directory).root 108 | var packageFound = false; 109 | 110 | // Find JSBox package 111 | while (directory != directoryRoot) { 112 | let files = fs.readdirSync(directory); 113 | const identifiers = ['assets', 'scripts', 'strings', 'config.json', 'main.js']; 114 | if (identifiers.reduce((value, identifier) => value && files.includes(identifier), true)) { 115 | packageFound = true; 116 | break; 117 | } 118 | directory = parentFolder(directory); 119 | } 120 | 121 | // Find Node.js package 122 | if (!packageFound) { 123 | directory = parentFolder(filePath); 124 | while (directory != directoryRoot) { 125 | const files = fs.readdirSync(directory); 126 | if (files.includes('package.json')) { 127 | break; 128 | } 129 | directory = parentFolder(directory); 130 | } 131 | } 132 | 133 | if (directory != directoryRoot) { 134 | // Sync as package 135 | 136 | if (!fs.existsSync(path.join(directory, '.output'))) { 137 | fs.mkdirSync(path.join(directory, '.output')); 138 | } 139 | var name = path.basename(directory) 140 | var target = path.resolve(directory, '.output', `${name}.box`); 141 | require('zip-folder')(directory, target, error => { 142 | if (error) { 143 | showError(error); 144 | } else { 145 | syncFile(target); 146 | } 147 | }); 148 | } else { 149 | // Sync as script 150 | syncFile(filePath); 151 | } 152 | } 153 | 154 | // Download File 155 | function downloadFile() { 156 | // Check host is available 157 | const host = vscode.workspace.getConfiguration('jsBox').get('host'); 158 | 159 | if (!host) { 160 | showError('Host is unavailable'); 161 | return; 162 | } 163 | 164 | const request = require('request'); 165 | const fs = require('fs'); 166 | 167 | // Get file list from server 168 | request(`http://${host}/list?path=/`, (error, response, body) => { 169 | 170 | if (error) { 171 | return showError(error); 172 | } 173 | 174 | const data = JSON.parse(body); 175 | const names = data.map(i => i.name); 176 | names.unshift('/'); 177 | 178 | // Show file list 179 | vscode.window.showQuickPick(names).then(fileName => { 180 | 181 | const filePath = fileName === '/' ? '/' : data.find(i => i.name === fileName).path; 182 | fileName = fileName === '/' ? 'scripts' : fileName; 183 | 184 | const option = { 185 | defaultUri: vscode.Uri.file(`${vscode.workspace.rootPath}/${fileName}`) 186 | }; 187 | 188 | // Show file dialog 189 | vscode.window.showSaveDialog(option).then(path => { 190 | 191 | if (path == undefined || path.fsPath == undefined || path.fsPath.length == 0) { 192 | return; 193 | } 194 | 195 | let dest = `${path.fsPath}${filePath.search(/\.js$/i) > 0 ? '' : '.zip'}`; 196 | let url = `http://${host}/download?path=${encodeURIComponent(filePath)}`; 197 | let stream = fs.createWriteStream(dest); 198 | 199 | // Download file 200 | require('http').get(url, function(response) { 201 | response.pipe(stream); 202 | stream.on('finish', function() { 203 | stream.close(); 204 | if (!dest.endsWith(".zip")) { 205 | vscode.workspace.openTextDocument(vscode.Uri.file(dest)).then(doc => vscode.window.showTextDocument(doc)) 206 | } else { 207 | require('open')(parentFolder(dest)); 208 | } 209 | }); 210 | }).on('error', function(error) { 211 | fs.unlink(dest); 212 | showError(error); 213 | }); 214 | }); 215 | }); 216 | }); 217 | } 218 | -------------------------------------------------------------------------------- /syntaxes/jsbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "JSBox", 4 | "injectionSelector": "L:source", 5 | "fileTypes": ["js", "ts"], 6 | "patterns": [ 7 | { 8 | "include": "#functions" 9 | }, 10 | { 11 | "include": "#interfaces" 12 | } 13 | ], 14 | "repository": { 15 | "functions": { 16 | "patterns": [ 17 | { 18 | "match": "(\\$require|\\$l10n|\\$delay|\\$rect|\\$size|\\$point|\\$insets|\\$color|\\$rgb|\\$rgba|\\$font|\\$range|\\$indexPath|\\$cellInset|\\$transform|\\$data|\\$labeledValue|\\$props|\\$objc|\\$objc_retain|\\$objc_release|\\$get_protocol|\\$objc_clean|\\$define_struct|\\$define|\\$protocol|\\$icon|\\$include)\\b", 19 | "name": "entity.name.function.jsbox" 20 | } 21 | ] 22 | }, 23 | "interfaces": { 24 | "patterns": [ 25 | { 26 | "match": "(\\$device)(?:\\s*\\.\\s*(taptic))?(?:\\s*\\.\\s*(info|isIphoneX|isIphonePlus|isIpad|isIpadPro|space|ssid|networkType|wlanAddress))?\\b(?!\\$)", 27 | "captures": { 28 | "1": { 29 | "name": "entity.name.class.jsbox" 30 | }, 31 | "2": { 32 | "name": "entity.name.function.jsbox" 33 | }, 34 | "3": { 35 | "name": "variable.name.jsbox" 36 | } 37 | } 38 | }, 39 | { 40 | "match": "(\\$app)(?:\\s*\\.\\s*(close|openURL|canOpenURL|openExtension|openBrowser|listen|notify|tips|setupWidget))?(?:\\s*\\.\\s*(debug|env|widgetIndex|info|idleTimerDisabled|applicationIconBadgeNumber|networkActivityIndicatorVisible|autoKeyboardEnabled|keyboardToolbarEnabled|rotateDisabled|strings|minSDKVer|minOSVer))?\\b(?!\\$)", 41 | "captures": { 42 | "1": { 43 | "name": "entity.name.class.jsbox" 44 | }, 45 | "2": { 46 | "name": "entity.name.function.jsbox" 47 | }, 48 | "3": { 49 | "name": "variable.name.jsbox" 50 | } 51 | } 52 | }, 53 | { 54 | "match": "(\\$system)(?:\\s*\\.\\s*(call|sms|mailto|facetime|home|makeIcon))?(?:\\s*\\.\\s*(brightness|volume))?\\b(?!\\$)", 55 | "captures": { 56 | "1": { 57 | "name": "entity.name.class.jsbox" 58 | }, 59 | "2": { 60 | "name": "entity.name.function.jsbox" 61 | }, 62 | "3": { 63 | "name": "variable.name.jsbox" 64 | } 65 | } 66 | }, 67 | { 68 | "match": "(\\$timer)(?:\\s*\\.\\s*(schedule))?\\b(?!\\$)", 69 | "captures": { 70 | "1": { 71 | "name": "entity.name.class.jsbox" 72 | }, 73 | "2": { 74 | "name": "entity.name.function.jsbox" 75 | }, 76 | "3": { 77 | "name": "variable.name.jsbox" 78 | } 79 | } 80 | }, 81 | { 82 | "match": "(\\$clipboard)(?:\\s*\\.\\s*(setTextLocalOnly|clear|copy|set))?(?:\\s*\\.\\s*(items|text|texts|html|image|images|phoneNumbers|phoneNumber|links|link|emails|email|dates|date))?\\b(?!\\$)", 83 | "captures": { 84 | "1": { 85 | "name": "entity.name.class.jsbox" 86 | }, 87 | "2": { 88 | "name": "entity.name.function.jsbox" 89 | }, 90 | "3": { 91 | "name": "variable.name.jsbox" 92 | } 93 | } 94 | }, 95 | { 96 | "match": "(\\$http)(?:\\s*\\.\\s*(setNetworkActivityIndicatorVisible|sync|request|get|post|download|upload|shorten|lengthen|startServer|stopServer|suspend|resume|cancel))?(?:\\s*\\.\\s*(status))?\\b(?!\\$)", 97 | "captures": { 98 | "1": { 99 | "name": "entity.name.class.jsbox" 100 | }, 101 | "2": { 102 | "name": "entity.name.function.jsbox" 103 | }, 104 | "3": { 105 | "name": "variable.name.jsbox" 106 | } 107 | } 108 | }, 109 | { 110 | "match": "(\\$cache)(?:\\s*\\.\\s*(set|setAsync|get|getAsync|remove|removeAsync|clear|clearAsync))?\\b(?!\\$)", 111 | "captures": { 112 | "1": { 113 | "name": "entity.name.class.jsbox" 114 | }, 115 | "2": { 116 | "name": "entity.name.function.jsbox" 117 | } 118 | } 119 | }, 120 | { 121 | "match": "(\\$keychain)(?:\\s*\\.\\s*(set|get|remove|clear|keys))?\\b(?!\\$)", 122 | "captures": { 123 | "1": { 124 | "name": "entity.name.class.jsbox" 125 | }, 126 | "2": { 127 | "name": "entity.name.function.jsbox" 128 | } 129 | } 130 | }, 131 | { 132 | "match": "(\\$thread)(?:\\s*\\.\\s*(main|background))?\\b(?!\\$)", 133 | "captures": { 134 | "1": { 135 | "name": "entity.name.class.jsbox" 136 | }, 137 | "2": { 138 | "name": "entity.name.function.jsbox" 139 | } 140 | } 141 | }, 142 | { 143 | "match": "(\\$http)(?:\\s*\\.\\s*(setTextLocalOnly|clear|copy|set))?(?:\\s*\\.\\s*(items|text|html|image|phoneNumbers|phoneNumber|links|link|emails|email|dates|date))?\\b(?!\\$)", 144 | "captures": { 145 | "1": { 146 | "name": "entity.name.class.jsbox" 147 | }, 148 | "2": { 149 | "name": "entity.name.function.jsbox" 150 | }, 151 | "3": { 152 | "name": "variable.name.jsbox" 153 | } 154 | } 155 | }, 156 | { 157 | "match": "(\\$env)(?:\\s*\\.\\s*(app|today|action|safari|all))?\\b(?!\\$)", 158 | "captures": { 159 | "1": { 160 | "name": "entity.name.class.jsbox" 161 | }, 162 | "2": { 163 | "name": "variable.name.jsbox" 164 | } 165 | } 166 | }, 167 | { 168 | "match": "(\\$align)(?:\\s*\\.\\s*(left|center|right|justified|natural))?\\b(?!\\$)", 169 | "captures": { 170 | "1": { 171 | "name": "entity.name.class.jsbox" 172 | }, 173 | "2": { 174 | "name": "variable.name.jsbox" 175 | } 176 | } 177 | }, 178 | { 179 | "match": "(\\$contentMode)(?:\\s*\\.\\s*(scaleToFill|scaleAspectFit|scaleAspectFill|redraw|center|top|bottom|left|right))?\\b(?!\\$)", 180 | "captures": { 181 | "1": { 182 | "name": "entity.name.class.jsbox" 183 | }, 184 | "2": { 185 | "name": "variable.name.jsbox" 186 | } 187 | } 188 | }, 189 | { 190 | "match": "(\\$btnType)(?:\\s*\\.\\s*(custom|system|disclosure|infoLight|infoDark|contactAdd))?\\b(?!\\$)", 191 | "captures": { 192 | "1": { 193 | "name": "entity.name.class.jsbox" 194 | }, 195 | "2": { 196 | "name": "variable.name.jsbox" 197 | } 198 | } 199 | }, 200 | { 201 | "match": "(\\$zero)(?:\\s*\\.\\s*(point|size|rect|insets))?\\b(?!\\$)", 202 | "captures": { 203 | "1": { 204 | "name": "entity.name.class.jsbox" 205 | }, 206 | "2": { 207 | "name": "variable.name.jsbox" 208 | } 209 | } 210 | }, 211 | { 212 | "match": "(\\$layout)(?:\\s*\\.\\s*(fill|center))?\\b(?!\\$)", 213 | "captures": { 214 | "1": { 215 | "name": "entity.name.class.jsbox" 216 | }, 217 | "2": { 218 | "name": "variable.name.jsbox" 219 | } 220 | } 221 | }, 222 | { 223 | "match": "(\\$lineCap)(?:\\s*\\.\\s*(butt|round|square))?\\b(?!\\$)", 224 | "captures": { 225 | "1": { 226 | "name": "entity.name.class.jsbox" 227 | }, 228 | "2": { 229 | "name": "variable.name.jsbox" 230 | } 231 | } 232 | }, 233 | { 234 | "match": "(\\$lineJoin)(?:\\s*\\.\\s*(miter|round|bevel))?\\b(?!\\$)", 235 | "captures": { 236 | "1": { 237 | "name": "entity.name.class.jsbox" 238 | }, 239 | "2": { 240 | "name": "variable.name.jsbox" 241 | } 242 | } 243 | }, 244 | { 245 | "match": "(\\$mediaType)(?:\\s*\\.\\s*(image|jpeg|jpeg2000|tiff|pict|gif|png|icns|bmp|ico|raw|live|movie|video|audio|mov|mpeg|mpeg2|mp3|mp4|avi|wav|midi))?\\b(?!\\$)", 246 | "captures": { 247 | "1": { 248 | "name": "entity.name.class.jsbox" 249 | }, 250 | "2": { 251 | "name": "variable.name.jsbox" 252 | } 253 | } 254 | }, 255 | { 256 | "match": "(\\$imgPicker)(?:\\s*\\.\\s*(quality|captureMode|device|flashMode))?\\b(?!\\$)", 257 | "captures": { 258 | "1": { 259 | "name": "entity.name.class.jsbox" 260 | }, 261 | "2": { 262 | "name": "variable.name.jsbox" 263 | } 264 | } 265 | }, 266 | { 267 | "match": "(\\$kbType)(?:\\s*\\.\\s*(default|ascii|nap|url|number|phone|namePhone|email|decimal|twitter|search|asciiPhone))?\\b(?!\\$)", 268 | "captures": { 269 | "1": { 270 | "name": "entity.name.class.jsbox" 271 | }, 272 | "2": { 273 | "name": "variable.name.jsbox" 274 | } 275 | } 276 | }, 277 | { 278 | "match": "(\\$assetMedia)(?:\\s*\\.\\s*(type|subType))?\\b(?!\\$)", 279 | "captures": { 280 | "1": { 281 | "name": "entity.name.class.jsbox" 282 | }, 283 | "2": { 284 | "name": "variable.name.jsbox" 285 | } 286 | } 287 | }, 288 | { 289 | "match": "(\\$pageSize)(?:\\s*\\.\\s*(letter|governmentLetter|legal|juniorLegal|ledger|tabloid|A0|A1|A2|A3|A4|A5|A6|A7|A8|A9|A10|B0|B1|B2|B3|B4|B5|B6|B7|B8|B9|B10|C0|C1|C2|C3|C4|C5|C6|C7|C8|C9|C10|custom))?\\b(?!\\$)", 290 | "captures": { 291 | "1": { 292 | "name": "entity.name.class.jsbox" 293 | }, 294 | "2": { 295 | "name": "variable.name.jsbox" 296 | } 297 | } 298 | }, 299 | { 300 | "match": "(\\$ui)(?:\\s*\\.\\s*(create|render|push|fill|pop|popToRoot|get|animate|alert|action|menu|toast|clearToast|error|loading|progress|preview|selectIcon))?(?:\\s*\\.\\s*(window|vc))?\\b(?!\\$)", 301 | "captures": { 302 | "1": { 303 | "name": "entity.name.class.jsbox" 304 | }, 305 | "2": { 306 | "name": "entity.name.function.jsbox" 307 | }, 308 | "3": { 309 | "name": "variable.name.jsbox" 310 | } 311 | } 312 | }, 313 | { 314 | "match": "(\\$picker)(?:\\s*\\.\\s*(date|data))?\\b(?!\\$)", 315 | "captures": { 316 | "1": { 317 | "name": "entity.name.class.jsbox" 318 | }, 319 | "2": { 320 | "name": "entity.name.function.jsbox" 321 | } 322 | } 323 | }, 324 | { 325 | "match": "(\\$context)(?:\\s*\\.\\s*(close))?(?:\\s*\\.\\s*(query|allItems|text|textItems|link|linkItems|image|imageItems|data|dataItems|safari))?\\b(?!\\$)", 326 | "captures": { 327 | "1": { 328 | "name": "entity.name.class.jsbox" 329 | }, 330 | "2": { 331 | "name": "entity.name.function.jsbox" 332 | }, 333 | "3": { 334 | "name": "variable.name.jsbox" 335 | } 336 | } 337 | }, 338 | { 339 | "match": "(\\$file)(?:\\s*\\.\\s*(read|write|delete|list|copy|move|mkdir|exists|isDirectory))?(?:\\s*\\.\\s*(extensions))?\\b(?!\\$)", 340 | "captures": { 341 | "1": { 342 | "name": "entity.name.class.jsbox" 343 | }, 344 | "2": { 345 | "name": "entity.name.function.jsbox" 346 | }, 347 | "3": { 348 | "name": "variable.name.jsbox" 349 | } 350 | } 351 | }, 352 | { 353 | "match": "(\\$drive)(?:\\s*\\.\\s*(open|save|read|write|delete|list|copy|move|mkdir|exists|isDirectory))?\\b(?!\\$)", 354 | "captures": { 355 | "1": { 356 | "name": "entity.name.class.jsbox" 357 | }, 358 | "2": { 359 | "name": "entity.name.function.jsbox" 360 | } 361 | } 362 | }, 363 | { 364 | "match": "(\\$addin)(?:\\s*\\.\\s*(save|delete|run|compile|eval))?(?:\\s*\\.\\s*(list|current))?\\b(?!\\$)", 365 | "captures": { 366 | "1": { 367 | "name": "entity.name.class.jsbox" 368 | }, 369 | "2": { 370 | "name": "entity.name.function.jsbox" 371 | }, 372 | "3": { 373 | "name": "variable.name.jsbox" 374 | } 375 | } 376 | }, 377 | { 378 | "match": "(\\$browser)(?:\\s*\\.\\s*(exec))?\\b(?!\\$)", 379 | "captures": { 380 | "1": { 381 | "name": "entity.name.class.jsbox" 382 | }, 383 | "2": { 384 | "name": "entity.name.function.jsbox" 385 | } 386 | } 387 | }, 388 | { 389 | "match": "(\\$keyboard)(?:\\s*\\.\\s*(insert|delete|moveCursor|playInputClick|next|dismiss))?(?:\\s*\\.\\s*(hasText|selectedText))?\\b(?!\\$)", 390 | "captures": { 391 | "1": { 392 | "name": "entity.name.class.jsbox" 393 | }, 394 | "2": { 395 | "name": "entity.name.function.jsbox" 396 | }, 397 | "3": { 398 | "name": "variable.name.jsbox" 399 | } 400 | } 401 | }, 402 | { 403 | "match": "(\\$network)(?:\\s*\\.\\s*(startPinging|stopPinging))?(?:\\s*\\.\\s*(ifa_data|proxy_settings))?\\b(?!\\$)", 404 | "captures": { 405 | "1": { 406 | "name": "entity.name.class.jsbox" 407 | }, 408 | "2": { 409 | "name": "entity.name.function.jsbox" 410 | }, 411 | "3": { 412 | "name": "variable.name.jsbox" 413 | } 414 | } 415 | }, 416 | { 417 | "match": "(\\$ssh)(?:\\s*\\.\\s*(connect|disconnect))?\\b(?!\\$)", 418 | "captures": { 419 | "1": { 420 | "name": "entity.name.class.jsbox" 421 | }, 422 | "2": { 423 | "name": "entity.name.function.jsbox" 424 | } 425 | } 426 | }, 427 | { 428 | "match": "(\\$lua)(?:\\s*\\.\\s*(eval|load|call|retain|release))?\\b(?!\\$)", 429 | "captures": { 430 | "1": { 431 | "name": "entity.name.class.jsbox" 432 | }, 433 | "2": { 434 | "name": "entity.name.function.jsbox" 435 | } 436 | } 437 | }, 438 | { 439 | "match": "(\\$widget)(?:\\s*\\.\\s*(mode|modeChanged|height))?\\b(?!\\$)", 440 | "captures": { 441 | "1": { 442 | "name": "entity.name.class.jsbox" 443 | }, 444 | "2": { 445 | "name": "variable.name.jsbox" 446 | } 447 | } 448 | }, 449 | { 450 | "match": "(\\$sqlite)(?:\\s*\\.\\s*(open|dbQueue|close|update|query|beginTransaction|rollback|commit))?\\b(?!\\$)", 451 | "captures": { 452 | "1": { 453 | "name": "entity.name.class.jsbox" 454 | }, 455 | "2": { 456 | "name": "variable.name.jsbox" 457 | } 458 | } 459 | }, 460 | { 461 | "match": "(\\$socket)(?:\\s*\\.\\s*(new))?\\b(?!\\$)", 462 | "captures": { 463 | "1": { 464 | "name": "entity.name.class.jsbox" 465 | }, 466 | "2": { 467 | "name": "variable.name.jsbox" 468 | } 469 | } 470 | }, 471 | { 472 | "match": "(\\$server)(?:\\s*\\.\\s*(new|start))?\\b(?!\\$)", 473 | "captures": { 474 | "1": { 475 | "name": "entity.name.class.jsbox" 476 | }, 477 | "2": { 478 | "name": "variable.name.jsbox" 479 | } 480 | } 481 | }, 482 | { 483 | "match": "(\\$intents)(?:\\s*\\.\\s*(finish))?\\b(?!\\$)", 484 | "captures": { 485 | "1": { 486 | "name": "entity.name.class.jsbox" 487 | }, 488 | "2": { 489 | "name": "entity.name.function.jsbox" 490 | } 491 | } 492 | }, 493 | { 494 | "match": "(\\$xml)(?:\\s*\\.\\s*(parse))?\\b(?!\\$)", 495 | "captures": { 496 | "1": { 497 | "name": "entity.name.class.jsbox" 498 | }, 499 | "2": { 500 | "name": "entity.name.function.jsbox" 501 | } 502 | } 503 | }, 504 | { 505 | "match": "(\\$editor)(?:\\s*\\.\\s*(text|view|selectedRange|selectedText|hasText|isActive|canUndo|canRedo|save|undo|redo|activate|deactivate|textInRange|insertText|deleteBackward|setTextInRange))?\\b(?!\\$)", 506 | "captures": { 507 | "1": { 508 | "name": "entity.name.class.jsbox" 509 | }, 510 | "2": { 511 | "name": "entity.name.function.jsbox" 512 | } 513 | } 514 | }, 515 | { 516 | "match": "(\\$prefs)(?:\\s*\\.\\s*(open|get|set|all))?\\b(?!\\$)", 517 | "captures": { 518 | "1": { 519 | "name": "entity.name.class.jsbox" 520 | }, 521 | "2": { 522 | "name": "entity.name.function.jsbox" 523 | } 524 | } 525 | }, 526 | { 527 | "match": "(\\$nodejs)(?:\\s*\\.\\s*(version|path|query|run|listen|notify))?\\b(?!\\$)", 528 | "captures": { 529 | "1": { 530 | "name": "entity.name.class.jsbox" 531 | }, 532 | "2": { 533 | "name": "entity.name.function.jsbox" 534 | } 535 | } 536 | }, 537 | { 538 | "match": "(\\$imagekit)(?:\\s*\\.\\s*(render|info|grayscale|invert|sepia|adjustEnhance|adjustRedEye|adjustBrightness|adjustContrast|adjustGamma|adjustOpacity|blur|emboss|sharpen|unsharpen|detectEdge|mask|reflect|cropTo|scaleBy|scaleTo|scaleFill|scaleAspectFit|scaleAspectFill|rotate|rotatePixels|flip|concatenate|combine|rounded|circular|toFile|extractGIF|makeGIF|makeVideo))?\\b(?!\\$)", 539 | "captures": { 540 | "1": { 541 | "name": "entity.name.class.jsbox" 542 | }, 543 | "2": { 544 | "name": "entity.name.function.jsbox" 545 | } 546 | } 547 | }, 548 | { 549 | "match": "(\\$photo)(?:\\s*\\.\\s*(take|pick|prompt|save|fetch|delete))?\\b(?!\\$)", 550 | "captures": { 551 | "1": { 552 | "name": "entity.name.class.jsbox" 553 | }, 554 | "2": { 555 | "name": "entity.name.function.jsbox" 556 | } 557 | } 558 | }, 559 | { 560 | "match": "(\\$audio)(?:\\s*\\.\\s*(play|pause|resume|stop|seek))?(?:\\s*\\.\\s*(status|duration|offset))?\\b(?!\\$)", 561 | "captures": { 562 | "1": { 563 | "name": "entity.name.class.jsbox" 564 | }, 565 | "2": { 566 | "name": "entity.name.function.jsbox" 567 | }, 568 | "3": { 569 | "name": "variable.name.jsbox" 570 | } 571 | } 572 | }, 573 | { 574 | "match": "(\\$pdf)(?:\\s*\\.\\s*(make))?\\b(?!\\$)", 575 | "captures": { 576 | "1": { 577 | "name": "entity.name.class.jsbox" 578 | }, 579 | "2": { 580 | "name": "entity.name.function.jsbox" 581 | } 582 | } 583 | }, 584 | { 585 | "match": "(\\$message)(?:\\s*\\.\\s*(sms|mail))?\\b(?!\\$)", 586 | "captures": { 587 | "1": { 588 | "name": "entity.name.class.jsbox" 589 | }, 590 | "2": { 591 | "name": "entity.name.function.jsbox" 592 | } 593 | } 594 | }, 595 | { 596 | "match": "(\\$calendar|\\$reminder)(?:\\s*\\.\\s*(fetch|create|save|delete))?\\b(?!\\$)", 597 | "captures": { 598 | "1": { 599 | "name": "entity.name.class.jsbox" 600 | }, 601 | "2": { 602 | "name": "entity.name.function.jsbox" 603 | } 604 | } 605 | }, 606 | { 607 | "match": "(\\$contact)(?:\\s*\\.\\s*(pick|fetch|create|save|delete|fetchGroups|addGroup|deleteGroup|updateGroup|addToGroup|removeFromGroup))?\\b(?!\\$)", 608 | "captures": { 609 | "1": { 610 | "name": "entity.name.class.jsbox" 611 | }, 612 | "2": { 613 | "name": "entity.name.function.jsbox" 614 | } 615 | } 616 | }, 617 | { 618 | "match": "(\\$location)(?:\\s*\\.\\s*(fetch|startUpdates|trackHeading|stopUpdates|select))?\\b(?!\\$)", 619 | "captures": { 620 | "1": { 621 | "name": "entity.name.class.jsbox" 622 | }, 623 | "2": { 624 | "name": "entity.name.function.jsbox" 625 | } 626 | } 627 | }, 628 | { 629 | "match": "(\\$motion)(?:\\s*\\.\\s*(startUpdates|stopUpdates))?(?:\\s*\\.\\s*(available))?\\b(?!\\$)", 630 | "captures": { 631 | "1": { 632 | "name": "entity.name.class.jsbox" 633 | }, 634 | "2": { 635 | "name": "entity.name.function.jsbox" 636 | }, 637 | "3": { 638 | "name": "variable.name.jsbox" 639 | } 640 | } 641 | }, 642 | { 643 | "match": "(\\$safari)(?:\\s*\\.\\s*(open|inject|addReadingItem))?(?:\\s*\\.\\s*(items))?\\b(?!\\$)", 644 | "captures": { 645 | "1": { 646 | "name": "entity.name.class.jsbox" 647 | }, 648 | "2": { 649 | "name": "entity.name.function.jsbox" 650 | }, 651 | "3": { 652 | "name": "variable.name.jsbox" 653 | } 654 | } 655 | }, 656 | { 657 | "match": "(\\$text)(?:\\s*\\.\\s*(analysis|tokenize|lookup|speech|base64Encode|base64Decode|URLEncode|URLDecode|HTMLEscape|HTMLUnescape|MD5|SHA1|SHA256|convertToPinYin|markdownToHtml|htmlToMarkdown|decodeData|sizeThatFits))?\\b(?!\\$)", 658 | "captures": { 659 | "1": { 660 | "name": "entity.name.class.jsbox" 661 | }, 662 | "2": { 663 | "name": "entity.name.function.jsbox" 664 | } 665 | } 666 | }, 667 | { 668 | "match": "(\\$quicklook)(?:\\s*\\.\\s*(open))?\\b(?!\\$)", 669 | "captures": { 670 | "1": { 671 | "name": "entity.name.class.jsbox" 672 | }, 673 | "2": { 674 | "name": "entity.name.function.jsbox" 675 | } 676 | } 677 | }, 678 | { 679 | "match": "(\\$share)(?:\\s*\\.\\s*(sheet|wechat|qq|tim))?\\b(?!\\$)", 680 | "captures": { 681 | "1": { 682 | "name": "entity.name.class.jsbox" 683 | }, 684 | "2": { 685 | "name": "entity.name.function.jsbox" 686 | } 687 | } 688 | }, 689 | { 690 | "match": "(\\$qrcode)(?:\\s*\\.\\s*(encode|decode|scan))?\\b(?!\\$)", 691 | "captures": { 692 | "1": { 693 | "name": "entity.name.class.jsbox" 694 | }, 695 | "2": { 696 | "name": "entity.name.function.jsbox" 697 | } 698 | } 699 | }, 700 | { 701 | "match": "(\\$push)(?:\\s*\\.\\s*(schedule|cancel|clear))?\\b(?!\\$)", 702 | "captures": { 703 | "1": { 704 | "name": "entity.name.class.jsbox" 705 | }, 706 | "2": { 707 | "name": "entity.name.function.jsbox" 708 | } 709 | } 710 | }, 711 | { 712 | "match": "(\\$archiver)(?:\\s*\\.\\s*(zip|unzip))?\\b(?!\\$)", 713 | "captures": { 714 | "1": { 715 | "name": "entity.name.class.jsbox" 716 | }, 717 | "2": { 718 | "name": "entity.name.function.jsbox" 719 | } 720 | } 721 | }, 722 | { 723 | "match": "(\\$detector)(?:\\s*\\.\\s*(date|address|link|phoneNumber))?\\b(?!\\$)", 724 | "captures": { 725 | "1": { 726 | "name": "entity.name.class.jsbox" 727 | }, 728 | "2": { 729 | "name": "entity.name.function.jsbox" 730 | } 731 | } 732 | }, 733 | { 734 | "match": "(\\$console)(?:\\s*\\.\\s*(log|info|warn|error|clear|open|close))?\\b(?!\\$)", 735 | "captures": { 736 | "1": { 737 | "name": "entity.name.class.jsbox" 738 | }, 739 | "2": { 740 | "name": "entity.name.function.jsbox" 741 | } 742 | } 743 | }, 744 | { 745 | "match": "(\\$input)(?:\\s*\\.\\s*(text|speech))?\\b(?!\\$)", 746 | "captures": { 747 | "1": { 748 | "name": "entity.name.class.jsbox" 749 | }, 750 | "2": { 751 | "name": "entity.name.function.jsbox" 752 | } 753 | } 754 | } 755 | ] 756 | } 757 | }, 758 | "scopeName": "source.jsbox" 759 | } 760 | -------------------------------------------------------------------------------- /snippets/jsbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "$device.info": { 3 | "prefix": "$device.info", 4 | "body": [ 5 | "\\$device.info" 6 | ], 7 | "description": "Get device information" 8 | }, 9 | "$device.isIphoneX": { 10 | "prefix": "$device.isIphoneX", 11 | "body": [ 12 | "\\$device.isIphoneX" 13 | ], 14 | "description": "Check if device is iPhone X" 15 | }, 16 | "$device.isIphonePlus": { 17 | "prefix": "$device.isIphonePlus", 18 | "body": [ 19 | "\\$device.isIphonePlus" 20 | ], 21 | "description": "Check if device is 3x" 22 | }, 23 | "$device.isIpad": { 24 | "prefix": "$device.isIpad", 25 | "body": [ 26 | "\\$device.isIpad" 27 | ], 28 | "description": "Check if device is iPad" 29 | }, 30 | "$device.isIpadPro": { 31 | "prefix": "$device.isIpadPro", 32 | "body": [ 33 | "\\$device.isIpadPro" 34 | ], 35 | "description": "Check if device is iPad Pro" 36 | }, 37 | "$device.ssid": { 38 | "prefix": "$device.ssid", 39 | "body": [ 40 | "\\$device.ssid" 41 | ], 42 | "description": "Get device ssid" 43 | }, 44 | "$device.networkType": { 45 | "prefix": "$device.networkType", 46 | "body": [ 47 | "\\$device.networkType" 48 | ], 49 | "description": "Get current network type" 50 | }, 51 | "$device.space": { 52 | "prefix": "$device.space", 53 | "body": [ 54 | "\\$device.space" 55 | ], 56 | "description": "Get device memory/disk states" 57 | }, 58 | "$device.wlanAddress": { 59 | "prefix": "$device.wlanAddress", 60 | "body": [ 61 | "\\$device.wlanAddress" 62 | ], 63 | "description": "Get device WLAN address" 64 | }, 65 | "$device.taptic(number)": { 66 | "prefix": "$device.taptic", 67 | "body": [ 68 | "\\$device.taptic(${1|0,1,2|});" 69 | ], 70 | "description": "Trigger a taptic feedback" 71 | }, 72 | "$app.minSDKVer": { 73 | "prefix": "$app.minSDKVer", 74 | "body": [ 75 | "\\$app.minSDKVer" 76 | ], 77 | "description": "Get minimal JSBox version" 78 | }, 79 | "$app.minOSVer": { 80 | "prefix": "$app.minOSVer", 81 | "body": [ 82 | "\\$app.minOSVer" 83 | ], 84 | "description": "Get minimal iOS version" 85 | }, 86 | "$app.tips(string)": { 87 | "prefix": "$app.tips", 88 | "body": [ 89 | "\\$app.tips(\"${1:tips}\");" 90 | ], 91 | "description": "Show one-time tips" 92 | }, 93 | "$app.widgetIndex": { 94 | "prefix": "$app.widgetIndex", 95 | "body": [ 96 | "\\$app.widgetIndex" 97 | ], 98 | "description": "Get current widget index" 99 | }, 100 | "$app.info": { 101 | "prefix": "$app.info", 102 | "body": [ 103 | "\\$app.info" 104 | ], 105 | "description": "Get app information" 106 | }, 107 | "$app.idleTimerDisabled": { 108 | "prefix": "$app.idleTimerDisabled", 109 | "body": [ 110 | "\\$app.idleTimerDisabled = ${1|true,false|};" 111 | ], 112 | "description": "Change idleTimerDisabled" 113 | }, 114 | "$app.close(delay)": { 115 | "prefix": "$app.close", 116 | "body": [ 117 | "\\$app.close();" 118 | ], 119 | "description": "Close the addin after a delay(optional)" 120 | }, 121 | "$app.env": { 122 | "prefix": "$app.env", 123 | "body": [ 124 | "\\$app.env" 125 | ], 126 | "description": "Get current environment" 127 | }, 128 | "$app.autoKeyboardEnabled": { 129 | "prefix": "$app.autoKeyboardEnabled", 130 | "body": [ 131 | "\\$app.autoKeyboardEnabled = ${1|true,false|};" 132 | ], 133 | "description": "Change autoKeyboardEnabled" 134 | }, 135 | "$app.keyboardToolbarEnabled": { 136 | "prefix": "$app.keyboardToolbarEnabled", 137 | "body": [ 138 | "\\$app.keyboardToolbarEnabled = ${1|true,false|};" 139 | ], 140 | "description": "Change keyboardToolbarEnabled" 141 | }, 142 | "$app.rotateDisabled": { 143 | "prefix": "$app.rotateDisabled", 144 | "body": [ 145 | "\\$app.rotateDisabled = ${1|true,false|};" 146 | ], 147 | "description": "Change rotateDisabled" 148 | }, 149 | "$app.openURL(string)": { 150 | "prefix": "$app.openURL", 151 | "body": [ 152 | "\\$app.openURL(\"${1:url}\");" 153 | ], 154 | "description": "Open URL" 155 | }, 156 | "$app.openBrowser(object)": { 157 | "prefix": "$app.openBrowser(object)", 158 | "body": [ 159 | "\\$app.openBrowser({", 160 | "\ttype: ${1|10000,10001,10002,10003,10004,10005,10006,10007,10008,10009|},", 161 | "\turl: \"$2\"", 162 | "});" 163 | ], 164 | "description": "Open URL with browser" 165 | }, 166 | "$app.listen(object)": { 167 | "prefix": "$app.listen", 168 | "body": [ 169 | "\\$app.listen({", 170 | "\tready: function() {", 171 | "\t\t$1", 172 | "\t},", 173 | "\texit: function() {", 174 | "\t\t$2", 175 | "\t}", 176 | "});" 177 | ], 178 | "description": "Observe notifications from addin" 179 | }, 180 | "$app.notify(object)": { 181 | "prefix": "$app.notify", 182 | "body": [ 183 | "\\$app.notify({", 184 | "\tname: \"$1\",", 185 | "\tobject: $2", 186 | "});" 187 | ], 188 | "description": "Post notification" 189 | }, 190 | "$app.setupWidget(object)": { 191 | "prefix": "$app.setupWidget", 192 | "body": [ 193 | "\\$app.setupWidget({", 194 | "\tname: \"$1\",", 195 | "\tindex: ${2|0,1,2|}", 196 | "});" 197 | ], 198 | "description": "Setup widget with name and index" 199 | }, 200 | "$app.strings": { 201 | "prefix": "$app.strings", 202 | "body": [ 203 | "\\$app.strings = {", 204 | "\t\"en\": {", 205 | "\t\t$1", 206 | "\t},", 207 | "\t\"zh-Hans\": {", 208 | "\t\t$2", 209 | "\t}", 210 | "};" 211 | ], 212 | "description": "Observe notifications from addin" 213 | }, 214 | "$system.brightness": { 215 | "prefix": "$system.brightness", 216 | "body": [ 217 | "\\$system.brightness" 218 | ], 219 | "description": "Get system brightness" 220 | }, 221 | "$system.volume": { 222 | "prefix": "$system.volume", 223 | "body": [ 224 | "\\$system.volume" 225 | ], 226 | "description": "Get system volume" 227 | }, 228 | "$system.call(number)": { 229 | "prefix": "$system.call", 230 | "body": [ 231 | "\\$system.call(${1:number});" 232 | ], 233 | "description": "Make a phone call" 234 | }, 235 | "$system.sms(number)": { 236 | "prefix": "$system.sms", 237 | "body": [ 238 | "\\$system.sms(${1:number});" 239 | ], 240 | "description": "Send a text message" 241 | }, 242 | "$system.mailto(email)": { 243 | "prefix": "$system.mailto", 244 | "body": [ 245 | "\\$system.mailto(\"${1:address}\");" 246 | ], 247 | "description": "Send an email" 248 | }, 249 | "$system.facetime(number)": { 250 | "prefix": "$system.facetime", 251 | "body": [ 252 | "\\$system.facetime(${1:number});" 253 | ], 254 | "description": "Start a FaceTime session" 255 | }, 256 | "$system.home()": { 257 | "prefix": "$system.home", 258 | "body": [ 259 | "\\$system.home();" 260 | ], 261 | "description": "Back to home screen" 262 | }, 263 | "$system.makeIcon(object)": { 264 | "prefix": "$system.makeIcon", 265 | "body": [ 266 | "\\$system.makeIcon({", 267 | "\ttitle: \"$1\",", 268 | "\turl: \"$2\",", 269 | "\ticon: $3", 270 | "});" 271 | ], 272 | "description": "Make a home screen icon" 273 | }, 274 | "$http.status": { 275 | "prefix": "$http.status", 276 | "body": [ 277 | "\\$http.status" 278 | ], 279 | "description": "Get current HTTP status" 280 | }, 281 | "$http.request(object)": { 282 | "prefix": "$http.request", 283 | "body": [ 284 | "\\$http.request({", 285 | "\tmethod: \"${1|GET,POST,PUT,DELETE,HEAD|}\",", 286 | "\turl: \"$2\",", 287 | "\theader: {", 288 | "\t\t", 289 | "\t},", 290 | "\tbody: {", 291 | "\t\t", 292 | "\t},", 293 | "\thandler: function(resp) {", 294 | "\t\tvar data = resp.data;", 295 | "\t}", 296 | "});" 297 | ], 298 | "description": "Send a HTTP request" 299 | }, 300 | "$http.get(object)": { 301 | "prefix": "$http.get", 302 | "body": [ 303 | "\\$http.get({", 304 | "\turl: \"$1\",", 305 | "\thandler: function(resp) {", 306 | "\t\tvar data = resp.data;", 307 | "\t}", 308 | "});" 309 | ], 310 | "description": "Send a GET request" 311 | }, 312 | "$http.post(object)": { 313 | "prefix": "$http.post", 314 | "body": [ 315 | "\\$http.post({", 316 | "\turl: \"$1\",", 317 | "\theader: {", 318 | "\t\t", 319 | "\t},", 320 | "\tbody: {", 321 | "\t\t", 322 | "\t},", 323 | "\thandler: function(resp) {", 324 | "\t\tvar data = resp.data;", 325 | "\t}", 326 | "});" 327 | ], 328 | "description": "Send a POST request" 329 | }, 330 | "$http.download(object)": { 331 | "prefix": "$http.download", 332 | "body": [ 333 | "\\$http.download({", 334 | "\turl: \"$1\",", 335 | "\theader: {", 336 | "\t\t", 337 | "\t},", 338 | "\tbody: {", 339 | "\t\t", 340 | "\t},", 341 | "\tprogress: function(bytesWritten, totalBytes) {", 342 | "\t\tvar percentage = bytesWritten * 1.0 / totalBytes", 343 | "\t},", 344 | "\thandler: function(resp) {", 345 | "\t\tvar file = resp.data;", 346 | "\t}", 347 | "});" 348 | ], 349 | "description": "Download a file through HTTP" 350 | }, 351 | "$http.upload(object)": { 352 | "prefix": "$http.upload", 353 | "body": [ 354 | "\\$http.upload({", 355 | "\turl: \"$1\",", 356 | "\tform: {", 357 | "\t\t", 358 | "\t},", 359 | "\tfiles: [{", 360 | "\t\t\"image\": image,", 361 | "\t\t\"name\": \"\",", 362 | "\t\t\"filename\": \"\",", 363 | "\t}],", 364 | "\tprogress: function(percentage) {", 365 | "\t\t", 366 | "\t},", 367 | "\thandler: function(resp) {", 368 | "\t\t", 369 | "\t}", 370 | "});" 371 | ], 372 | "description": "Upload a file through HTTP" 373 | }, 374 | "$http.shorten(object)": { 375 | "prefix": "$http.shorten", 376 | "body": [ 377 | "\\$http.shorten({", 378 | "\turl: \"$1\",", 379 | "\thandler: function(url) {", 380 | "\t\t$2", 381 | "\t}", 382 | "});" 383 | ], 384 | "description": "Shorten a URL" 385 | }, 386 | "$http.lengthen(object)": { 387 | "prefix": "$http.lengthen", 388 | "body": [ 389 | "\\$http.lengthen({", 390 | "\turl: \"$1\",", 391 | "\thandler: function(url) {", 392 | "\t\t$2", 393 | "\t}", 394 | "});" 395 | ], 396 | "description": "Expand a URL" 397 | }, 398 | "$http.startServer(object)": { 399 | "prefix": "$http.startServer", 400 | "body": [ 401 | "\\$http.startServer({", 402 | "\tport: $1,", 403 | "\tpath: \"$2\"", 404 | "\thandler: function(result) {", 405 | "\t\tvar url = result.url;", 406 | "\t\t$3", 407 | "\t}", 408 | "});" 409 | ], 410 | "description": "Start a http server" 411 | }, 412 | "$http.stopServer()": { 413 | "prefix": "$http.stopServer", 414 | "body": [ 415 | "\\$http.stopServer();" 416 | ], 417 | "description": "Stop created http server" 418 | }, 419 | "$http.suspend(identifier)": { 420 | "prefix": "$http.suspend", 421 | "body": [ 422 | "\\$http.suspend(\"${1:identifier}\");" 423 | ], 424 | "description": "Suspend a http request" 425 | }, 426 | "$http.resume(identifier)": { 427 | "prefix": "$http.resume", 428 | "body": [ 429 | "\\$http.resume(\"${1:identifier}\");" 430 | ], 431 | "description": "Resume a http request" 432 | }, 433 | "$http.cancel(identifier)": { 434 | "prefix": "$http.cancel", 435 | "body": [ 436 | "\\$http.cancel(\"${1:identifier}\");" 437 | ], 438 | "description": "Cancel a http request" 439 | }, 440 | "$cache.set(string, object)": { 441 | "prefix": "$cache.set", 442 | "body": [ 443 | "\\$cache.set(\"${1:key}\", ${2:value});" 444 | ], 445 | "description": "Cache object" 446 | }, 447 | "$cache.setAsync(object)": { 448 | "prefix": "$cache.setAsync", 449 | "body": [ 450 | "\\$cache.setAsync({", 451 | "\tkey: \"$1\",", 452 | "\tvalue: ${2:value},", 453 | "\thandler: function(object) {", 454 | "\t\t$3", 455 | "\t}", 456 | "});" 457 | ], 458 | "description": "Cache object (async)" 459 | }, 460 | "$cache.get(string)": { 461 | "prefix": "$cache.get", 462 | "body": [ 463 | "\\$cache.get(\"${1:key}\");" 464 | ], 465 | "description": "Get cached object" 466 | }, 467 | "$cache.getAsync(object)": { 468 | "prefix": "$cache.getAsync", 469 | "body": [ 470 | "\\$cache.getAsync({", 471 | "\tkey: \"$1\",", 472 | "\thandler: function(object) {", 473 | "\t\t$2", 474 | "\t}", 475 | "});" 476 | ], 477 | "description": "Get cached object (async)" 478 | }, 479 | "$cache.remove(string)": { 480 | "prefix": "$cache.remove", 481 | "body": [ 482 | "\\$cache.remove(\"${1:key}\");" 483 | ], 484 | "description": "Remove cached object" 485 | }, 486 | "$cache.removeAsync(object)": { 487 | "prefix": "$cache.removeAsync", 488 | "body": [ 489 | "\\$cache.removeAsync({", 490 | "\tkey: \"$1\",", 491 | "\thandler: function() {", 492 | "\t\t$2", 493 | "\t}", 494 | "});" 495 | ], 496 | "description": "Remove cached object (async)" 497 | }, 498 | "$cache.clear()": { 499 | "prefix": "$cache.clear", 500 | "body": [ 501 | "\\$cache.clear();" 502 | ], 503 | "description": "Clear all cached object" 504 | }, 505 | "$cache.clearAsync(object)": { 506 | "prefix": "$cache.clearAsync", 507 | "body": [ 508 | "\\$cache.clearAsync({", 509 | "\thandler: function() {", 510 | "\t\t$1", 511 | "\t}", 512 | "});" 513 | ], 514 | "description": "Clear all cached object (async)" 515 | }, 516 | "$thread.background(object)": { 517 | "prefix": "$thread.background", 518 | "body": [ 519 | "\\$thread.background({", 520 | "\tdelay: 0,", 521 | "\thandler: function() {", 522 | "\t\t$1", 523 | "\t}", 524 | "});" 525 | ], 526 | "description": "Execute on background thread" 527 | }, 528 | "$thread.main(object)": { 529 | "prefix": "$thread.main", 530 | "body": [ 531 | "\\$thread.main({", 532 | "\tdelay: 0,", 533 | "\thandler: function() {", 534 | "\t\t$1", 535 | "\t}", 536 | "});" 537 | ], 538 | "description": "Execute on main thread" 539 | }, 540 | "$delay(number, function)": { 541 | "prefix": "$delay", 542 | "body": [ 543 | "\\$delay(0.3, function() {", 544 | "\t$1", 545 | "});" 546 | ], 547 | "description": "Execute with a delay (in second)" 548 | }, 549 | "$timer.schedule(object)": { 550 | "prefix": "$timer.schedule", 551 | "body": [ 552 | "\\$timer.schedule({", 553 | "\tinterval: 3,", 554 | "\thandler: function() {", 555 | "\t\t$1", 556 | "\t}", 557 | "});" 558 | ], 559 | "description": "Schedule a timer" 560 | }, 561 | "$clipboard.text": { 562 | "prefix": "$clipboard.text", 563 | "body": [ 564 | "\\$clipboard.text" 565 | ], 566 | "description": "Get text from clipboard" 567 | }, 568 | "$clipboard.texts": { 569 | "prefix": "$clipboard.texts", 570 | "body": [ 571 | "\\$clipboard.texts" 572 | ], 573 | "description": "Get all texts from clipboard" 574 | }, 575 | "$clipboard.image": { 576 | "prefix": "$clipboard.image", 577 | "body": [ 578 | "\\$clipboard.image" 579 | ], 580 | "description": "Get image from clipboard" 581 | }, 582 | "$clipboard.images": { 583 | "prefix": "$clipboard.images", 584 | "body": [ 585 | "\\$clipboard.images" 586 | ], 587 | "description": "Get all images from clipboard" 588 | }, 589 | "$clipboard.items": { 590 | "prefix": "$clipboard.items", 591 | "body": [ 592 | "\\$clipboard.items" 593 | ], 594 | "description": "Get all items from clipboard" 595 | }, 596 | "$clipboard.phoneNumbers": { 597 | "prefix": "$clipboard.phoneNumbers", 598 | "body": [ 599 | "\\$clipboard.phoneNumbers" 600 | ], 601 | "description": "Get all phone numbers from clipboard" 602 | }, 603 | "$clipboard.phoneNumber": { 604 | "prefix": "$clipboard.phoneNumber", 605 | "body": [ 606 | "\\$clipboard.phoneNumber" 607 | ], 608 | "description": "Get the first phone number from clipboard" 609 | }, 610 | "$clipboard.links": { 611 | "prefix": "$clipboard.links", 612 | "body": [ 613 | "\\$clipboard.links" 614 | ], 615 | "description": "Get all links from clipboard" 616 | }, 617 | "$clipboard.link": { 618 | "prefix": "$clipboard.link", 619 | "body": [ 620 | "\\$clipboard.link" 621 | ], 622 | "description": "Get the first link from clipboard" 623 | }, 624 | "$clipboard.emails": { 625 | "prefix": "$clipboard.emails", 626 | "body": [ 627 | "\\$clipboard.emails" 628 | ], 629 | "description": "Get all emails from clipboard" 630 | }, 631 | "$clipboard.email": { 632 | "prefix": "$clipboard.email", 633 | "body": [ 634 | "\\$clipboard.email" 635 | ], 636 | "description": "Get the first email from clipboard" 637 | }, 638 | "$clipboard.dates": { 639 | "prefix": "$clipboard.dates", 640 | "body": [ 641 | "\\$clipboard.date" 642 | ], 643 | "description": "Get all dates from clipboard" 644 | }, 645 | "$clipboard.date": { 646 | "prefix": "$clipboard.date", 647 | "body": [ 648 | "\\$clipboard.date" 649 | ], 650 | "description": "Get the first date from clipboard" 651 | }, 652 | "$clipboard.setTextLocalOnly(string)": { 653 | "prefix": "$clipboard.setTextLocalOnly", 654 | "body": [ 655 | "\\$clipboard.setTextLocalOnly(\"${1:text}\");" 656 | ], 657 | "description": "Set text to local clipboard" 658 | }, 659 | "$clipboard.set(object)": { 660 | "prefix": "$clipboard.set", 661 | "body": [ 662 | "\\$clipboard.set({", 663 | "\t\"type\": \"$1\",", 664 | "\t\"value\": ${2:value}", 665 | "});" 666 | ], 667 | "description": "Set key-value to clipboard" 668 | }, 669 | "$clipboard.copy(object)": { 670 | "prefix": "$clipboard.copy", 671 | "body": [ 672 | "\\$clipboard.copy({", 673 | "\t\"${1|text,image,data|}\": ${2:object},", 674 | "\t\"ttl\": 30,", 675 | "\t\"locally\": ${3|true,false|}", 676 | "});" 677 | ], 678 | "description": "Copy text to clipboard with options" 679 | }, 680 | "$clipboard.clear()": { 681 | "prefix": "$clipboard.clear", 682 | "body": [ 683 | "\\$clipboard.clear();" 684 | ], 685 | "description": "Clear clipboard" 686 | }, 687 | "$include(path)": { 688 | "prefix": "$include", 689 | "body": [ 690 | "\\$include(\"${1:path}\");" 691 | ], 692 | "description": "Include an external script with path" 693 | }, 694 | "$l10n(key)": { 695 | "prefix": "$l10n", 696 | "body": [ 697 | "\\$l10n(\"${1:key}\");" 698 | ], 699 | "description": "Get localized string" 700 | }, 701 | "$rect(x, y, width, height)": { 702 | "prefix": "$rect", 703 | "body": [ 704 | "\\$rect(${1:x}, ${2:y}, ${3:width}, ${4:height});" 705 | ], 706 | "description": "Create a rect" 707 | }, 708 | "$size(width, height)": { 709 | "prefix": "$size", 710 | "body": [ 711 | "\\$size(${1:width}, ${2:height});" 712 | ], 713 | "description": "Create a size" 714 | }, 715 | "$point(x, y)": { 716 | "prefix": "$point", 717 | "body": [ 718 | "\\$point(${1:x}, ${2:y});" 719 | ], 720 | "description": "Create a point" 721 | }, 722 | "$insets(top, left, bottom, right)": { 723 | "prefix": "$insets", 724 | "body": [ 725 | "\\$insets(${1:top}, ${2:left}, ${3:bottom}, ${4:right});" 726 | ], 727 | "description": "Create a point" 728 | }, 729 | "$color(hex)": { 730 | "prefix": "$color", 731 | "body": [ 732 | "\\$color(\"#${1:000000}\");" 733 | ], 734 | "description": "Create a color with hex" 735 | }, 736 | "$color(name)": { 737 | "prefix": "$color", 738 | "body": [ 739 | "\\$color(\"${1|tint,black,darkGray,lightGray,white,gray,red,green,blue,cyan,yellow,magenta,orange,purple,brown,clear|}\");" 740 | ], 741 | "description": "Create a color with name" 742 | }, 743 | "$rgb(red, green, blue)": { 744 | "prefix": "$rgb", 745 | "body": [ 746 | "\\$rgb(${1:red}, ${2:green}, ${3:blue});" 747 | ], 748 | "description": "Create a color with rgb" 749 | }, 750 | "$rgba(red, green, blue, alpha)": { 751 | "prefix": "$rgba", 752 | "body": [ 753 | "\\$rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha});" 754 | ], 755 | "description": "Create a color with rgba" 756 | }, 757 | "$font(size)": { 758 | "prefix": "$font", 759 | "body": [ 760 | "\\$font(${1:size});" 761 | ], 762 | "description": "Create a font with size" 763 | }, 764 | "$font(weight, size)": { 765 | "prefix": "$font", 766 | "body": [ 767 | "\\$font(\"${1|bold,default|}\", ${2:size});" 768 | ], 769 | "description": "Create a font with weight and size" 770 | }, 771 | "$font(name, size)": { 772 | "prefix": "$font", 773 | "body": [ 774 | "\\$font(\"${1:name}\", ${2:size});" 775 | ], 776 | "description": "Create a font with name and size" 777 | }, 778 | "$range(location, length)": { 779 | "prefix": "$range", 780 | "body": [ 781 | "\\$range(${1:location}, ${2:length});" 782 | ], 783 | "description": "Create a range" 784 | }, 785 | "$indexPath(section, row)": { 786 | "prefix": "$indexPath", 787 | "body": [ 788 | "\\$indexPath(${1:section}, ${2:row});" 789 | ], 790 | "description": "Create an indexPath" 791 | }, 792 | "$data(object)": { 793 | "prefix": "$data", 794 | "body": [ 795 | "\\$data({\"${1|string,path,url|}\": ${2:object}});" 796 | ], 797 | "description": "Create a data" 798 | }, 799 | "$icon(code, color, size)": { 800 | "prefix": "$icon", 801 | "body": [ 802 | "\\$icon(${1:code}, ${2:color}, ${3:size});" 803 | ], 804 | "description": "Create an icon" 805 | }, 806 | "$props(object)": { 807 | "prefix": "$props", 808 | "body": [ 809 | "\\$props(\"${1:object}\");" 810 | ], 811 | "description": "Get all properties of an object" 812 | }, 813 | "$env": { 814 | "prefix": "$env", 815 | "body": [ 816 | "\\$env.${1|app,today,action,safari,all|}" 817 | ], 818 | "description": "Environment constants" 819 | }, 820 | "$align": { 821 | "prefix": "$align", 822 | "body": [ 823 | "\\$align.${1|left,center,right,justified,natural|}" 824 | ], 825 | "description": "Alignment constants" 826 | }, 827 | "$contentMode": { 828 | "prefix": "$contentMode", 829 | "body": [ 830 | "\\$contentMode.${1|scaleToFill,scaleAspectFit,scaleAspectFill,redraw,center,top,bottom,left,right|}" 831 | ], 832 | "description": "ContentMode constants" 833 | }, 834 | "$btnType": { 835 | "prefix": "$btnType", 836 | "body": [ 837 | "\\$btnType.${1|custom,system,disclosure,infoLight,infoDark,contactAdd|}" 838 | ], 839 | "description": "ButtonType constants" 840 | }, 841 | "$zero": { 842 | "prefix": "$zero", 843 | "body": [ 844 | "\\$zero.${1|point,size,rect,insets|}" 845 | ], 846 | "description": "Zero constants" 847 | }, 848 | "$layout": { 849 | "prefix": "$layout", 850 | "body": [ 851 | "\\$layout.${1|fill,center|}" 852 | ], 853 | "description": "Layout constants" 854 | }, 855 | "$lineCap": { 856 | "prefix": "$lineCap", 857 | "body": [ 858 | "\\$lineCap.${1|butt,round,square|}" 859 | ], 860 | "description": "LineCap constants" 861 | }, 862 | "$lineJoin": { 863 | "prefix": "$lineJoin", 864 | "body": [ 865 | "\\$lineJoin.${1|miter,round,bevel|}" 866 | ], 867 | "description": "LineJoin constants" 868 | }, 869 | "$mediaType": { 870 | "prefix": "$mediaType", 871 | "body": [ 872 | "\\$mediaType.${1|image,jpeg,jpeg2000,tiff,pict,gif,png,icns,bmp,ico,raw,live,movie,video,audio,mov,mpeg,mpeg2,mp3,mp4,avi,wav,midi|}" 873 | ], 874 | "description": "MediaType constants" 875 | }, 876 | "$imgPicker.quality": { 877 | "prefix": "$imgPicker.quality", 878 | "body": [ 879 | "\\$imgPicker.quality.${1|high,medium,low,r640x480,r1280x720,r960x540|}" 880 | ], 881 | "description": "ImagePicker quality constants" 882 | }, 883 | "$imgPicker.captureMode": { 884 | "prefix": "$imgPicker.captureMode", 885 | "body": [ 886 | "\\$imgPicker.captureMode.${1|photo,video|}" 887 | ], 888 | "description": "ImagePicker captureMode constants" 889 | }, 890 | "$imgPicker.device": { 891 | "prefix": "$imgPicker.device", 892 | "body": [ 893 | "\\$imgPicker.device.${1|rear,front|}" 894 | ], 895 | "description": "ImagePicker device constants" 896 | }, 897 | "$imgPicker.flashMode": { 898 | "prefix": "$imgPicker.flashMode", 899 | "body": [ 900 | "\\$imgPicker.flashMode.${1|off,auto,on|}" 901 | ], 902 | "description": "ImagePicker flashMode constants" 903 | }, 904 | "$kbType": { 905 | "prefix": "$kbType", 906 | "body": [ 907 | "\\$kbType.${1|default,ascii,nap,url,number,phone,namePhone,email,decimal,twitter,search,asciiPhone|}" 908 | ], 909 | "description": "KeyboardType constants" 910 | }, 911 | "$assetMedia.type": { 912 | "prefix": "$assetMedia.type", 913 | "body": [ 914 | "\\$assetMedia.type.${1|unknown,image,video,audio|}" 915 | ], 916 | "description": "AssetMedia type constants" 917 | }, 918 | "$assetMedia.subType": { 919 | "prefix": "$assetMedia.subType", 920 | "body": [ 921 | "\\$assetMedia.subType.${1|none,panorama,hdr,screenshot,live,depthEffect,streamed,highFrameRate,timelapse|}" 922 | ], 923 | "description": "AssetMedia subType constants" 924 | }, 925 | "$pageSize": { 926 | "prefix": "$pageSize", 927 | "body": [ 928 | "\\$pageSize.${1|letter,governmentLetter,legal,juniorLegal,ledger,tabloid, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, custom|}" 929 | ], 930 | "description": "PageSize constants" 931 | }, 932 | "$ui.window": { 933 | "prefix": "$ui.window", 934 | "body": [ 935 | "\\$ui.window" 936 | ], 937 | "description": "Get current window" 938 | }, 939 | "$ui.vc": { 940 | "prefix": "$ui.vc", 941 | "body": [ 942 | "\\$ui.vc" 943 | ], 944 | "description": "Get current view controller" 945 | }, 946 | "$ui.render(views)": { 947 | "prefix": "$ui.render", 948 | "body": [ 949 | "\\$ui.render({", 950 | "\tprops: {", 951 | "\t\ttitle: \"$1\"", 952 | "\t},", 953 | "\tviews: [{", 954 | "\t\ttype: \"${2|view,label,tab,button,input,slider,switch,spinner,progress,gallery,stepper,image,scroll,text,map,web,list,matrix,date-picker,picker,video,canvas,menu,blur,gradient,markdown,runtime|}\",", 955 | "\t\tprops: {", 956 | "\t\t\tid: \"$3\"", 957 | "\t\t},", 958 | "\t\tlayout: function(make, view) {", 959 | "\t\t\t$4", 960 | "\t\t},", 961 | "\t\tevents: {", 962 | "\t\t\t$5", 963 | "\t\t}", 964 | "\t}]", 965 | "});" 966 | ], 967 | "description": "Render views" 968 | }, 969 | "$ui.push(views)": { 970 | "prefix": "$ui.push", 971 | "body": [ 972 | "\\$ui.push({", 973 | "\tprops: {", 974 | "\t\ttitle: \"$1\"", 975 | "\t},", 976 | "\tviews: [{", 977 | "\t\ttype: \"${2|view,label,tab,button,input,slider,switch,spinner,progress,gallery,stepper,image,scroll,text,map,web,list,matrix,date-picker,picker,video,canvas,menu,blur,gradient,markdown,runtime|}\",", 978 | "\t\tprops: {", 979 | "\t\t\tid: \"$3\"", 980 | "\t\t},", 981 | "\t\tlayout: function(make, view) {", 982 | "\t\t\t$4", 983 | "\t\t},", 984 | "\t\tevents: {", 985 | "\t\t\t$5", 986 | "\t\t}", 987 | "\t}]", 988 | "});" 989 | ], 990 | "description": "Push views" 991 | }, 992 | "$ui.create(view)": { 993 | "prefix": "$ui.create", 994 | "body": [ 995 | "\\$ui.create({", 996 | "\ttype: \"${1|view,label,tab,button,input,slider,switch,spinner,progress,gallery,stepper,image,scroll,text,map,web,list,matrix,date-picker,picker,video,canvas,menu,blur,gradient,markdown,runtime|}\",", 997 | "\tprops: {", 998 | "\t\tid: \"$2\"", 999 | "\t},", 1000 | "\tlayout: function(make, view) {", 1001 | "\t\t$3", 1002 | "\t},", 1003 | "\tevents: {", 1004 | "\t\t$4", 1005 | "\t}", 1006 | "});" 1007 | ], 1008 | "description": "Create a view" 1009 | }, 1010 | "make.left": { 1011 | "prefix": "make.left", 1012 | "body": [ 1013 | "make.left.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1014 | ], 1015 | "description": "make.left" 1016 | }, 1017 | "make.right": { 1018 | "prefix": "make.right", 1019 | "body": [ 1020 | "make.right.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1021 | ], 1022 | "description": "make.right" 1023 | }, 1024 | "make.top": { 1025 | "prefix": "make.top", 1026 | "body": [ 1027 | "make.top.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1028 | ], 1029 | "description": "make.top" 1030 | }, 1031 | "make.bottom": { 1032 | "prefix": "make.bottom", 1033 | "body": [ 1034 | "make.bottom.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1035 | ], 1036 | "description": "make.bottom" 1037 | }, 1038 | "make.edges": { 1039 | "prefix": "make.edges", 1040 | "body": [ 1041 | "make.edges.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1042 | ], 1043 | "description": "make.edges" 1044 | }, 1045 | "make.centerX": { 1046 | "prefix": "make.centerX", 1047 | "body": [ 1048 | "make.centerX.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1049 | ], 1050 | "description": "make.centerX" 1051 | }, 1052 | "make.centerY": { 1053 | "prefix": "make.centerY", 1054 | "body": [ 1055 | "make.centerY.${1|equalTo,inset,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1056 | ], 1057 | "description": "make.centerY" 1058 | }, 1059 | "make.width": { 1060 | "prefix": "make.width", 1061 | "body": [ 1062 | "make.width.${1|equalTo,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1063 | ], 1064 | "description": "make.width" 1065 | }, 1066 | "make.height": { 1067 | "prefix": "make.height", 1068 | "body": [ 1069 | "make.height.${1|equalTo,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1070 | ], 1071 | "description": "make.height" 1072 | }, 1073 | "make.size": { 1074 | "prefix": "make.size", 1075 | "body": [ 1076 | "make.size.${1|equalTo,greaterThanOrEqualTo,lessThanOrEqualTo|}" 1077 | ], 1078 | "description": "make.size" 1079 | }, 1080 | "$ui.animate(object)": { 1081 | "prefix": "$ui.animate", 1082 | "body": [ 1083 | "\\$ui.animate({", 1084 | "\tduration: 0.4,", 1085 | "\tdelay: 0,", 1086 | "\tdamping: 0,", 1087 | "\tvelocity: 0,", 1088 | "\toptions: 0,", 1089 | "\tanimation: function() {", 1090 | "\t\t$1", 1091 | "\t},", 1092 | "\tcompletion: function() {", 1093 | "\t\t$2", 1094 | "\t}", 1095 | "});" 1096 | ], 1097 | "description": "Animate changes of views" 1098 | }, 1099 | "$ui.pop()": { 1100 | "prefix": "$ui.pop", 1101 | "body": [ 1102 | "\\$ui.pop();" 1103 | ], 1104 | "description": "Pop the most front view" 1105 | }, 1106 | "$ui.popToRoot()": { 1107 | "prefix": "$ui.popToRoot", 1108 | "body": [ 1109 | "\\$ui.popToRoot();" 1110 | ], 1111 | "description": "Pop to root view" 1112 | }, 1113 | "$ui.get(id)": { 1114 | "prefix": "$ui.get", 1115 | "body": [ 1116 | "\\$ui.get(\"${1:id}\");" 1117 | ], 1118 | "description": "Get an view by id" 1119 | }, 1120 | "$ui.alert(object)": { 1121 | "prefix": "$ui.alert", 1122 | "body": [ 1123 | "\\$ui.alert({", 1124 | "\ttitle: \"$1\",", 1125 | "\tmessage: \"$2\",", 1126 | "});" 1127 | ], 1128 | "description": "Present an alert" 1129 | }, 1130 | "$ui.menu(object)": { 1131 | "prefix": "$ui.menu", 1132 | "body": [ 1133 | "\\$ui.menu({", 1134 | "\titems: [$1],", 1135 | "\thandler: function(title, idx) {", 1136 | "\t\t$2", 1137 | "\t}", 1138 | "});" 1139 | ], 1140 | "description": "Popup a menu" 1141 | }, 1142 | "$ui.toast(message)": { 1143 | "prefix": "$ui.toast", 1144 | "body": [ 1145 | "\\$ui.toast(\"${1:message}\");" 1146 | ], 1147 | "description": "Show a toast" 1148 | }, 1149 | "$ui.clearToast()": { 1150 | "prefix": "$ui.clearToast", 1151 | "body": [ 1152 | "\\$ui.clearToast();" 1153 | ], 1154 | "description": "Clear the toast" 1155 | }, 1156 | "$ui.error(message)": { 1157 | "prefix": "$ui.error", 1158 | "body": [ 1159 | "\\$ui.error(\"${1:message}\");" 1160 | ], 1161 | "description": "Show an error" 1162 | }, 1163 | "$ui.loading(boolean)": { 1164 | "prefix": "$ui.loading", 1165 | "body": [ 1166 | "\\$ui.loading(${1|true,false|});" 1167 | ], 1168 | "description": "Toggle the loading state" 1169 | }, 1170 | "$ui.progress(number)": { 1171 | "prefix": "$ui.progress", 1172 | "body": [ 1173 | "\\$ui.progress(${1:number});" 1174 | ], 1175 | "description": "Update the progress value" 1176 | }, 1177 | "$ui.preview(object)": { 1178 | "prefix": "$ui.preview", 1179 | "body": [ 1180 | "\\$ui.preview({", 1181 | "\ttitle: \"\",", 1182 | "\t${1|url,html,text|}: \"\"", 1183 | "});" 1184 | ], 1185 | "description": "Preview a media" 1186 | }, 1187 | "$ui.selectIcon(object)": { 1188 | "prefix": "$ui.selectIcon", 1189 | "body": [ 1190 | "\\$ui.selectIcon({", 1191 | "\thandler: function(name) {", 1192 | "\t\t$1", 1193 | "\t}", 1194 | "});" 1195 | ], 1196 | "description": "Select a built-in icon" 1197 | }, 1198 | "$input.text(object)": { 1199 | "prefix": "$input.text", 1200 | "body": [ 1201 | "\\$input.text({", 1202 | "\ttype: ${1:type},", 1203 | "\tplaceholder: \"$2\",", 1204 | "\ttext: \"\",", 1205 | "\thandler: function(text) {", 1206 | "\t\t$3", 1207 | "\t}", 1208 | "});" 1209 | ], 1210 | "description": "Input a text" 1211 | }, 1212 | "$input.speech(object)": { 1213 | "prefix": "$input.speech", 1214 | "body": [ 1215 | "\\$input.speech({", 1216 | "\tlocale: \"$1\",", 1217 | "\thandler: function(text) {", 1218 | "\t\t$2", 1219 | "\t}", 1220 | "});" 1221 | ], 1222 | "description": "Text dictation" 1223 | }, 1224 | "$context.query": { 1225 | "prefix": "$context.query", 1226 | "body": [ 1227 | "\\$context.query" 1228 | ], 1229 | "description": "Get query items from context" 1230 | }, 1231 | "$context.text": { 1232 | "prefix": "$context.text", 1233 | "body": [ 1234 | "\\$context.text" 1235 | ], 1236 | "description": "Get the first text from context" 1237 | }, 1238 | "$context.textItems": { 1239 | "prefix": "$context.textItems", 1240 | "body": [ 1241 | "\\$context.textItems" 1242 | ], 1243 | "description": "Get all text items from context" 1244 | }, 1245 | "$context.link": { 1246 | "prefix": "$context.link", 1247 | "body": [ 1248 | "\\$context.link" 1249 | ], 1250 | "description": "Get the first link from context" 1251 | }, 1252 | "$context.linkItems": { 1253 | "prefix": "$context.linkItems", 1254 | "body": [ 1255 | "\\$context.linkItems" 1256 | ], 1257 | "description": "Get all link items from context" 1258 | }, 1259 | "$context.image": { 1260 | "prefix": "$context.image", 1261 | "body": [ 1262 | "\\$context.image" 1263 | ], 1264 | "description": "Get the first image from context" 1265 | }, 1266 | "$context.imageItems": { 1267 | "prefix": "$context.imageItems", 1268 | "body": [ 1269 | "\\$context.imageItems" 1270 | ], 1271 | "description": "Get all image items from context" 1272 | }, 1273 | "$context.safari.items": { 1274 | "prefix": "$context.safari.items", 1275 | "body": [ 1276 | "\\$context.safari.items" 1277 | ], 1278 | "description": "Get Safari items from context" 1279 | }, 1280 | "$context.data": { 1281 | "prefix": "$context.data", 1282 | "body": [ 1283 | "\\$context.data" 1284 | ], 1285 | "description": "Get the first data from context" 1286 | }, 1287 | "$context.dataItems": { 1288 | "prefix": "$context.dataItems", 1289 | "body": [ 1290 | "\\$context.dataItems" 1291 | ], 1292 | "description": "Get all data items from context" 1293 | }, 1294 | "$context.allItems": { 1295 | "prefix": "$context.allItems", 1296 | "body": [ 1297 | "\\$context.allItems" 1298 | ], 1299 | "description": "Get all items from context" 1300 | }, 1301 | "$context.close()": { 1302 | "prefix": "$context.close", 1303 | "body": [ 1304 | "\\$context.close();" 1305 | ], 1306 | "description": "Close current context(extension)" 1307 | }, 1308 | "$file.read(path)": { 1309 | "prefix": "$file.read", 1310 | "body": [ 1311 | "\\$file.read(\"${1:path}\");" 1312 | ], 1313 | "description": "Read a file with path" 1314 | }, 1315 | "$file.write(object)": { 1316 | "prefix": "$file.write", 1317 | "body": [ 1318 | "\\$file.write({", 1319 | "\tdata: ${1:data},", 1320 | "\tpath: \"$2\"", 1321 | "});" 1322 | ], 1323 | "description": "Write a file to disk" 1324 | }, 1325 | "$file.delete(path)": { 1326 | "prefix": "$file.delete", 1327 | "body": [ 1328 | "\\$file.delete(\"${1:path}\");" 1329 | ], 1330 | "description": "Delete a file with path" 1331 | }, 1332 | "$file.list(path)": { 1333 | "prefix": "$file.list", 1334 | "body": [ 1335 | "\\$file.list(\"${1:path}\");" 1336 | ], 1337 | "description": "List a directory with path" 1338 | }, 1339 | "$file.copy(object)": { 1340 | "prefix": "$file.copy", 1341 | "body": [ 1342 | "\\$file.copy({", 1343 | "\tsrc: \"$1\",", 1344 | "\tdst: \"$2\"", 1345 | "});" 1346 | ], 1347 | "description": "Copy a file" 1348 | }, 1349 | "$file.move(object)": { 1350 | "prefix": "$file.move", 1351 | "body": [ 1352 | "\\$file.move({", 1353 | "\tsrc: \"$1\",", 1354 | "\tdst: \"$2\"", 1355 | "});" 1356 | ], 1357 | "description": "Move a file" 1358 | }, 1359 | "$file.mkdir(path)": { 1360 | "prefix": "$file.mkdir", 1361 | "body": [ 1362 | "\\$file.mkdir(\"${1:path}\");" 1363 | ], 1364 | "description": "Make a directory with path" 1365 | }, 1366 | "$file.exists(path)": { 1367 | "prefix": "$file.exists", 1368 | "body": [ 1369 | "\\$file.exists(\"${1:path}\");" 1370 | ], 1371 | "description": "Check whether a file exists" 1372 | }, 1373 | "$file.isDirectory(path)": { 1374 | "prefix": "$file.isDirectory", 1375 | "body": [ 1376 | "\\$file.isDirectory(\"${1:path}\");" 1377 | ], 1378 | "description": "Check whether a path is directory" 1379 | }, 1380 | "$drive.open(object)": { 1381 | "prefix": "$drive.open", 1382 | "body": [ 1383 | "\\$drive.open({", 1384 | "\thandler: function(data) {", 1385 | "\t\t$1", 1386 | "\t}", 1387 | "});" 1388 | ], 1389 | "description": "Open iCloud Drive document picker" 1390 | }, 1391 | "$drive.save(object)": { 1392 | "prefix": "$drive.save", 1393 | "body": [ 1394 | "\\$drive.save({", 1395 | "\tdata: ${1:data},", 1396 | "\thandler: function() {", 1397 | "\t\t$2", 1398 | "\t}", 1399 | "});" 1400 | ], 1401 | "description": "Save a file to iCloud Drive" 1402 | }, 1403 | "$drive.read(path)": { 1404 | "prefix": "$drive.read", 1405 | "body": [ 1406 | "\\$drive.read(\"${1:path}\");" 1407 | ], 1408 | "description": "Read a file with path" 1409 | }, 1410 | "$drive.write(object)": { 1411 | "prefix": "$drive.write", 1412 | "body": [ 1413 | "\\$drive.write({", 1414 | "\tdata: ${1:data},", 1415 | "\tpath: \"$2\"", 1416 | "});" 1417 | ], 1418 | "description": "Write a file to disk" 1419 | }, 1420 | "$drive.delete(path)": { 1421 | "prefix": "$drive.delete", 1422 | "body": [ 1423 | "\\$drive.delete(\"${1:path}\");" 1424 | ], 1425 | "description": "Delete a file with path" 1426 | }, 1427 | "$drive.list(path)": { 1428 | "prefix": "$drive.list", 1429 | "body": [ 1430 | "\\$drive.list(\"${1:path}\");" 1431 | ], 1432 | "description": "List a directory with path" 1433 | }, 1434 | "$drive.copy(object)": { 1435 | "prefix": "$drive.copy", 1436 | "body": [ 1437 | "\\$drive.copy({", 1438 | "\tsrc: \"$1\",", 1439 | "\tdst: \"$2\"", 1440 | "});" 1441 | ], 1442 | "description": "Copy a file" 1443 | }, 1444 | "$drive.move(object)": { 1445 | "prefix": "$drive.move", 1446 | "body": [ 1447 | "\\$drive.move({", 1448 | "\tsrc: \"$1\",", 1449 | "\tdst: \"$2\"", 1450 | "});" 1451 | ], 1452 | "description": "Move a file" 1453 | }, 1454 | "$drive.mkdir(path)": { 1455 | "prefix": "$drive.mkdir", 1456 | "body": [ 1457 | "\\$drive.mkdir(\"${1:path}\");" 1458 | ], 1459 | "description": "Make a directory with path" 1460 | }, 1461 | "$drive.exists(path)": { 1462 | "prefix": "$drive.exists", 1463 | "body": [ 1464 | "\\$drive.exists(\"${1:path}\");" 1465 | ], 1466 | "description": "Check whether a file exists" 1467 | }, 1468 | "$drive.isDirectory(path)": { 1469 | "prefix": "$drive.isDirectory", 1470 | "body": [ 1471 | "\\$drive.isDirectory(\"${1:path}\");" 1472 | ], 1473 | "description": "Check whether a path is directory" 1474 | }, 1475 | "$addin.list": { 1476 | "prefix": "$addin.list", 1477 | "body": [ 1478 | "\\$addin.list" 1479 | ], 1480 | "description": "Get all installed addins" 1481 | }, 1482 | "$addin.current": { 1483 | "prefix": "$addin.current", 1484 | "body": [ 1485 | "\\$addin.current" 1486 | ], 1487 | "description": "Get current running addin" 1488 | }, 1489 | "$addin.save(object)": { 1490 | "prefix": "$addin.save", 1491 | "body": [ 1492 | "\\$addin.save({", 1493 | "\tname: \"$1\",", 1494 | "\tdata: ${2:data}", 1495 | "});" 1496 | ], 1497 | "description": "Save an addins to JSBox" 1498 | }, 1499 | "$addin.delete(name)": { 1500 | "prefix": "$addin.delete", 1501 | "body": [ 1502 | "\\$addin.delete(\"${1:name}\");" 1503 | ], 1504 | "description": "Delete an existed addin with name" 1505 | }, 1506 | "$addin.run(name)": { 1507 | "prefix": "$addin.run", 1508 | "body": [ 1509 | "\\$addin.run(\"${1:name}\");" 1510 | ], 1511 | "description": "Run an existed addin with name" 1512 | }, 1513 | "$addin.compile(script)": { 1514 | "prefix": "$addin.compile", 1515 | "body": [ 1516 | "\\$addin.compile(\"${1:script}\");" 1517 | ], 1518 | "description": "Compile script to JSBox's syntax" 1519 | }, 1520 | "$addin.eval(script)": { 1521 | "prefix": "$addin.eval", 1522 | "body": [ 1523 | "\\$addin.eval(\"${1:script}\");" 1524 | ], 1525 | "description": "Evaluate script with JSBox's syntax" 1526 | }, 1527 | "$browser.exec(object)": { 1528 | "prefix": "$browser.exec", 1529 | "body": [ 1530 | "\\$browser.exec({", 1531 | "\tscript: \"$1\",", 1532 | "\thandler: function() {", 1533 | "\t\t$2", 1534 | "\t}", 1535 | "});" 1536 | ], 1537 | "description": "Evaluate script in browser environment" 1538 | }, 1539 | "$keyboard.hasText": { 1540 | "prefix": "$keyboard.hasText", 1541 | "body": [ 1542 | "\\$keyboard.hasText" 1543 | ], 1544 | "description": "Check whether text field has text" 1545 | }, 1546 | "$keyboard.selectedText": { 1547 | "prefix": "$keyboard.selectedText", 1548 | "body": [ 1549 | "\\$keyboard.selectedText" 1550 | ], 1551 | "description": "Get selected text from text field" 1552 | }, 1553 | "$keyboard.insert(text)": { 1554 | "prefix": "$keyboard.insert", 1555 | "body": [ 1556 | "\\$keyboard.insert(\"${1:text}\");" 1557 | ], 1558 | "description": "Insert text to text field" 1559 | }, 1560 | "$keyboard.delete()": { 1561 | "prefix": "$keyboard.delete", 1562 | "body": [ 1563 | "\\$keyboard.delete();" 1564 | ], 1565 | "description": "Delete text in text field" 1566 | }, 1567 | "$keyboard.moveCursor(offset)": { 1568 | "prefix": "$keyboard.moveCursor", 1569 | "body": [ 1570 | "\\$keyboard.moveCursor(${1:offset});" 1571 | ], 1572 | "description": "Move cursor in text field" 1573 | }, 1574 | "$keyboard.playInputClick()": { 1575 | "prefix": "$keyboard.playInputClick", 1576 | "body": [ 1577 | "\\$keyboard.playInputClick();" 1578 | ], 1579 | "description": "Play input click audio" 1580 | }, 1581 | "$keyboard.next()": { 1582 | "prefix": "$keyboard.next", 1583 | "body": [ 1584 | "\\$keyboard.next();" 1585 | ], 1586 | "description": "Switch to next keyboard" 1587 | }, 1588 | "$keyboard.dismiss()": { 1589 | "prefix": "$keyboard.dismiss", 1590 | "body": [ 1591 | "\\$keyboard.dismiss();" 1592 | ], 1593 | "description": "Dismiss current keyboard" 1594 | }, 1595 | "$network.ifa_data": { 1596 | "prefix": "$network.ifa_data", 1597 | "body": [ 1598 | "\\$network.ifa_data" 1599 | ], 1600 | "description": "Get current ifa data" 1601 | }, 1602 | "$network.proxy_settings": { 1603 | "prefix": "$network.proxy_settings", 1604 | "body": [ 1605 | "\\$network.proxy_settings" 1606 | ], 1607 | "description": "Get current proxy settings" 1608 | }, 1609 | "$network.startPinging(object)": { 1610 | "prefix": "$network.startPinging", 1611 | "body": [ 1612 | "\\$network.startPinging({", 1613 | "\thost: \"$1\",", 1614 | "\ttimeout: $2,", 1615 | "\tttl: $3", 1616 | "});" 1617 | ], 1618 | "description": "Start pinging" 1619 | }, 1620 | "$network.stopPinging()": { 1621 | "prefix": "$network.stopPinging", 1622 | "body": [ 1623 | "\\$network.stopPinging();" 1624 | ], 1625 | "description": "Stop pinging" 1626 | }, 1627 | "$ssh.connect()": { 1628 | "prefix": "$ssh.connect", 1629 | "body": [ 1630 | "\\$ssh.connect({", 1631 | "\thost: \"$1\",", 1632 | "\tusername: \"$2\",", 1633 | "\tport: $3,", 1634 | "\tpublic_key: $4,", 1635 | "\tprivate_key: $5", 1636 | "});" 1637 | ], 1638 | "description": "Create SSH connect" 1639 | }, 1640 | "$ssh.disconnect()": { 1641 | "prefix": "$ssh.disconnect", 1642 | "body": [ 1643 | "\\$ssh.disconnect();" 1644 | ], 1645 | "description": "Stop SSH connect" 1646 | }, 1647 | "$lua.eval(script)": { 1648 | "prefix": "$lua.eval", 1649 | "body": [ 1650 | "\\$lua.eval(\"${1:script}\");" 1651 | ], 1652 | "description": "Evaluate lua script" 1653 | }, 1654 | "$lua.load(path)": { 1655 | "prefix": "$lua.load", 1656 | "body": [ 1657 | "\\$lua.load(\"${1:path}\");" 1658 | ], 1659 | "description": "Evaluate lua from path" 1660 | }, 1661 | "$lua.call(object)": { 1662 | "prefix": "$lua.call", 1663 | "body": [ 1664 | "\\$lua.call({", 1665 | "\tname: \"$1\",", 1666 | "\targs: $2", 1667 | "});" 1668 | ], 1669 | "description": "Call an existing lua function" 1670 | }, 1671 | "$lua.retain(object)": { 1672 | "prefix": "$lua.retain", 1673 | "body": [ 1674 | "\\$lua.retain(${1:object});" 1675 | ], 1676 | "description": "Retain a lua object" 1677 | }, 1678 | "$lua.release(object)": { 1679 | "prefix": "$lua.release", 1680 | "body": [ 1681 | "\\$lua.release(${1:object});" 1682 | ], 1683 | "description": "Release a lua object" 1684 | }, 1685 | "$widget.mode": { 1686 | "prefix": "$widget.mode", 1687 | "body": [ 1688 | "\\$widget.mode" 1689 | ], 1690 | "description": "Get current widget mode" 1691 | }, 1692 | "$widget.modeChanged": { 1693 | "prefix": "$widget.modeChanged", 1694 | "body": [ 1695 | "\\$widget.modeChanged" 1696 | ], 1697 | "description": "Widget mode changed callback" 1698 | }, 1699 | "$widget.height": { 1700 | "prefix": "$widget.height", 1701 | "body": [ 1702 | "\\$widget.height" 1703 | ], 1704 | "description": "Get current widget height" 1705 | }, 1706 | "$intents.finish(result)": { 1707 | "prefix": "$intents.finish", 1708 | "body": [ 1709 | "\\$intents.finish(${1:result})" 1710 | ], 1711 | "description": "Finish intents with result" 1712 | }, 1713 | "$photo.take(object)": { 1714 | "prefix": "$photo.take", 1715 | "body": [ 1716 | "\\$photo.take({", 1717 | "\tformat: \"${1|image,data|}\",", 1718 | "\thandler: function(resp) {", 1719 | "\t\tvar image = resp.image;", 1720 | "\t\t$2", 1721 | "\t}", 1722 | "});" 1723 | ], 1724 | "description": "Take a photo with camera" 1725 | }, 1726 | "$photo.pick(object)": { 1727 | "prefix": "$photo.pick", 1728 | "body": [ 1729 | "\\$photo.pick({", 1730 | "\tformat: \"${1|image,data|}\",", 1731 | "\thandler: function(resp) {", 1732 | "\t\tvar image = resp.image;", 1733 | "\t\t$2", 1734 | "\t}", 1735 | "});" 1736 | ], 1737 | "description": "Pick a photo in photo library" 1738 | }, 1739 | "$photo.prompt(object)": { 1740 | "prefix": "$photo.prompt", 1741 | "body": [ 1742 | "\\$photo.prompt({", 1743 | "\thandler: function(resp) {", 1744 | "\t\tvar image = resp.image;", 1745 | "\t\t$1", 1746 | "\t}", 1747 | "});" 1748 | ], 1749 | "description": "Let users choose take or pick" 1750 | }, 1751 | "$photo.save(object)": { 1752 | "prefix": "$photo.save", 1753 | "body": [ 1754 | "\\$photo.save({", 1755 | "\t${1|image,data|}: ${2:object},", 1756 | "\thandler: function(success) {", 1757 | "\t\t$3", 1758 | "\t}", 1759 | "});" 1760 | ], 1761 | "description": "Save a photo to library" 1762 | }, 1763 | "$photo.fetch(object)": { 1764 | "prefix": "$photo.fetch", 1765 | "body": [ 1766 | "\\$photo.fetch({", 1767 | "\tcount: ${1:count},", 1768 | "\tformat: ${2|image,data|},", 1769 | "\thandler: function(images) {", 1770 | "\t\t$3", 1771 | "\t}", 1772 | "});" 1773 | ], 1774 | "description": "Fetch photos from library" 1775 | }, 1776 | "$photo.delete(object)": { 1777 | "prefix": "$photo.delete", 1778 | "body": [ 1779 | "\\$photo.delete({", 1780 | "\tcount: ${1:count},", 1781 | "\thandler: function(success) {", 1782 | "\t\t$3", 1783 | "\t}", 1784 | "});" 1785 | ], 1786 | "description": "Delete photos in library" 1787 | }, 1788 | "$audio.play(object)": { 1789 | "prefix": "$audio.play", 1790 | "body": [ 1791 | "\\$audio.play({${1|url,id|}: ${2:object}});" 1792 | ], 1793 | "description": "Play audio track" 1794 | }, 1795 | "$audio.pause()": { 1796 | "prefix": "$audio.pause", 1797 | "body": [ 1798 | "\\$audio.pause();" 1799 | ], 1800 | "description": "Pause audio track" 1801 | }, 1802 | "$audio.resume()": { 1803 | "prefix": "$audio.resume", 1804 | "body": [ 1805 | "\\$audio.resume();" 1806 | ], 1807 | "description": "Resume audio track" 1808 | }, 1809 | "$audio.stop()": { 1810 | "prefix": "$audio.stop", 1811 | "body": [ 1812 | "\\$audio.stop();" 1813 | ], 1814 | "description": "Stop audio track" 1815 | }, 1816 | "$audio.seek(seconds)": { 1817 | "prefix": "$audio.seek", 1818 | "body": [ 1819 | "\\$audio.seek(${1:seconds});" 1820 | ], 1821 | "description": "Seek audio track to seconds" 1822 | }, 1823 | "$audio.status": { 1824 | "prefix": "$audio.status", 1825 | "body": [ 1826 | "\\$audio.status" 1827 | ], 1828 | "description": "Get audio track status" 1829 | }, 1830 | "$audio.duration": { 1831 | "prefix": "$audio.duration", 1832 | "body": [ 1833 | "\\$audio.duration" 1834 | ], 1835 | "description": "Get audio track duration" 1836 | }, 1837 | "$audio.offset": { 1838 | "prefix": "$audio.offset", 1839 | "body": [ 1840 | "\\$audio.offset" 1841 | ], 1842 | "description": "Get audio track offset" 1843 | }, 1844 | "$pdf.make(object)": { 1845 | "prefix": "$pdf.make", 1846 | "body": [ 1847 | "\\$pdf.make({", 1848 | "\t${1|url,html|}: \"$2\",", 1849 | "\tpageSize: \\$pageSize.A5,", 1850 | "\thandler: function(resp) {", 1851 | "\t\tvar data = resp.data;", 1852 | "\t\t$3", 1853 | "\t}", 1854 | "});" 1855 | ], 1856 | "description": "Make PDF document" 1857 | }, 1858 | "$message.sms(object)": { 1859 | "prefix": "$message.sms", 1860 | "body": [ 1861 | "\\$message.sms({", 1862 | "\trecipients: [$1],", 1863 | "\tbody: \"$2\",", 1864 | "\tsubject: \"$3\",", 1865 | "\thandler: function(result) {", 1866 | "\t\t$4", 1867 | "\t}", 1868 | "});" 1869 | ], 1870 | "description": "Send a text message" 1871 | }, 1872 | "$message.mail(object)": { 1873 | "prefix": "$message.mail", 1874 | "body": [ 1875 | "\\$message.mail({", 1876 | "\tsubject: \"$1\",", 1877 | "\tto: [$2],", 1878 | "\tbody: \"$3\",", 1879 | "\thandler: function(result) {", 1880 | "\t\t$4", 1881 | "\t}", 1882 | "});" 1883 | ], 1884 | "description": "Send an email" 1885 | }, 1886 | "$calendar.fetch(object)": { 1887 | "prefix": "$calendar.fetch", 1888 | "body": [ 1889 | "\\$calendar.fetch({", 1890 | "\tstartDate: ${1:date},", 1891 | "\thours: ${2:hours},", 1892 | "\thandler: function(resp) {", 1893 | "\t\tvar events = resp.events;", 1894 | "\t\t$3", 1895 | "\t}", 1896 | "});" 1897 | ], 1898 | "description": "Fetch calendar items" 1899 | }, 1900 | "$calendar.create(object)": { 1901 | "prefix": "$calendar.create", 1902 | "body": [ 1903 | "\\$calendar.create({", 1904 | "\ttitle: \"$1\",", 1905 | "\tstartDate: ${2:date},", 1906 | "\thours: ${3:hours},", 1907 | "\tnotes: \"$4\",", 1908 | "\thandler: function(resp) {", 1909 | "\t\t$5", 1910 | "\t}", 1911 | "});" 1912 | ], 1913 | "description": "Create a calendar item" 1914 | }, 1915 | "$calendar.save(object)": { 1916 | "prefix": "$calendar.save", 1917 | "body": [ 1918 | "\\$calendar.save({event: ${1:event}});" 1919 | ], 1920 | "description": "Save a calendar item after modified" 1921 | }, 1922 | "$calendar.delete(object)": { 1923 | "prefix": "$calendar.delete", 1924 | "body": [ 1925 | "\\$calendar.delete({", 1926 | "\tevent: ${1:event},", 1927 | "\thandler: function(resp) {", 1928 | "\t\t$2", 1929 | "\t}", 1930 | "});" 1931 | ], 1932 | "description": "Delete a calendar item" 1933 | }, 1934 | "$reminder.fetch(object)": { 1935 | "prefix": "$reminder.fetch", 1936 | "body": [ 1937 | "\\$reminder.fetch({", 1938 | "\tstartDate: ${1:date},", 1939 | "\thours: ${2:hours},", 1940 | "\thandler: function(resp) {", 1941 | "\t\tvar events = resp.events;", 1942 | "\t\t$3", 1943 | "\t}", 1944 | "});" 1945 | ], 1946 | "description": "Fetch reminder items" 1947 | }, 1948 | "$reminder.create(object)": { 1949 | "prefix": "$reminder.create", 1950 | "body": [ 1951 | "\\$reminder.create({", 1952 | "\ttitle: \"$1\",", 1953 | "\talarmDate: ${2:date},", 1954 | "\tnotes: \"$3\",", 1955 | "\turl: \"$4\",", 1956 | "\thandler: function(resp) {", 1957 | "\t\t$5", 1958 | "\t}", 1959 | "});" 1960 | ], 1961 | "description": "Create a reminder" 1962 | }, 1963 | "$reminder.save(object)": { 1964 | "prefix": "$reminder.save", 1965 | "body": [ 1966 | "\\$reminder.save({", 1967 | "\tevent: ${1:event},", 1968 | "\thandler: function(resp) {", 1969 | "\t\t$2", 1970 | "\t}", 1971 | "});" 1972 | ], 1973 | "description": "Save a reminder item after modified" 1974 | }, 1975 | "$reminder.delete(object)": { 1976 | "prefix": "$reminder.delete", 1977 | "body": [ 1978 | "\\$reminder.delete({", 1979 | "\tevent: ${1:event},", 1980 | "\thandler: function(resp) {", 1981 | "\t\t$2", 1982 | "\t}", 1983 | "});" 1984 | ], 1985 | "description": "Delete a reminder item" 1986 | }, 1987 | "$contact.pick(object)": { 1988 | "prefix": "$contact.pick", 1989 | "body": [ 1990 | "\\$contact.pick({", 1991 | "\tmulti: ${1|true,false|},", 1992 | "\thandler: function(contact) {", 1993 | "\t\t$2", 1994 | "\t}", 1995 | "});" 1996 | ], 1997 | "description": "Pick contacts" 1998 | }, 1999 | "$contact.fetch(object)": { 2000 | "prefix": "$contact.fetch", 2001 | "body": [ 2002 | "\\$contact.fetch({", 2003 | "\tkey: \"$1\",", 2004 | "\thandler: function(contacts) {", 2005 | "\t\t$2", 2006 | "\t}", 2007 | "});" 2008 | ], 2009 | "description": "Fetch contacts" 2010 | }, 2011 | "$contact.create(object)": { 2012 | "prefix": "$contact.create", 2013 | "body": [ 2014 | "\\$contact.create({", 2015 | "\tgivenName: \"$1\",", 2016 | "\tfamilyName: \"$2\",", 2017 | "\tphoneNumbers: {", 2018 | "\t\t\"Home\": \"$3\"", 2019 | "\t},", 2020 | "\temails: {", 2021 | "\t\t\"Home\": \"$4\"", 2022 | "\t},", 2023 | "\thandler: function(resp) {", 2024 | "\t\t$5", 2025 | "\t}", 2026 | "});" 2027 | ], 2028 | "description": "Create a contact" 2029 | }, 2030 | "$contact.save(object)": { 2031 | "prefix": "$contact.save", 2032 | "body": [ 2033 | "\\$contact.save({", 2034 | "\tcontact: ${1:contact},", 2035 | "\thandler: function(resp) {", 2036 | "\t\t$2", 2037 | "\t}", 2038 | "});" 2039 | ], 2040 | "description": "Save a contact after modified" 2041 | }, 2042 | "$contact.delete(object)": { 2043 | "prefix": "$contact.delete", 2044 | "body": [ 2045 | "\\$contact.delete({", 2046 | "\tcontacts: ${1:contacts},", 2047 | "\thandler: function(resp) {", 2048 | "\t\t$2", 2049 | "\t}", 2050 | "});" 2051 | ], 2052 | "description": "Delete some contacts" 2053 | }, 2054 | "$contact.fetchGroups(object)": { 2055 | "prefix": "$contact.fetchGroups", 2056 | "body": [ 2057 | "\\$contact.fetchGroups({", 2058 | "\thandler: function(groups) {", 2059 | "\t\t$1", 2060 | "\t}", 2061 | "});" 2062 | ], 2063 | "description": "Fetch all groups" 2064 | }, 2065 | "$contact.addGroup(object)": { 2066 | "prefix": "$contact.addGroup", 2067 | "body": [ 2068 | "\\$contact.addGroup({", 2069 | "\tname: \"$1\",", 2070 | "\thandler: function(group) {", 2071 | "\t\t$2", 2072 | "\t}", 2073 | "});" 2074 | ], 2075 | "description": "Add a group with name" 2076 | }, 2077 | "$contact.deleteGroup(object)": { 2078 | "prefix": "$contact.deleteGroup", 2079 | "body": [ 2080 | "\\$contact.deleteGroup({", 2081 | "\tgroup: $1,", 2082 | "\thandler: function(success) {", 2083 | "\t\t$2", 2084 | "\t}", 2085 | "});" 2086 | ], 2087 | "description": "Delete an existing group" 2088 | }, 2089 | "$contact.updateGroup(object)": { 2090 | "prefix": "$contact.updateGroup", 2091 | "body": [ 2092 | "\\$contact.updateGroup({", 2093 | "\tgroup: $1,", 2094 | "\thandler: function(success) {", 2095 | "\t\t$2", 2096 | "\t}", 2097 | "});" 2098 | ], 2099 | "description": "Save an updated group" 2100 | }, 2101 | "$contact.addToGroup(object)": { 2102 | "prefix": "$contact.addToGroup", 2103 | "body": [ 2104 | "\\$contact.addToGroup({", 2105 | "\tcontact: $1,", 2106 | "\tgroup: $2,", 2107 | "\thandler: function(success) {", 2108 | "\t\t$3", 2109 | "\t}", 2110 | "});" 2111 | ], 2112 | "description": "Add a contact to a group" 2113 | }, 2114 | "$contact.removeFromGroup(object)": { 2115 | "prefix": "$contact.removeFromGroup", 2116 | "body": [ 2117 | "\\$contact.removeFromGroup({", 2118 | "\tcontact: $1,", 2119 | "\tgroup: $2,", 2120 | "\thandler: function(success) {", 2121 | "\t\t$3", 2122 | "\t}", 2123 | "});" 2124 | ], 2125 | "description": "Remove a contact from a group" 2126 | }, 2127 | "$location.fetch(object)": { 2128 | "prefix": "$location.fetch", 2129 | "body": [ 2130 | "\\$location.fetch({", 2131 | "\thandler: function(resp) {", 2132 | "\t\tvar lat = resp.lat;", 2133 | "\t\tvar lng = resp.lat;", 2134 | "\t\tvar alt = resp.alt;", 2135 | "\t\t$1", 2136 | "\t}", 2137 | "});" 2138 | ], 2139 | "description": "Fetch current location" 2140 | }, 2141 | "$location.select(object)": { 2142 | "prefix": "$location.select", 2143 | "body": [ 2144 | "\\$location.select({", 2145 | "\thandler: function(resp) {", 2146 | "\t\tvar lat = resp.lat;", 2147 | "\t\tvar lng = resp.lat;", 2148 | "\t\t$1", 2149 | "\t}", 2150 | "});" 2151 | ], 2152 | "description": "Select location from map" 2153 | }, 2154 | "$location.startUpdates(object)": { 2155 | "prefix": "$location.startUpdates", 2156 | "body": [ 2157 | "\\$location.startUpdates({", 2158 | "\thandler: function(resp) {", 2159 | "\t\tvar lat = resp.lat", 2160 | "\t\tvar lng = resp.lat", 2161 | "\t\tvar alt = resp.alt", 2162 | "\t\t$1", 2163 | "\t}", 2164 | "});" 2165 | ], 2166 | "description": "Track user location" 2167 | }, 2168 | "$location.trackHeading(object)": { 2169 | "prefix": "$location.trackHeading", 2170 | "body": [ 2171 | "\\$location.trackHeading({", 2172 | "\thandler: function(resp) {", 2173 | "\t\tvar magneticHeading = resp.magneticHeading", 2174 | "\t\tvar trueHeading = resp.trueHeading", 2175 | "\t\tvar headingAccuracy = resp.headingAccuracy", 2176 | "\t\tvar x = resp.x", 2177 | "\t\tvar y = resp.y", 2178 | "\t\tvar z = resp.z", 2179 | "\t\t$1", 2180 | "\t}", 2181 | "});" 2182 | ], 2183 | "description": "Track user heading" 2184 | }, 2185 | "$location.stopUpdates()": { 2186 | "prefix": "$location.stopUpdates", 2187 | "body": [ 2188 | "\\$location.stopUpdates();" 2189 | ], 2190 | "description": "Stop track user location" 2191 | }, 2192 | "$motion.startUpdates(object)": { 2193 | "prefix": "$motion.startUpdates", 2194 | "body": [ 2195 | "\\$motion.startUpdates({", 2196 | "\tinterval: ${1:interval},", 2197 | "\thandler: function(resp) {", 2198 | "\t\t$2", 2199 | "\t}", 2200 | "});" 2201 | ], 2202 | "description": "Start track sensor data" 2203 | }, 2204 | "$motion.stopUpdates()": { 2205 | "prefix": "$motion.stopUpdates", 2206 | "body": [ 2207 | "\\$motion.stopUpdates();" 2208 | ], 2209 | "description": "Stop track sensor data" 2210 | }, 2211 | "$safari.open(object)": { 2212 | "prefix": "$safari.open", 2213 | "body": [ 2214 | "\\$safari.open({", 2215 | "\turl: \"$1\",", 2216 | "\tentersReader: ${2|true,false|},", 2217 | "\theight: ${3:height},", 2218 | "\thandler: function() {", 2219 | "\t\t$4", 2220 | "\t}", 2221 | "});" 2222 | ], 2223 | "description": "Open URL with Safari" 2224 | }, 2225 | "$safari.inject(script)": { 2226 | "prefix": "$safari.inject", 2227 | "body": [ 2228 | "\\$safari.inject(\"${1:script}\");" 2229 | ], 2230 | "description": "Inject script into Safari" 2231 | }, 2232 | "$safari.addReadingItem(script)": { 2233 | "prefix": "$safari.addReadingItem", 2234 | "body": [ 2235 | "\\$safari.addReadingItem({", 2236 | "\turl: \"$1\",", 2237 | "\ttitle: \"$2\",", 2238 | "\tpreview: \"$3\"", 2239 | "});" 2240 | ], 2241 | "description": "Add to Safari reading list" 2242 | }, 2243 | "$text.tokenize(object)": { 2244 | "prefix": "$text.tokenize", 2245 | "body": [ 2246 | "\\$text.tokenize({", 2247 | "\ttext: \"$1\",", 2248 | "\thandler: function(results) {", 2249 | "\t\t$2", 2250 | "\t}", 2251 | "});" 2252 | ], 2253 | "description": "Text tokenization" 2254 | }, 2255 | "$text.lookup(string)": { 2256 | "prefix": "$text.lookup", 2257 | "body": [ 2258 | "\\$text.lookup(\"${1:text}\");" 2259 | ], 2260 | "description": "Lookup text" 2261 | }, 2262 | "$text.speech(object)": { 2263 | "prefix": "$text.speech", 2264 | "body": [ 2265 | "\\$text.speech({", 2266 | "\ttext: \"$1\",", 2267 | "\trate: ${2:rate}", 2268 | "});" 2269 | ], 2270 | "description": "Text speech" 2271 | }, 2272 | "$text.base64Encode(string)": { 2273 | "prefix": "$text.base64Encode", 2274 | "body": [ 2275 | "\\$text.base64Encode(\"${1:text}\");" 2276 | ], 2277 | "description": "base64 Encode" 2278 | }, 2279 | "$text.base64Decode(string)": { 2280 | "prefix": "$text.base64Decode", 2281 | "body": [ 2282 | "\\$text.base64Decode(\"${1:text}\");" 2283 | ], 2284 | "description": "base64 Decode" 2285 | }, 2286 | "$text.URLEncode(string)": { 2287 | "prefix": "$text.URLEncode", 2288 | "body": [ 2289 | "\\$text.URLEncode(\"${1:text}\");" 2290 | ], 2291 | "description": "URL Encode" 2292 | }, 2293 | "$text.URLDecode(string)": { 2294 | "prefix": "$text.URLDecode", 2295 | "body": [ 2296 | "\\$text.URLDecode(\"${1:text}\");" 2297 | ], 2298 | "description": "URL Decode" 2299 | }, 2300 | "$text.HTMLEscape(string)": { 2301 | "prefix": "$text.HTMLEscape", 2302 | "body": [ 2303 | "\\$text.HTMLEscape(\"${1:text}\");" 2304 | ], 2305 | "description": "HTML Escape" 2306 | }, 2307 | "$text.HTMLUnescape(string)": { 2308 | "prefix": "$text.HTMLUnescape", 2309 | "body": [ 2310 | "\\$text.HTMLUnescape(\"${1:text}\");" 2311 | ], 2312 | "description": "HTML Unescape" 2313 | }, 2314 | "$text.MD5(string)": { 2315 | "prefix": "$text.MD5", 2316 | "body": [ 2317 | "\\$text.MD5(\"${1:text}\");" 2318 | ], 2319 | "description": "MD5" 2320 | }, 2321 | "$text.SHA1(string)": { 2322 | "prefix": "$text.SHA1", 2323 | "body": [ 2324 | "\\$text.SHA1(\"${1:text}\");" 2325 | ], 2326 | "description": "SHA1" 2327 | }, 2328 | "$text.SHA256(string)": { 2329 | "prefix": "$text.SHA256", 2330 | "body": [ 2331 | "\\$text.SHA256(\"${1:text}\");" 2332 | ], 2333 | "description": "SHA256" 2334 | }, 2335 | "$text.convertToPinYin(string)": { 2336 | "prefix": "$text.convertToPinYin", 2337 | "body": [ 2338 | "\\$text.convertToPinYin(\"${1:text}\");" 2339 | ], 2340 | "description": "Convert text to Pin Yin" 2341 | }, 2342 | "$text.markdownToHtml(string)": { 2343 | "prefix": "$text.markdownToHtml", 2344 | "body": [ 2345 | "\\$text.markdownToHtml(\"${1:text}\");" 2346 | ], 2347 | "description": "Convert markdown to html" 2348 | }, 2349 | "$text.htmlToMarkdown(string)": { 2350 | "prefix": "$text.htmlToMarkdown", 2351 | "body": [ 2352 | "\\$text.htmlToMarkdown(\"${1:text}\");" 2353 | ], 2354 | "description": "Convert html to markdown" 2355 | }, 2356 | "$text.decodeData(object)": { 2357 | "prefix": "$text.decodeData", 2358 | "body": [ 2359 | "\\$text.decodeData({", 2360 | "\tdata: $1,", 2361 | "\tencoding: $2", 2362 | "});" 2363 | ], 2364 | "description": "Decode data to text" 2365 | }, 2366 | "$share.sheet(object)": { 2367 | "prefix": "$share.sheet", 2368 | "body": [ 2369 | "\\$share.sheet([${1:item}]);" 2370 | ], 2371 | "description": "Present share sheet" 2372 | }, 2373 | "$share.wechat(object)": { 2374 | "prefix": "$share.wechat", 2375 | "body": [ 2376 | "\\$share.wechat(${1:object});" 2377 | ], 2378 | "description": "Share media to WeChat" 2379 | }, 2380 | "$share.qq(object)": { 2381 | "prefix": "$share.qq", 2382 | "body": [ 2383 | "\\$share.qq(${1:object});" 2384 | ], 2385 | "description": "Share media to QQ" 2386 | }, 2387 | "$share.tim(object)": { 2388 | "prefix": "$share.tim", 2389 | "body": [ 2390 | "\\$share.tim(${1:object});" 2391 | ], 2392 | "description": "Share media to TIM" 2393 | }, 2394 | "$qrcode.encode(string)": { 2395 | "prefix": "$qrcode.encode", 2396 | "body": [ 2397 | "\\$qrcode.encode(\"${1:string}\");" 2398 | ], 2399 | "description": "Encode a string to qrcode image" 2400 | }, 2401 | "$qrcode.decode(image)": { 2402 | "prefix": "$qrcode.decode", 2403 | "body": [ 2404 | "\\$qrcode.decode(${1:image});" 2405 | ], 2406 | "description": "Decode a qrcode image to string" 2407 | }, 2408 | "$qrcode.scan(object)": { 2409 | "prefix": "$qrcode.scan", 2410 | "body": [ 2411 | "\\$qrcode.scan({", 2412 | "\thandler(string) {", 2413 | "\t\t$1", 2414 | "\t},", 2415 | "\tcancelled() {", 2416 | "\t\t$2", 2417 | "\t}", 2418 | "});" 2419 | ], 2420 | "description": "Scan qrcode with camera" 2421 | }, 2422 | "$push.schedule(object)": { 2423 | "prefix": "$push.schedule", 2424 | "body": [ 2425 | "\\$push.schedule({", 2426 | "\ttitle: \"$1\",", 2427 | "\tbody: \"$2\",", 2428 | "\tdelay: ${3:delay}", 2429 | "});" 2430 | ], 2431 | "description": "Schedule a local push notification" 2432 | }, 2433 | "$push.cancel(object)": { 2434 | "prefix": "$push.cancel", 2435 | "body": [ 2436 | "\\$push.cancel({", 2437 | "\ttitle: \"$1\",", 2438 | "\tbody: \"$2\"", 2439 | "});" 2440 | ], 2441 | "description": "Cancel a local push notification" 2442 | }, 2443 | "$push.clear()": { 2444 | "prefix": "$push.clear", 2445 | "body": [ 2446 | "\\$push.clear();" 2447 | ], 2448 | "description": "Clear all push notifications" 2449 | }, 2450 | "$picker.date(object)": { 2451 | "prefix": "$picker.date", 2452 | "body": [ 2453 | "\\$picker.date({", 2454 | "\thandler: function(date) {", 2455 | "\t\t$1", 2456 | "\t}", 2457 | "});" 2458 | ], 2459 | "description": "Pick a date" 2460 | }, 2461 | "$archiver.zip(object)": { 2462 | "prefix": "$archiver.zip", 2463 | "body": [ 2464 | "\\$archiver.zip({", 2465 | "\tfiles: ${1:files},", 2466 | "\tdest: \"$2\",", 2467 | "\thandler: function(success) {", 2468 | "\t\t$3", 2469 | "\t}", 2470 | "});" 2471 | ], 2472 | "description": "Create a zip archiver" 2473 | }, 2474 | "$archiver.unzip(object)": { 2475 | "prefix": "$archiver.unzip", 2476 | "body": [ 2477 | "\\$archiver.unzip({", 2478 | "\tfile: ${1:file},", 2479 | "\tdest: \"$2\",", 2480 | "\thandler: function(success) {", 2481 | "\t\t$3", 2482 | "\t}", 2483 | "});" 2484 | ], 2485 | "description": "Unarchive a zip file" 2486 | }, 2487 | "$detector.date(string)": { 2488 | "prefix": "$detector.date", 2489 | "body": [ 2490 | "\\$detector.date(\"${1:string}\");" 2491 | ], 2492 | "description": "Get all dates from string" 2493 | }, 2494 | "$detector.address(string)": { 2495 | "prefix": "$detector.address", 2496 | "body": [ 2497 | "\\$detector.address(\"${1:string}\");" 2498 | ], 2499 | "description": "Get all addresses from string" 2500 | }, 2501 | "$detector.link(string)": { 2502 | "prefix": "$detector.link", 2503 | "body": [ 2504 | "\\$detector.link(\"${1:string}\");" 2505 | ], 2506 | "description": "Get all links from string" 2507 | }, 2508 | "$detector.phoneNumber(string)": { 2509 | "prefix": "$detector.phoneNumber", 2510 | "body": [ 2511 | "\\$detector.phoneNumber(\"${1:string}\");" 2512 | ], 2513 | "description": "Get all phone numbers from string" 2514 | }, 2515 | "$quicklook.open(object)": { 2516 | "prefix": "$quicklook.open", 2517 | "body": [ 2518 | "\\$quicklook.open();" 2519 | ], 2520 | "description": "Open QuickLook view" 2521 | }, 2522 | "$objc(className)": { 2523 | "prefix": "$objc", 2524 | "body": [ 2525 | "\\$objc(\"${1:className}\");" 2526 | ], 2527 | "description": "Get an objective-c class dynamically" 2528 | }, 2529 | "$objc_retain(object)": { 2530 | "prefix": "$objc_retain", 2531 | "body": [ 2532 | "\\$objc_retain(${1:object});" 2533 | ], 2534 | "description": "Retain an objective-c object" 2535 | }, 2536 | "$objc_release(object)": { 2537 | "prefix": "$objc_release", 2538 | "body": [ 2539 | "\\$objc_release(${1:object});" 2540 | ], 2541 | "description": "Release an objective-c object" 2542 | }, 2543 | "$get_protocol(name)": { 2544 | "prefix": "$get_protocol", 2545 | "body": [ 2546 | "\\$get_protocol(\"${1:name}\");" 2547 | ], 2548 | "description": "Get an objective-c protocol" 2549 | }, 2550 | "$objc_clean()": { 2551 | "prefix": "$objc_clean", 2552 | "body": [ 2553 | "\\$objc_clean();" 2554 | ], 2555 | "description": "Clean objective-c definitions" 2556 | }, 2557 | "$define_struct(object)": { 2558 | "prefix": "$define_struct", 2559 | "body": [ 2560 | "\\$define_struct({", 2561 | "\tname: \"$1\",", 2562 | "\tprops: $2", 2563 | "});" 2564 | ], 2565 | "description": "Define an objective-c struct" 2566 | }, 2567 | "$define(object)": { 2568 | "prefix": "$define", 2569 | "body": [ 2570 | "\\$define({", 2571 | "\ttype: \"$1\",", 2572 | "\tevents: {", 2573 | "\t\t$2", 2574 | "\t},", 2575 | "\tclassEvents: {", 2576 | "\t\t$3", 2577 | "\t}", 2578 | "});" 2579 | ], 2580 | "description": "Create an objective-c class dynamically" 2581 | }, 2582 | "$console.info(string)": { 2583 | "prefix": "$console.info", 2584 | "body": [ 2585 | "\\$console.info(\"${1:string}\");" 2586 | ], 2587 | "description": "Write info to console" 2588 | }, 2589 | "$console.warn(string)": { 2590 | "prefix": "$console.warn", 2591 | "body": [ 2592 | "\\$console.warn(\"${1:string}\");" 2593 | ], 2594 | "description": "Write warning to console" 2595 | }, 2596 | "$console.error(string)": { 2597 | "prefix": "$console.error", 2598 | "body": [ 2599 | "\\$console.error(\"${1:string}\");" 2600 | ], 2601 | "description": "Write error to console" 2602 | }, 2603 | "$console.clear()": { 2604 | "prefix": "$console.clear", 2605 | "body": [ 2606 | "\\$console.clear();" 2607 | ], 2608 | "description": "Clear console" 2609 | }, 2610 | "$console.open()": { 2611 | "prefix": "$console.open", 2612 | "body": [ 2613 | "\\$console.open();" 2614 | ], 2615 | "description": "Open console" 2616 | }, 2617 | "$console.close()": { 2618 | "prefix": "$console.close", 2619 | "body": [ 2620 | "\\$console.close();" 2621 | ], 2622 | "description": "Close console" 2623 | } 2624 | } 2625 | --------------------------------------------------------------------------------