├── README.md ├── bug └── .ignore ├── case └── .ignore ├── client ├── linux │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── .zentao.sh │ │ ├── app.js │ │ ├── base.js │ │ ├── lang │ │ │ ├── Chinese.js │ │ │ └── English.js │ │ ├── node_modules │ │ │ ├── .bin │ │ │ │ ├── blessed │ │ │ │ └── blessed.cmd │ │ │ ├── blessed │ │ │ │ ├── .npmignore │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── bin │ │ │ │ │ └── tput.js │ │ │ │ ├── browser │ │ │ │ │ ├── Makefile │ │ │ │ │ └── transform.js │ │ │ │ ├── example │ │ │ │ │ ├── ansi-viewer │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── ansi-art.list │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── singlebyte.js │ │ │ │ │ ├── blessed-telnet.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── multiplex.js │ │ │ │ │ ├── ping │ │ │ │ │ ├── simple-form.js │ │ │ │ │ ├── time.js │ │ │ │ │ └── widget.js │ │ │ │ ├── index.js │ │ │ │ ├── lib │ │ │ │ │ ├── alias.js │ │ │ │ │ ├── blessed.js │ │ │ │ │ ├── colors.js │ │ │ │ │ ├── events.js │ │ │ │ │ ├── gpmclient.js │ │ │ │ │ ├── helpers.js │ │ │ │ │ ├── keys.js │ │ │ │ │ ├── program.js │ │ │ │ │ ├── tput.js │ │ │ │ │ ├── unicode.js │ │ │ │ │ ├── widget.js │ │ │ │ │ └── widgets │ │ │ │ │ │ ├── ansiimage.js │ │ │ │ │ │ ├── bigtext.js │ │ │ │ │ │ ├── box.js │ │ │ │ │ │ ├── button.js │ │ │ │ │ │ ├── checkbox.js │ │ │ │ │ │ ├── element.js │ │ │ │ │ │ ├── filemanager.js │ │ │ │ │ │ ├── form.js │ │ │ │ │ │ ├── image.js │ │ │ │ │ │ ├── input.js │ │ │ │ │ │ ├── layout.js │ │ │ │ │ │ ├── line.js │ │ │ │ │ │ ├── list.js │ │ │ │ │ │ ├── listbar.js │ │ │ │ │ │ ├── listtable.js │ │ │ │ │ │ ├── loading.js │ │ │ │ │ │ ├── log.js │ │ │ │ │ │ ├── message.js │ │ │ │ │ │ ├── node.js │ │ │ │ │ │ ├── overlayimage.js │ │ │ │ │ │ ├── progressbar.js │ │ │ │ │ │ ├── prompt.js │ │ │ │ │ │ ├── question.js │ │ │ │ │ │ ├── radiobutton.js │ │ │ │ │ │ ├── radioset.js │ │ │ │ │ │ ├── screen.js │ │ │ │ │ │ ├── scrollablebox.js │ │ │ │ │ │ ├── scrollabletext.js │ │ │ │ │ │ ├── table.js │ │ │ │ │ │ ├── terminal.js │ │ │ │ │ │ ├── text.js │ │ │ │ │ │ ├── textarea.js │ │ │ │ │ │ ├── textbox.js │ │ │ │ │ │ └── video.js │ │ │ │ ├── package.json │ │ │ │ ├── usr │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── AUTHORS │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README │ │ │ │ │ │ ├── ter-u14b.json │ │ │ │ │ │ └── ter-u14n.json │ │ │ │ │ ├── linux │ │ │ │ │ ├── windows-ansi │ │ │ │ │ ├── xterm │ │ │ │ │ ├── xterm-256color │ │ │ │ │ ├── xterm.termcap │ │ │ │ │ └── xterm.terminfo │ │ │ │ └── vendor │ │ │ │ │ └── tng.js │ │ │ └── xmldom │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── LICENSE │ │ │ │ ├── __package__.js │ │ │ │ ├── changelog │ │ │ │ ├── component.json │ │ │ │ ├── dom-parser.js │ │ │ │ ├── dom.js │ │ │ │ ├── package.json │ │ │ │ ├── readme.md │ │ │ │ └── sax.js │ │ └── zentao │ └── makefile └── tortoise │ ├── README.md │ ├── TurtleZenTao.sln │ ├── TurtleZenTao.v12.suo │ ├── TurtleZenTao │ ├── App.config │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── TurtleMain.cs │ ├── TurtleZenTao.csproj │ └── bin │ │ ├── Debug │ │ ├── Chinese.lang │ │ ├── English.lang │ │ ├── Newtonsoft.Json.dll │ │ ├── TurtleZenTao.exe │ │ ├── TurtleZenTao.exe.config │ │ ├── TurtleZenTao.pdb │ │ ├── TurtleZenTao.vshost.exe │ │ ├── TurtleZenTao.vshost.exe.config │ │ ├── TurtleZenTao.vshost.exe.manifest │ │ ├── TurtleZenTaoLib.dll │ │ └── TurtleZenTaoLib.pdb │ │ └── Release │ │ ├── Chinese.lang │ │ ├── English.lang │ │ ├── Newtonsoft.Json.dll │ │ ├── TurtleZenTao.exe │ │ ├── TurtleZenTao.exe.config │ │ ├── TurtleZenTao.pdb │ │ ├── TurtleZenTao.vshost.exe │ │ ├── TurtleZenTao.vshost.exe.config │ │ ├── TurtleZenTao.vshost.exe.manifest │ │ ├── TurtleZenTaoLib.dll │ │ ├── TurtleZenTaoLib.pdb │ │ └── turtlezendao.db │ └── TurtleZenTaoLib │ ├── DbManage.cs │ ├── HttpUtil.cs │ ├── IBugTraqProvider.cs │ ├── IssuesForm.Designer.cs │ ├── IssuesForm.cs │ ├── IssuesForm.resx │ ├── Lang.cs │ ├── LangChooseForm.Designer.cs │ ├── LangChooseForm.cs │ ├── LangChooseForm.resx │ ├── Plugin.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx │ ├── SiteEditForm.Designer.cs │ ├── SiteEditForm.cs │ ├── SiteEditForm.resx │ ├── SiteManageForm.Designer.cs │ ├── SiteManageForm.cs │ ├── SiteManageForm.resx │ ├── TurtleZenTaoLib.csproj │ ├── TurtleZenTaoLib.csproj.user │ ├── WorkTimeEditForm.Designer.cs │ ├── WorkTimeEditForm.cs │ ├── WorkTimeEditForm.resx │ ├── ZenTaoManage.cs │ ├── bin │ ├── Debug │ │ ├── Newtonsoft.Json.dll │ │ ├── TurtleZenTaoLib.dll │ │ └── TurtleZenTaoLib.pdb │ └── Release │ │ ├── Newtonsoft.Json.dll │ │ ├── TurtleZenTaoLib.dll │ │ └── TurtleZenTaoLib.pdb │ └── resource │ └── $this.Icon.ico ├── doc └── .ignore ├── language ├── en.php ├── en_tf ├── mergelang.php ├── separatelang.php └── zh-cn.php ├── plan └── .ignore ├── product └── .ignore ├── project └── .ignore ├── release └── .ignore ├── story └── .ignore ├── task └── .ignore ├── todo └── .ignore └── user └── .ignore /README.md: -------------------------------------------------------------------------------- 1 | ### 禅道扩展库使用说明 2 | 3 | * 这个库用来大家分享交流禅道扩展使用。 4 | * 请发Pull Request来提交您的代码。 5 | * 提交代码前请选择对应的分类目录。 6 | * 提交代码时请修改README.MD文件,将您的插件添加到索引中。 7 | 8 | ### ZENTAOPMS EXTENSION REPO 9 | 10 | * This repo is used to share extensions of zentaopms. 11 | * Please send pull request to summit your extension. 12 | * Please select a directory for your extension. 13 | * Please change the README.MD to add your extension. 14 | 15 | ### Extension list 16 | 17 | #### bug 18 | #### case 19 | #### doc 20 | #### language 21 | #### plan 22 | #### product 23 | #### project 24 | #### release 25 | #### story 26 | #### task 27 | #### todo 28 | #### user 29 | -------------------------------------------------------------------------------- /bug/.ignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/bug/.ignore -------------------------------------------------------------------------------- /case/.ignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/case/.ignore -------------------------------------------------------------------------------- /client/linux/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/linux/README.md -------------------------------------------------------------------------------- /client/linux/bin/.zentao.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | svnpath=/usr/bin/svn 3 | gitpath=/usr/bin/git 4 | zentaopath=~/.zentao/bin/zentao 5 | exepath=$svnpath 6 | commitFile=~/.zentao/tmp/.zentao.commit 7 | logInfoFile=~/.zentao/tmp/.commit.log 8 | logCommond="" 9 | function svn(){ 10 | exepath=$svnpath; 11 | logCommond="log -r COMMITTED -v --xml" 12 | 13 | case $1 in 14 | commit) 15 | runZentao $@; 16 | ;; 17 | ci) 18 | runZentao $@; 19 | ;; 20 | *) 21 | $exepath $@; 22 | ;; 23 | esac 24 | } 25 | 26 | function git(){ 27 | exepath=$gitpath; 28 | logCommond="log -1 --name-status --pretty=oneline" 29 | case $1 in 30 | commit) 31 | runZentao $@; 32 | ;; 33 | ci) 34 | runZentao $@; 35 | ;; 36 | *) 37 | $exepath $@; 38 | ;; 39 | esac 40 | 41 | } 42 | 43 | function runZentao(){ 44 | 45 | #清除上次执行生成的文件 46 | if [ -f $commitFile ]; then 47 | rm $commitFile; 48 | fi 49 | 50 | #清除上次执行生成的文件 51 | if [ -f $logInfoFile ]; then 52 | rm $logInfoFile; 53 | fi 54 | 55 | #执行禅道TUI操作命令 56 | $zentaopath $exepath; 57 | 58 | #当zentao执行成功并生成了提交文件才执行提交命令 59 | if [ -f $commitFile ]; then 60 | #提交之前先更新 61 | $exepath update 62 | #提交文件 63 | $exepath $@ -F $commitFile; 64 | 65 | #commit命令成功时执行 66 | if [ $? -eq 0 ]; then 67 | echo "$exepath">$logInfoFile 68 | $exepath $logCommond>>$logInfoFile 69 | $zentaopath $exepath; 70 | fi 71 | else 72 | #说明TUI中什么操作也没有做 73 | $exepath $@ 74 | fi 75 | } 76 | -------------------------------------------------------------------------------- /client/linux/bin/lang/Chinese.js: -------------------------------------------------------------------------------- 1 | var Lang = {}; 2 | 3 | Lang["UnsuportedOS"] = "不支持的操作系统, 只支持linux系统"; 4 | Lang["StartInstallZentao"] = "开始安装zentao-for-linux"; 5 | Lang["IsAddWebsite"] = "你没有添加过禅道站点,是否添加(y or n)"; 6 | Lang["EnterWebsiteName"] = "请输入站点名称"; 7 | Lang["EnterWebsiteURI"] = "请输入站点地址"; 8 | Lang["InvalidURI"] = "错误的站点地址格式,请重新输入"; 9 | Lang["EnterUserName"] = "请输入用户名"; 10 | Lang["EnterPassword"] = "请输入密码"; 11 | Lang["IsContinueAddWebsite"] = "是否继续添加站点(y or n)"; 12 | Lang["LoginFailed"] = "登录失败"; 13 | Lang["BugTableTitle"] = "Bug与任务"; 14 | Lang["BugTableTip"] = "按↑↓选择项目,按Space键切换选择状态,按0键切换解决状态\r\n按Tab键切换工作区域,按Shift + S键切换任务和BUG"; 15 | Lang["Select"] = "选择"; 16 | Lang["BugID"] = "BugID"; 17 | Lang["BugTitle"] = "标题"; 18 | Lang["BugResolved"] = "已解决"; 19 | Lang["BugTab"] = "Bug"; 20 | Lang["TaskTab"] = "任务"; 21 | Lang["TaskID"] = "任务ID"; 22 | Lang["TaskName"] = "任务名称"; 23 | Lang["ConsumedTime"] = "已用时"; 24 | Lang["RemainTime"] = "剩余用时"; 25 | Lang["TaskFinished"] = "已完成"; 26 | Lang["OK"] = "确定"; 27 | Lang["Cancel"] = "取消"; 28 | Lang["WorkTimeTitle"] = "工时统计"; 29 | Lang["siteTableTitle"] = "站点选择"; 30 | Lang["siteTableTip"] = "按↑↓选择项目,按Enter进入操作"; 31 | Lang["SiteName"] = "站点名称"; 32 | Lang["SiteUrl"] = "站点地址"; 33 | Lang["UserName"] = "用户名"; 34 | Lang["Password"] = "密码"; 35 | Lang["EnterRepository"] = "请输入仓库数字"; 36 | Lang["CheckedIcon"] = "●"; 37 | Lang["UnCheckedIcon"] = "○"; 38 | 39 | 40 | module.exports = Lang; -------------------------------------------------------------------------------- /client/linux/bin/lang/English.js: -------------------------------------------------------------------------------- 1 | var Lang = {}; 2 | 3 | Lang["UnsuportedOS"] = "Unsupported OS"; 4 | Lang["StartInstallZentao"] = "Start Install Zentao"; 5 | Lang["IsAddWebsite"] = "No website found, whether to add?(y or n)"; 6 | Lang["EnterWebsiteName"] = "Please enter website name"; 7 | Lang["EnterWebsiteURI"] = "please enter website url"; 8 | Lang["InvalidURI"] = "invalid url,please retry"; 9 | Lang["EnterUserName"] = "please enter username"; 10 | Lang["EnterPassword"] = "please enter password"; 11 | Lang["IsContinueAddWebsite"] = "continue to add?(y or n)"; 12 | Lang["LoginFailed"] = "Login Failed"; 13 | Lang["BugTableTitle"] = "Bug And Task"; 14 | Lang["BugTableTip"] = "Press↑↓ to select item,press Space to select/deselect,press 0 to resolve/unresolve\r\npress Tab to switch workspace,press Shift + S to switch Bug/Task"; 15 | Lang["Select"] = "Select"; 16 | Lang["BugID"] = "BugID"; 17 | Lang["BugTitle"] = "Title"; 18 | Lang["BugResolved"] = "Resloved"; 19 | Lang["BugTab"] = "Bug"; 20 | Lang["TaskTab"] = "Task"; 21 | Lang["TaskID"] = "TaskID"; 22 | Lang["TaskName"] = "TaskName"; 23 | Lang["ConsumedTime"] = "ConsumedTime"; 24 | Lang["RemainTime"] = "RemainTime"; 25 | Lang["TaskFinished"] = "Done"; 26 | Lang["OK"] = "OK"; 27 | Lang["Cancel"] = "Cancle"; 28 | Lang["WorkTimeTitle"] = "Work Time Edit"; 29 | Lang["siteTableTitle"] = "Site Select"; 30 | Lang["siteTableTip"] = "Press↑↓ to select item,press Enter to Bug/Task"; 31 | Lang["SiteName"] = "Site Name"; 32 | Lang["SiteUrl"] = "Site Url"; 33 | Lang["UserName"] = "UserName"; 34 | Lang["Password"] = "Password"; 35 | Lang["EnterRepository"] = "Please Enter Repository Number"; 36 | Lang["CheckedIcon"] = "●"; 37 | Lang["UnCheckedIcon"] = "○"; 38 | 39 | 40 | 41 | module.exports = Lang; -------------------------------------------------------------------------------- /client/linux/bin/node_modules/.bin/blessed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") 3 | 4 | case `uname` in 5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 6 | esac 7 | 8 | if [ -x "$basedir/node" ]; then 9 | "$basedir/node" "$basedir/../blessed/bin/tput.js" "$@" 10 | ret=$? 11 | else 12 | node "$basedir/../blessed/bin/tput.js" "$@" 13 | ret=$? 14 | fi 15 | exit $ret 16 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/.bin/blessed.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\..\blessed\bin\tput.js" %* 3 | ) ELSE ( 4 | @SETLOCAL 5 | @SET PATHEXT=%PATHEXT:;.JS;=;% 6 | node "%~dp0\..\blessed\bin\tput.js" %* 7 | ) -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | test/ 3 | img/ 4 | node_modules/ 5 | .jshintrc 6 | .jscsrc 7 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Blessed v0.1.0 - new terminal goodies for node.js 2 | 3 | ![blessed](https://raw.githubusercontent.com/chjj/blessed/master/img/v0.1.0-3.gif) 4 | 5 | The features demonstrated in the above gif __element transparency/shadow__ and 6 | __border docking__. 7 | 8 | ## New useful options for your typewriter application: 9 | 10 | - __`transparent` option__ - Lower element opacity to 50%. This will display 11 | dimmed elements and content behind the foreground element using a naive color 12 | blending function (good enough for a terminal's limited amount of colors). 13 | works best with 256color terminals. (see widget-shadow.js) 14 | 15 | - __`shadow` option__ - Give the element a translucent shadow. Automatically 16 | darkens the background behind it. (see widget-shadow.js) 17 | 18 | - __`dockBorders` option__ - Element borders will automatically "dock" to each 19 | other. Instead of overlapping the borders end up connecting. (see 20 | widget-dock.js) 21 | 22 | - __`autoPadding` default__ - Auto padding is now enabled by default, meaning 23 | blessed will automatically position elements inside their parent's border. 24 | 25 | - __`rleft` property__ - Relative offsets are now default element properties 26 | (`left` instead of `rleft`). 27 | 28 | - __`draggable` property__ - Make any element draggable with the mouse. (see 29 | widget-shadow.js or widget-dock.js) 30 | 31 | - __`Table` and `ListTable` elements__ - Tables with a high quality rendering. 32 | (see widget-table.js and widget-listtable.js) 33 | 34 | - __`Log` element__ - A top to bottom logger box with scrollback and other 35 | features. (see widget-log.js) 36 | 37 | - __Obscurable borders__ - In addition to docking borders, it's possible to 38 | obscure borders by sliding them off the screen with negative offsets. (see 39 | widget-dock.js) 40 | 41 | - __Percentage expressions__ - Like CSS, arithmetic can now be performed on 42 | percentages. e.g. `width: '50%-1'`. This is useful for overlapping borders on 43 | elements with a percentage width. (see widget-dock.js) 44 | 45 | ## Other features that weren't mentioned before: 46 | 47 | - __`setHover` option__ - Set a hover text box to follow cursor on mouseover, 48 | similar to how a web browser handles the "title" attribute. (see widget.js) 49 | 50 | - __`Terminal` element__ - Spin up a pseudo terminal as a blessed element. 51 | useful for writing a terminal multiplexer. (requires term.js and pty.js as 52 | optional dependencies). (see example/multiplex.js) 53 | 54 | - __`Image` element__ - Uses `w3mimgdisplay` to draw real images your terminal. 55 | this is much easier than calling w3mimgdisplay by hand. Image elements behave 56 | like any other element, although it is wise to use `width: 'shrink', height: 57 | 'shrink'`. (see widget-image.js) 58 | 59 | --- 60 | 61 | The major things that justified the 0.1.0 release were fixes and stabilization 62 | of api (`autoPadding`/`rleft`/`left`). Scrolling boxes were almost completely 63 | revamped to work a bit smarter. 64 | 65 | --- 66 | 67 | ## Things yet to come: 68 | 69 | - __@secrettriangle's [improvements](https://github.com/slap-editor/slap) for 70 | textareas__ - This allows for real text navigation. 71 | 72 | - __Gravity and margin layouts__ 73 | 74 | This is something that's been in the idea bin for a while. Every element could 75 | potentially have properties like: 76 | 77 | ``` 78 | gravity: 'bottomleft', 79 | margin: 5, 80 | `` 81 | 82 | In other words, just a more complex `float` system than what the CSSOM is used 83 | to. 84 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015, Christopher Jeffrey and contributors 2 | https://github.com/chjj/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/bin/tput.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var blessed = require('../') 4 | , argv = process.argv.slice(2) 5 | , cmd = argv.shift() 6 | , tput; 7 | 8 | tput = blessed.tput({ 9 | terminal: process.env.TERM, 10 | termcap: !!process.env.USE_TERMCAP, 11 | extended: true 12 | }); 13 | 14 | if (tput[cmd]) { 15 | process.stdout.write(tput[cmd].apply(tput, argv)); 16 | } 17 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/browser/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @cd .. && browserify -e index.js -o browser/blessed.js 3 | 4 | clean: 5 | @rm -f blessed.js 6 | 7 | .PHONY: clean all 8 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/browser/transform.js: -------------------------------------------------------------------------------- 1 | /** 2 | * transform.js - browserify workaround for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | var Transform = require('stream').Transform 8 | , path = require('path') 9 | , fs = require('fs'); 10 | 11 | /** 12 | * Transformer 13 | */ 14 | 15 | function transformer(code) { 16 | var stream = new Transform; 17 | stream._transform = function(chunk, encoding, callback) { 18 | return callback(null, chunk); 19 | }; 20 | stream._flush = function(callback) { 21 | if (code) { 22 | stream.push(code); 23 | } 24 | return callback(); 25 | }; 26 | return stream; 27 | } 28 | 29 | /** 30 | * Explicitly require all widgets in widget.js 31 | */ 32 | 33 | var widgets = fs.readdirSync(__dirname + '/../lib/widgets'); 34 | 35 | var requireWidgets = widgets.reduce(function(out, name) { 36 | name = path.basename(name, '.js'); 37 | out += '\nrequire(\'./widgets/' + name + '\');'; 38 | return out; 39 | }, ''); 40 | 41 | /** 42 | * Do not make filesystem calls in tput.js for 43 | * terminfo or termcap, just use xterm terminfo/cap. 44 | */ 45 | 46 | var infoPath = path.resolve(__dirname, '..', 'usr', 'xterm-256color') 47 | , capPath = path.resolve(__dirname, '..', 'usr', 'xterm.termcap'); 48 | 49 | var infoPathFake = path.resolve( 50 | path.sep, 'usr', 'share', 'terminfo', 51 | path.basename(infoPath)[0], 52 | path.basename(infoPath) 53 | ); 54 | 55 | function readMethods() { 56 | Tput._infoBuffer = new Buffer(TERMINFO, 'base64'); 57 | 58 | Tput.prototype.readTerminfo = function() { 59 | this.terminal = TERMINFO_NAME; 60 | return this.parseTerminfo(Tput._infoBuffer, TERMINFO_PATH); 61 | }; 62 | 63 | Tput.cpaths = []; 64 | Tput.termcap = TERMCAP; 65 | 66 | Tput.prototype._readTermcap = Tput.prototype.readTermcap; 67 | Tput.prototype.readTermcap = function() { 68 | this.terminal = TERMCAP_NAME; 69 | return this._readTermcap(this.terminal); 70 | }; 71 | 72 | Tput.prototype.detectUnicode = function() { 73 | return true; 74 | }; 75 | } 76 | 77 | readMethods = readMethods.toString().slice(24, -2) 78 | .replace(/^ /gm, '') 79 | .replace('TERMINFO', JSON.stringify(fs.readFileSync(infoPath, 'base64'))) 80 | .replace('TERMINFO_NAME', JSON.stringify(path.basename(infoPath))) 81 | .replace('TERMINFO_PATH', JSON.stringify(infoPathFake)) 82 | .replace('TERMCAP', JSON.stringify(fs.readFileSync(capPath, 'utf8'))) 83 | .replace('TERMCAP_NAME', JSON.stringify(path.basename(capPath, '.termcap'))); 84 | 85 | /** 86 | * Helpers 87 | */ 88 | 89 | function end(file, offset) { 90 | return file.split(path.sep).slice(-offset).join('/'); 91 | } 92 | 93 | /** 94 | * Expose 95 | */ 96 | 97 | module.exports = function(file) { 98 | if (end(file, 2) === 'lib/widget.js') { 99 | return transformer(requireWidgets); 100 | } 101 | if (end(file, 2) === 'lib/tput.js') { 102 | return transformer(readMethods); 103 | } 104 | return transformer(); 105 | }; 106 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/ansi-viewer/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Christopher Jeffrey 2 | https://github.com/chjj/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/ansi-viewer/README.md: -------------------------------------------------------------------------------- 1 | # ansi-viewer 2 | 3 | A terminal app to view ANSI art from http://artscene.textfiles.com/ansi/. 4 | 5 | ![ansi-viewer](https://raw.githubusercontent.com/chjj/blessed/master/img/ansi-viewer.png) 6 | 7 | ## Contribution and License Agreement 8 | 9 | If you contribute code to this project, you are implicitly allowing your code 10 | to be distributed under the MIT license. You are also implicitly verifying that 11 | all code is your original work. `` 12 | 13 | ## License 14 | 15 | Copyright (c) 2015, Christopher Jeffrey. (MIT License) 16 | 17 | See LICENSE for more info. 18 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/ansi-viewer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ansi-viewer", 3 | "description": "ANSI art viewer for node", 4 | "author": "Christopher Jeffrey", 5 | "version": "0.0.1", 6 | "main": "./index.js", 7 | "bin": "./index.js", 8 | "preferGlobal": false, 9 | "repository": "git://github.com/chjj/blessed.git", 10 | "homepage": "https://github.com/chjj/blessed", 11 | "bugs": { "url": "http://github.com/chjj/blessed/issues" }, 12 | "keywords": ["ansi", "art"], 13 | "tags": ["ansi", "art"], 14 | "dependencies": { 15 | "blessed": ">=0.1.5", 16 | "term.js": "0.0.4", 17 | "request": "2.55.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/blessed-telnet.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * blessed-telnet.js 5 | * https://github.com/chjj/blessed 6 | * Copyright (c) 2013-2015, Christopher Jeffrey (MIT License) 7 | * A blessed telnet server. 8 | * See: https://github.com/TooTallNate/node-telnet 9 | */ 10 | 11 | process.title = 'blessed-telnet'; 12 | 13 | var fs = require('fs'); 14 | var path = require('path'); 15 | var blessed = require('blessed'); 16 | var telnet = require('telnet'); 17 | 18 | var server = telnet.createServer(function(client) { 19 | client.do.transmit_binary(); 20 | client.do.terminal_type(); 21 | client.do.window_size(); 22 | client.do.environment_variables(); 23 | 24 | client.on('debug', function(msg) { 25 | console.error(msg); 26 | }); 27 | 28 | client.on('environment variables', function(data) { 29 | if (data.command === 'sb') { 30 | if (data.name === 'TERM') { 31 | screen.terminal = data.value; 32 | } else { 33 | // Clear the screen since they may have used `env send [var]`. 34 | screen.realloc(); 35 | } 36 | screen.render(); 37 | } 38 | }); 39 | 40 | client.on('terminal type', function(data) { 41 | if (data.command === 'sb' && data.name) { 42 | screen.terminal = data.name; 43 | screen.render(); 44 | } 45 | }); 46 | 47 | client.on('window size', function(data) { 48 | if (data.command === 'sb') { 49 | client.columns = data.columns; 50 | client.rows = data.rows; 51 | client.emit('resize'); 52 | } 53 | }); 54 | 55 | // Make the client look like a tty: 56 | client.setRawMode = function(mode) { 57 | client.isRaw = mode; 58 | if (!client.writable) return; 59 | if (mode) { 60 | client.do.suppress_go_ahead(); 61 | client.will.suppress_go_ahead(); 62 | client.will.echo(); 63 | } else { 64 | client.dont.suppress_go_ahead(); 65 | client.wont.suppress_go_ahead(); 66 | client.wont.echo(); 67 | } 68 | }; 69 | client.isTTY = true; 70 | client.isRaw = false; 71 | client.columns = 80; 72 | client.rows = 24; 73 | 74 | var screen = blessed.screen({ 75 | smartCSR: true, 76 | input: client, 77 | output: client, 78 | terminal: 'xterm-256color', 79 | fullUnicode: true 80 | }); 81 | 82 | client.on('close', function() { 83 | if (!screen.destroyed) { 84 | screen.destroy(); 85 | } 86 | }); 87 | 88 | screen.on('destroy', function() { 89 | if (client.writable) { 90 | client.destroy(); 91 | } 92 | }); 93 | 94 | if (test === 'widget-simple') { 95 | return simpleTest(screen); 96 | } 97 | 98 | loadTest(screen, test); 99 | }); 100 | 101 | function simpleTest(screen) { 102 | screen.data.main = blessed.box({ 103 | parent: screen, 104 | width: '80%', 105 | height: '90%', 106 | border: 'line', 107 | content: 'Welcome to my server. Here is your own private session.', 108 | style: { 109 | bg: 'red' 110 | } 111 | }); 112 | 113 | screen.key('i', function() { 114 | screen.data.main.style.bg = 'blue'; 115 | screen.render(); 116 | }); 117 | 118 | screen.key(['C-c', 'q'], function(ch, key) { 119 | screen.destroy(); 120 | }); 121 | 122 | screen.render(); 123 | } 124 | 125 | var test = process.argv[2] || path.resolve(__dirname, '../test/widget-shadow.js'); 126 | if (~test.indexOf('widget-png.js')) process.argv.length = 2; 127 | test = path.resolve(process.cwd(), test); 128 | 129 | function loadTest(screen, name) { 130 | var Screen = blessed.screen; 131 | blessed.screen = function() { return screen; }; 132 | var path = require.resolve(name); 133 | delete require.cache[path]; 134 | require(name); 135 | blessed.screen = Screen; 136 | } 137 | 138 | server.listen(2300); 139 | console.log('Listening on 2300...'); 140 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Example Program for Blessed 3 | * Copyright (c) 2013, Christopher Jeffrey (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | var blessed = require('../') 8 | , program = blessed.program(); 9 | 10 | process.title = 'blessed'; 11 | 12 | program.on('keypress', function(ch, key) { 13 | if (key.name === 'q') { 14 | program.clear(); 15 | program.disableMouse(); 16 | program.showCursor(); 17 | program.normalBuffer(); 18 | process.exit(0); 19 | } 20 | }); 21 | 22 | program.on('mouse', function(data) { 23 | if (data.action === 'mouseup') return; 24 | program.move(1, program.rows); 25 | program.eraseInLine('right'); 26 | if (data.action === 'wheelup') { 27 | program.write('Mouse wheel up at: ' + data.x + ', ' + data.y); 28 | } else if (data.action === 'wheeldown') { 29 | program.write('Mouse wheel down at: ' + data.x + ', ' + data.y); 30 | } else if (data.action === 'mousedown' && data.button === 'left') { 31 | program.write('Left button down at: ' + data.x + ', ' + data.y); 32 | } else if (data.action === 'mousedown' && data.button === 'right') { 33 | program.write('Right button down at: ' + data.x + ', ' + data.y); 34 | } else { 35 | program.write('Mouse at: ' + data.x + ', ' + data.y); 36 | } 37 | program.move(data.x, data.y); 38 | program.bg('red'); 39 | program.write(' '); 40 | program.bg('!red'); 41 | }); 42 | 43 | program.on('focus', function() { 44 | program.move(1, program.rows); 45 | program.write('Gained focus.'); 46 | }); 47 | 48 | program.on('blur', function() { 49 | program.move(1, program.rows); 50 | program.write('Lost focus.'); 51 | }); 52 | 53 | program.alternateBuffer(); 54 | program.enableMouse(); 55 | program.hideCursor(); 56 | program.clear(); 57 | 58 | program.move(1, 1); 59 | program.bg('black'); 60 | program.write('Hello world', 'blue fg'); 61 | program.setx((program.cols / 2 | 0) - 4); 62 | program.down(5); 63 | program.write('Hi again!'); 64 | program.bg('!black'); 65 | program.feed(); 66 | 67 | program.getCursor(function(err, data) { 68 | if (!err) { 69 | program.write('Cursor is at: ' + data.x + ', ' + data.y + '.'); 70 | program.feed(); 71 | } 72 | 73 | program.charset('SCLD'); 74 | program.write('abcdefghijklmnopqrstuvwxyz0123456789'); 75 | program.charset('US'); 76 | program.setx(1); 77 | }); 78 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/multiplex.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * multiplex.js 5 | * https://github.com/chjj/blessed 6 | * Copyright (c) 2013-2015, Christopher Jeffrey (MIT License) 7 | * A terminal multiplexer created by blessed. 8 | */ 9 | 10 | process.title = 'multiplex.js'; 11 | 12 | var blessed = require('blessed') 13 | , screen; 14 | 15 | screen = blessed.screen({ 16 | smartCSR: true, 17 | log: process.env.HOME + '/blessed-terminal.log', 18 | fullUnicode: true, 19 | dockBorders: true, 20 | ignoreDockContrast: true 21 | }); 22 | 23 | var topleft = blessed.terminal({ 24 | parent: screen, 25 | cursor: 'line', 26 | cursorBlink: true, 27 | screenKeys: false, 28 | label: ' multiplex.js ', 29 | left: 0, 30 | top: 0, 31 | width: '50%', 32 | height: '50%', 33 | border: 'line', 34 | style: { 35 | fg: 'default', 36 | bg: 'default', 37 | focus: { 38 | border: { 39 | fg: 'green' 40 | } 41 | } 42 | } 43 | }); 44 | 45 | topleft.pty.on('data', function(data) { 46 | screen.log(JSON.stringify(data)); 47 | }); 48 | 49 | var topright = blessed.terminal({ 50 | parent: screen, 51 | cursor: 'block', 52 | cursorBlink: true, 53 | screenKeys: false, 54 | label: ' multiplex.js ', 55 | left: '50%-1', 56 | top: 0, 57 | width: '50%+1', 58 | height: '50%', 59 | border: 'line', 60 | style: { 61 | fg: 'red', 62 | bg: 'black', 63 | focus: { 64 | border: { 65 | fg: 'green' 66 | } 67 | } 68 | } 69 | }); 70 | 71 | var bottomleft = blessed.terminal({ 72 | parent: screen, 73 | cursor: 'block', 74 | cursorBlink: true, 75 | screenKeys: false, 76 | label: ' multiplex.js ', 77 | left: 0, 78 | top: '50%-1', 79 | width: '50%', 80 | height: '50%+1', 81 | border: 'line', 82 | style: { 83 | fg: 'default', 84 | bg: 'default', 85 | focus: { 86 | border: { 87 | fg: 'green' 88 | } 89 | } 90 | } 91 | }); 92 | 93 | var bottomright = blessed.terminal({ 94 | parent: screen, 95 | cursor: 'block', 96 | cursorBlink: true, 97 | screenKeys: false, 98 | label: ' multiplex.js ', 99 | left: '50%-1', 100 | top: '50%-1', 101 | width: '50%+1', 102 | height: '50%+1', 103 | border: 'line', 104 | style: { 105 | fg: 'default', 106 | bg: 'default', 107 | focus: { 108 | border: { 109 | fg: 'green' 110 | } 111 | } 112 | } 113 | }); 114 | 115 | [topleft, topright, bottomleft, bottomright].forEach(function(term) { 116 | term.enableDrag(function(mouse) { 117 | return !!mouse.ctrl; 118 | }); 119 | term.on('title', function(title) { 120 | screen.title = title; 121 | term.setLabel(' ' + title + ' '); 122 | screen.render(); 123 | }); 124 | term.on('click', term.focus.bind(term)); 125 | }); 126 | 127 | topleft.focus(); 128 | 129 | screen.key('C-q', function() { 130 | topleft.kill(); 131 | topright.kill(); 132 | bottomleft.kill(); 133 | bottomright.kill(); 134 | return screen.destroy(); 135 | }); 136 | 137 | screen.program.key('S-tab', function() { 138 | screen.focusNext(); 139 | screen.render(); 140 | }); 141 | 142 | screen.render(); 143 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/simple-form.js: -------------------------------------------------------------------------------- 1 | var blessed = require('blessed') 2 | , screen = blessed.screen(); 3 | 4 | var form = blessed.form({ 5 | parent: screen, 6 | keys: true, 7 | left: 0, 8 | top: 0, 9 | width: 30, 10 | height: 4, 11 | bg: 'green', 12 | content: 'Submit or cancel?' 13 | }); 14 | 15 | var submit = blessed.button({ 16 | parent: form, 17 | mouse: true, 18 | keys: true, 19 | shrink: true, 20 | padding: { 21 | left: 1, 22 | right: 1 23 | }, 24 | left: 10, 25 | top: 2, 26 | shrink: true, 27 | name: 'submit', 28 | content: 'submit', 29 | style: { 30 | bg: 'blue', 31 | focus: { 32 | bg: 'red' 33 | }, 34 | hover: { 35 | bg: 'red' 36 | } 37 | } 38 | }); 39 | 40 | var cancel = blessed.button({ 41 | parent: form, 42 | mouse: true, 43 | keys: true, 44 | shrink: true, 45 | padding: { 46 | left: 1, 47 | right: 1 48 | }, 49 | left: 20, 50 | top: 2, 51 | shrink: true, 52 | name: 'cancel', 53 | content: 'cancel', 54 | style: { 55 | bg: 'blue', 56 | focus: { 57 | bg: 'red' 58 | }, 59 | hover: { 60 | bg: 'red' 61 | } 62 | } 63 | }); 64 | 65 | submit.on('press', function() { 66 | form.submit(); 67 | }); 68 | 69 | cancel.on('press', function() { 70 | form.reset(); 71 | }); 72 | 73 | form.on('submit', function(data) { 74 | form.setContent('Submitted.'); 75 | screen.render(); 76 | }); 77 | 78 | form.on('reset', function(data) { 79 | form.setContent('Canceled.'); 80 | screen.render(); 81 | }); 82 | 83 | screen.key('q', function() { 84 | process.exit(0); 85 | }); 86 | 87 | screen.render(); 88 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/example/widget.js: -------------------------------------------------------------------------------- 1 | var blessed = require('../'); 2 | 3 | // Create a screen object. 4 | var screen = blessed.screen(); 5 | 6 | // Create a box perfectly centered horizontally and vertically. 7 | var box = blessed.box({ 8 | top: 'center', 9 | left: 'center', 10 | width: '50%', 11 | height: '50%', 12 | content: 'Hello {bold}world{/bold}!', 13 | tags: true, 14 | border: { 15 | type: 'line' 16 | }, 17 | style: { 18 | fg: 'white', 19 | bg: 'magenta', 20 | border: { 21 | fg: '#ffffff' 22 | }, 23 | hover: { 24 | bg: 'green' 25 | } 26 | } 27 | }); 28 | 29 | // Append our box to the screen. 30 | screen.append(box); 31 | 32 | // If our box is clicked, change the content. 33 | box.on('click', function(data) { 34 | box.setContent('{center}Some different {red-fg}content{/red-fg}.{/center}'); 35 | screen.render(); 36 | }); 37 | 38 | // If box is focused, handle `enter` and give us some more content. 39 | box.key('enter', function() { 40 | box.setContent('{right}Even different {black-fg}content{/black-fg}.{/right}\n'); 41 | box.setLine(1, 'bar'); 42 | box.insertLine(1, 'foo'); 43 | screen.render(); 44 | }); 45 | 46 | // Quit on Escape, q, or Control-C. 47 | screen.key(['escape', 'q', 'C-c'], function(ch, key) { 48 | return process.exit(0); 49 | }); 50 | 51 | // Focus our element. 52 | box.focus(); 53 | 54 | // Render the screen. 55 | screen.render(); 56 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/blessed'); 2 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/blessed.js: -------------------------------------------------------------------------------- 1 | /** 2 | * blessed - a high-level terminal interface library for node.js 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Blessed 9 | */ 10 | 11 | function blessed() { 12 | return blessed.program.apply(null, arguments); 13 | } 14 | 15 | blessed.program = blessed.Program = require('./program'); 16 | blessed.tput = blessed.Tput = require('./tput'); 17 | blessed.widget = require('./widget'); 18 | blessed.colors = require('./colors'); 19 | blessed.unicode = require('./unicode'); 20 | blessed.helpers = require('./helpers'); 21 | 22 | blessed.helpers.sprintf = blessed.tput.sprintf; 23 | blessed.helpers.tryRead = blessed.tput.tryRead; 24 | blessed.helpers.merge(blessed, blessed.helpers); 25 | 26 | blessed.helpers.merge(blessed, blessed.widget); 27 | 28 | /** 29 | * Expose 30 | */ 31 | 32 | module.exports = blessed; 33 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/events.js: -------------------------------------------------------------------------------- 1 | /** 2 | * events.js - event emitter for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | var slice = Array.prototype.slice; 8 | 9 | /** 10 | * EventEmitter 11 | */ 12 | 13 | function EventEmitter() { 14 | if (!this._events) this._events = {}; 15 | } 16 | 17 | EventEmitter.prototype.setMaxListeners = function(n) { 18 | this._maxListeners = n; 19 | }; 20 | 21 | EventEmitter.prototype.addListener = function(type, listener) { 22 | if (!this._events[type]) { 23 | this._events[type] = listener; 24 | } else if (typeof this._events[type] === 'function') { 25 | this._events[type] = [this._events[type], listener]; 26 | } else { 27 | this._events[type].push(listener); 28 | } 29 | this._emit('newListener', [type, listener]); 30 | }; 31 | 32 | EventEmitter.prototype.on = EventEmitter.prototype.addListener; 33 | 34 | EventEmitter.prototype.removeListener = function(type, listener) { 35 | var handler = this._events[type]; 36 | if (!handler) return; 37 | 38 | if (typeof handler === 'function' || handler.length === 1) { 39 | delete this._events[type]; 40 | this._emit('removeListener', [type, listener]); 41 | return; 42 | } 43 | 44 | for (var i = 0; i < handler.length; i++) { 45 | if (handler[i] === listener || handler[i].listener === listener) { 46 | handler.splice(i, 1); 47 | this._emit('removeListener', [type, listener]); 48 | return; 49 | } 50 | } 51 | }; 52 | 53 | EventEmitter.prototype.off = EventEmitter.prototype.removeListener; 54 | 55 | EventEmitter.prototype.removeAllListeners = function(type) { 56 | if (type) { 57 | delete this._events[type]; 58 | } else { 59 | this._events = {}; 60 | } 61 | }; 62 | 63 | EventEmitter.prototype.once = function(type, listener) { 64 | function on() { 65 | this.removeListener(type, on); 66 | return listener.apply(this, arguments); 67 | } 68 | on.listener = listener; 69 | return this.on(type, on); 70 | }; 71 | 72 | EventEmitter.prototype.listeners = function(type) { 73 | return typeof this._events[type] === 'function' 74 | ? [this._events[type]] 75 | : this._events[type] || []; 76 | }; 77 | 78 | EventEmitter.prototype._emit = function(type, args) { 79 | var handler = this._events[type] 80 | , ret; 81 | 82 | // if (type !== 'event') { 83 | // this._emit('event', [type.replace(/^element /, '')].concat(args)); 84 | // } 85 | 86 | if (!handler) { 87 | if (type === 'error') { 88 | throw new args[0]; 89 | } 90 | return; 91 | } 92 | 93 | if (typeof handler === 'function') { 94 | return handler.apply(this, args); 95 | } 96 | 97 | for (var i = 0; i < handler.length; i++) { 98 | if (handler[i].apply(this, args) === false) { 99 | ret = false; 100 | } 101 | } 102 | 103 | return ret !== false; 104 | }; 105 | 106 | EventEmitter.prototype.emit = function(type) { 107 | var args = slice.call(arguments, 1) 108 | , params = slice.call(arguments) 109 | , el = this; 110 | 111 | this._emit('event', params); 112 | 113 | if (this.type === 'screen') { 114 | return this._emit(type, args); 115 | } 116 | 117 | if (this._emit(type, args) === false) { 118 | return false; 119 | } 120 | 121 | type = 'element ' + type; 122 | args.unshift(this); 123 | // `element` prefix 124 | // params = [type].concat(args); 125 | // no `element` prefix 126 | // params.splice(1, 0, this); 127 | 128 | do { 129 | // el._emit('event', params); 130 | if (!el._events[type]) continue; 131 | if (el._emit(type, args) === false) { 132 | return false; 133 | } 134 | } while (el = el.parent); 135 | 136 | return true; 137 | }; 138 | 139 | // For hooking into the main EventEmitter if we want to. 140 | // Might be better to do things this way being that it 141 | // will always be compatible with node, not to mention 142 | // it gives us domain support as well. 143 | // Node.prototype._emit = Node.prototype.emit; 144 | // Node.prototype.emit = function(type) { 145 | // var args, el; 146 | // 147 | // if (this.type === 'screen') { 148 | // return this._emit.apply(this, arguments); 149 | // } 150 | // 151 | // this._emit.apply(this, arguments); 152 | // if (this._bubbleStopped) return false; 153 | // 154 | // args = slice.call(arguments, 1); 155 | // el = this; 156 | // 157 | // args.unshift('element ' + type, this); 158 | // this._bubbleStopped = false; 159 | // //args.push(stopBubble); 160 | // 161 | // do { 162 | // if (!el._events || !el._events[type]) continue; 163 | // el._emit.apply(el, args); 164 | // if (this._bubbleStopped) return false; 165 | // } while (el = el.parent); 166 | // 167 | // return true; 168 | // }; 169 | // 170 | // Node.prototype._addListener = Node.prototype.addListener; 171 | // Node.prototype.on = 172 | // Node.prototype.addListener = function(type, listener) { 173 | // function on() { 174 | // if (listener.apply(this, arguments) === false) { 175 | // this._bubbleStopped = true; 176 | // } 177 | // } 178 | // on.listener = listener; 179 | // return this._addListener(type, on); 180 | // }; 181 | 182 | /** 183 | * Expose 184 | */ 185 | 186 | exports = EventEmitter; 187 | exports.EventEmitter = EventEmitter; 188 | 189 | module.exports = exports; 190 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/gpmclient.js: -------------------------------------------------------------------------------- 1 | /** 2 | * gpmclient.js - support the gpm mouse protocol 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | var net = require('net'); 8 | var fs = require('fs'); 9 | var EventEmitter = require('events').EventEmitter; 10 | 11 | var GPM_USE_MAGIC = false; 12 | 13 | var GPM_MOVE = 1 14 | , GPM_DRAG = 2 15 | , GPM_DOWN = 4 16 | , GPM_UP = 8; 17 | 18 | var GPM_DOUBLE = 32 19 | , GPM_MFLAG = 128; 20 | 21 | var GPM_REQ_NOPASTE = 3 22 | , GPM_HARD = 256; 23 | 24 | var GPM_MAGIC = 0x47706D4C; 25 | var GPM_SOCKET = '/dev/gpmctl'; 26 | 27 | // typedef struct Gpm_Connect { 28 | // unsigned short eventMask, defaultMask; 29 | // unsigned short minMod, maxMod; 30 | // int pid; 31 | // int vc; 32 | // } Gpm_Connect; 33 | 34 | function send_config(socket, Gpm_Connect, callback) { 35 | var buffer; 36 | if (GPM_USE_MAGIC) { 37 | buffer = new Buffer(20); 38 | buffer.writeUInt32LE(GPM_MAGIC, 0); 39 | buffer.writeUInt16LE(Gpm_Connect.eventMask, 4); 40 | buffer.writeUInt16LE(Gpm_Connect.defaultMask, 6); 41 | buffer.writeUInt16LE(Gpm_Connect.minMod, 8); 42 | buffer.writeUInt16LE(Gpm_Connect.maxMod, 10); 43 | buffer.writeInt16LE(process.pid, 12); 44 | buffer.writeInt16LE(Gpm_Connect.vc, 16); 45 | } else { 46 | buffer = new Buffer(16); 47 | buffer.writeUInt16LE(Gpm_Connect.eventMask, 0); 48 | buffer.writeUInt16LE(Gpm_Connect.defaultMask, 2); 49 | buffer.writeUInt16LE(Gpm_Connect.minMod, 4); 50 | buffer.writeUInt16LE(Gpm_Connect.maxMod, 6); 51 | buffer.writeInt16LE(Gpm_Connect.pid, 8); 52 | buffer.writeInt16LE(Gpm_Connect.vc, 12); 53 | } 54 | socket.write(buffer, function() { 55 | if (callback) callback(); 56 | }); 57 | } 58 | 59 | // typedef struct Gpm_Event { 60 | // unsigned char buttons, modifiers; // try to be a multiple of 4 61 | // unsigned short vc; 62 | // short dx, dy, x, y; // displacement x,y for this event, and absolute x,y 63 | // enum Gpm_Etype type; 64 | // // clicks e.g. double click are determined by time-based processing 65 | // int clicks; 66 | // enum Gpm_Margin margin; 67 | // // wdx/y: displacement of wheels in this event. Absolute values are not 68 | // // required, because wheel movement is typically used for scrolling 69 | // // or selecting fields, not for cursor positioning. The application 70 | // // can determine when the end of file or form is reached, and not 71 | // // go any further. 72 | // // A single mouse will use wdy, "vertical scroll" wheel. 73 | // short wdx, wdy; 74 | // } Gpm_Event; 75 | 76 | function parseEvent(raw) { 77 | var evnt = {}; 78 | evnt.buttons = raw[0]; 79 | evnt.modifiers = raw[1]; 80 | evnt.vc = raw.readUInt16LE(2); 81 | evnt.dx = raw.readInt16LE(4); 82 | evnt.dy = raw.readInt16LE(6); 83 | evnt.x = raw.readInt16LE(8); 84 | evnt.y = raw.readInt16LE(10); 85 | evnt.type = raw.readInt16LE(12); 86 | evnt.clicks = raw.readInt32LE(16); 87 | evnt.margin = raw.readInt32LE(20); 88 | evnt.wdx = raw.readInt16LE(24); 89 | evnt.wdy = raw.readInt16LE(26); 90 | return evnt; 91 | } 92 | 93 | function GpmClient(options) { 94 | if (!(this instanceof GpmClient)) { 95 | return new GpmClient(options); 96 | } 97 | 98 | EventEmitter.call(this); 99 | 100 | var pid = process.pid; 101 | 102 | // check tty for /dev/tty[n] 103 | var path; 104 | try { 105 | path = fs.readlinkSync('/proc/' + pid + '/fd/0'); 106 | } catch (e) { 107 | ; 108 | } 109 | var tty = /tty[0-9]+$/.exec(path); 110 | if (tty === null) { 111 | // TODO: should also check for /dev/input/.. 112 | } 113 | 114 | var vc; 115 | if (tty) { 116 | tty = tty[0]; 117 | vc = +/[0-9]+$/.exec(tty)[0]; 118 | } 119 | 120 | var self = this; 121 | 122 | if (tty) { 123 | fs.stat(GPM_SOCKET, function(err, stat) { 124 | if (err || !stat.isSocket()) { 125 | return; 126 | } 127 | 128 | var conf = { 129 | eventMask: 0xffff, 130 | defaultMask: GPM_MOVE | GPM_HARD, 131 | minMod: 0, 132 | maxMod: 0xffff, 133 | pid: pid, 134 | vc: vc 135 | }; 136 | 137 | var gpm = net.createConnection(GPM_SOCKET); 138 | this.gpm = gpm; 139 | 140 | gpm.on('connect', function() { 141 | send_config(gpm, conf, function() { 142 | conf.pid = 0; 143 | conf.vc = GPM_REQ_NOPASTE; 144 | //send_config(gpm, conf); 145 | }); 146 | }); 147 | 148 | gpm.on('data', function(packet) { 149 | var evnt = parseEvent(packet); 150 | switch (evnt.type & 15) { 151 | case GPM_MOVE: 152 | if (evnt.dx || evnt.dy) { 153 | self.emit('move', evnt.buttons, evnt.modifiers, evnt.x, evnt.y); 154 | } 155 | if (evnt.wdx || evnt.wdy) { 156 | self.emit('mousewheel', 157 | evnt.buttons, evnt.modifiers, 158 | evnt.x, evnt.y, evnt.wdx, evnt.wdy); 159 | } 160 | break; 161 | case GPM_DRAG: 162 | if (evnt.dx || evnt.dy) { 163 | self.emit('drag', evnt.buttons, evnt.modifiers, evnt.x, evnt.y); 164 | } 165 | if (evnt.wdx || evnt.wdy) { 166 | self.emit('mousewheel', 167 | evnt.buttons, evnt.modifiers, 168 | evnt.x, evnt.y, evnt.wdx, evnt.wdy); 169 | } 170 | break; 171 | case GPM_DOWN: 172 | self.emit('btndown', evnt.buttons, evnt.modifiers, evnt.x, evnt.y); 173 | if (evnt.type & GPM_DOUBLE) { 174 | self.emit('dblclick', evnt.buttons, evnt.modifiers, evnt.x, evnt.y); 175 | } 176 | break; 177 | case GPM_UP: 178 | self.emit('btnup', evnt.buttons, evnt.modifiers, evnt.x, evnt.y); 179 | if (!(evnt.type & GPM_MFLAG)) { 180 | self.emit('click', evnt.buttons, evnt.modifiers, evnt.x, evnt.y); 181 | } 182 | break; 183 | } 184 | }); 185 | 186 | gpm.on('error', function() { 187 | self.stop(); 188 | }); 189 | }); 190 | } 191 | } 192 | 193 | GpmClient.prototype.__proto__ = EventEmitter.prototype; 194 | 195 | GpmClient.prototype.stop = function() { 196 | if (this.gpm) { 197 | this.gpm.end(); 198 | } 199 | delete this.gpm; 200 | }; 201 | 202 | GpmClient.prototype.ButtonName = function(btn) { 203 | if (btn & 4) return 'left'; 204 | if (btn & 2) return 'middle'; 205 | if (btn & 1) return 'right'; 206 | return ''; 207 | }; 208 | 209 | GpmClient.prototype.hasShiftKey = function(mod) { 210 | return (mod & 1) ? true : false; 211 | }; 212 | 213 | GpmClient.prototype.hasCtrlKey = function(mod) { 214 | return (mod & 4) ? true : false; 215 | }; 216 | 217 | GpmClient.prototype.hasMetaKey = function(mod) { 218 | return (mod & 8) ? true : false; 219 | }; 220 | 221 | module.exports = GpmClient; 222 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/helpers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * helpers.js - helpers for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var fs = require('fs'); 12 | 13 | var unicode = require('./unicode'); 14 | 15 | /** 16 | * Helpers 17 | */ 18 | 19 | var helpers = exports; 20 | 21 | helpers.merge = function(a, b) { 22 | Object.keys(b).forEach(function(key) { 23 | a[key] = b[key]; 24 | }); 25 | return a; 26 | }; 27 | 28 | helpers.asort = function(obj) { 29 | return obj.sort(function(a, b) { 30 | a = a.name.toLowerCase(); 31 | b = b.name.toLowerCase(); 32 | 33 | if (a[0] === '.' && b[0] === '.') { 34 | a = a[1]; 35 | b = b[1]; 36 | } else { 37 | a = a[0]; 38 | b = b[0]; 39 | } 40 | 41 | return a > b ? 1 : (a < b ? -1 : 0); 42 | }); 43 | }; 44 | 45 | helpers.hsort = function(obj) { 46 | return obj.sort(function(a, b) { 47 | return b.index - a.index; 48 | }); 49 | }; 50 | 51 | helpers.findFile = function(start, target) { 52 | return (function read(dir) { 53 | var files, file, stat, out; 54 | 55 | if (dir === '/dev' || dir === '/sys' 56 | || dir === '/proc' || dir === '/net') { 57 | return null; 58 | } 59 | 60 | try { 61 | files = fs.readdirSync(dir); 62 | } catch (e) { 63 | files = []; 64 | } 65 | 66 | for (var i = 0; i < files.length; i++) { 67 | file = files[i]; 68 | 69 | if (file === target) { 70 | return (dir === '/' ? '' : dir) + '/' + file; 71 | } 72 | 73 | try { 74 | stat = fs.lstatSync((dir === '/' ? '' : dir) + '/' + file); 75 | } catch (e) { 76 | stat = null; 77 | } 78 | 79 | if (stat && stat.isDirectory() && !stat.isSymbolicLink()) { 80 | out = read((dir === '/' ? '' : dir) + '/' + file); 81 | if (out) return out; 82 | } 83 | } 84 | 85 | return null; 86 | })(start); 87 | }; 88 | 89 | // Escape text for tag-enabled elements. 90 | helpers.escape = function(text) { 91 | return text.replace(/[{}]/g, function(ch) { 92 | return ch === '{' ? '{open}' : '{close}'; 93 | }); 94 | }; 95 | 96 | helpers.parseTags = function(text, screen) { 97 | return helpers.Element.prototype._parseTags.call( 98 | { parseTags: true, screen: screen || helpers.Screen.global }, text); 99 | }; 100 | 101 | helpers.generateTags = function(style, text) { 102 | var open = '' 103 | , close = ''; 104 | 105 | Object.keys(style || {}).forEach(function(key) { 106 | var val = style[key]; 107 | if (typeof val === 'string') { 108 | val = val.replace(/^light(?!-)/, 'light-'); 109 | val = val.replace(/^bright(?!-)/, 'bright-'); 110 | open = '{' + val + '-' + key + '}' + open; 111 | close += '{/' + val + '-' + key + '}'; 112 | } else { 113 | if (val === true) { 114 | open = '{' + key + '}' + open; 115 | close += '{/' + key + '}'; 116 | } 117 | } 118 | }); 119 | 120 | if (text != null) { 121 | return open + text + close; 122 | } 123 | 124 | return { 125 | open: open, 126 | close: close 127 | }; 128 | }; 129 | 130 | helpers.attrToBinary = function(style, element) { 131 | return helpers.Element.prototype.sattr.call(element || {}, style); 132 | }; 133 | 134 | helpers.stripTags = function(text) { 135 | if (!text) return ''; 136 | return text 137 | .replace(/{(\/?)([\w\-,;!#]*)}/g, '') 138 | .replace(/\x1b\[[\d;]*m/g, ''); 139 | }; 140 | 141 | helpers.cleanTags = function(text) { 142 | return helpers.stripTags(text).trim(); 143 | }; 144 | 145 | helpers.dropUnicode = function(text) { 146 | if (!text) return ''; 147 | return text 148 | .replace(unicode.chars.all, '??') 149 | .replace(unicode.chars.combining, '') 150 | .replace(unicode.chars.surrogate, '?'); 151 | }; 152 | 153 | helpers.__defineGetter__('Screen', function() { 154 | if (!helpers._screen) { 155 | helpers._screen = require('./widgets/screen'); 156 | } 157 | return helpers._screen; 158 | }); 159 | 160 | helpers.__defineGetter__('Element', function() { 161 | if (!helpers._element) { 162 | helpers._element = require('./widgets/element'); 163 | } 164 | return helpers._element; 165 | }); 166 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widget.js: -------------------------------------------------------------------------------- 1 | /** 2 | * widget.js - high-level interface for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | var widget = exports; 8 | 9 | widget.classes = [ 10 | 'Node', 11 | 'Screen', 12 | 'Element', 13 | 'Box', 14 | 'Text', 15 | 'Line', 16 | 'ScrollableBox', 17 | 'ScrollableText', 18 | 'BigText', 19 | 'List', 20 | 'Form', 21 | 'Input', 22 | 'Textarea', 23 | 'Textbox', 24 | 'Button', 25 | 'ProgressBar', 26 | 'FileManager', 27 | 'Checkbox', 28 | 'RadioSet', 29 | 'RadioButton', 30 | 'Prompt', 31 | 'Question', 32 | 'Message', 33 | 'Loading', 34 | 'Listbar', 35 | 'Log', 36 | 'Table', 37 | 'ListTable', 38 | 'Terminal', 39 | 'Image', 40 | 'ANSIImage', 41 | 'OverlayImage', 42 | 'Video', 43 | 'Layout' 44 | ]; 45 | 46 | widget.classes.forEach(function(name) { 47 | var file = name.toLowerCase(); 48 | widget[name] = widget[file] = require('./widgets/' + file); 49 | }); 50 | 51 | widget.aliases = { 52 | 'ListBar': 'Listbar', 53 | 'PNG': 'ANSIImage' 54 | }; 55 | 56 | Object.keys(widget.aliases).forEach(function(key) { 57 | var name = widget.aliases[key]; 58 | widget[key] = widget[name]; 59 | widget[key.toLowerCase()] = widget[name]; 60 | }); 61 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/ansiimage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ansiimage.js - render PNGS/GIFS as ANSI 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var cp = require('child_process'); 12 | 13 | var colors = require('../colors'); 14 | 15 | var Node = require('./node'); 16 | var Box = require('./box'); 17 | 18 | var tng = require('../../vendor/tng'); 19 | 20 | /** 21 | * ANSIImage 22 | */ 23 | 24 | function ANSIImage(options) { 25 | var self = this; 26 | 27 | if (!(this instanceof Node)) { 28 | return new ANSIImage(options); 29 | } 30 | 31 | options = options || {}; 32 | options.shrink = true; 33 | 34 | Box.call(this, options); 35 | 36 | this.scale = this.options.scale || 1.0; 37 | this.options.animate = this.options.animate !== false; 38 | this._noFill = true; 39 | 40 | if (this.options.file) { 41 | this.setImage(this.options.file); 42 | } 43 | 44 | this.screen.on('prerender', function() { 45 | var lpos = self.lpos; 46 | if (!lpos) return; 47 | // prevent image from blending with itself if there are alpha channels 48 | self.screen.clearRegion(lpos.xi, lpos.xl, lpos.yi, lpos.yl); 49 | }); 50 | 51 | this.on('destroy', function() { 52 | self.stop(); 53 | }); 54 | } 55 | 56 | ANSIImage.prototype.__proto__ = Box.prototype; 57 | 58 | ANSIImage.prototype.type = 'ansiimage'; 59 | 60 | ANSIImage.curl = function(url) { 61 | try { 62 | return cp.execFileSync('curl', 63 | ['-s', '-A', '', url], 64 | { stdio: ['ignore', 'pipe', 'ignore'] }); 65 | } catch (e) { 66 | ; 67 | } 68 | try { 69 | return cp.execFileSync('wget', 70 | ['-U', '', '-O', '-', url], 71 | { stdio: ['ignore', 'pipe', 'ignore'] }); 72 | } catch (e) { 73 | ; 74 | } 75 | throw new Error('curl or wget failed.'); 76 | }; 77 | 78 | ANSIImage.prototype.setImage = function(file) { 79 | this.file = typeof file === 'string' ? file : null; 80 | 81 | if (/^https?:/.test(file)) { 82 | file = ANSIImage.curl(file); 83 | } 84 | 85 | var width = this.position.width; 86 | var height = this.position.height; 87 | 88 | if (width != null) { 89 | width = this.width; 90 | } 91 | 92 | if (height != null) { 93 | height = this.height; 94 | } 95 | 96 | try { 97 | this.setContent(''); 98 | 99 | this.img = tng(file, { 100 | colors: colors, 101 | width: width, 102 | height: height, 103 | scale: this.scale, 104 | ascii: this.options.ascii, 105 | speed: this.options.speed, 106 | filename: this.file 107 | }); 108 | 109 | if (width == null || height == null) { 110 | this.width = this.img.cellmap[0].length; 111 | this.height = this.img.cellmap.length; 112 | } 113 | 114 | if (this.img.frames && this.options.animate) { 115 | this.play(); 116 | } else { 117 | this.cellmap = this.img.cellmap; 118 | } 119 | } catch (e) { 120 | this.setContent('Image Error: ' + e.message); 121 | this.img = null; 122 | this.cellmap = null; 123 | } 124 | }; 125 | 126 | ANSIImage.prototype.play = function() { 127 | var self = this; 128 | if (!this.img) return; 129 | return this.img.play(function(bmp, cellmap) { 130 | self.cellmap = cellmap; 131 | self.screen.render(); 132 | }); 133 | }; 134 | 135 | ANSIImage.prototype.pause = function() { 136 | if (!this.img) return; 137 | return this.img.pause(); 138 | }; 139 | 140 | ANSIImage.prototype.stop = function() { 141 | if (!this.img) return; 142 | return this.img.stop(); 143 | }; 144 | 145 | ANSIImage.prototype.clearImage = function() { 146 | this.stop(); 147 | this.setContent(''); 148 | this.img = null; 149 | this.cellmap = null; 150 | }; 151 | 152 | ANSIImage.prototype.render = function() { 153 | var coords = this._render(); 154 | if (!coords) return; 155 | 156 | if (this.img && this.cellmap) { 157 | this.img.renderElement(this.cellmap, this); 158 | } 159 | 160 | return coords; 161 | }; 162 | 163 | /** 164 | * Expose 165 | */ 166 | 167 | module.exports = ANSIImage; 168 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/bigtext.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bigtext.js - bigtext element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var fs = require('fs'); 12 | 13 | var Node = require('./node'); 14 | var Box = require('./box'); 15 | 16 | /** 17 | * BigText 18 | */ 19 | 20 | function BigText(options) { 21 | if (!(this instanceof Node)) { 22 | return new BigText(options); 23 | } 24 | options = options || {}; 25 | options.font = options.font 26 | || __dirname + '/../../usr/fonts/ter-u14n.json'; 27 | options.fontBold = options.font 28 | || __dirname + '/../../usr/fonts/ter-u14b.json'; 29 | this.fch = options.fch; 30 | this.ratio = {}; 31 | this.font = this.loadFont(options.font); 32 | this.fontBold = this.loadFont(options.font); 33 | Box.call(this, options); 34 | if (this.style.bold) { 35 | this.font = this.fontBold; 36 | } 37 | } 38 | 39 | BigText.prototype.__proto__ = Box.prototype; 40 | 41 | BigText.prototype.type = 'bigtext'; 42 | 43 | BigText.prototype.loadFont = function(filename) { 44 | var self = this 45 | , data 46 | , font; 47 | 48 | data = JSON.parse(fs.readFileSync(filename, 'utf8')); 49 | 50 | this.ratio.width = data.width; 51 | this.ratio.height = data.height; 52 | 53 | function convertLetter(ch, lines) { 54 | var line, i; 55 | 56 | while (lines.length > self.ratio.height) { 57 | lines.shift(); 58 | lines.pop(); 59 | } 60 | 61 | lines = lines.map(function(line) { 62 | var chs = line.split(''); 63 | chs = chs.map(function(ch) { 64 | return ch === ' ' ? 0 : 1; 65 | }); 66 | while (chs.length < self.ratio.width) { 67 | chs.push(0); 68 | } 69 | return chs; 70 | }); 71 | 72 | while (lines.length < self.ratio.height) { 73 | line = []; 74 | for (i = 0; i < self.ratio.width; i++) { 75 | line.push(0); 76 | } 77 | lines.push(line); 78 | } 79 | 80 | return lines; 81 | } 82 | 83 | font = Object.keys(data.glyphs).reduce(function(out, ch) { 84 | var lines = data.glyphs[ch].map; 85 | out[ch] = convertLetter(ch, lines); 86 | return out; 87 | }, {}); 88 | 89 | delete font[' ']; 90 | 91 | return font; 92 | }; 93 | 94 | BigText.prototype.setContent = function(content) { 95 | this.content = ''; 96 | this.text = content || ''; 97 | }; 98 | 99 | BigText.prototype.render = function() { 100 | if (this.position.width == null || this._shrinkWidth) { 101 | // if (this.width - this.iwidth < this.ratio.width * this.text.length + 1) { 102 | this.position.width = this.ratio.width * this.text.length + 1; 103 | this._shrinkWidth = true; 104 | // } 105 | } 106 | if (this.position.height == null || this._shrinkHeight) { 107 | // if (this.height - this.iheight < this.ratio.height + 0) { 108 | this.position.height = this.ratio.height + 0; 109 | this._shrinkHeight = true; 110 | // } 111 | } 112 | 113 | var coords = this._render(); 114 | if (!coords) return; 115 | 116 | var lines = this.screen.lines 117 | , left = coords.xi + this.ileft 118 | , top = coords.yi + this.itop 119 | , right = coords.xl - this.iright 120 | , bottom = coords.yl - this.ibottom; 121 | 122 | var dattr = this.sattr(this.style) 123 | , bg = dattr & 0x1ff 124 | , fg = (dattr >> 9) & 0x1ff 125 | , flags = (dattr >> 18) & 0x1ff 126 | , attr = (flags << 18) | (bg << 9) | fg; 127 | 128 | for (var x = left, i = 0; x < right; x += this.ratio.width, i++) { 129 | var ch = this.text[i]; 130 | if (!ch) break; 131 | var map = this.font[ch]; 132 | if (!map) continue; 133 | for (var y = top; y < Math.min(bottom, top + this.ratio.height); y++) { 134 | if (!lines[y]) continue; 135 | var mline = map[y - top]; 136 | if (!mline) continue; 137 | for (var mx = 0; mx < this.ratio.width; mx++) { 138 | var mcell = mline[mx]; 139 | if (mcell == null) break; 140 | if (this.fch && this.fch !== ' ') { 141 | lines[y][x + mx][0] = dattr; 142 | lines[y][x + mx][1] = mcell === 1 ? this.fch : this.ch; 143 | } else { 144 | lines[y][x + mx][0] = mcell === 1 ? attr : dattr; 145 | lines[y][x + mx][1] = mcell === 1 ? ' ' : this.ch; 146 | } 147 | } 148 | lines[y].dirty = true; 149 | } 150 | } 151 | 152 | return coords; 153 | }; 154 | 155 | /** 156 | * Expose 157 | */ 158 | 159 | module.exports = BigText; 160 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/box.js: -------------------------------------------------------------------------------- 1 | /** 2 | * box.js - box element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Element = require('./element'); 13 | 14 | /** 15 | * Box 16 | */ 17 | 18 | function Box(options) { 19 | if (!(this instanceof Node)) { 20 | return new Box(options); 21 | } 22 | options = options || {}; 23 | Element.call(this, options); 24 | } 25 | 26 | Box.prototype.__proto__ = Element.prototype; 27 | 28 | Box.prototype.type = 'box'; 29 | 30 | /** 31 | * Expose 32 | */ 33 | 34 | module.exports = Box; 35 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * button.js - button element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Input = require('./input'); 13 | 14 | /** 15 | * Button 16 | */ 17 | 18 | function Button(options) { 19 | var self = this; 20 | 21 | if (!(this instanceof Node)) { 22 | return new Button(options); 23 | } 24 | 25 | options = options || {}; 26 | 27 | if (options.autoFocus == null) { 28 | options.autoFocus = false; 29 | } 30 | 31 | Input.call(this, options); 32 | 33 | this.on('keypress', function(ch, key) { 34 | if (key.name === 'enter' || key.name === 'space') { 35 | return self.press(); 36 | } 37 | }); 38 | 39 | if (this.options.mouse) { 40 | this.on('click', function() { 41 | return self.press(); 42 | }); 43 | } 44 | } 45 | 46 | Button.prototype.__proto__ = Input.prototype; 47 | 48 | Button.prototype.type = 'button'; 49 | 50 | Button.prototype.press = function() { 51 | this.focus(); 52 | this.value = true; 53 | var result = this.emit('press'); 54 | delete this.value; 55 | return result; 56 | }; 57 | 58 | /** 59 | * Expose 60 | */ 61 | 62 | module.exports = Button; 63 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/checkbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * checkbox.js - checkbox element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Input = require('./input'); 13 | 14 | /** 15 | * Checkbox 16 | */ 17 | 18 | function Checkbox(options) { 19 | var self = this; 20 | 21 | if (!(this instanceof Node)) { 22 | return new Checkbox(options); 23 | } 24 | 25 | options = options || {}; 26 | 27 | Input.call(this, options); 28 | 29 | this.text = options.content || options.text || ''; 30 | this.checked = this.value = options.checked || false; 31 | 32 | this.on('keypress', function(ch, key) { 33 | if (key.name === 'enter' || key.name === 'space') { 34 | self.toggle(); 35 | self.screen.render(); 36 | } 37 | }); 38 | 39 | if (options.mouse) { 40 | this.on('click', function() { 41 | self.toggle(); 42 | self.screen.render(); 43 | }); 44 | } 45 | 46 | this.on('focus', function() { 47 | var lpos = self.lpos; 48 | if (!lpos) return; 49 | self.screen.program.lsaveCursor('checkbox'); 50 | self.screen.program.cup(lpos.yi, lpos.xi + 1); 51 | self.screen.program.showCursor(); 52 | }); 53 | 54 | this.on('blur', function() { 55 | self.screen.program.lrestoreCursor('checkbox', true); 56 | }); 57 | } 58 | 59 | Checkbox.prototype.__proto__ = Input.prototype; 60 | 61 | Checkbox.prototype.type = 'checkbox'; 62 | 63 | Checkbox.prototype.render = function() { 64 | this.clearPos(true); 65 | this.setContent('[' + (this.checked ? 'x' : ' ') + '] ' + this.text, true); 66 | return this._render(); 67 | }; 68 | 69 | Checkbox.prototype.check = function() { 70 | if (this.checked) return; 71 | this.checked = this.value = true; 72 | this.emit('check'); 73 | }; 74 | 75 | Checkbox.prototype.uncheck = function() { 76 | if (!this.checked) return; 77 | this.checked = this.value = false; 78 | this.emit('uncheck'); 79 | }; 80 | 81 | Checkbox.prototype.toggle = function() { 82 | return this.checked 83 | ? this.uncheck() 84 | : this.check(); 85 | }; 86 | 87 | /** 88 | * Expose 89 | */ 90 | 91 | module.exports = Checkbox; 92 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/filemanager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * filemanager.js - file manager element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var path = require('path') 12 | , fs = require('fs'); 13 | 14 | var helpers = require('../helpers'); 15 | 16 | var Node = require('./node'); 17 | var List = require('./list'); 18 | 19 | /** 20 | * FileManager 21 | */ 22 | 23 | function FileManager(options) { 24 | var self = this; 25 | 26 | if (!(this instanceof Node)) { 27 | return new FileManager(options); 28 | } 29 | 30 | options = options || {}; 31 | options.parseTags = true; 32 | // options.label = ' {blue-fg}%path{/blue-fg} '; 33 | 34 | List.call(this, options); 35 | 36 | this.cwd = options.cwd || process.cwd(); 37 | this.file = this.cwd; 38 | this.value = this.cwd; 39 | 40 | if (options.label && ~options.label.indexOf('%path')) { 41 | this._label.setContent(options.label.replace('%path', this.cwd)); 42 | } 43 | 44 | this.on('select', function(item) { 45 | var value = item.content.replace(/\{[^{}]+\}/g, '').replace(/@$/, '') 46 | , file = path.resolve(self.cwd, value); 47 | 48 | return fs.stat(file, function(err, stat) { 49 | if (err) { 50 | return self.emit('error', err, file); 51 | } 52 | self.file = file; 53 | self.value = file; 54 | if (stat.isDirectory()) { 55 | self.emit('cd', file, self.cwd); 56 | self.cwd = file; 57 | if (options.label && ~options.label.indexOf('%path')) { 58 | self._label.setContent(options.label.replace('%path', file)); 59 | } 60 | self.refresh(); 61 | } else { 62 | self.emit('file', file); 63 | } 64 | }); 65 | }); 66 | } 67 | 68 | FileManager.prototype.__proto__ = List.prototype; 69 | 70 | FileManager.prototype.type = 'file-manager'; 71 | 72 | FileManager.prototype.refresh = function(cwd, callback) { 73 | if (!callback) { 74 | callback = cwd; 75 | cwd = null; 76 | } 77 | 78 | var self = this; 79 | 80 | if (cwd) this.cwd = cwd; 81 | else cwd = this.cwd; 82 | 83 | return fs.readdir(cwd, function(err, list) { 84 | if (err && err.code === 'ENOENT') { 85 | self.cwd = cwd !== process.env.HOME 86 | ? process.env.HOME 87 | : '/'; 88 | return self.refresh(callback); 89 | } 90 | 91 | if (err) { 92 | if (callback) return callback(err); 93 | return self.emit('error', err, cwd); 94 | } 95 | 96 | var dirs = [] 97 | , files = []; 98 | 99 | list.unshift('..'); 100 | 101 | list.forEach(function(name) { 102 | var f = path.resolve(cwd, name) 103 | , stat; 104 | 105 | try { 106 | stat = fs.lstatSync(f); 107 | } catch (e) { 108 | ; 109 | } 110 | 111 | if ((stat && stat.isDirectory()) || name === '..') { 112 | dirs.push({ 113 | name: name, 114 | text: '{light-blue-fg}' + name + '{/light-blue-fg}/', 115 | dir: true 116 | }); 117 | } else if (stat && stat.isSymbolicLink()) { 118 | files.push({ 119 | name: name, 120 | text: '{light-cyan-fg}' + name + '{/light-cyan-fg}@', 121 | dir: false 122 | }); 123 | } else { 124 | files.push({ 125 | name: name, 126 | text: name, 127 | dir: false 128 | }); 129 | } 130 | }); 131 | 132 | dirs = helpers.asort(dirs); 133 | files = helpers.asort(files); 134 | 135 | list = dirs.concat(files).map(function(data) { 136 | return data.text; 137 | }); 138 | 139 | self.setItems(list); 140 | self.select(0); 141 | self.screen.render(); 142 | 143 | self.emit('refresh'); 144 | 145 | if (callback) callback(); 146 | }); 147 | }; 148 | 149 | FileManager.prototype.pick = function(cwd, callback) { 150 | if (!callback) { 151 | callback = cwd; 152 | cwd = null; 153 | } 154 | 155 | var self = this 156 | , focused = this.screen.focused === this 157 | , hidden = this.hidden 158 | , onfile 159 | , oncancel; 160 | 161 | function resume() { 162 | self.removeListener('file', onfile); 163 | self.removeListener('cancel', oncancel); 164 | if (hidden) { 165 | self.hide(); 166 | } 167 | if (!focused) { 168 | self.screen.restoreFocus(); 169 | } 170 | self.screen.render(); 171 | } 172 | 173 | this.on('file', onfile = function(file) { 174 | resume(); 175 | return callback(null, file); 176 | }); 177 | 178 | this.on('cancel', oncancel = function() { 179 | resume(); 180 | return callback(); 181 | }); 182 | 183 | this.refresh(cwd, function(err) { 184 | if (err) return callback(err); 185 | 186 | if (hidden) { 187 | self.show(); 188 | } 189 | 190 | if (!focused) { 191 | self.screen.saveFocus(); 192 | self.focus(); 193 | } 194 | 195 | self.screen.render(); 196 | }); 197 | }; 198 | 199 | FileManager.prototype.reset = function(cwd, callback) { 200 | if (!callback) { 201 | callback = cwd; 202 | cwd = null; 203 | } 204 | this.cwd = cwd || this.options.cwd; 205 | this.refresh(callback); 206 | }; 207 | 208 | /** 209 | * Expose 210 | */ 211 | 212 | module.exports = FileManager; 213 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/image.js: -------------------------------------------------------------------------------- 1 | /** 2 | * image.js - image element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | 14 | /** 15 | * Image 16 | */ 17 | 18 | function Image(options) { 19 | if (!(this instanceof Node)) { 20 | return new Image(options); 21 | } 22 | 23 | options = options || {}; 24 | options.type = options.itype || options.type || 'ansi'; 25 | 26 | Box.call(this, options); 27 | 28 | if (options.type === 'ansi' && this.type !== 'ansiimage') { 29 | var ANSIImage = require('./ansiimage'); 30 | Object.getOwnPropertyNames(ANSIImage.prototype).forEach(function(key) { 31 | if (key === 'type') return; 32 | Object.defineProperty(this, key, 33 | Object.getOwnPropertyDescriptor(ANSIImage.prototype, key)); 34 | }, this); 35 | ANSIImage.call(this, options); 36 | return this; 37 | } 38 | 39 | if (options.type === 'overlay' && this.type !== 'overlayimage') { 40 | var OverlayImage = require('./overlayimage'); 41 | Object.getOwnPropertyNames(OverlayImage.prototype).forEach(function(key) { 42 | if (key === 'type') return; 43 | Object.defineProperty(this, key, 44 | Object.getOwnPropertyDescriptor(OverlayImage.prototype, key)); 45 | }, this); 46 | OverlayImage.call(this, options); 47 | return this; 48 | } 49 | 50 | throw new Error('`type` must either be `ansi` or `overlay`.'); 51 | } 52 | 53 | Image.prototype.__proto__ = Box.prototype; 54 | 55 | Image.prototype.type = 'image'; 56 | 57 | /** 58 | * Expose 59 | */ 60 | 61 | module.exports = Image; 62 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/input.js: -------------------------------------------------------------------------------- 1 | /** 2 | * input.js - abstract input element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | 14 | /** 15 | * Input 16 | */ 17 | 18 | function Input(options) { 19 | if (!(this instanceof Node)) { 20 | return new Input(options); 21 | } 22 | options = options || {}; 23 | Box.call(this, options); 24 | } 25 | 26 | Input.prototype.__proto__ = Box.prototype; 27 | 28 | Input.prototype.type = 'input'; 29 | 30 | /** 31 | * Expose 32 | */ 33 | 34 | module.exports = Input; 35 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * layout.js - layout element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Element = require('./element'); 13 | 14 | /** 15 | * Layout 16 | */ 17 | 18 | function Layout(options) { 19 | if (!(this instanceof Node)) { 20 | return new Layout(options); 21 | } 22 | 23 | options = options || {}; 24 | 25 | if ((options.width == null 26 | && (options.left == null && options.right == null)) 27 | || (options.height == null 28 | && (options.top == null && options.bottom == null))) { 29 | throw new Error('`Layout` must have a width and height!'); 30 | } 31 | 32 | options.layout = options.layout || 'inline'; 33 | 34 | Element.call(this, options); 35 | 36 | if (options.renderer) { 37 | this.renderer = options.renderer; 38 | } 39 | } 40 | 41 | Layout.prototype.__proto__ = Element.prototype; 42 | 43 | Layout.prototype.type = 'layout'; 44 | 45 | Layout.prototype.isRendered = function(el) { 46 | if (!el.lpos) return false; 47 | return (el.lpos.xl - el.lpos.xi) > 0 48 | && (el.lpos.yl - el.lpos.yi) > 0; 49 | }; 50 | 51 | Layout.prototype.getLast = function(i) { 52 | while (this.children[--i]) { 53 | var el = this.children[i]; 54 | if (this.isRendered(el)) return el; 55 | } 56 | }; 57 | 58 | Layout.prototype.getLastCoords = function(i) { 59 | var last = this.getLast(i); 60 | if (last) return last.lpos; 61 | }; 62 | 63 | Layout.prototype._renderCoords = function() { 64 | var coords = this._getCoords(true); 65 | var children = this.children; 66 | this.children = []; 67 | this._render(); 68 | this.children = children; 69 | return coords; 70 | }; 71 | 72 | Layout.prototype.renderer = function(coords) { 73 | var self = this; 74 | 75 | // The coordinates of the layout element 76 | var width = coords.xl - coords.xi 77 | , height = coords.yl - coords.yi 78 | , xi = coords.xi 79 | , yi = coords.yi; 80 | 81 | // The current row offset in cells (which row are we on?) 82 | var rowOffset = 0; 83 | 84 | // The index of the first child in the row 85 | var rowIndex = 0; 86 | var lastRowIndex = 0; 87 | 88 | // Figure out the highest width child 89 | if (this.options.layout === 'grid') { 90 | var highWidth = this.children.reduce(function(out, el) { 91 | out = Math.max(out, el.width); 92 | return out; 93 | }, 0); 94 | } 95 | 96 | return function iterator(el, i) { 97 | // Make our children shrinkable. If they don't have a height, for 98 | // example, calculate it for them. 99 | el.shrink = true; 100 | 101 | // Find the previous rendered child's coordinates 102 | var last = self.getLast(i); 103 | 104 | // If there is no previously rendered element, we are on the first child. 105 | if (!last) { 106 | el.position.left = 0; 107 | el.position.top = 0; 108 | } else { 109 | // Otherwise, figure out where to place this child. We'll start by 110 | // setting it's `left`/`x` coordinate to right after the previous 111 | // rendered element. This child will end up directly to the right of it. 112 | el.position.left = last.lpos.xl - xi; 113 | 114 | // Make sure the position matches the highest width element 115 | if (self.options.layout === 'grid') { 116 | // Compensate with width: 117 | // el.position.width = el.width + (highWidth - el.width); 118 | // Compensate with position: 119 | el.position.left += highWidth - (last.lpos.xl - last.lpos.xi); 120 | } 121 | 122 | // If our child does not overlap the right side of the Layout, set it's 123 | // `top`/`y` to the current `rowOffset` (the coordinate for the current 124 | // row). 125 | if (el.position.left + el.width <= width) { 126 | el.position.top = rowOffset; 127 | } else { 128 | // Otherwise we need to start a new row and calculate a new 129 | // `rowOffset` and `rowIndex` (the index of the child on the current 130 | // row). 131 | rowOffset += self.children.slice(rowIndex, i).reduce(function(out, el) { 132 | if (!self.isRendered(el)) return out; 133 | out = Math.max(out, el.lpos.yl - el.lpos.yi); 134 | return out; 135 | }, 0); 136 | lastRowIndex = rowIndex; 137 | rowIndex = i; 138 | el.position.left = 0; 139 | el.position.top = rowOffset; 140 | } 141 | } 142 | 143 | // Make sure the elements on lower rows graviatate up as much as possible 144 | if (self.options.layout === 'inline') { 145 | var above = null; 146 | var abovea = Infinity; 147 | for (var j = lastRowIndex; j < rowIndex; j++) { 148 | var l = self.children[j]; 149 | if (!self.isRendered(l)) continue; 150 | var abs = Math.abs(el.position.left - (l.lpos.xi - xi)); 151 | // if (abs < abovea && (l.lpos.xl - l.lpos.xi) <= el.width) { 152 | if (abs < abovea) { 153 | above = l; 154 | abovea = abs; 155 | } 156 | } 157 | if (above) { 158 | el.position.top = above.lpos.yl - yi; 159 | } 160 | } 161 | 162 | // If our child overflows the Layout, do not render it! 163 | // Disable this feature for now. 164 | if (el.position.top + el.height > height) { 165 | // Returning false tells blessed to ignore this child. 166 | // return false; 167 | } 168 | }; 169 | }; 170 | 171 | Layout.prototype.render = function() { 172 | this._emit('prerender'); 173 | 174 | var coords = this._renderCoords(); 175 | if (!coords) { 176 | delete this.lpos; 177 | return; 178 | } 179 | 180 | if (coords.xl - coords.xi <= 0) { 181 | coords.xl = Math.max(coords.xl, coords.xi); 182 | return; 183 | } 184 | 185 | if (coords.yl - coords.yi <= 0) { 186 | coords.yl = Math.max(coords.yl, coords.yi); 187 | return; 188 | } 189 | 190 | this.lpos = coords; 191 | 192 | if (this.border) coords.xi++, coords.xl--, coords.yi++, coords.yl--; 193 | if (this.tpadding) { 194 | coords.xi += this.padding.left, coords.xl -= this.padding.right; 195 | coords.yi += this.padding.top, coords.yl -= this.padding.bottom; 196 | } 197 | 198 | var iterator = this.renderer(coords); 199 | 200 | if (this.border) coords.xi--, coords.xl++, coords.yi--, coords.yl++; 201 | if (this.tpadding) { 202 | coords.xi -= this.padding.left, coords.xl += this.padding.right; 203 | coords.yi -= this.padding.top, coords.yl += this.padding.bottom; 204 | } 205 | 206 | this.children.forEach(function(el, i) { 207 | if (el.screen._ci !== -1) { 208 | el.index = el.screen._ci++; 209 | } 210 | var rendered = iterator(el, i); 211 | if (rendered === false) { 212 | delete el.lpos; 213 | return; 214 | } 215 | // if (el.screen._rendering) { 216 | // el._rendering = true; 217 | // } 218 | el.render(); 219 | // if (el.screen._rendering) { 220 | // el._rendering = false; 221 | // } 222 | }); 223 | 224 | this._emit('render', [coords]); 225 | 226 | return coords; 227 | }; 228 | 229 | /** 230 | * Expose 231 | */ 232 | 233 | module.exports = Layout; 234 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/line.js: -------------------------------------------------------------------------------- 1 | /** 2 | * line.js - line element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | 14 | /** 15 | * Line 16 | */ 17 | 18 | function Line(options) { 19 | if (!(this instanceof Node)) { 20 | return new Line(options); 21 | } 22 | 23 | options = options || {}; 24 | 25 | var orientation = options.orientation || 'vertical'; 26 | delete options.orientation; 27 | 28 | if (orientation === 'vertical') { 29 | options.width = 1; 30 | } else { 31 | options.height = 1; 32 | } 33 | 34 | Box.call(this, options); 35 | 36 | this.ch = !options.type || options.type === 'line' 37 | ? orientation === 'horizontal' ? '─' : '│' 38 | : options.ch || ' '; 39 | 40 | this.border = { 41 | type: 'bg', 42 | __proto__: this 43 | }; 44 | 45 | this.style.border = this.style; 46 | } 47 | 48 | Line.prototype.__proto__ = Box.prototype; 49 | 50 | Line.prototype.type = 'line'; 51 | 52 | /** 53 | * Expose 54 | */ 55 | 56 | module.exports = Line; 57 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/listtable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * listtable.js - list table element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | var List = require('./list'); 14 | var Table = require('./table'); 15 | 16 | /** 17 | * ListTable 18 | */ 19 | 20 | function ListTable(options) { 21 | var self = this; 22 | 23 | if (!(this instanceof Node)) { 24 | return new ListTable(options); 25 | } 26 | 27 | options = options || {}; 28 | options.shrink = true; 29 | options.normalShrink = true; 30 | options.style = options.style || {}; 31 | options.style.border = options.style.border || {}; 32 | options.style.header = options.style.header || {}; 33 | options.style.cell = options.style.cell || {}; 34 | this.__align = options.align || 'center'; 35 | delete options.align; 36 | 37 | options.style.selected = options.style.cell.selected; 38 | options.style.item = options.style.cell; 39 | 40 | List.call(this, options); 41 | 42 | this._header = new Box({ 43 | parent: this, 44 | left: this.screen.autoPadding ? 0 : this.ileft, 45 | top: 0, 46 | width: 'shrink', 47 | height: 1, 48 | style: options.style.header, 49 | tags: options.parseTags || options.tags 50 | }); 51 | 52 | this.on('scroll', function() { 53 | self._header.setFront(); 54 | self._header.rtop = self.childBase; 55 | if (!self.screen.autoPadding) { 56 | self._header.rtop = self.childBase + (self.border ? 1 : 0); 57 | } 58 | }); 59 | 60 | this.pad = options.pad != null 61 | ? options.pad 62 | : 2; 63 | 64 | this.setData(options.rows || options.data); 65 | 66 | this.on('attach', function() { 67 | self.setData(self.rows); 68 | }); 69 | 70 | this.on('resize', function() { 71 | var selected = self.selected; 72 | self.setData(self.rows); 73 | self.select(selected); 74 | self.screen.render(); 75 | }); 76 | } 77 | 78 | ListTable.prototype.__proto__ = List.prototype; 79 | 80 | ListTable.prototype.type = 'list-table'; 81 | 82 | ListTable.prototype._calculateMaxes = Table.prototype._calculateMaxes; 83 | 84 | ListTable.prototype.setRows = 85 | ListTable.prototype.setData = function(rows) { 86 | var self = this 87 | , align = this.__align; 88 | 89 | if (this.visible && this.lpos) { 90 | this.clearPos(); 91 | } 92 | 93 | this.clearItems(); 94 | 95 | this.rows = rows || []; 96 | 97 | this._calculateMaxes(); 98 | 99 | if (!this._maxes) return; 100 | 101 | this.addItem(''); 102 | 103 | this.rows.forEach(function(row, i) { 104 | var isHeader = i === 0; 105 | var text = ''; 106 | row.forEach(function(cell, i) { 107 | var width = self._maxes[i]; 108 | var clen = self.strWidth(cell); 109 | 110 | if (i !== 0) { 111 | text += ' '; 112 | } 113 | 114 | while (clen < width) { 115 | if (align === 'center') { 116 | cell = ' ' + cell + ' '; 117 | clen += 2; 118 | } else if (align === 'left') { 119 | cell = cell + ' '; 120 | clen += 1; 121 | } else if (align === 'right') { 122 | cell = ' ' + cell; 123 | clen += 1; 124 | } 125 | } 126 | 127 | if (clen > width) { 128 | if (align === 'center') { 129 | cell = cell.substring(1); 130 | clen--; 131 | } else if (align === 'left') { 132 | cell = cell.slice(0, -1); 133 | clen--; 134 | } else if (align === 'right') { 135 | cell = cell.substring(1); 136 | clen--; 137 | } 138 | } 139 | 140 | text += cell; 141 | }); 142 | if (isHeader) { 143 | self._header.setContent(text); 144 | } else { 145 | self.addItem(text); 146 | } 147 | }); 148 | 149 | this._header.setFront(); 150 | 151 | this.select(0); 152 | }; 153 | 154 | ListTable.prototype._select = ListTable.prototype.select; 155 | ListTable.prototype.select = function(i) { 156 | if (i === 0) { 157 | i = 1; 158 | } 159 | if (i <= this.childBase) { 160 | this.setScroll(this.childBase - 1); 161 | } 162 | return this._select(i); 163 | }; 164 | 165 | ListTable.prototype.render = function() { 166 | var self = this; 167 | 168 | var coords = this._render(); 169 | if (!coords) return; 170 | 171 | this._calculateMaxes(); 172 | 173 | if (!this._maxes) return coords; 174 | 175 | var lines = this.screen.lines 176 | , xi = coords.xi 177 | , yi = coords.yi 178 | , rx 179 | , ry 180 | , i; 181 | 182 | var battr = this.sattr(this.style.border); 183 | 184 | var height = coords.yl - coords.yi - this.ibottom; 185 | 186 | if (!this.border || this.options.noCellBorders) return coords; 187 | 188 | // Draw border with correct angles. 189 | ry = 0; 190 | for (i = 0; i < height + 1; i++) { 191 | if (!lines[yi + ry]) break; 192 | rx = 0; 193 | self._maxes.slice(0, -1).forEach(function(max) { 194 | rx += max; 195 | if (!lines[yi + ry][xi + rx + 1]) return; 196 | // center 197 | if (ry === 0) { 198 | // top 199 | rx++; 200 | lines[yi + ry][xi + rx][0] = battr; 201 | lines[yi + ry][xi + rx][1] = '\u252c'; // '┬' 202 | // XXX If we alter iheight and itop for no borders - nothing should be written here 203 | if (!self.border.top) { 204 | lines[yi + ry][xi + rx][1] = '\u2502'; // '│' 205 | } 206 | lines[yi + ry].dirty = true; 207 | } else if (ry === height) { 208 | // bottom 209 | rx++; 210 | lines[yi + ry][xi + rx][0] = battr; 211 | lines[yi + ry][xi + rx][1] = '\u2534'; // '┴' 212 | // XXX If we alter iheight and ibottom for no borders - nothing should be written here 213 | if (!self.border.bottom) { 214 | lines[yi + ry][xi + rx][1] = '\u2502'; // '│' 215 | } 216 | lines[yi + ry].dirty = true; 217 | } else { 218 | // middle 219 | rx++; 220 | } 221 | }); 222 | ry += 1; 223 | } 224 | 225 | // Draw internal borders. 226 | for (ry = 1; ry < height; ry++) { 227 | if (!lines[yi + ry]) break; 228 | rx = 0; 229 | self._maxes.slice(0, -1).forEach(function(max) { 230 | rx += max; 231 | if (!lines[yi + ry][xi + rx + 1]) return; 232 | if (self.options.fillCellBorders !== false) { 233 | var lbg = lines[yi + ry][xi + rx][0] & 0x1ff; 234 | rx++; 235 | lines[yi + ry][xi + rx][0] = (battr & ~0x1ff) | lbg; 236 | } else { 237 | rx++; 238 | lines[yi + ry][xi + rx][0] = battr; 239 | } 240 | lines[yi + ry][xi + rx][1] = '\u2502'; // '│' 241 | lines[yi + ry].dirty = true; 242 | }); 243 | } 244 | 245 | return coords; 246 | }; 247 | 248 | /** 249 | * Expose 250 | */ 251 | 252 | module.exports = ListTable; 253 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/loading.js: -------------------------------------------------------------------------------- 1 | /** 2 | * loading.js - loading element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | var Text = require('./text'); 14 | 15 | /** 16 | * Loading 17 | */ 18 | 19 | function Loading(options) { 20 | if (!(this instanceof Node)) { 21 | return new Loading(options); 22 | } 23 | 24 | options = options || {}; 25 | 26 | Box.call(this, options); 27 | 28 | this._.icon = new Text({ 29 | parent: this, 30 | align: 'center', 31 | top: 2, 32 | left: 1, 33 | right: 1, 34 | height: 1, 35 | content: '|' 36 | }); 37 | } 38 | 39 | Loading.prototype.__proto__ = Box.prototype; 40 | 41 | Loading.prototype.type = 'loading'; 42 | 43 | Loading.prototype.load = function(text) { 44 | var self = this; 45 | 46 | // XXX Keep above: 47 | // var parent = this.parent; 48 | // this.detach(); 49 | // parent.append(this); 50 | 51 | this.show(); 52 | this.setContent(text); 53 | 54 | if (this._.timer) { 55 | this.stop(); 56 | } 57 | 58 | this.screen.lockKeys = true; 59 | 60 | this._.timer = setInterval(function() { 61 | if (self._.icon.content === '|') { 62 | self._.icon.setContent('/'); 63 | } else if (self._.icon.content === '/') { 64 | self._.icon.setContent('-'); 65 | } else if (self._.icon.content === '-') { 66 | self._.icon.setContent('\\'); 67 | } else if (self._.icon.content === '\\') { 68 | self._.icon.setContent('|'); 69 | } 70 | self.screen.render(); 71 | }, 200); 72 | }; 73 | 74 | Loading.prototype.stop = function() { 75 | this.screen.lockKeys = false; 76 | this.hide(); 77 | if (this._.timer) { 78 | clearInterval(this._.timer); 79 | delete this._.timer; 80 | } 81 | this.screen.render(); 82 | }; 83 | 84 | /** 85 | * Expose 86 | */ 87 | 88 | module.exports = Loading; 89 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/log.js: -------------------------------------------------------------------------------- 1 | /** 2 | * log.js - log element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var util = require('util'); 12 | 13 | var nextTick = global.setImmediate || process.nextTick.bind(process); 14 | 15 | var Node = require('./node'); 16 | var ScrollableText = require('./scrollabletext'); 17 | 18 | /** 19 | * Log 20 | */ 21 | 22 | function Log(options) { 23 | var self = this; 24 | 25 | if (!(this instanceof Node)) { 26 | return new Log(options); 27 | } 28 | 29 | options = options || {}; 30 | 31 | ScrollableText.call(this, options); 32 | 33 | this.scrollback = options.scrollback != null 34 | ? options.scrollback 35 | : Infinity; 36 | this.scrollOnInput = options.scrollOnInput; 37 | 38 | this.on('set content', function() { 39 | if (!self._userScrolled || self.scrollOnInput) { 40 | nextTick(function() { 41 | self.setScrollPerc(100); 42 | self._userScrolled = false; 43 | self.screen.render(); 44 | }); 45 | } 46 | }); 47 | } 48 | 49 | Log.prototype.__proto__ = ScrollableText.prototype; 50 | 51 | Log.prototype.type = 'log'; 52 | 53 | Log.prototype.log = 54 | Log.prototype.add = function() { 55 | var args = Array.prototype.slice.call(arguments); 56 | if (typeof args[0] === 'object') { 57 | args[0] = util.inspect(args[0], true, 20, true); 58 | } 59 | var text = util.format.apply(util, args); 60 | this.emit('log', text); 61 | var ret = this.pushLine(text); 62 | if (this._clines.fake.length > this.scrollback) { 63 | this.shiftLine(0, (this.scrollback / 3) | 0); 64 | } 65 | return ret; 66 | }; 67 | 68 | Log.prototype._scroll = Log.prototype.scroll; 69 | Log.prototype.scroll = function(offset, always) { 70 | if (offset === 0) return this._scroll(offset, always); 71 | this._userScrolled = true; 72 | var ret = this._scroll(offset, always); 73 | if (this.getScrollPerc() === 100) { 74 | this._userScrolled = false; 75 | } 76 | return ret; 77 | }; 78 | 79 | /** 80 | * Expose 81 | */ 82 | 83 | module.exports = Log; 84 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/message.js: -------------------------------------------------------------------------------- 1 | /** 2 | * message.js - message element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | 14 | /** 15 | * Message / Error 16 | */ 17 | 18 | function Message(options) { 19 | if (!(this instanceof Node)) { 20 | return new Message(options); 21 | } 22 | 23 | options = options || {}; 24 | options.tags = true; 25 | 26 | Box.call(this, options); 27 | } 28 | 29 | Message.prototype.__proto__ = Box.prototype; 30 | 31 | Message.prototype.type = 'message'; 32 | 33 | Message.prototype.log = 34 | Message.prototype.display = function(text, time, callback) { 35 | var self = this; 36 | 37 | if (typeof time === 'function') { 38 | callback = time; 39 | time = null; 40 | } 41 | 42 | if (time == null) time = 3; 43 | 44 | // Keep above: 45 | // var parent = this.parent; 46 | // this.detach(); 47 | // parent.append(this); 48 | 49 | if (this.scrollable) { 50 | this.screen.saveFocus(); 51 | this.focus(); 52 | this.scrollTo(0); 53 | } 54 | 55 | this.show(); 56 | this.setContent(text); 57 | this.screen.render(); 58 | 59 | if (time === Infinity || time === -1 || time === 0) { 60 | var end = function() { 61 | if (end.done) return; 62 | end.done = true; 63 | if (self.scrollable) { 64 | try { 65 | self.screen.restoreFocus(); 66 | } catch (e) { 67 | ; 68 | } 69 | } 70 | self.hide(); 71 | self.screen.render(); 72 | if (callback) callback(); 73 | }; 74 | 75 | setTimeout(function() { 76 | self.onScreenEvent('keypress', function fn(ch, key) { 77 | if (key.name === 'mouse') return; 78 | if (self.scrollable) { 79 | if ((key.name === 'up' || (self.options.vi && key.name === 'k')) 80 | || (key.name === 'down' || (self.options.vi && key.name === 'j')) 81 | || (self.options.vi && key.name === 'u' && key.ctrl) 82 | || (self.options.vi && key.name === 'd' && key.ctrl) 83 | || (self.options.vi && key.name === 'b' && key.ctrl) 84 | || (self.options.vi && key.name === 'f' && key.ctrl) 85 | || (self.options.vi && key.name === 'g' && !key.shift) 86 | || (self.options.vi && key.name === 'g' && key.shift)) { 87 | return; 88 | } 89 | } 90 | if (self.options.ignoreKeys && ~self.options.ignoreKeys.indexOf(key.name)) { 91 | return; 92 | } 93 | self.removeScreenEvent('keypress', fn); 94 | end(); 95 | }); 96 | // XXX May be affected by new element.options.mouse option. 97 | if (!self.options.mouse) return; 98 | self.onScreenEvent('mouse', function fn(data) { 99 | if (data.action === 'mousemove') return; 100 | self.removeScreenEvent('mouse', fn); 101 | end(); 102 | }); 103 | }, 10); 104 | 105 | return; 106 | } 107 | 108 | setTimeout(function() { 109 | self.hide(); 110 | self.screen.render(); 111 | if (callback) callback(); 112 | }, time * 1000); 113 | }; 114 | 115 | Message.prototype.error = function(text, time, callback) { 116 | return this.display('{red-fg}Error: ' + text + '{/red-fg}', time, callback); 117 | }; 118 | 119 | /** 120 | * Expose 121 | */ 122 | 123 | module.exports = Message; 124 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/progressbar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * progressbar.js - progress bar element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Input = require('./input'); 13 | 14 | /** 15 | * ProgressBar 16 | */ 17 | 18 | function ProgressBar(options) { 19 | var self = this; 20 | 21 | if (!(this instanceof Node)) { 22 | return new ProgressBar(options); 23 | } 24 | 25 | options = options || {}; 26 | 27 | Input.call(this, options); 28 | 29 | this.filled = options.filled || 0; 30 | if (typeof this.filled === 'string') { 31 | this.filled = +this.filled.slice(0, -1); 32 | } 33 | this.value = this.filled; 34 | 35 | this.pch = options.pch || ' '; 36 | 37 | // XXX Workaround that predates the usage of `el.ch`. 38 | if (options.ch) { 39 | this.pch = options.ch; 40 | this.ch = ' '; 41 | } 42 | if (options.bch) { 43 | this.ch = options.bch; 44 | } 45 | 46 | if (!this.style.bar) { 47 | this.style.bar = {}; 48 | this.style.bar.fg = options.barFg; 49 | this.style.bar.bg = options.barBg; 50 | } 51 | 52 | this.orientation = options.orientation || 'horizontal'; 53 | 54 | if (options.keys) { 55 | this.on('keypress', function(ch, key) { 56 | var back, forward; 57 | if (self.orientation === 'horizontal') { 58 | back = ['left', 'h']; 59 | forward = ['right', 'l']; 60 | } else if (self.orientation === 'vertical') { 61 | back = ['down', 'j']; 62 | forward = ['up', 'k']; 63 | } 64 | if (key.name === back[0] || (options.vi && key.name === back[1])) { 65 | self.progress(-5); 66 | self.screen.render(); 67 | return; 68 | } 69 | if (key.name === forward[0] || (options.vi && key.name === forward[1])) { 70 | self.progress(5); 71 | self.screen.render(); 72 | return; 73 | } 74 | }); 75 | } 76 | 77 | if (options.mouse) { 78 | this.on('click', function(data) { 79 | var x, y, m, p; 80 | if (!self.lpos) return; 81 | if (self.orientation === 'horizontal') { 82 | x = data.x - self.lpos.xi; 83 | m = (self.lpos.xl - self.lpos.xi) - self.iwidth; 84 | p = x / m * 100 | 0; 85 | } else if (self.orientation === 'vertical') { 86 | y = data.y - self.lpos.yi; 87 | m = (self.lpos.yl - self.lpos.yi) - self.iheight; 88 | p = y / m * 100 | 0; 89 | } 90 | self.setProgress(p); 91 | }); 92 | } 93 | } 94 | 95 | ProgressBar.prototype.__proto__ = Input.prototype; 96 | 97 | ProgressBar.prototype.type = 'progress-bar'; 98 | 99 | ProgressBar.prototype.render = function() { 100 | var ret = this._render(); 101 | if (!ret) return; 102 | 103 | var xi = ret.xi 104 | , xl = ret.xl 105 | , yi = ret.yi 106 | , yl = ret.yl 107 | , dattr; 108 | 109 | if (this.border) xi++, yi++, xl--, yl--; 110 | 111 | if (this.orientation === 'horizontal') { 112 | xl = xi + ((xl - xi) * (this.filled / 100)) | 0; 113 | } else if (this.orientation === 'vertical') { 114 | yi = yi + ((yl - yi) - (((yl - yi) * (this.filled / 100)) | 0)); 115 | } 116 | 117 | dattr = this.sattr(this.style.bar); 118 | 119 | this.screen.fillRegion(dattr, this.pch, xi, xl, yi, yl); 120 | 121 | if (this.content) { 122 | var line = this.screen.lines[yi]; 123 | for (var i = 0; i < this.content.length; i++) { 124 | line[xi + i][1] = this.content[i]; 125 | } 126 | line.dirty = true; 127 | } 128 | 129 | return ret; 130 | }; 131 | 132 | ProgressBar.prototype.progress = function(filled) { 133 | this.filled += filled; 134 | if (this.filled < 0) this.filled = 0; 135 | else if (this.filled > 100) this.filled = 100; 136 | if (this.filled === 100) { 137 | this.emit('complete'); 138 | } 139 | this.value = this.filled; 140 | }; 141 | 142 | ProgressBar.prototype.setProgress = function(filled) { 143 | this.filled = 0; 144 | this.progress(filled); 145 | }; 146 | 147 | ProgressBar.prototype.reset = function() { 148 | this.emit('reset'); 149 | this.filled = 0; 150 | this.value = this.filled; 151 | }; 152 | 153 | /** 154 | * Expose 155 | */ 156 | 157 | module.exports = ProgressBar; 158 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/prompt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * prompt.js - prompt element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | var Button = require('./button'); 14 | var Textbox = require('./textbox'); 15 | 16 | /** 17 | * Prompt 18 | */ 19 | 20 | function Prompt(options) { 21 | if (!(this instanceof Node)) { 22 | return new Prompt(options); 23 | } 24 | 25 | options = options || {}; 26 | 27 | options.hidden = true; 28 | 29 | Box.call(this, options); 30 | 31 | this._.input = new Textbox({ 32 | parent: this, 33 | top: 3, 34 | height: 1, 35 | left: 2, 36 | right: 2, 37 | bg: 'black' 38 | }); 39 | 40 | this._.okay = new Button({ 41 | parent: this, 42 | top: 5, 43 | height: 1, 44 | left: 2, 45 | width: 6, 46 | content: 'Okay', 47 | align: 'center', 48 | bg: 'black', 49 | hoverBg: 'blue', 50 | autoFocus: false, 51 | mouse: true 52 | }); 53 | 54 | this._.cancel = new Button({ 55 | parent: this, 56 | top: 5, 57 | height: 1, 58 | shrink: true, 59 | left: 10, 60 | width: 8, 61 | content: 'Cancel', 62 | align: 'center', 63 | bg: 'black', 64 | hoverBg: 'blue', 65 | autoFocus: false, 66 | mouse: true 67 | }); 68 | } 69 | 70 | Prompt.prototype.__proto__ = Box.prototype; 71 | 72 | Prompt.prototype.type = 'prompt'; 73 | 74 | Prompt.prototype.input = 75 | Prompt.prototype.setInput = 76 | Prompt.prototype.readInput = function(text, value, callback) { 77 | var self = this; 78 | var okay, cancel; 79 | 80 | if (!callback) { 81 | callback = value; 82 | value = ''; 83 | } 84 | 85 | // Keep above: 86 | // var parent = this.parent; 87 | // this.detach(); 88 | // parent.append(this); 89 | 90 | this.show(); 91 | this.setContent(' ' + text); 92 | 93 | this._.input.value = value; 94 | 95 | this.screen.saveFocus(); 96 | 97 | this._.okay.on('press', okay = function() { 98 | self._.input.submit(); 99 | }); 100 | 101 | this._.cancel.on('press', cancel = function() { 102 | self._.input.cancel(); 103 | }); 104 | 105 | this._.input.readInput(function(err, data) { 106 | self.hide(); 107 | self.screen.restoreFocus(); 108 | self._.okay.removeListener('press', okay); 109 | self._.cancel.removeListener('press', cancel); 110 | return callback(err, data); 111 | }); 112 | 113 | this.screen.render(); 114 | }; 115 | 116 | /** 117 | * Expose 118 | */ 119 | 120 | module.exports = Prompt; 121 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/question.js: -------------------------------------------------------------------------------- 1 | /** 2 | * question.js - question element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | var Button = require('./button'); 14 | 15 | /** 16 | * Question 17 | */ 18 | 19 | function Question(options) { 20 | if (!(this instanceof Node)) { 21 | return new Question(options); 22 | } 23 | 24 | options = options || {}; 25 | options.hidden = true; 26 | 27 | Box.call(this, options); 28 | 29 | this._.okay = new Button({ 30 | screen: this.screen, 31 | parent: this, 32 | top: 2, 33 | height: 1, 34 | left: 2, 35 | width: 6, 36 | content: 'Okay', 37 | align: 'center', 38 | bg: 'black', 39 | hoverBg: 'blue', 40 | autoFocus: false, 41 | mouse: true 42 | }); 43 | 44 | this._.cancel = new Button({ 45 | screen: this.screen, 46 | parent: this, 47 | top: 2, 48 | height: 1, 49 | shrink: true, 50 | left: 10, 51 | width: 8, 52 | content: 'Cancel', 53 | align: 'center', 54 | bg: 'black', 55 | hoverBg: 'blue', 56 | autoFocus: false, 57 | mouse: true 58 | }); 59 | } 60 | 61 | Question.prototype.__proto__ = Box.prototype; 62 | 63 | Question.prototype.type = 'question'; 64 | 65 | Question.prototype.ask = function(text, callback) { 66 | var self = this; 67 | var press, okay, cancel; 68 | 69 | // Keep above: 70 | // var parent = this.parent; 71 | // this.detach(); 72 | // parent.append(this); 73 | 74 | this.show(); 75 | this.setContent(' ' + text); 76 | 77 | this.onScreenEvent('keypress', press = function(ch, key) { 78 | if (key.name === 'mouse') return; 79 | if (key.name !== 'enter' 80 | && key.name !== 'escape' 81 | && key.name !== 'q' 82 | && key.name !== 'y' 83 | && key.name !== 'n') { 84 | return; 85 | } 86 | done(null, key.name === 'enter' || key.name === 'y'); 87 | }); 88 | 89 | this._.okay.on('press', okay = function() { 90 | done(null, true); 91 | }); 92 | 93 | this._.cancel.on('press', cancel = function() { 94 | done(null, false); 95 | }); 96 | 97 | this.screen.saveFocus(); 98 | this.focus(); 99 | 100 | function done(err, data) { 101 | self.hide(); 102 | self.screen.restoreFocus(); 103 | self.removeScreenEvent('keypress', press); 104 | self._.okay.removeListener('press', okay); 105 | self._.cancel.removeListener('press', cancel); 106 | return callback(err, data); 107 | } 108 | 109 | this.screen.render(); 110 | }; 111 | 112 | /** 113 | * Expose 114 | */ 115 | 116 | module.exports = Question; 117 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/radiobutton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * radiobutton.js - radio button element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Checkbox = require('./checkbox'); 13 | 14 | /** 15 | * RadioButton 16 | */ 17 | 18 | function RadioButton(options) { 19 | var self = this; 20 | 21 | if (!(this instanceof Node)) { 22 | return new RadioButton(options); 23 | } 24 | 25 | options = options || {}; 26 | 27 | Checkbox.call(this, options); 28 | 29 | this.on('check', function() { 30 | var el = self; 31 | while (el = el.parent) { 32 | if (el.type === 'radio-set' 33 | || el.type === 'form') break; 34 | } 35 | el = el || self.parent; 36 | el.forDescendants(function(el) { 37 | if (el.type !== 'radio-button' || el === self) { 38 | return; 39 | } 40 | el.uncheck(); 41 | }); 42 | }); 43 | } 44 | 45 | RadioButton.prototype.__proto__ = Checkbox.prototype; 46 | 47 | RadioButton.prototype.type = 'radio-button'; 48 | 49 | RadioButton.prototype.render = function() { 50 | this.clearPos(true); 51 | this.setContent('(' + (this.checked ? '*' : ' ') + ') ' + this.text, true); 52 | return this._render(); 53 | }; 54 | 55 | RadioButton.prototype.toggle = RadioButton.prototype.check; 56 | 57 | /** 58 | * Expose 59 | */ 60 | 61 | module.exports = RadioButton; 62 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/radioset.js: -------------------------------------------------------------------------------- 1 | /** 2 | * radioset.js - radio set element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Box = require('./box'); 13 | 14 | /** 15 | * RadioSet 16 | */ 17 | 18 | function RadioSet(options) { 19 | if (!(this instanceof Node)) { 20 | return new RadioSet(options); 21 | } 22 | options = options || {}; 23 | // Possibly inherit parent's style. 24 | // options.style = this.parent.style; 25 | Box.call(this, options); 26 | } 27 | 28 | RadioSet.prototype.__proto__ = Box.prototype; 29 | 30 | RadioSet.prototype.type = 'radio-set'; 31 | 32 | /** 33 | * Expose 34 | */ 35 | 36 | module.exports = RadioSet; 37 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/scrollabletext.js: -------------------------------------------------------------------------------- 1 | /** 2 | * scrollabletext.js - scrollable text element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var ScrollableBox = require('./scrollablebox'); 13 | 14 | /** 15 | * ScrollableText 16 | */ 17 | 18 | function ScrollableText(options) { 19 | if (!(this instanceof Node)) { 20 | return new ScrollableText(options); 21 | } 22 | options = options || {}; 23 | options.alwaysScroll = true; 24 | ScrollableBox.call(this, options); 25 | } 26 | 27 | ScrollableText.prototype.__proto__ = ScrollableBox.prototype; 28 | 29 | ScrollableText.prototype.type = 'scrollable-text'; 30 | 31 | /** 32 | * Expose 33 | */ 34 | 35 | module.exports = ScrollableText; 36 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/text.js: -------------------------------------------------------------------------------- 1 | /** 2 | * text.js - text element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Element = require('./element'); 13 | 14 | /** 15 | * Text 16 | */ 17 | 18 | function Text(options) { 19 | if (!(this instanceof Node)) { 20 | return new Text(options); 21 | } 22 | options = options || {}; 23 | options.shrink = true; 24 | Element.call(this, options); 25 | } 26 | 27 | Text.prototype.__proto__ = Element.prototype; 28 | 29 | Text.prototype.type = 'text'; 30 | 31 | /** 32 | * Expose 33 | */ 34 | 35 | module.exports = Text; 36 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/textbox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * textbox.js - textbox element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var Node = require('./node'); 12 | var Textarea = require('./textarea'); 13 | 14 | /** 15 | * Textbox 16 | */ 17 | 18 | function Textbox(options) { 19 | if (!(this instanceof Node)) { 20 | return new Textbox(options); 21 | } 22 | 23 | options = options || {}; 24 | 25 | options.scrollable = false; 26 | 27 | Textarea.call(this, options); 28 | 29 | this.secret = options.secret; 30 | this.censor = options.censor; 31 | } 32 | 33 | Textbox.prototype.__proto__ = Textarea.prototype; 34 | 35 | Textbox.prototype.type = 'textbox'; 36 | 37 | Textbox.prototype.__olistener = Textbox.prototype._listener; 38 | Textbox.prototype._listener = function(ch, key) { 39 | if (key.name === 'enter') { 40 | this._done(null, this.value); 41 | return; 42 | } 43 | return this.__olistener(ch, key); 44 | }; 45 | 46 | Textbox.prototype.setValue = function(value) { 47 | var visible, val; 48 | if (value == null) { 49 | value = this.value; 50 | } 51 | if (this._value !== value) { 52 | value = value.replace(/\n/g, ''); 53 | this.value = value; 54 | this._value = value; 55 | if (this.secret) { 56 | this.setContent(''); 57 | } else if (this.censor) { 58 | this.setContent(Array(this.value.length + 1).join('*')); 59 | } else { 60 | visible = -(this.width - this.iwidth - 1); 61 | val = this.value.replace(/\t/g, this.screen.tabc); 62 | this.setContent(val.slice(visible)); 63 | } 64 | this._updateCursor(); 65 | } 66 | }; 67 | 68 | Textbox.prototype.submit = function() { 69 | if (!this.__listener) return; 70 | return this.__listener('\r', { name: 'enter' }); 71 | }; 72 | 73 | /** 74 | * Expose 75 | */ 76 | 77 | module.exports = Textbox; 78 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/lib/widgets/video.js: -------------------------------------------------------------------------------- 1 | /** 2 | * video.js - video element for blessed 3 | * Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License). 4 | * https://github.com/chjj/blessed 5 | */ 6 | 7 | /** 8 | * Modules 9 | */ 10 | 11 | var cp = require('child_process'); 12 | 13 | var Node = require('./node'); 14 | var Box = require('./box'); 15 | var Terminal = require('./terminal'); 16 | 17 | /** 18 | * Video 19 | */ 20 | 21 | function Video(options) { 22 | var self = this 23 | , shell 24 | , args; 25 | 26 | if (!(this instanceof Node)) { 27 | return new Video(options); 28 | } 29 | 30 | options = options || {}; 31 | 32 | Box.call(this, options); 33 | 34 | if (this.exists('mplayer')) { 35 | shell = 'mplayer'; 36 | args = ['-vo', 'caca', '-quiet', options.file]; 37 | } else if (this.exists('mpv')) { 38 | shell = 'mpv'; 39 | args = ['--vo', 'caca', '--really-quiet', options.file]; 40 | } else { 41 | this.parseTags = true; 42 | this.setContent('{red-fg}{bold}Error:{/bold}' 43 | + ' mplayer or mpv not installed.{/red-fg}'); 44 | return this; 45 | } 46 | 47 | var opts = { 48 | parent: this, 49 | left: 0, 50 | top: 0, 51 | width: this.width - this.iwidth, 52 | height: this.height - this.iheight, 53 | shell: shell, 54 | args: args.slice() 55 | }; 56 | 57 | this.now = Date.now() / 1000 | 0; 58 | this.start = opts.start || 0; 59 | if (this.start) { 60 | if (shell === 'mplayer') { 61 | opts.args.unshift('-ss', this.start + ''); 62 | } else if (shell === 'mpv') { 63 | opts.args.unshift('--start', this.start + ''); 64 | } 65 | } 66 | 67 | var DISPLAY = process.env.DISPLAY; 68 | delete process.env.DISPLAY; 69 | this.tty = new Terminal(opts); 70 | process.env.DISPLAY = DISPLAY; 71 | 72 | this.on('click', function() { 73 | self.tty.pty.write('p'); 74 | }); 75 | 76 | // mplayer/mpv cannot resize itself in the terminal, so we have 77 | // to restart it at the correct start time. 78 | this.on('resize', function() { 79 | self.tty.destroy(); 80 | 81 | var opts = { 82 | parent: self, 83 | left: 0, 84 | top: 0, 85 | width: self.width - self.iwidth, 86 | height: self.height - self.iheight, 87 | shell: shell, 88 | args: args.slice() 89 | }; 90 | 91 | var watched = (Date.now() / 1000 | 0) - self.now; 92 | self.now = Date.now() / 1000 | 0; 93 | self.start += watched; 94 | if (shell === 'mplayer') { 95 | opts.args.unshift('-ss', self.start + ''); 96 | } else if (shell === 'mpv') { 97 | opts.args.unshift('--start', self.start + ''); 98 | } 99 | 100 | var DISPLAY = process.env.DISPLAY; 101 | delete process.env.DISPLAY; 102 | self.tty = new Terminal(opts); 103 | process.env.DISPLAY = DISPLAY; 104 | self.screen.render(); 105 | }); 106 | } 107 | 108 | Video.prototype.__proto__ = Box.prototype; 109 | 110 | Video.prototype.type = 'video'; 111 | 112 | Video.prototype.exists = function(program) { 113 | try { 114 | return !!+cp.execSync('type ' 115 | + program + ' > /dev/null 2> /dev/null' 116 | + ' && echo 1', { encoding: 'utf8' }).trim(); 117 | } catch (e) { 118 | return false; 119 | } 120 | }; 121 | 122 | /** 123 | * Expose 124 | */ 125 | 126 | module.exports = Video; 127 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "blessed", 5 | "F:\\工作文档\\兼职工作\\禅道-vim\\zentao-nodejs" 6 | ] 7 | ], 8 | "_from": "blessed@latest", 9 | "_id": "blessed@0.1.81", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/blessed", 13 | "_nodeVersion": "0.12.7", 14 | "_npmUser": { 15 | "email": "chjjeffrey@gmail.com", 16 | "name": "chjj" 17 | }, 18 | "_npmVersion": "2.14.1", 19 | "_phantomChildren": {}, 20 | "_requested": { 21 | "name": "blessed", 22 | "raw": "blessed", 23 | "rawSpec": "", 24 | "scope": null, 25 | "spec": "latest", 26 | "type": "tag" 27 | }, 28 | "_requiredBy": [ 29 | "#USER" 30 | ], 31 | "_resolved": "https://registry.npmjs.org/blessed/-/blessed-0.1.81.tgz", 32 | "_shasum": "f962d687ec2c369570ae71af843256e6d0ca1129", 33 | "_shrinkwrap": null, 34 | "_spec": "blessed", 35 | "_where": "F:\\工作文档\\兼职工作\\禅道-vim\\zentao-nodejs", 36 | "author": { 37 | "name": "Christopher Jeffrey" 38 | }, 39 | "bin": { 40 | "blessed": "./bin/tput.js" 41 | }, 42 | "browserify": { 43 | "transform": [ 44 | "./browser/transform.js" 45 | ] 46 | }, 47 | "bugs": { 48 | "url": "http://github.com/chjj/blessed/issues" 49 | }, 50 | "dependencies": {}, 51 | "description": "A high-level terminal interface library for node.js.", 52 | "devDependencies": {}, 53 | "directories": {}, 54 | "dist": { 55 | "shasum": "f962d687ec2c369570ae71af843256e6d0ca1129", 56 | "tarball": "https://registry.npmjs.org/blessed/-/blessed-0.1.81.tgz" 57 | }, 58 | "engines": { 59 | "node": ">= 0.8.0" 60 | }, 61 | "gitHead": "a45575fee63fac158fd467087ec172f657bfec6b", 62 | "homepage": "https://github.com/chjj/blessed", 63 | "keywords": [ 64 | "curses", 65 | "tui", 66 | "tput", 67 | "terminfo", 68 | "termcap" 69 | ], 70 | "license": "MIT", 71 | "main": "./lib/blessed.js", 72 | "maintainers": [ 73 | { 74 | "email": "chjjeffrey@gmail.com", 75 | "name": "chjj" 76 | } 77 | ], 78 | "name": "blessed", 79 | "optionalDependencies": {}, 80 | "preferGlobal": false, 81 | "readme": "ERROR: No README data found!", 82 | "repository": { 83 | "type": "git", 84 | "url": "git://github.com/chjj/blessed.git" 85 | }, 86 | "scripts": {}, 87 | "tags": [ 88 | "curses", 89 | "tui", 90 | "tput", 91 | "terminfo", 92 | "termcap" 93 | ], 94 | "version": "0.1.81" 95 | } 96 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/usr/fonts/AUTHORS: -------------------------------------------------------------------------------- 1 | Dimitar Zhekov 2 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/usr/fonts/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Dimitar Toshkov Zhekov, 2 | with Reserved Font Name "Terminus Font". 3 | 4 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 5 | This license is copied below, and is also available with a FAQ at: 6 | http://scripts.sil.org/OFL 7 | 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide 15 | development of collaborative font projects, to support the font creation 16 | efforts of academic and linguistic communities, and to provide a free and 17 | open framework in which fonts may be shared and improved in partnership 18 | with others. 19 | 20 | The OFL allows the licensed fonts to be used, studied, modified and 21 | redistributed freely as long as they are not sold by themselves. The 22 | fonts, including any derivative works, can be bundled, embedded, 23 | redistributed and/or sold with any software provided that any reserved 24 | names are not used by derivative works. The fonts and derivatives, 25 | however, cannot be released under any other type of license. The 26 | requirement for fonts to remain under this license does not apply 27 | to any document created using the fonts or their derivatives. 28 | 29 | DEFINITIONS 30 | "Font Software" refers to the set of files released by the Copyright 31 | Holder(s) under this license and clearly marked as such. This may 32 | include source files, build scripts and documentation. 33 | 34 | "Reserved Font Name" refers to any names specified as such after the 35 | copyright statement(s). 36 | 37 | "Original Version" refers to the collection of Font Software components as 38 | distributed by the Copyright Holder(s). 39 | 40 | "Modified Version" refers to any derivative made by adding to, deleting, 41 | or substituting -- in part or in whole -- any of the components of the 42 | Original Version, by changing formats or by porting the Font Software to a 43 | new environment. 44 | 45 | "Author" refers to any designer, engineer, programmer, technical 46 | writer or other person who contributed to the Font Software. 47 | 48 | PERMISSION & CONDITIONS 49 | Permission is hereby granted, free of charge, to any person obtaining 50 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 51 | redistribute, and sell modified and unmodified copies of the Font 52 | Software, subject to the following conditions: 53 | 54 | 1) Neither the Font Software nor any of its individual components, 55 | in Original or Modified Versions, may be sold by itself. 56 | 57 | 2) Original or Modified Versions of the Font Software may be bundled, 58 | redistributed and/or sold with any software, provided that each copy 59 | contains the above copyright notice and this license. These can be 60 | included either as stand-alone text files, human-readable headers or 61 | in the appropriate machine-readable metadata fields within text or 62 | binary files as long as those fields can be easily viewed by the user. 63 | 64 | 3) No Modified Version of the Font Software may use the Reserved Font 65 | Name(s) unless explicit written permission is granted by the corresponding 66 | Copyright Holder. This restriction only applies to the primary font name as 67 | presented to the users. 68 | 69 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 70 | Software shall not be used to promote, endorse or advertise any 71 | Modified Version, except to acknowledge the contribution(s) of the 72 | Copyright Holder(s) and the Author(s) or with their explicit written 73 | permission. 74 | 75 | 5) The Font Software, modified or unmodified, in part or in whole, 76 | must be distributed entirely under this license, and must not be 77 | distributed under any other license. The requirement for fonts to 78 | remain under this license does not apply to any document created 79 | using the Font Software. 80 | 81 | TERMINATION 82 | This license becomes null and void if any of the above conditions are 83 | not met. 84 | 85 | DISCLAIMER 86 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 87 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 88 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 89 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 90 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 91 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 92 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 93 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 94 | OTHER DEALINGS IN THE FONT SOFTWARE. 95 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/usr/linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/linux/bin/node_modules/blessed/usr/linux -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/usr/windows-ansi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/linux/bin/node_modules/blessed/usr/windows-ansi -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/usr/xterm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/linux/bin/node_modules/blessed/usr/xterm -------------------------------------------------------------------------------- /client/linux/bin/node_modules/blessed/usr/xterm-256color: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/linux/bin/node_modules/blessed/usr/xterm-256color -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | t 3 | travis.yml 4 | .project 5 | changelog 6 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - '0.10' 5 | 6 | branches: 7 | only: 8 | - master 9 | - proof 10 | - travis-ci 11 | 12 | # Not using `npm install --dev` because it is recursive. It will pull in the all 13 | # development dependencies for CoffeeScript. Way too much spew in the Travis CI 14 | # build output. 15 | 16 | before_install: 17 | - npm install 18 | - npm install istanbul coveralls 19 | 20 | env: 21 | global: 22 | - secure: "BxUHTsa1WVANLQoimilbZwa1MCWSdM9hOmPWBE/rsYb7uT/iiqkRXXwnWhKtN5CLvTvIQbiAzq4iyPID0S8UHrnxClYQrOuA6QkrtwgIEuDAmijao/bgxobPOremvkwXcpMGIwzYKyYQQtSEaEIQbqf6gSSKW9dBh/GZ/vfTsqo=" 23 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/LICENSE: -------------------------------------------------------------------------------- 1 | You can choose any one of those: 2 | 3 | The MIT License (MIT): 4 | 5 | link:http://opensource.org/licenses/MIT 6 | 7 | LGPL: 8 | http://www.gnu.org/licenses/lgpl.html 9 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/__package__.js: -------------------------------------------------------------------------------- 1 | this.addScript('dom.js',['DOMImplementation','XMLSerializer']); 2 | this.addScript('dom-parser.js',['DOMHandler','DOMParser'], 3 | ['DOMImplementation','XMLReader']); 4 | this.addScript('sax.js','XMLReader'); -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/changelog: -------------------------------------------------------------------------------- 1 | ### Version 0.1.16 2 | 3 | Sat May 4 14:58:03 UTC 2013 4 | 5 | * Correctly handle multibyte Unicode greater than two byts. #57. #56. 6 | * Initial unit testing and test coverage. #53. #46. #19. 7 | * Create Bower `component.json` #52. 8 | 9 | ### Version 0.1.8 10 | 11 | * Add: some test case from node-o3-xml(excludes xpath support) 12 | * Fix: remove existed attribute before setting (bug introduced in v0.1.5) 13 | * Fix: index direct access for childNodes and any NodeList collection(not w3c standard) 14 | * Fix: remove last child bug 15 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xmldom", 3 | "version": "0.1.15", 4 | "main": "dom-parser.js", 5 | "ignore": [ 6 | "**/.*", 7 | "node_modules", 8 | "components" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /client/linux/bin/node_modules/xmldom/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "xmldom", 5 | "F:\\工作文档\\兼职工作\\禅道-vim\\zentao-linux-gui\\bin" 6 | ] 7 | ], 8 | "_from": "xmldom@latest", 9 | "_id": "xmldom@0.1.27", 10 | "_inCache": true, 11 | "_installable": true, 12 | "_location": "/xmldom", 13 | "_nodeVersion": "5.5.0", 14 | "_npmOperationalInternal": { 15 | "host": "packages-12-west.internal.npmjs.com", 16 | "tmp": "tmp/xmldom-0.1.27.tgz_1480305406093_0.9070004557725042" 17 | }, 18 | "_npmUser": { 19 | "email": "jindw@xidea.org", 20 | "name": "jindw" 21 | }, 22 | "_npmVersion": "3.3.12", 23 | "_phantomChildren": {}, 24 | "_requested": { 25 | "name": "xmldom", 26 | "raw": "xmldom", 27 | "rawSpec": "", 28 | "scope": null, 29 | "spec": "latest", 30 | "type": "tag" 31 | }, 32 | "_requiredBy": [ 33 | "#USER" 34 | ], 35 | "_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", 36 | "_shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9", 37 | "_shrinkwrap": null, 38 | "_spec": "xmldom", 39 | "_where": "F:\\工作文档\\兼职工作\\禅道-vim\\zentao-linux-gui\\bin", 40 | "author": { 41 | "email": "jindw@xidea.org", 42 | "name": "jindw", 43 | "url": "http://www.xidea.org" 44 | }, 45 | "bugs": { 46 | "email": "jindw@xidea.org", 47 | "url": "http://github.com/jindw/xmldom/issues" 48 | }, 49 | "contributors": [ 50 | { 51 | "email": "yaronn01@gmail.com", 52 | "name": "Yaron Naveh", 53 | "url": "http://webservices20.blogspot.com/" 54 | }, 55 | { 56 | "email": "amirjanyan@gmail.com", 57 | "name": "Harutyun Amirjanyan", 58 | "url": "https://github.com/nightwing" 59 | }, 60 | { 61 | "email": "alan@prettyrobots.com", 62 | "name": "Alan Gutierrez", 63 | "url": "http://www.prettyrobots.com/" 64 | } 65 | ], 66 | "dependencies": {}, 67 | "description": "A W3C Standard XML DOM(Level2 CORE) implementation and parser(DOMParser/XMLSerializer).", 68 | "devDependencies": { 69 | "proof": "0.0.28" 70 | }, 71 | "directories": {}, 72 | "dist": { 73 | "shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9", 74 | "tarball": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz" 75 | }, 76 | "engines": { 77 | "node": ">=0.1" 78 | }, 79 | "gitHead": "b53aa82a36160d85faab394035dcd1784764537f", 80 | "homepage": "https://github.com/jindw/xmldom", 81 | "keywords": [ 82 | "w3c", 83 | "dom", 84 | "xml", 85 | "parser", 86 | "javascript", 87 | "DOMParser", 88 | "XMLSerializer" 89 | ], 90 | "licenses": [ 91 | { 92 | "MIT": "http://opensource.org/licenses/MIT", 93 | "type": "LGPL", 94 | "url": "http://www.gnu.org/licenses/lgpl.html" 95 | } 96 | ], 97 | "main": "./dom-parser.js", 98 | "maintainers": [ 99 | { 100 | "email": "jindw@xidea.org", 101 | "name": "jindw" 102 | }, 103 | { 104 | "email": "yaronn01@gmail.com", 105 | "name": "yaron" 106 | }, 107 | { 108 | "email": "alan@prettyrobots.com", 109 | "name": "bigeasy" 110 | }, 111 | { 112 | "email": "kethinov@gmail.com", 113 | "name": "kethinov" 114 | }, 115 | { 116 | "email": "jinyun.jin@gmail.com", 117 | "name": "jinjinyun" 118 | } 119 | ], 120 | "name": "xmldom", 121 | "optionalDependencies": {}, 122 | "readme": "ERROR: No README data found!", 123 | "repository": { 124 | "type": "git", 125 | "url": "git://github.com/jindw/xmldom.git" 126 | }, 127 | "scripts": { 128 | "test": "proof platform win32 && proof test */*/*.t.js || t/test" 129 | }, 130 | "version": "0.1.27" 131 | } 132 | -------------------------------------------------------------------------------- /client/linux/bin/zentao: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | zentaoDir=$0 4 | 5 | if [ -f "/usr/bin/zentao" ]; then 6 | script=`ls -l /usr/bin/zentao` 7 | zentaoDir=`dirname ${script#*->}` 8 | else 9 | zentaoDir=`dirname $0` 10 | fi 11 | 12 | $zentaoDir/node $zentaoDir/app.js $@ 13 | -------------------------------------------------------------------------------- /client/linux/makefile: -------------------------------------------------------------------------------- 1 | targetDir=~/.zentao 2 | sourceDir=. 3 | 4 | ARCH = 64 5 | ifeq ($(shell getconf LONG_BIT), 32) 6 | ARCH = 86 7 | else 8 | ARCH = 64 9 | endif 10 | nodefile=node-v6.9.1-linux-x$(ARCH) 11 | nodeFileGz=$(nodefile).tar.xz 12 | nodeFileTar=$(nodefile).tar 13 | 14 | install: 15 | mkdir $(targetDir) 16 | mkdir $(targetDir)/log 17 | mkdir $(targetDir)/tmp 18 | mkdir $(targetDir)/conf 19 | 20 | ifeq ($(nodeFileGz), $(wildcard $(nodeFileGz))) 21 | echo "$(nodeFileGz) found" 22 | else 23 | wget https://nodejs.org/dist/v6.9.1/$(nodefile).tar.xz --no-check-certificate 24 | xz -d $(nodeFileGz) 25 | endif 26 | 27 | ifeq ($(nodeFileTar), $(wildcard $(nodeFileTar))) 28 | tar xvf $(nodeFileTar) 29 | endif 30 | 31 | cp -R $(sourceDir)/bin $(targetDir) 32 | cp $(nodefile)/bin/node $(targetDir)/bin/node 33 | 34 | chmod 777 $(targetDir)/bin/zentao 35 | echo "source $(targetDir)/bin/.zentao.sh">~/.bashrc 36 | chmod 777 $(targetDir)/bin/.zentao.sh 37 | $(targetDir)/bin/.zentao.sh 38 | uninstall: 39 | rm -rf $(targetDir) 40 | sed -i "/source .*\/bin\/\.zentao\.sh/d" ~/.bashrc 41 | -------------------------------------------------------------------------------- /client/tortoise/README.md: -------------------------------------------------------------------------------- 1 | # TurtleZenTao 2 | 3 | ##关于TurtleZenTao 4 | TurtleZenTao是一个TortoiseSVN和TortoiseGit的问题追踪扩展,基于.Net Framework开发 5 | 6 | ##安装 7 | 安装目录运行TurtleZenTao.exe,第一个界面上有安装插件的按钮,点击之后即可将插件安装到TortoiseSVN和TortoiseGit中。 8 | 如果TurtleZenTao.exe的绝对路径中存在中文,有可能会导致安装不成功,将二进制程序拷贝到全英文路径中重新安装即可 9 | 10 | ##使用 11 | 程序支持多语言包,语言配置选项在添加插件到svn或者git时,点击Option会添加一个语言参数,语言包存在于TurtleZenTaoLib.dll同一目录,文件后缀为.lang,如果需要扩展其他语言复制一个.lang文件修改即可。 -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TurtleZenTao", "TurtleZenTao\TurtleZenTao.csproj", "{EA5E1124-E1BE-43C5-8C9D-54A1F75D4027}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TurtleZenTaoLib", "TurtleZenTaoLib\TurtleZenTaoLib.csproj", "{2854A8D8-5AA6-491C-BB4E-46E9ABC557A6}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {EA5E1124-E1BE-43C5-8C9D-54A1F75D4027}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {EA5E1124-E1BE-43C5-8C9D-54A1F75D4027}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {EA5E1124-E1BE-43C5-8C9D-54A1F75D4027}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {EA5E1124-E1BE-43C5-8C9D-54A1F75D4027}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {2854A8D8-5AA6-491C-BB4E-46E9ABC557A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {2854A8D8-5AA6-491C-BB4E-46E9ABC557A6}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {2854A8D8-5AA6-491C-BB4E-46E9ABC557A6}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {2854A8D8-5AA6-491C-BB4E-46E9ABC557A6}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao.v12.suo -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("TurtleZenTao")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TurtleZenTao")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("f075bfcb-9b29-43f5-9ef5-eb420274d753")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TurtleZenTao.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TurtleZenTao.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TurtleZenTao.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/TurtleMain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using TurtleZenTaoLib; 7 | 8 | /** 9 | * @author 张彪 10 | * @version 1.0 2016-10-14 11 | */ 12 | namespace TurtleZenTao 13 | { 14 | static class TurtleMain 15 | { 16 | /// 17 | /// 安装以及测试程序 18 | /// 19 | [STAThread] 20 | static void Main(string[] argv) 21 | { 22 | Application.EnableVisualStyles(); 23 | Application.SetCompatibleTextRenderingDefault(false); 24 | 25 | Plugin plugin = new Plugin(); 26 | Plugin.lang.load("Chinese"); 27 | 28 | plugin.installPlugin(); 29 | 30 | if (plugin.isPluginInstalled()) 31 | { 32 | MessageBox.Show(Plugin.lang.getText("InstallSuccess")); 33 | } 34 | else{ 35 | MessageBox.Show(Plugin.lang.getText("InstallFailed")); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/TurtleZenTao.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EA5E1124-E1BE-43C5-8C9D-54A1F75D4027} 8 | WinExe 9 | Properties 10 | TurtleZenTao 11 | TurtleZenTao 12 | v4.0 13 | 512 14 | 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | TurtleZenTao.TurtleMain 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ResXFileCodeGenerator 54 | Resources.Designer.cs 55 | Designer 56 | 57 | 58 | True 59 | Resources.resx 60 | True 61 | 62 | 63 | SettingsSingleFileGenerator 64 | Settings.Designer.cs 65 | 66 | 67 | True 68 | Settings.settings 69 | True 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | {2854a8d8-5aa6-491c-bb4e-46e9abc557a6} 78 | TurtleZenTaoLib 79 | 80 | 81 | 82 | 89 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/Chinese.lang: -------------------------------------------------------------------------------- 1 | Choose Issue 从禅道中选择 2 | login failed 登录失败 3 | statusStrip1 状态栏 4 | none 无 5 | Search 搜索 6 | Bug Bug 7 | Operate 操作 8 | Title 标题 9 | Task 任务 10 | TaskID 任务编号 11 | Task Name 任务名称 12 | Estimate 预计用时 13 | Consumed 已用时 14 | Left Time 剩余用时 15 | All 全选 16 | None 不选 17 | OK 确定 18 | Cancel 取消 19 | Issue Dialog 问题 20 | UserName 用户名 21 | Password 密码 22 | Website 网址 23 | Add 添加 24 | Validate 验证 25 | Site Edit Dialog 网站编辑 26 | Add Website 添加站点 27 | Install Plugin 安装扩展 28 | No 序号 29 | Edit 编辑 30 | Remove 移除 31 | Website Manage Dialog 网站管理 32 | LoginSuccess 登录成功 33 | Resolved 已解决 34 | BugID BugID 35 | Select 选择 36 | Finished 完成 37 | IsFinished 是否完成 38 | TaskName 任务名称 39 | ConsumeTime 已耗时 40 | LeftTime 剩余时间 41 | WorkTimeEdit 工时统计 42 | OperateSucess 操作成功 43 | InstallSuccess 安装成功 44 | InstallFailed 安装失败 45 | Loading 加载中 46 | WebsiteName 网站名称 47 | LoadFailed 加载失败 -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/English.lang: -------------------------------------------------------------------------------- 1 | Choose Issue Choose From ZenTao 2 | login failed Login Failed 3 | statusStrip1 Status 4 | none None 5 | Search Search 6 | Bug Bug 7 | Operate Operate 8 | Title Title 9 | Task Task 10 | TaskID TaskID 11 | Task Name Task Name 12 | Estimate Estimate 13 | Consumed Consumed 14 | Left Time Left Time 15 | All All 16 | None None 17 | OK OK 18 | Cancel Cancel 19 | Issue Dialog Issue Dialog 20 | UserName UserName 21 | Password Password 22 | Website Website 23 | Add Add 24 | Validate Validate 25 | Site Edit Dialog Site Edit Dialog 26 | Add Website Add Website 27 | Install Plugin Install Plugin 28 | No No 29 | Edit Edit 30 | Remove Remove 31 | Website Manage Dialog Website Manage Dialog 32 | LoginSuccess Login Success 33 | Resolved Resolved 34 | BugID BugID 35 | Select Select 36 | Finished Finished 37 | IsFinished Is Finished 38 | TaskName Task Name 39 | ConsumeTime Consumed Time 40 | LeftTime Left Time 41 | WorkTimeEdit Task Time Edit Dialog 42 | OperateSucess Operate Sucess 43 | InstallSuccess Plugin Install Success 44 | InstallFailed Plugin Install Failed 45 | Loading Waiting 46 | WebsiteName WebsiteName 47 | LoadFailed Load Failed -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Debug/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.exe -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.pdb -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.vshost.exe -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTao.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTaoLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTaoLib.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTaoLib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Debug/TurtleZenTaoLib.pdb -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/Chinese.lang: -------------------------------------------------------------------------------- 1 | Choose Issue 从禅道中选择 2 | login failed 登录失败 3 | statusStrip1 状态栏 4 | none 无 5 | Search 搜索 6 | Bug Bug 7 | Operate 操作 8 | Title 标题 9 | Task 任务 10 | TaskID 任务编号 11 | Task Name 任务名称 12 | Estimate 预计用时 13 | Consumed 已用时 14 | Left Time 剩余用时 15 | All 全选 16 | None 不选 17 | OK 确定 18 | Cancel 取消 19 | Issue Dialog Bug与任务 20 | UserName 用户名 21 | Password 密码 22 | Website 网址 23 | Add 添加 24 | Validate 验证 25 | Site Edit Dialog 网站编辑 26 | Add Website 添加站点 27 | Install Plugin 安装扩展 28 | No 序号 29 | Edit 编辑 30 | Remove 移除 31 | Website Manage Dialog 网站管理 32 | LoginSuccess 登录成功 33 | Resolved 已解决 34 | BugID BugID 35 | Select 选择 36 | Finished 完成 37 | IsFinished 是否完成 38 | TaskName 任务名称 39 | ConsumeTime 已耗时 40 | LeftTime 剩余时间 41 | WorkTimeEdit 工时统计 42 | OperateSucess 操作成功 43 | InstallSuccess 安装成功 44 | InstallFailed 安装失败 45 | Loading 加载中 46 | WebsiteName 网站名称 47 | LoadFailed 加载失败 48 | ServerResponseError 服务器返回内容出错,请检查你配置的地址 -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/English.lang: -------------------------------------------------------------------------------- 1 | Choose Issue Choose From ZenTao 2 | login failed Login Failed 3 | statusStrip1 Status 4 | none None 5 | Search Search 6 | Bug Bug 7 | Operate Operate 8 | Title Title 9 | Task Task 10 | TaskID TaskID 11 | Task Name Task Name 12 | Estimate Estimate 13 | Consumed Consumed 14 | Left Time Left Time 15 | All All 16 | None None 17 | OK OK 18 | Cancel Cancel 19 | Issue Dialog Issue Dialog 20 | UserName UserName 21 | Password Password 22 | Website Website 23 | Add Add 24 | Validate Validate 25 | Site Edit Dialog Site Edit Dialog 26 | Add Website Add Website 27 | Install Plugin Install Plugin 28 | No No 29 | Edit Edit 30 | Remove Remove 31 | Website Manage Dialog Website Manage Dialog 32 | LoginSuccess Login Success 33 | Resolved Resolved 34 | BugID BugID 35 | Select Select 36 | Finished Finished 37 | IsFinished Is Finished 38 | TaskName Task Name 39 | ConsumeTime Consumed Time 40 | LeftTime Left Time 41 | WorkTimeEdit Task Time Edit Dialog 42 | OperateSucess Operate Sucess 43 | InstallSuccess Plugin Install Success 44 | InstallFailed Plugin Install Failed 45 | Loading Waiting 46 | WebsiteName WebsiteName 47 | LoadFailed Load Failed 48 | ServerResponseError Server Response Error.Please Check Your Site Url. -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Release/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.exe -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.pdb -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.vshost.exe -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.vshost.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTao.vshost.exe.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTaoLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Release/TurtleZenTaoLib.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/TurtleZenTaoLib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTao/bin/Release/TurtleZenTaoLib.pdb -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTao/bin/Release/turtlezendao.db: -------------------------------------------------------------------------------- 1 | aHR0cDovL2RlbW8uemVudGFvLm5ldC8JZGVtbwkxMjM0NTYJZGVtbw== 2 | aHR0cDovL2lzc3VlLmZhbmdndWFudG9uZy5jb20JYWRtaW4tZGV2CWNoZW5ndG9vMjAxMgkgY2hlbmd0b28= 3 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/DbManage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | /** 8 | * @author 张彪 9 | * @version 1.0 2016-10-14 10 | */ 11 | namespace TurtleZenTaoLib 12 | { 13 | /// 14 | /// 数据存储类 15 | /// 16 | class DbManage 17 | { 18 | private string fileName = "turtlezendao.db"; 19 | private List rows = new List(); 20 | 21 | public DbManage() { 22 | getWebsites(); 23 | } 24 | 25 | /// 26 | /// 添加站点记录 27 | /// 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | public bool addWebsiteInfo(int index, string url, string user, string pass, string websiteName){ 34 | string row = url + "\t" + user + "\t" + pass + "\t " + websiteName; 35 | rows.Add(row); 36 | 37 | save(); 38 | 39 | return true; 40 | } 41 | 42 | /// 43 | /// 编辑站点记录 44 | /// 45 | /// 46 | /// 47 | /// 48 | /// 49 | /// 50 | public bool editWebsiteInfo(int index, string url, string user, string pass, string websiteName) 51 | { 52 | rows[index] = url + "\t" + user + "\t" + pass + "\t" + websiteName; 53 | save(); 54 | return true; 55 | } 56 | 57 | /// 58 | /// 删除站点记录 59 | /// 60 | /// 61 | public void deleteWebsiteInfo(int index) { 62 | rows.RemoveAt(index); 63 | 64 | save(); 65 | } 66 | 67 | /// 68 | /// 读取站点记录 69 | /// 70 | /// 71 | public List getWebsites() { 72 | 73 | if (rows.Count > 0){ 74 | return rows; 75 | } 76 | 77 | try 78 | { 79 | FileStream fs = new FileStream(fileName, FileMode.Open); 80 | 81 | StreamReader reader = new StreamReader(fs); 82 | 83 | while (!reader.EndOfStream) 84 | { 85 | string line = Encoding.Default.GetString(Convert.FromBase64String(reader.ReadLine())); 86 | rows.Add(line); 87 | } 88 | reader.Close(); 89 | fs.Close(); 90 | 91 | return rows; 92 | }catch (Exception e){ 93 | return rows; 94 | } 95 | 96 | } 97 | 98 | /// 99 | /// 保存站点记录数据 100 | /// 101 | public void save() { 102 | FileStream fs = new FileStream(fileName, FileMode.Create); 103 | 104 | StreamWriter sw = new StreamWriter(fs, Encoding.Default); 105 | 106 | foreach(string row in rows){ 107 | byte[] data = Encoding.Default.GetBytes(row); 108 | string base64 = Convert.ToBase64String(data); 109 | sw.WriteLine(base64); 110 | } 111 | 112 | sw.Close(); 113 | fs.Close(); 114 | } 115 | 116 | 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/HttpUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using System.Net; 7 | using System.IO; 8 | 9 | using System.Windows.Forms; 10 | 11 | /** 12 | * @author 张彪 13 | * @version 1.0 2016-10-14 14 | */ 15 | namespace TurtleZenTaoLib 16 | { 17 | /// 18 | /// HTTP操作类 19 | /// 20 | class HttpClient 21 | { 22 | public static CookieContainer container = new CookieContainer(); 23 | 24 | public HttpClient() { 25 | } 26 | 27 | public static string get(string url){ 28 | try 29 | { 30 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 31 | request.CookieContainer = container; 32 | request.Method = "GET"; 33 | request.ContentType = "text/html;charset=UTF-8"; 34 | 35 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 36 | Stream myResponseStream = response.GetResponseStream(); 37 | StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8")); 38 | string retString = myStreamReader.ReadToEnd(); 39 | myStreamReader.Close(); 40 | myResponseStream.Close(); 41 | 42 | return retString; 43 | } 44 | catch (Exception e) 45 | { 46 | MessageBox.Show(Plugin.lang.getText("LoadFailed") + ":" + e.Message); 47 | return ""; 48 | } 49 | 50 | } 51 | 52 | public static string post(string url, byte[] data) { 53 | 54 | try 55 | { 56 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 57 | request.Method = "POST"; 58 | request.ContentType = "application/x-www-form-urlencoded"; 59 | request.ContentLength = data.Length; 60 | request.CookieContainer = container; 61 | 62 | Stream myRequestStream = request.GetRequestStream(); 63 | myRequestStream.Write(data, 0, data.Length); 64 | 65 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 66 | 67 | response.Cookies = container.GetCookies(response.ResponseUri); 68 | Stream myResponseStream = response.GetResponseStream(); 69 | StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8")); 70 | string retString = myStreamReader.ReadToEnd(); 71 | myStreamReader.Close(); 72 | myResponseStream.Close(); 73 | 74 | return retString; 75 | } 76 | catch (Exception e) 77 | { 78 | MessageBox.Show(Plugin.lang.getText("LoadFailed") + ":" + e.Message); 79 | return ""; 80 | } 81 | 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/IBugTraqProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | /** 5 | * @author 张彪 6 | */ 7 | namespace TurtleZenTaoLib 8 | { 9 | [ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("298B927C-7220-423C-B7B4-6E241F00CD93")] 10 | public interface IBugTraqProvider 11 | { 12 | [return: MarshalAs(UnmanagedType.VariantBool)] 13 | bool ValidateParameters(IntPtr hParentWnd, 14 | [MarshalAs(UnmanagedType.BStr)] string parameters); 15 | 16 | [return: MarshalAs(UnmanagedType.BStr)] 17 | string GetLinkText(IntPtr hParentWnd, 18 | [MarshalAs(UnmanagedType.BStr)] string parameters); 19 | 20 | [return: MarshalAs(UnmanagedType.BStr)] 21 | string GetCommitMessage(IntPtr hParentWnd, 22 | [MarshalAs(UnmanagedType.BStr)] string parameters, 23 | [MarshalAs(UnmanagedType.BStr)] string commonRoot, 24 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] string[] pathList, 25 | [MarshalAs(UnmanagedType.BStr)] string originalMessage); 26 | } 27 | 28 | [ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("C5C85E31-2F9B-4916-A7BA-8E27D481EE83")] 29 | public interface IBugTraqProvider2 : IBugTraqProvider 30 | { 31 | [return: MarshalAs(UnmanagedType.VariantBool)] 32 | new bool ValidateParameters(IntPtr hParentWnd, 33 | [MarshalAs(UnmanagedType.BStr)] string parameters); 34 | 35 | [return: MarshalAs(UnmanagedType.BStr)] 36 | new string GetLinkText(IntPtr hParentWnd, 37 | [MarshalAs(UnmanagedType.BStr)] string parameters); 38 | 39 | [return: MarshalAs(UnmanagedType.BStr)] 40 | new string GetCommitMessage(IntPtr hParentWnd, 41 | [MarshalAs(UnmanagedType.BStr)] string parameters, 42 | [MarshalAs(UnmanagedType.BStr)] string commonRoot, 43 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] string[] pathList, 44 | [MarshalAs(UnmanagedType.BStr)] string originalMessage); 45 | 46 | [return: MarshalAs(UnmanagedType.BStr)] 47 | string GetCommitMessage2(IntPtr hParentWnd, 48 | [MarshalAs(UnmanagedType.BStr)] string parameters, 49 | [MarshalAs(UnmanagedType.BStr)] string commonURL, 50 | [MarshalAs(UnmanagedType.BStr)] string commonRoot, 51 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] string[] pathList, 52 | [MarshalAs(UnmanagedType.BStr)] string originalMessage, 53 | [MarshalAs(UnmanagedType.BStr)] string bugID, 54 | [MarshalAs(UnmanagedType.BStr)] out string bugIDOut, 55 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] out string[] revPropNames, 56 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] out string[] revPropValues); 57 | 58 | [return: MarshalAs(UnmanagedType.BStr)] 59 | string CheckCommit(IntPtr hParentWnd, 60 | [MarshalAs(UnmanagedType.BStr)] string parameters, 61 | [MarshalAs(UnmanagedType.BStr)] string commonURL, 62 | [MarshalAs(UnmanagedType.BStr)] string commonRoot, 63 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] string[] pathList, 64 | [MarshalAs(UnmanagedType.BStr)] string commitMessage); 65 | 66 | [return: MarshalAs(UnmanagedType.BStr)] 67 | string OnCommitFinished( 68 | IntPtr hParentWnd, 69 | [MarshalAs(UnmanagedType.BStr)] string commonRoot, 70 | [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] string[] pathList, 71 | [MarshalAs(UnmanagedType.BStr)] string logMessage, 72 | [MarshalAs(UnmanagedType.U4)] int revision); 73 | 74 | [return: MarshalAs(UnmanagedType.VariantBool)] 75 | bool HasOptions(); 76 | 77 | [return: MarshalAs(UnmanagedType.BStr)] 78 | string ShowOptionsDialog( 79 | IntPtr hParentWnd, 80 | [MarshalAs(UnmanagedType.BStr)] string parameters); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/Lang.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | using System.Windows.Forms; 7 | using System.Diagnostics; 8 | 9 | namespace TurtleZenTaoLib 10 | { 11 | public class Lang 12 | { 13 | private Dictionary langMap = new Dictionary(); 14 | 15 | /// 16 | /// 获取文本国际化值 17 | /// 18 | /// 19 | /// 20 | public string getText(string name) { 21 | 22 | if (langMap.ContainsKey(name)) { 23 | return langMap[name]; 24 | } 25 | 26 | return name; 27 | } 28 | 29 | 30 | /// 31 | /// 处理控件内部的文本语言国际化 32 | /// 33 | /// 34 | public void langProcess(Control parent) 35 | { 36 | if (parent.Text != null && !parent.Text.Equals("")) 37 | { 38 | parent.Text = getText(parent.Text); 39 | } 40 | 41 | 42 | if (parent.ContextMenuStrip != null) 43 | { 44 | ContextMenuStrip menu = parent.ContextMenuStrip; 45 | 46 | foreach (ToolStripItem item in menu.Items) 47 | { 48 | item.Text = Plugin.lang.getText(item.Text); 49 | } 50 | } 51 | 52 | //listview处理替换列头 53 | if (parent is ListView) 54 | { 55 | ListView listview = (ListView)parent; 56 | System.Drawing.Graphics graph = listview.CreateGraphics(); 57 | 58 | System.Drawing.Font font = new System.Drawing.Font("宋体", 9); 59 | 60 | listview.BeginUpdate(); 61 | foreach (ColumnHeader li in listview.Columns) 62 | { 63 | li.Text = getText(li.Text); 64 | 65 | //计算文本长度 66 | li.Width = (int)Math.Ceiling(graph.MeasureString(li.Text, font).Width) * 2; 67 | } 68 | listview.EndUpdate(); 69 | 70 | graph.Dispose(); 71 | } 72 | 73 | //递归处理子项 74 | foreach (Control control in parent.Controls) 75 | { 76 | langProcess(control); 77 | } 78 | } 79 | 80 | 81 | /// 82 | /// 加载国际化字库 83 | /// 84 | /// 85 | public void load(string langName) 86 | { 87 | langMap.Clear(); 88 | string path = System.Reflection.Assembly.GetExecutingAssembly().Location; 89 | 90 | path = path.Substring(0, path.LastIndexOf('\\') + 1) + langName + ".lang"; 91 | 92 | try 93 | { 94 | 95 | 96 | if (!File.Exists(path)) { 97 | MessageBox.Show(path); 98 | return ; 99 | } 100 | 101 | FileStream fs = new FileStream(path, FileMode.Open); 102 | 103 | StreamReader reader = new StreamReader(fs, Encoding.UTF8); 104 | 105 | while (!reader.EndOfStream) 106 | { 107 | string line = reader.ReadLine(); 108 | string[] items = line.Split('\t'); 109 | 110 | if (items.Length > 1) 111 | { 112 | langMap.Add(items[0], items[1]); 113 | } 114 | else { 115 | MessageBox.Show("语言包 " + path + "存在问题:" + line); 116 | } 117 | 118 | } 119 | 120 | reader.Close(); 121 | fs.Close(); 122 | }catch(Exception e){ 123 | MessageBox.Show("语言包 " + path + "存在问题:" + e.Message); 124 | } 125 | } 126 | 127 | /// 128 | /// 查找当前的DLL路径下的语言包 129 | /// 130 | /// 131 | public List getLangs() { 132 | string dir = System.Reflection.Assembly.GetExecutingAssembly().Location; 133 | 134 | dir = dir.Substring(0, dir.LastIndexOf('\\')); 135 | DirectoryInfo currentDir = new DirectoryInfo(dir); 136 | 137 | FileInfo[] files = currentDir.GetFiles("*.lang"); 138 | 139 | List lngs = new List(); 140 | 141 | foreach (FileInfo file in files) 142 | { 143 | lngs.Add(file.Name.Replace(".lang", "")); 144 | } 145 | 146 | return lngs; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/LangChooseForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace TurtleZenTaoLib 2 | { 3 | partial class LangChooseForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LangChooseForm)); 32 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.comboBox1 = new System.Windows.Forms.ComboBox(); 35 | this.button1 = new System.Windows.Forms.Button(); 36 | this.tableLayoutPanel1.SuspendLayout(); 37 | this.SuspendLayout(); 38 | // 39 | // tableLayoutPanel1 40 | // 41 | this.tableLayoutPanel1.ColumnCount = 2; 42 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F)); 43 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); 44 | this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); 45 | this.tableLayoutPanel1.Controls.Add(this.comboBox1, 1, 0); 46 | this.tableLayoutPanel1.Location = new System.Drawing.Point(27, 12); 47 | this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 48 | this.tableLayoutPanel1.RowCount = 1; 49 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 50 | this.tableLayoutPanel1.Size = new System.Drawing.Size(233, 31); 51 | this.tableLayoutPanel1.TabIndex = 0; 52 | // 53 | // label1 54 | // 55 | this.label1.AutoSize = true; 56 | this.label1.Dock = System.Windows.Forms.DockStyle.Fill; 57 | this.label1.Location = new System.Drawing.Point(3, 0); 58 | this.label1.Name = "label1"; 59 | this.label1.Size = new System.Drawing.Size(63, 31); 60 | this.label1.TabIndex = 0; 61 | this.label1.Text = "Language"; 62 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 63 | this.label1.Click += new System.EventHandler(this.label1_Click); 64 | // 65 | // comboBox1 66 | // 67 | this.comboBox1.Anchor = System.Windows.Forms.AnchorStyles.Left; 68 | this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 69 | this.comboBox1.FormattingEnabled = true; 70 | this.comboBox1.Location = new System.Drawing.Point(72, 5); 71 | this.comboBox1.Name = "comboBox1"; 72 | this.comboBox1.Size = new System.Drawing.Size(121, 20); 73 | this.comboBox1.TabIndex = 1; 74 | // 75 | // button1 76 | // 77 | this.button1.Location = new System.Drawing.Point(99, 60); 78 | this.button1.Name = "button1"; 79 | this.button1.Size = new System.Drawing.Size(75, 23); 80 | this.button1.TabIndex = 1; 81 | this.button1.Text = "OK"; 82 | this.button1.UseVisualStyleBackColor = true; 83 | this.button1.Click += new System.EventHandler(this.button1_Click); 84 | // 85 | // LangChooseForm 86 | // 87 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 88 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 89 | this.ClientSize = new System.Drawing.Size(284, 104); 90 | this.Controls.Add(this.button1); 91 | this.Controls.Add(this.tableLayoutPanel1); 92 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 93 | this.MaximumSize = new System.Drawing.Size(300, 143); 94 | this.MinimumSize = new System.Drawing.Size(300, 143); 95 | this.Name = "LangChooseForm"; 96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 97 | this.Text = "Language"; 98 | this.Load += new System.EventHandler(this.LangChoose_Load); 99 | this.tableLayoutPanel1.ResumeLayout(false); 100 | this.tableLayoutPanel1.PerformLayout(); 101 | this.ResumeLayout(false); 102 | 103 | } 104 | 105 | #endregion 106 | 107 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 108 | private System.Windows.Forms.Label label1; 109 | private System.Windows.Forms.ComboBox comboBox1; 110 | private System.Windows.Forms.Button button1; 111 | } 112 | } -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/LangChooseForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | /** 11 | * 语言切换 12 | * @author 张彪 13 | * @version 1.0 2016-10-14 19:58 补充注释 14 | */ 15 | namespace TurtleZenTaoLib 16 | { 17 | /// 18 | /// 语言选择弹窗 19 | /// 20 | public partial class LangChooseForm : Form 21 | { 22 | public LangChooseForm() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | private void label1_Click(object sender, EventArgs e) 28 | { 29 | 30 | } 31 | 32 | private void LangChoose_Load(object sender, EventArgs e) 33 | { 34 | List langs = Plugin.lang.getLangs(); 35 | 36 | this.comboBox1.BeginUpdate(); 37 | foreach (string lang in langs) 38 | { 39 | this.comboBox1.Items.Add(lang); 40 | } 41 | this.comboBox1.SelectedIndex = 0; 42 | this.comboBox1.EndUpdate(); 43 | } 44 | 45 | private void button1_Click(object sender, EventArgs e) 46 | { 47 | this.Close(); 48 | } 49 | 50 | public string getSelectLang() { 51 | return (string)this.comboBox1.SelectedItem; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("TurtleZenTaoLib")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TurtleZenTaoLib")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 使此程序集中的类型 18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | // 则将该类型上的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("6c929089-db9a-4581-b7d1-6c3c6d154a99")] 24 | 25 | // 程序集的版本信息由下面四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TurtleZenTaoLib.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TurtleZenTaoLib.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/SiteEditForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace TurtleZenTaoLib 11 | { 12 | public partial class SiteEditForm : Form 13 | { 14 | private SiteManageForm manageForm; 15 | 16 | private SiteOperate operate = SiteOperate.NEW; 17 | 18 | private int editIndex = 0; 19 | 20 | public SiteEditForm(SiteManageForm manageForm) 21 | { 22 | this.manageForm = manageForm; 23 | InitializeComponent(); 24 | 25 | Plugin.lang.langProcess(this); 26 | statusStrip1.Hide(); 27 | } 28 | 29 | /// 30 | /// 添加站点btn 31 | /// 32 | /// 33 | /// 34 | private void addWebsiteBtnClick(object sender, EventArgs e) 35 | { 36 | if (operate == SiteOperate.NEW) 37 | { 38 | manageForm.addWebSite(this.websiteUrl.Text, this.username.Text, this.password.Text, this.websiteName.Text); 39 | } 40 | else { 41 | manageForm.editWebSite(editIndex, websiteUrl.Text, username.Text, password.Text, this.websiteName.Text); 42 | } 43 | 44 | setOperate(SiteOperate.NEW); 45 | this.Hide(); 46 | } 47 | 48 | /// 49 | /// 设置弹窗是编辑还是新增 50 | /// 51 | /// 52 | public void setOperate(SiteOperate operate) { 53 | this.operate = operate; 54 | 55 | switch (this.operate) 56 | { 57 | case SiteOperate.EDIT: this.addWebsiteBtn.Text = Plugin.lang.getText("Edit"); break; 58 | default: { 59 | this.addWebsiteBtn.Text = Plugin.lang.getText("Add"); 60 | this.websiteUrl.Text = ""; 61 | this.username.Text = ""; 62 | this.password.Text = ""; 63 | this.websiteName.Text = ""; 64 | } break; 65 | } 66 | } 67 | 68 | /// 69 | /// 设置编辑的初始化数据 70 | /// 71 | /// 72 | /// 73 | /// 74 | /// 75 | public void setEditData(int index, string url, string username, string password, string websiteName) { 76 | 77 | this.editIndex = index; 78 | 79 | this.websiteUrl.Text = url; 80 | this.username.Text = username; 81 | this.password.Text = password; 82 | this.websiteName.Text = websiteName; 83 | 84 | setOperate(SiteOperate.EDIT); 85 | 86 | this.addWebsiteBtn.Text = Plugin.lang.getText("OK"); 87 | } 88 | 89 | private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e) 90 | { 91 | 92 | } 93 | 94 | private void label1_Click(object sender, EventArgs e) 95 | { 96 | 97 | } 98 | 99 | private void button2_Click(object sender, EventArgs e) 100 | { 101 | onStartLoading(); 102 | Result result = ZenTaoManage.login(websiteUrl.Text, username.Text, password.Text); 103 | 104 | this.toolStripProgressBar1.Value = 100; 105 | if (result.isSuccess()) 106 | { 107 | MessageBox.Show(Plugin.lang.getText("LoginSuccess")); 108 | }else 109 | { 110 | MessageBox.Show(result.msg); 111 | } 112 | 113 | onEndLoading(); 114 | } 115 | 116 | public void onStartLoading() { 117 | this.statusStrip1.Show(); 118 | this.toolStripProgressBar1.Minimum = 0; 119 | this.toolStripProgressBar1.Maximum = 100; 120 | this.toolStripProgressBar1.Value = 50; 121 | this.toolStripStatusLabel1.Text = Plugin.lang.getText("Loading"); 122 | this.Update(); 123 | } 124 | 125 | public void onEndLoading() { 126 | this.toolStripProgressBar1.Value = 0; 127 | this.toolStripStatusLabel1.Text = Plugin.lang.getText(""); 128 | this.statusStrip1.Hide(); 129 | } 130 | 131 | private void splitContainer2_Panel2_Paint(object sender, PaintEventArgs e) 132 | { 133 | 134 | } 135 | 136 | private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e) 137 | { 138 | 139 | } 140 | 141 | 142 | } 143 | 144 | public enum SiteOperate 145 | { 146 | NEW, 147 | EDIT 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/SiteManageForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace TurtleZenTaoLib 11 | { 12 | public partial class SiteManageForm : Form 13 | { 14 | private SiteEditForm editForm; 15 | public Plugin plugin; 16 | private DbManage dbManage; 17 | 18 | public SiteManageForm(Plugin plugin) 19 | { 20 | InitializeComponent(); 21 | 22 | editForm = new SiteEditForm(this); 23 | this.plugin = plugin; 24 | dbManage = new DbManage(); 25 | 26 | initSiteList(); 27 | Plugin.lang.langProcess(this); 28 | 29 | this.statusStrip1.Hide(); 30 | } 31 | 32 | private void toolStripStatusLabel1_Click(object sender, EventArgs e) 33 | { 34 | 35 | } 36 | 37 | private void addSiteBtnClick(object sender, EventArgs e) 38 | { 39 | editForm.ShowDialog(); 40 | } 41 | 42 | private void button2_Click(object sender, EventArgs e) 43 | { 44 | 45 | } 46 | 47 | private void siteListView_SelectedIndexChanged(object sender, EventArgs e) 48 | { 49 | 50 | } 51 | 52 | public void addWebSite(string siteUrl, string username, string password, string websiteName) { 53 | siteListView.BeginUpdate(); 54 | ListViewItem item = new ListViewItem(); 55 | 56 | item.Text = siteListView.Items.Count + ""; 57 | item.SubItems.Add(websiteName); 58 | item.SubItems.Add(siteUrl); 59 | item.SubItems.Add(username); 60 | item.SubItems.Add("******"); 61 | 62 | siteListView.Items.Add(item); 63 | siteListView.EndUpdate(); 64 | 65 | dbManage.addWebsiteInfo(0, siteUrl, username, password, websiteName); 66 | } 67 | 68 | /// 69 | /// 初始化网站列表 70 | /// 71 | public void initSiteList() { 72 | siteListView.Items.Clear(); 73 | 74 | siteListView.BeginUpdate(); 75 | foreach(string row in dbManage.getWebsites()){ 76 | string[] rowItem = row.Split('\t'); 77 | 78 | 79 | ListViewItem item = new ListViewItem(); 80 | 81 | item.Text = siteListView.Items.Count + ""; 82 | 83 | string websiteName = ""; 84 | if(rowItem.Length > 3){ 85 | websiteName = rowItem[3]; 86 | } 87 | 88 | item.SubItems.Add(websiteName); 89 | item.SubItems.Add(rowItem[0]); 90 | item.SubItems.Add(rowItem[1]); 91 | item.SubItems.Add("******"); 92 | 93 | siteListView.Items.Add(item); 94 | } 95 | 96 | siteListView.EndUpdate(); 97 | } 98 | 99 | /// 100 | /// 网站编辑结果展示 101 | /// 102 | /// 103 | /// 104 | /// 105 | /// 106 | public void editWebSite(int index, string siteUrl, string username, string password, string websiteName) 107 | { 108 | siteListView.BeginUpdate(); 109 | ListViewItem item = siteListView.Items[index]; 110 | 111 | item.SubItems[1].Text = websiteName; 112 | item.SubItems[2].Text = siteUrl; 113 | item.SubItems[3].Text = username; 114 | item.SubItems[4].Text = "******"; 115 | 116 | siteListView.EndUpdate(); 117 | 118 | dbManage.editWebsiteInfo(index, siteUrl, username, password, websiteName); 119 | } 120 | 121 | /// 122 | /// 鼠标右键编辑网站信息 123 | /// 124 | /// 125 | /// 126 | public void onEditClick(object sender, EventArgs e) 127 | { 128 | if (siteListView.SelectedItems.Count == 0) { 129 | return; 130 | } 131 | 132 | ListViewItem selectedItem = siteListView.SelectedItems[0]; 133 | int index = selectedItem.Index; 134 | 135 | SiteEditForm editForm = new SiteEditForm(this); 136 | string[] row = dbManage.getWebsites()[index].Split('\t'); 137 | string websiteName = ""; 138 | if (row.Length > 3) 139 | { 140 | websiteName = row[3]; 141 | } 142 | 143 | editForm.setEditData(selectedItem.Index, row[0], row[1], row[2], websiteName); 144 | 145 | editForm.ShowDialog(); 146 | } 147 | 148 | /// 149 | /// 鼠标右键删除网站 150 | /// 151 | /// 152 | /// 153 | public void onDeleteClick(object sender, EventArgs e) 154 | { 155 | ListViewItem selectedItem = siteListView.SelectedItems[0]; 156 | int index = selectedItem.Index; 157 | siteListView.Items.RemoveAt(index); 158 | siteListView.Update(); 159 | 160 | dbManage.deleteWebsiteInfo(index); 161 | } 162 | 163 | /// 164 | /// 列表项鼠标双击处理 165 | /// 166 | /// 167 | /// 168 | private void onListDbClicked(object sender, EventArgs e) 169 | { 170 | ListViewItem selectedItem = siteListView.SelectedItems[0]; 171 | int index = selectedItem.Index; 172 | 173 | string[] website = dbManage.getWebsites()[index].Split('\t'); 174 | plugin.enterIssueForm(website[0], website[1], website[2]); 175 | } 176 | 177 | private void SiteManageForm_Load(object sender, EventArgs e) 178 | { 179 | if (this.siteListView.Items.Count > 0) 180 | { 181 | foreach (ColumnHeader head in this.siteListView.Columns) 182 | { 183 | head.Width = -2; 184 | } 185 | } 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/TurtleZenTaoLib.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2854A8D8-5AA6-491C-BB4E-46E9ABC557A6} 8 | Library 9 | Properties 10 | TurtleZenTaoLib 11 | TurtleZenTaoLib 12 | v4.0 13 | 512 14 | 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Form 50 | 51 | 52 | IssuesForm.cs 53 | 54 | 55 | 56 | 57 | Form 58 | 59 | 60 | LangChooseForm.cs 61 | 62 | 63 | 64 | 65 | True 66 | True 67 | Resources.resx 68 | 69 | 70 | Form 71 | 72 | 73 | SiteEditForm.cs 74 | 75 | 76 | Form 77 | 78 | 79 | SiteManageForm.cs 80 | 81 | 82 | Form 83 | 84 | 85 | WorkTimeEditForm.cs 86 | 87 | 88 | 89 | 90 | 91 | IssuesForm.cs 92 | 93 | 94 | LangChooseForm.cs 95 | 96 | 97 | ResXFileCodeGenerator 98 | Resources.Designer.cs 99 | 100 | 101 | SiteEditForm.cs 102 | 103 | 104 | SiteManageForm.cs 105 | 106 | 107 | WorkTimeEditForm.cs 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 124 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/TurtleZenTaoLib.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/WorkTimeEditForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace TurtleZenTaoLib 11 | { 12 | public partial class WorkTimeEditForm : Form 13 | { 14 | 15 | public WorkTimeEditForm() 16 | { 17 | InitializeComponent(); 18 | Plugin.lang.langProcess(this); 19 | } 20 | 21 | private void checkBox1_CheckedChanged(object sender, EventArgs e) 22 | { 23 | if (finished.Checked) 24 | { 25 | left.Text = "0"; 26 | left.ReadOnly = true; 27 | } 28 | else { 29 | left.ReadOnly = false; 30 | } 31 | 32 | } 33 | 34 | public void setValues(string taskId, string taskName, string consumed, string left, bool finished) { 35 | this.taskId.Text = taskId; 36 | this.taskName.Text = taskName; 37 | this.consumed.Text = consumed; 38 | this.left.Text = left; 39 | this.finished.Checked = finished; 40 | } 41 | 42 | public string getTaskId() { 43 | return taskId.Text; 44 | } 45 | 46 | public string getTaskName() 47 | { 48 | return taskName.Text; 49 | } 50 | 51 | public string getConsumed() 52 | { 53 | return consumed.Text; 54 | } 55 | 56 | public string getLeft() 57 | { 58 | return left.Text; 59 | } 60 | 61 | 62 | public bool isFinished() 63 | { 64 | return finished.Checked; 65 | } 66 | 67 | private void button1_Click(object sender, EventArgs e) 68 | { 69 | this.Close(); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/bin/Debug/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/bin/Debug/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/bin/Debug/TurtleZenTaoLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/bin/Debug/TurtleZenTaoLib.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/bin/Debug/TurtleZenTaoLib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/bin/Debug/TurtleZenTaoLib.pdb -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/bin/Release/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/bin/Release/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/bin/Release/TurtleZenTaoLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/bin/Release/TurtleZenTaoLib.dll -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/bin/Release/TurtleZenTaoLib.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/bin/Release/TurtleZenTaoLib.pdb -------------------------------------------------------------------------------- /client/tortoise/TurtleZenTaoLib/resource/$this.Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/client/tortoise/TurtleZenTaoLib/resource/$this.Icon.ico -------------------------------------------------------------------------------- /doc/.ignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easysoft/zentaoextension/e085852ad4676d57291c1d5da56f0f88d3a50bc5/doc/.ignore -------------------------------------------------------------------------------- /language/mergelang.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | $content) 44 | { 45 | fwrite($fh, "/* " . $module . " */"); 46 | fwrite($fh, $content); 47 | } 48 | fclose($fh); 49 | } 50 | 51 | echo "merge lang files down!\n"; 52 | -------------------------------------------------------------------------------- /language/separatelang.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | $module) 29 | { 30 | $module = trim(rtrim(ltrim($module, '/*'), '*/')); 31 | $langDir = $module . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR; 32 | @mkdir($langDir, 0777, true); 33 | if(is_dir($langDir)) file_put_contents($langDir . $lang . '.php', "