Skip to content

Commit

Permalink
增加一个小功能,快速复制文字内容
Browse files Browse the repository at this point in the history
  • Loading branch information
bugluo committed Oct 19, 2018
1 parent 41f2ff8 commit 1f6b989
Show file tree
Hide file tree
Showing 241 changed files with 62 additions and 1 deletion.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/MochaJSDelegate.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/about.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/checkForUpdate.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/codeColor.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/codeSetting.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/codeStyle.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/colorReplace.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/common.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/commonPreview.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/commonPreviewJson.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/config.json
100644 → 100755
Empty file.
25 changes: 25 additions & 0 deletions WeSketch.sketchplugin/Contents/Sketch/copyText.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@import "common.js"

function copyText(context) {
var i18 = _(context).codeStyle;
function getText() {
paste(selection.stringValue().trim());
context.document.showMessage(i18.m2)
}
function paste(text) {
var pasteBoard = [NSPasteboard generalPasteboard];
[pasteBoard declareTypes: [NSArray arrayWithObject: NSPasteboardTypeString] owner: nil];
[pasteBoard setString: text forType: NSPasteboardTypeString];

}
if (context.selection.count() < 1) {
return context.document.showMessage(i18.m1);
}
var selection = context.selection[0];
getText(selection);
var ga = new Analytics(context);
if (ga) ga.sendEvent('codeText', 'use');
}
var onRun = function (context) {
copyText(context);
}
Empty file modified WeSketch.sketchplugin/Contents/Sketch/exportColor.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/exportSlice.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/exportUIkit.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/flag.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/fontCharacters.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/ga.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/i18n/jaJP.json
100644 → 100755
Empty file.
11 changes: 10 additions & 1 deletion WeSketch.sketchplugin/Contents/Sketch/i18n/manifest-enUS.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Miaow",
"author": "Tencent WeChat",
"version": "1.4.3",
"version": "1.4.4",
"identifier": "cn.wechat",
"description": "A set of plugins for Sketch include drawing links & marks, UI Kit & Color sync, font & text replacing",
"icon": "minicon.png",
Expand Down Expand Up @@ -243,6 +243,14 @@
"istool":"true",
"handler" : "onRun"
},
{
"name" : "Text Picker",
"identifier" : "codeText",
"script" : "copyText.js",
"shortcut": "command shift t",
"istool":"true",
"handler" : "onRun"
},
{
"name" : "Copy CSS Style",
"identifier" : "codeStyle",
Expand Down Expand Up @@ -402,6 +410,7 @@
"fontCharacters",
"-",
"codeColor",
"codeText",
"exportSlice",
"codeStyle",
"setSymbolCode",
Expand Down
Empty file modified WeSketch.sketchplugin/Contents/Sketch/i18n/manifest-jaJP.json
100644 → 100755
Empty file.
9 changes: 9 additions & 0 deletions WeSketch.sketchplugin/Contents/Sketch/i18n/manifest-zhCN.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@
"istool":"",
"handler" : "onRun"
},
{
"name" : "获取文字",
"identifier" : "codeText",
"script" : "copyText.js",
"shortcut": "command control c",
"istool":"true",
"handler" : "onRun"
},
{
"name" : "快捷取色",
"identifier" : "codeColor",
Expand Down Expand Up @@ -401,6 +409,7 @@
"fontCharacters",
"-",
"codeColor",
"codeText",
"exportSlice",
"codeStyle",
"setSymbolCode",
Expand Down
9 changes: 9 additions & 0 deletions WeSketch.sketchplugin/Contents/Sketch/i18n/manifest-zhTW.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@
"istool":"",
"handler" : "onRun"
},
{
"name" : "获取文字",
"identifier" : "codeText",
"script" : "copyText.js",
"shortcut": "command control c",
"istool":"true",
"handler" : "onRun"
},
{
"name" : "快捷取色",
"identifier" : "codeColor",
Expand Down Expand Up @@ -385,6 +393,7 @@
"fontCharacters",
"-",
"codeColor",
"codeText",
"exportSlice",
"codeStyle",
"codeSetting",
Expand Down
Empty file modified WeSketch.sketchplugin/Contents/Sketch/i18n/zhTW.json
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/iconQ.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/importColor.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/importUIkit.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/issues.js
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/panel/icon.html
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/panel/img/t1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/panel/img/t2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/toolbar/close.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/toolbar/line.png
100644 → 100755
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/toolbar/miaow.png
100644 → 100755
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/toolbar/wiki.png
100644 → 100755
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/toolbar2/line.png
100644 → 100755
Empty file modified WeSketch.sketchplugin/Contents/Sketch/library/toolbar2/wiki.png
100644 → 100755
Empty file modified WeSketch.sketchplugin/Contents/Sketch/localPreview.js
100644 → 100755
Empty file.
9 changes: 9 additions & 0 deletions WeSketch.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@
"istool":"true",
"handler" : "onRun"
},
{
"name" : "Text Picker",
"identifier" : "codeText",
"script" : "copyText.js",
"shortcut": "command control c",
"istool":"true",
"handler" : "onRun"
},
{
"name" : "Copy CSS Style",
"identifier" : "codeStyle",
Expand Down Expand Up @@ -402,6 +410,7 @@
"fontCharacters",
"-",
"codeColor",
"codeText",
"exportSlice",
"codeStyle",
"setSymbolCode",
Expand Down
Empty file modified WeSketch.sketchplugin/Contents/Sketch/onAction.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/organizer.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/preview.html
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/previewToolbar.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/setting.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/showPreview.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/sortingLayers.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/symbolCode.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/syncColor.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/syncSetting.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/textReplace.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/toolSetting.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/toolbar.js
100644 → 100755
Empty file.
Empty file modified WeSketch.sketchplugin/Contents/Sketch/webPreview.js
100644 → 100755
Empty file.

0 comments on commit 1f6b989

Please sign in to comment.