├── tests ├── site │ ├── scripts.js │ ├── data.json │ ├── styles.css │ ├── search.php │ ├── login.php │ ├── b.html │ ├── c.html │ ├── index.html │ └── a.html └── data │ ├── commands │ ├── exec.test.command.js │ ├── test.command.js │ ├── exec.push_to_production.js │ └── push_to_production.js │ ├── a.json │ ├── a.txt │ ├── b.json │ ├── b.txt │ ├── jasmine │ ├── exec.jasmine.test.js │ └── subfolder │ │ ├── exec.jasmine.test.js │ │ └── subsubfolder │ │ └── exec.jasmine.test.js │ └── exec.github.search.spec.js ├── .gitignore ├── src ├── js │ ├── vendor │ │ ├── ace │ │ │ └── src-noconflict │ │ │ │ ├── mode-text.js │ │ │ │ ├── theme-textmate.js │ │ │ │ ├── ext-statusbar.js │ │ │ │ ├── mode-lucene.js │ │ │ │ ├── ext-spellcheck.js │ │ │ │ ├── ext-themelist.js │ │ │ │ ├── mode-properties.js │ │ │ │ ├── theme-eclipse.js │ │ │ │ ├── theme-xcode.js │ │ │ │ ├── mode-sql.js │ │ │ │ ├── theme-clouds.js │ │ │ │ ├── ext-static_highlight.js │ │ │ │ ├── theme-vibrant_ink.js │ │ │ │ ├── theme-merbivore.js │ │ │ │ ├── mode-ada.js │ │ │ │ └── theme-github.js │ │ └── jasmine-1.3.1 │ │ │ └── MIT.LICENSE │ ├── commands │ │ ├── common │ │ │ ├── clear.js │ │ │ ├── l.js │ │ │ ├── middleman.js │ │ │ ├── marker.js │ │ │ ├── pass.js │ │ │ ├── delay.js │ │ │ ├── stringify.js │ │ │ ├── exec.js │ │ │ ├── history.js │ │ │ ├── var.js │ │ │ ├── date.js │ │ │ ├── read.js │ │ │ ├── request.js │ │ │ ├── compare.js │ │ │ ├── diff.js │ │ │ └── man.js │ │ ├── os │ │ │ ├── cwd.js │ │ │ ├── cd.js │ │ │ ├── shell.js │ │ │ ├── writefile.js │ │ │ ├── readfile.js │ │ │ ├── block.js │ │ │ ├── tree.js │ │ │ └── watch.js │ │ ├── messages │ │ │ ├── hr.js │ │ │ ├── title.js │ │ │ ├── echo.js │ │ │ ├── echoshell.js │ │ │ ├── error.js │ │ │ ├── info.js │ │ │ ├── small.js │ │ │ ├── success.js │ │ │ ├── warning.js │ │ │ ├── echoraw.js │ │ │ └── hidden.js │ │ ├── tabs │ │ │ ├── refresh.js │ │ │ ├── load.js │ │ │ ├── screenshot.js │ │ │ └── newtab.js │ │ ├── page │ │ │ ├── pageinsertcss.js │ │ │ ├── pageinsertjs.js │ │ │ ├── pageinsertjsw.js │ │ │ ├── pagehighlight.js │ │ │ ├── pagequery.js │ │ │ ├── pageclick.js │ │ │ ├── pageclickw.js │ │ │ ├── pageexpect.js │ │ │ └── pagecontains.js │ │ ├── develop │ │ │ ├── runjasmine.js │ │ │ └── jshint.js │ │ ├── forms │ │ │ ├── formconfirm.js │ │ │ ├── forminput.js │ │ │ ├── formtextarea.js │ │ │ └── formfile.js │ │ └── data │ │ │ ├── storage.js │ │ │ ├── profile.js │ │ │ └── alias.js │ ├── boot.js │ ├── lib │ │ ├── CommandParser.js │ │ ├── Commands.js │ │ ├── CommandBase.js │ │ ├── Context.js │ │ └── Shell.js │ ├── global.js │ ├── scripts │ │ └── marker.js │ ├── chain.js │ └── content.js ├── devtools.html ├── img │ ├── audio.png │ ├── swap.png │ ├── icon128.png │ ├── icon16.png │ ├── icon19.png │ ├── icon38.png │ ├── icon48.png │ ├── slider.png │ └── sliderbg.png ├── font │ ├── fontello.eot │ ├── fontello.ttf │ └── fontello.woff ├── newtab │ ├── fonts │ │ ├── 9k-RPmcnxYEPm8CNFsH2gg.woff │ │ ├── boeCNmOCCh-EWFLSfVffDg.woff │ │ ├── BM8u7YRmG0S-vNUxWAiLF4bN6UDyHWBl620a-IRfuBk.woff │ │ ├── BraFEMRumMsVbWgqTQIWRPesZW2xOQ-xsNqO47m55DA.woff │ │ ├── DXI1ORHCpsQm3Vp6mXoaTVMBBrntOh5tSEdJ1aeglyY.woff │ │ ├── EInbV5DfGHOiMmvb1Xr-hlMBBrntOh5tSEdJ1aeglyY.woff │ │ ├── K88pR3goAWT7BTt32Z01m7O3LdcAZYWl9Si6vvxL-qU.woff │ │ ├── MTP_ySUJH_bn48VBG8sNSlMBBrntOh5tSEdJ1aeglyY.woff │ │ ├── PRmiXeptR36kaC0GEAetxnAs8Wu_YJ_iPyCHUNPN6JQ.woff │ │ ├── PRmiXeptR36kaC0GEAetxq_HxB5EqkbxBlcMADog12k.woff │ │ ├── PRmiXeptR36kaC0GEAetxr6z-VYxiFCB6NAIKy3J77w.woff │ │ ├── PRmiXeptR36kaC0GEAetxtmPLRxFEEE7es7tC2X2zcQ.woff │ │ ├── fas9dl2wmMkt5rCu-aBez_esZW2xOQ-xsNqO47m55DA.woff │ │ ├── jObgDQiPUtmACAaaK3pMGz8E0i7KZn-EPnyo3HZu7kw.woff │ │ ├── k3k702ZOKiLJc3WVjuplzFMBBrntOh5tSEdJ1aeglyY.woff │ │ └── xjAJXh38I15wypJXxuGMBhsKoB_2lT5BZsH32Y4e7So.woff │ ├── Economica.css │ ├── newtab.html │ ├── newtab.js │ ├── newtab.css │ └── font.css ├── devtools.js ├── css │ ├── less │ │ ├── index.less │ │ ├── hint.less │ │ ├── diff.less │ │ ├── tree.less │ │ ├── messages.less │ │ ├── form.less │ │ ├── editor.less │ │ ├── manual.less │ │ ├── shell.less │ │ ├── main.less │ │ └── console.less │ ├── marker.css │ ├── OpenSans.css │ ├── fontello.css │ └── Tetris.css ├── manifest.json └── index.html ├── design ├── icon.png ├── icon.psd ├── icon_bw.png ├── preview.jpg └── preview.psd ├── package.json ├── tpl └── README.md ├── Gruntfile.js └── tasks └── generate-man-in-markdown.js /tests/site/scripts.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/mode-text.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-textmate.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/devtools.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /design/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/design/icon.png -------------------------------------------------------------------------------- /design/icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/design/icon.psd -------------------------------------------------------------------------------- /src/img/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/audio.png -------------------------------------------------------------------------------- /src/img/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/swap.png -------------------------------------------------------------------------------- /design/icon_bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/design/icon_bw.png -------------------------------------------------------------------------------- /design/preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/design/preview.jpg -------------------------------------------------------------------------------- /design/preview.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/design/preview.psd -------------------------------------------------------------------------------- /src/img/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/icon128.png -------------------------------------------------------------------------------- /src/img/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/icon16.png -------------------------------------------------------------------------------- /src/img/icon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/icon19.png -------------------------------------------------------------------------------- /src/img/icon38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/icon38.png -------------------------------------------------------------------------------- /src/img/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/icon48.png -------------------------------------------------------------------------------- /src/img/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/slider.png -------------------------------------------------------------------------------- /src/font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/font/fontello.eot -------------------------------------------------------------------------------- /src/font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/font/fontello.ttf -------------------------------------------------------------------------------- /src/font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/font/fontello.woff -------------------------------------------------------------------------------- /src/img/sliderbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/img/sliderbg.png -------------------------------------------------------------------------------- /tests/data/commands/exec.test.command.js: -------------------------------------------------------------------------------- 1 | function execTestCommandName(args) { 2 | exec("success executing a command"); 3 | } -------------------------------------------------------------------------------- /tests/data/commands/test.command.js: -------------------------------------------------------------------------------- 1 | function testCommandName(args) { 2 | exec("echo Test Command. Args:" + args.join(", ")); 3 | } -------------------------------------------------------------------------------- /src/newtab/fonts/9k-RPmcnxYEPm8CNFsH2gg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/9k-RPmcnxYEPm8CNFsH2gg.woff -------------------------------------------------------------------------------- /src/newtab/fonts/boeCNmOCCh-EWFLSfVffDg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/boeCNmOCCh-EWFLSfVffDg.woff -------------------------------------------------------------------------------- /tests/site/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "name": "User 1" 5 | }, 6 | { 7 | "name": "User 2" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /src/devtools.js: -------------------------------------------------------------------------------- 1 | chrome.devtools.panels.create( 2 | "Auxilio", 3 | "img/icon16.png", 4 | "index.html", 5 | function() { 6 | 7 | } 8 | ); -------------------------------------------------------------------------------- /tests/data/commands/exec.push_to_production.js: -------------------------------------------------------------------------------- 1 | function nameOfCommand(args, callback) { 2 | info("Pushing to production directly."); 3 | callback(); 4 | } -------------------------------------------------------------------------------- /src/newtab/fonts/BM8u7YRmG0S-vNUxWAiLF4bN6UDyHWBl620a-IRfuBk.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/BM8u7YRmG0S-vNUxWAiLF4bN6UDyHWBl620a-IRfuBk.woff -------------------------------------------------------------------------------- /src/newtab/fonts/BraFEMRumMsVbWgqTQIWRPesZW2xOQ-xsNqO47m55DA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/BraFEMRumMsVbWgqTQIWRPesZW2xOQ-xsNqO47m55DA.woff -------------------------------------------------------------------------------- /src/newtab/fonts/DXI1ORHCpsQm3Vp6mXoaTVMBBrntOh5tSEdJ1aeglyY.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/DXI1ORHCpsQm3Vp6mXoaTVMBBrntOh5tSEdJ1aeglyY.woff -------------------------------------------------------------------------------- /src/newtab/fonts/EInbV5DfGHOiMmvb1Xr-hlMBBrntOh5tSEdJ1aeglyY.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/EInbV5DfGHOiMmvb1Xr-hlMBBrntOh5tSEdJ1aeglyY.woff -------------------------------------------------------------------------------- /src/newtab/fonts/K88pR3goAWT7BTt32Z01m7O3LdcAZYWl9Si6vvxL-qU.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/K88pR3goAWT7BTt32Z01m7O3LdcAZYWl9Si6vvxL-qU.woff -------------------------------------------------------------------------------- /src/newtab/fonts/MTP_ySUJH_bn48VBG8sNSlMBBrntOh5tSEdJ1aeglyY.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/MTP_ySUJH_bn48VBG8sNSlMBBrntOh5tSEdJ1aeglyY.woff -------------------------------------------------------------------------------- /src/newtab/fonts/PRmiXeptR36kaC0GEAetxnAs8Wu_YJ_iPyCHUNPN6JQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/PRmiXeptR36kaC0GEAetxnAs8Wu_YJ_iPyCHUNPN6JQ.woff -------------------------------------------------------------------------------- /src/newtab/fonts/PRmiXeptR36kaC0GEAetxq_HxB5EqkbxBlcMADog12k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/PRmiXeptR36kaC0GEAetxq_HxB5EqkbxBlcMADog12k.woff -------------------------------------------------------------------------------- /src/newtab/fonts/PRmiXeptR36kaC0GEAetxr6z-VYxiFCB6NAIKy3J77w.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/PRmiXeptR36kaC0GEAetxr6z-VYxiFCB6NAIKy3J77w.woff -------------------------------------------------------------------------------- /src/newtab/fonts/PRmiXeptR36kaC0GEAetxtmPLRxFEEE7es7tC2X2zcQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/PRmiXeptR36kaC0GEAetxtmPLRxFEEE7es7tC2X2zcQ.woff -------------------------------------------------------------------------------- /src/newtab/fonts/fas9dl2wmMkt5rCu-aBez_esZW2xOQ-xsNqO47m55DA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/fas9dl2wmMkt5rCu-aBez_esZW2xOQ-xsNqO47m55DA.woff -------------------------------------------------------------------------------- /src/newtab/fonts/jObgDQiPUtmACAaaK3pMGz8E0i7KZn-EPnyo3HZu7kw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/jObgDQiPUtmACAaaK3pMGz8E0i7KZn-EPnyo3HZu7kw.woff -------------------------------------------------------------------------------- /src/newtab/fonts/k3k702ZOKiLJc3WVjuplzFMBBrntOh5tSEdJ1aeglyY.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/k3k702ZOKiLJc3WVjuplzFMBBrntOh5tSEdJ1aeglyY.woff -------------------------------------------------------------------------------- /src/newtab/fonts/xjAJXh38I15wypJXxuGMBhsKoB_2lT5BZsH32Y4e7So.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krasimir/auxilio/master/src/newtab/fonts/xjAJXh38I15wypJXxuGMBhsKoB_2lT5BZsH32Y4e7So.woff -------------------------------------------------------------------------------- /tests/data/a.json: -------------------------------------------------------------------------------- 1 | { 2 | "members": [ 3 | { 4 | "name": "John Black", 5 | "job": "developer" 6 | }, 7 | { 8 | "name": "Martin Silver", 9 | "job": "designer" 10 | } 11 | ], 12 | "type": "name-and-job" 13 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Auxilio", 3 | "version": "0.0.1", 4 | "devDependencies": { 5 | "grunt": "0.4.1", 6 | "grunt-contrib-concat": "0.3.0", 7 | "grunt-contrib-watch": "0.4.4", 8 | "assemble-less": "0.4.8" 9 | } 10 | } -------------------------------------------------------------------------------- /src/newtab/Economica.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Economica'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Economica'), local('Economica-Regular'), url(./fonts/jObgDQiPUtmACAaaK3pMGz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); 6 | } -------------------------------------------------------------------------------- /tests/data/a.txt: -------------------------------------------------------------------------------- 1 | Web design encompasses many different skills and disciplines in the production and maintenance of websites. The different areas of web design include web graphic design; authoring, including standardised code and proprietary software; user experience design; and search engine optimization. -------------------------------------------------------------------------------- /tests/data/b.json: -------------------------------------------------------------------------------- 1 | { 2 | "members": [ 3 | { 4 | "name": "John Black", 5 | "job": "developer" 6 | }, 7 | { 8 | "name": "Martin Silver", 9 | "job": "manager" 10 | }, 11 | { 12 | "name": "Jacob Tomas", 13 | "job": "tester" 14 | } 15 | ], 16 | "type": "name-and-job" 17 | } -------------------------------------------------------------------------------- /src/css/less/index.less: -------------------------------------------------------------------------------- 1 | @import "lesshat.less"; 2 | @import "main.less"; 3 | @import "console.less"; 4 | @import "messages.less"; 5 | @import "form.less"; 6 | @import "diff.less"; 7 | @import "shell.less"; 8 | @import "hint.less"; 9 | @import "tree.less"; 10 | @import "editor.less"; 11 | @import "manual.less"; -------------------------------------------------------------------------------- /tests/data/b.txt: -------------------------------------------------------------------------------- 1 | Web design encompasses many different skills and disciplines in the production and maintenance of the internet sites. The different areas of web design include web graphic design; interface design; authoring, including standardised code and proprietary software; user experience design; and search engine optimization. -------------------------------------------------------------------------------- /tests/site/styles.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | width: 100%; 3 | height: 100%; 4 | font-family: Tahoma; 5 | font-size: 16px; 6 | margin: 0; 7 | padding: 20px 0 0 0; 8 | } 9 | h1, h2, h3, h4, h5, h6 { 10 | font-weight: normal; 11 | padding: 0; 12 | margin: 0 0 10px 0; 13 | color: #222; 14 | } 15 | .content { 16 | padding: 20px; 17 | } -------------------------------------------------------------------------------- /tests/data/commands/push_to_production.js: -------------------------------------------------------------------------------- 1 | function nameOfCommand(args, callback) { 2 | var commitMessage = args.length > 0 ? args.join(" ") : false; 3 | if(commitMessage === false) { 4 | error("Sorry, please type a commit message."); 5 | callback(); 6 | } else { 7 | echo("Pushing to production with message = '" + commitMessage + "'"); 8 | callback(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/js/commands/common/clear.js: -------------------------------------------------------------------------------- 1 | Commands.register("clear", { 2 | run: function(args, callback) { 3 | App.clear(); 4 | callback(); 5 | }, 6 | man: { 7 | desc: 'Clearing the current console\'s output.', 8 | format: 'clear', 9 | examples: [ 10 | {text: '', code: 'clear'}, 11 | {text: 'In script', code: 'clear()'} 12 | ], 13 | returns: 'null', 14 | group: 'common' 15 | } 16 | }) -------------------------------------------------------------------------------- /src/js/boot.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | Autocomplete.init(); 3 | Autocomplete.on("match", function(res) { 4 | App.setCommandValue(res.value); 5 | }); 6 | App.init(); 7 | Context.init(); 8 | Shell.init(); 9 | Profile.init(); 10 | document.querySelector("body").addEventListener("keydown", function(e) { 11 | if(e.ctrlKey && e.keyCode === 123) { 12 | App.command.focus(); 13 | } 14 | }); 15 | }; -------------------------------------------------------------------------------- /src/js/commands/common/l.js: -------------------------------------------------------------------------------- 1 | Commands.register("l", { 2 | run: function(args, callback) { 3 | App.clear(); 4 | callback(); 5 | }, 6 | man: function() { 7 | return ''; 8 | }, 9 | man: { 10 | desc: 'Clearing the current console\'s output.', 11 | format: 'l', 12 | examples: [ 13 | {text: 'Just type l and press Enter', code: 'l'} 14 | ], 15 | returns: 'null', 16 | group: 'common' 17 | } 18 | }) -------------------------------------------------------------------------------- /src/css/less/hint.less: -------------------------------------------------------------------------------- 1 | .hint { 2 | .transition(~"all 400ms ease-out"); 3 | display: block; 4 | position: fixed; 5 | top: 74px; 6 | left: -400px; 7 | background: @color-b; 8 | color: @color-c; 9 | font-size: 14px; 10 | line-height: 20px; 11 | padding: 10px; 12 | border-top-right-radius: 12px; 13 | border-bottom-right-radius: 12px; 14 | border-bottom-left-radius: 12px; 15 | border: solid 1px lighten(@color-c, 10%); 16 | .box-shadow(~"0 1px 5px #999"); 17 | } -------------------------------------------------------------------------------- /tests/data/jasmine/exec.jasmine.test.js: -------------------------------------------------------------------------------- 1 | function jasmineTest(args, callback) { 2 | describe("A test suite", function() { 3 | it("should echo something to the console", function(done) { 4 | exec("echo That's coming from a jasmine test.", function() { 5 | done(); 6 | }) 7 | }); 8 | it("should get the current date", function(done) { 9 | exec("date true", function(res) { 10 | expect(res.monthName).toBeDefined(); 11 | done(); 12 | }) 13 | }); 14 | }); 15 | callback(); 16 | } -------------------------------------------------------------------------------- /tests/data/jasmine/subfolder/exec.jasmine.test.js: -------------------------------------------------------------------------------- 1 | function jasmineTest(args, callback) { 2 | describe("A test suite", function() { 3 | it("should echo something to the console", function(next) { 4 | exec("echo That's coming from a jasmine test.", function() { 5 | next(); 6 | }) 7 | }); 8 | it("should get the current date", function(next) { 9 | exec("date true", function(res) { 10 | expect(res.monthName).toBeDefined(); 11 | next(); 12 | }) 13 | }) 14 | }); 15 | callback(); 16 | } -------------------------------------------------------------------------------- /tests/data/jasmine/subfolder/subsubfolder/exec.jasmine.test.js: -------------------------------------------------------------------------------- 1 | function jasmineTest(args, callback) { 2 | describe("A test suite", function() { 3 | it("should echo something to the console", function(next) { 4 | exec("echo That's coming from a jasmine test.", function() { 5 | next(); 6 | }) 7 | }); 8 | it("should get the current date", function(next) { 9 | exec("date true", function(res) { 10 | expect(res.monthName).toBeDefined(); 11 | next(); 12 | }) 13 | }) 14 | }); 15 | callback(); 16 | } -------------------------------------------------------------------------------- /src/js/commands/os/cwd.js: -------------------------------------------------------------------------------- 1 | Commands.register("cwd", { 2 | requiredArguments: 0, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | callback(Context.get()); 7 | }, 8 | man: { 9 | desc: 'Returns the current working directory of auxilio-backend.', 10 | format: 'cwd', 11 | examples: [ 12 | {text: 'Command line', code: 'cwd'}, 13 | {text: 'In script', code: 'cwd(function(res) {\n\ 14 | console.log(res);\n\ 15 | });'} 16 | ], 17 | returns: 'string', 18 | group: 'os' 19 | } 20 | }) -------------------------------------------------------------------------------- /src/js/commands/common/middleman.js: -------------------------------------------------------------------------------- 1 | Commands.register("middleman", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | callback(args); 7 | }, 8 | man: { 9 | desc: 'The command simply passes the given argument to its callback', 10 | format: 'middleman [resource]', 11 | examples: [ 12 | {text: 'Command line (chaining)', code: 'date && middleman && echo'} 13 | ], 14 | returns: 'The result of the previous command in the chain.', 15 | group: 'common' 16 | } 17 | }) -------------------------------------------------------------------------------- /src/js/commands/os/cd.js: -------------------------------------------------------------------------------- 1 | Commands.register("cd", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var path = args.join(" "); 7 | shell("cd " + path, callback) 8 | }, 9 | man: { 10 | desc: 'Change the current directory', 11 | format: 'cd [path]', 12 | examples: [ 13 | {text: 'Command line', code: 'cd D:/Work'}, 14 | {text: 'In script', code: 'cd("D:/Work", function() {\n\ 15 | console.log("directory changed");\n\ 16 | });'} 17 | ], 18 | returns: 'null', 19 | group: 'os' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/common/marker.js: -------------------------------------------------------------------------------- 1 | Commands.register("marker", { 2 | requiredArguments: 0, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | if(chrome && chrome.runtime) { 7 | chrome.runtime.sendMessage({type: "marker"}, callback); 8 | } 9 | }, 10 | man: { 11 | desc: 'Gives you ability to place markers on the current page. screenshot command could be used after that.', 12 | format: 'marker', 13 | examples: [ 14 | {text: 'Command line', code: 'marker'} 15 | ], 16 | returns: 'null', 17 | group: 'common' 18 | } 19 | }) -------------------------------------------------------------------------------- /src/js/commands/common/pass.js: -------------------------------------------------------------------------------- 1 | Commands.register("pass", { 2 | requiredArguments: 1, 3 | format: '
',
 4 | 	lookForQuotes: false,
 5 | 	concatArgs: true,
 6 | 	run: function(args, callback) {		
 7 | 		callback();
 8 | 	},
 9 | 	man: {
10 | 		desc: 'Sometimes is needed to stop passing a result from one command to another. This command simply calls its callback without any arguments.',
11 | 		format: 'pass',
12 | 		examples: [
13 | 			{text: 'Command line (chaining)', code: 'date true && pass && echo That\'s a string without date.'}
14 | 		],
15 | 		returns: 'null',
16 | 		group: 'common'
17 | 	}	
18 | })


--------------------------------------------------------------------------------
/src/js/commands/messages/hr.js:
--------------------------------------------------------------------------------
 1 | Commands.register("hr", {
 2 | 	requiredArguments: 0,
 3 | 	lookForQuotes: false,
 4 | 	concatArgs: true,
 5 | 	run: function(args, callback) {
 6 | 		App.setOutputPanelContent('

'); 7 | callback(); 8 | }, 9 | man: function() { 10 | return 'Adds <hr /> tag to the console\'s output panel'; 11 | }, 12 | man: { 13 | desc: 'Adds <hr /> tag to the console\'s output panel', 14 | format: 'hr', 15 | examples: [ 16 | {text: 'Command line', code: 'hr'}, 17 | {text: 'In script', code: 'hr();'} 18 | ], 19 | returns: 'null', 20 | group: 'messages' 21 | } 22 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/title.js: -------------------------------------------------------------------------------- 1 | Commands.register("title", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('

' + this.formatter(args) + '

'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'title [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'title Hello world!'}, 14 | {text: 'In script', code: 'title("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/echo.js: -------------------------------------------------------------------------------- 1 | Commands.register("echo", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('
' + this.formatter(args) + '
'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'echo [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'echo Hello world!'}, 14 | {text: 'In script', code: 'echo("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/common/delay.js: -------------------------------------------------------------------------------- 1 | Commands.register("delay", { 2 | requiredArguments: 1, 3 | run: function(args, callback) { 4 | var interval = parseInt(args.shift()); 5 | setTimeout(function() { 6 | callback(); 7 | }, interval) 8 | }, 9 | man: { 10 | desc: 'Delays the next command', 11 | format: 'delay [miliseconds]', 12 | examples: [ 13 | {text: 'Command line', code: 'delay 2000'}, 14 | {text: 'Command line (chaining)', code: 'echo A && delay 2000 && echo B'}, 15 | {text: 'In script', code: 'delay(2000, function() {\n\ 16 | console.log("hello");\n\ 17 | })'} 18 | ], 19 | returns: 'null', 20 | group: 'common' 21 | } 22 | }) -------------------------------------------------------------------------------- /tests/site/search.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | Login 16 | 17 | 18 | 19 |
20 |

Login

21 |

22 |
23 |

Back to home page

24 |
25 | 26 | -------------------------------------------------------------------------------- /src/js/commands/common/stringify.js: -------------------------------------------------------------------------------- 1 | Commands.register("stringify", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | for(var i=0; i' + this.formatter(args) + ''); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'echoshell [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'echoshell Hello world!'}, 14 | {text: 'In script', code: 'echoshell("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/error.js: -------------------------------------------------------------------------------- 1 | Commands.register("error", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('
' + this.formatter(args) + '
'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'error [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'error Hello world!'}, 14 | {text: 'In script', code: 'error("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/info.js: -------------------------------------------------------------------------------- 1 | Commands.register("info", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('
' + this.formatter(args) + '
'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'info [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'info Hello world!'}, 14 | {text: 'In script', code: 'info("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/small.js: -------------------------------------------------------------------------------- 1 | Commands.register("small", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('
' + this.formatter(args) + '
'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'small [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'small Hello world!'}, 14 | {text: 'In script', code: 'small("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/success.js: -------------------------------------------------------------------------------- 1 | Commands.register("success", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('
' + this.formatter(args) + '
'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'success [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'success Hello world!'}, 14 | {text: 'In script', code: 'success("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/css/less/diff.less: -------------------------------------------------------------------------------- 1 | .diff { 2 | display: inline-block; 3 | } 4 | .diff-level { 5 | margin-left: 1.6em; 6 | } 7 | .diff-holder { 8 | color: #666; 9 | margin: 0; 10 | } 11 | .diff-holder span { 12 | color: #AAA; 13 | } 14 | del.diff { 15 | text-decoration: none; 16 | color: #b30000; 17 | background: #fadad7; 18 | } 19 | ins.diff { 20 | background: #eaf2c2; 21 | color: #406619; 22 | text-decoration: none; 23 | } 24 | del.diff-key { 25 | border: 1px solid #f8a4a4; 26 | } 27 | ins.diff-key { 28 | border: 1px solid #a3ce4c; 29 | margin-top: -1px; 30 | position: relative; 31 | } 32 | ins.diff span { 33 | color: #AABF40; 34 | } 35 | del.diff span { 36 | color: #EE8177; 37 | } -------------------------------------------------------------------------------- /src/js/commands/messages/warning.js: -------------------------------------------------------------------------------- 1 | Commands.register("warning", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent('
' + this.formatter(args) + '
'); 7 | callback(this.formatter(args)); 8 | }, 9 | man: { 10 | desc: 'Outputs message.', 11 | format: 'warning [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'warning Hello world!'}, 14 | {text: 'In script', code: 'warning("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/tabs/refresh.js: -------------------------------------------------------------------------------- 1 | Commands.register("refresh", { 2 | requiredArguments: 0, 3 | run: function(args, callback) { 4 | if(chrome && chrome.runtime) { 5 | chrome.runtime.sendMessage({type: "refresh"}, function() { 6 | exec("echo current tab is refreshed"); 7 | callback(); 8 | }); 9 | } else { 10 | callback(); 11 | } 12 | }, 13 | man: { 14 | desc: 'Refreshes the current tab\'s page', 15 | format: 'refresh', 16 | examples: [ 17 | {text: 'Command line', code: 'refresh'}, 18 | {text: 'In script', code: 'refresh(function() {\n\ 19 | console.log("The current page is refreshed.");\n\ 20 | });'} 21 | ], 22 | returns: 'null', 23 | group: 'tabs' 24 | } 25 | }) -------------------------------------------------------------------------------- /tests/site/login.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | Login 18 | 19 | 20 | 21 |
22 |

Login

23 |


24 |

Back to home page

25 |
26 | 27 | -------------------------------------------------------------------------------- /src/js/lib/CommandParser.js: -------------------------------------------------------------------------------- 1 | var CommandParser = (function() { 2 | var parse = function(str, lookForQuotes) { 3 | var args = []; 4 | var readingPart = false; 5 | var part = ''; 6 | for(var i=0; i' + this.formatter(args, true, true, true) + ''); 7 | callback(this.formatter(args, true, true, true)); 8 | }, 9 | man: { 10 | desc: 'Outputs message in raw format. Even the html is shown as string.', 11 | format: 'echoraw [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'echoraw Hello world!'}, 14 | {text: 'In script', code: 'echoraw("Hello world!", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/messages/hidden.js: -------------------------------------------------------------------------------- 1 | Commands.register("hidden", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | App.setOutputPanelContent(''); 7 | callback(args.join(" ")); 8 | }, 9 | man: { 10 | desc: 'Outputs invisible content. I.e. useful when you have to add hidden html markup.', 11 | format: 'hidden [text]', 12 | examples: [ 13 | {text: 'Command line', code: 'hidden <input type="hidden" name="property" />'}, 14 | {text: 'In script', code: 'hidden("<input type="hidden" name="property" />", function(res) {\n\ 15 | console.log(res);\n\ 16 | });'} 17 | ], 18 | returns: 'string', 19 | group: 'messages' 20 | } 21 | }) -------------------------------------------------------------------------------- /src/js/commands/tabs/load.js: -------------------------------------------------------------------------------- 1 | Commands.register("load", { 2 | requiredArguments: 1, 3 | format: '
',
 4 | 	run: function(args, callback) {
 5 | 		var url = args[0];
 6 | 		if(url.indexOf("http") == -1) url = "http://" + url;
 7 | 		if(chrome && chrome.runtime) {
 8 | 			chrome.runtime.sendMessage({type: "load", url: url}, function() {
 9 | 				exec("echo " + url + " is loaded");
10 | 				callback();
11 | 			});
12 | 		} else {
13 | 			callback();
14 | 		}
15 | 	},
16 | 	man: {
17 | 		desc: 'Loads another page in the current tab.',
18 | 		format: 'load [url]',
19 | 		examples: [
20 | 			{text: 'Command line', code: 'load github.com'},
21 | 			{text: 'In script', code: 'load("github.com", function() {\n\
22 | 	console.log("new page loaded");\n\
23 | });'}
24 | 		],
25 | 		returns: 'null',
26 | 		group: 'tabs'
27 | 	}	
28 | })


--------------------------------------------------------------------------------
/src/manifest.json:
--------------------------------------------------------------------------------
 1 | {
 2 |     "manifest_version": 2,
 3 |     "name": "Auxilio",
 4 |     "description": "Helper tools",
 5 |     "version": "0.1.86",
 6 |     "icons": { "16": "img/icon16.png", "48": "img/icon48.png", "128": "img/icon128.png" },
 7 |     "permissions": ["tabs", "debugger", "http://*/", "https://*/*", "webNavigation", "storage", ""],
 8 |     "background": { "scripts": ["js/background.js"], "persistent": false },
 9 |     "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
10 |     "devtools_page": "devtools.html",
11 |     "content_scripts": [
12 |         {
13 |             "matches": ["http://*/*", "https://*/*"], 
14 |             "js": ["js/content.js"]
15 |         }
16 |     ],
17 |     "chrome_url_overrides" : {
18 |         "newtab": "newtab/newtab.html"
19 |     }
20 | }


--------------------------------------------------------------------------------
/tests/data/exec.github.search.spec.js:
--------------------------------------------------------------------------------
 1 | function testingGitHubSearching(args, callback) {
 2 | 	describe("Testing GitHub searching", function() {
 3 | 		it("should load github.com", function(done) {
 4 | 			load("github.com", done);
 5 | 		});
 6 | 		it("shoud type 'auxilio' in the search bar", function(done) {
 7 | 			pageinsertjs('document.querySelector("#js-command-bar-field").value="auxilio";', done);
 8 | 		});
 9 | 		it("shoud submit the form", function(done) {
10 | 			pageinsertjsw('document.querySelector("#top_search_form").submit()', done);
11 | 		});
12 | 		it("should have h3 element which contains 'auxilio'", function(done) {
13 | 			pagequery('h3', 'krasimir/auxilio', function(res) {
14 | 				expect(res.elements >= 1).toBe(true);
15 | 				done();
16 | 				screenshot();
17 | 			})
18 | 		});
19 | 	});
20 | 	callback();
21 | }


--------------------------------------------------------------------------------
/src/newtab/newtab.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 	
 4 | 		
 5 | 		
 6 | 		
 7 | 		
 8 | 		
 9 | 		
10 | 		...
11 | 	
12 | 	
13 | 		WTF! Show me the old page!
14 | 		
15 |
16 |

17 |

18 |
19 |
20 |
21 |
22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /src/js/commands/common/exec.js: -------------------------------------------------------------------------------- 1 | Commands.register("exec", { 2 | requiredArguments: 1, 3 | run: function(args, callback) { 4 | var strToExecute = args.join(" "); 5 | if(strToExecute.indexOf('\n') >= 0) { 6 | strToExecute = strToExecute.join(" ").replace(/\n/g, ' && '); 7 | } 8 | exec(args.join(" "), function(res) { 9 | callback(res); 10 | }); 11 | }, 12 | man: { 13 | desc: 'Executes a given command. Accepts commands separated by &&.', 14 | format: 'exec [command/s]', 15 | examples: [ 16 | {text: 'Command line', code: 'exec echo "test"'}, 17 | {text: 'Command line (chaining)', code: 'readfile showing-date.aux && exec'}, 18 | {text: 'In script', code: 'exec("echo Hello world! && date true", function(res) {\n\ 19 | console.log(res);\n\ 20 | })'} 21 | ], 22 | returns: 'The result of the executed command.', 23 | group: 'common' 24 | } 25 | }) -------------------------------------------------------------------------------- /src/js/commands/page/pageinsertcss.js: -------------------------------------------------------------------------------- 1 | Commands.register("pageinsertcss", { 2 | requiredArguments: 1, 3 | format: '
',
 4 | 	lookForQuotes: false,
 5 | 	run: function(args, callback) {
 6 | 		var csscode = args.join(" ");
 7 | 		if(chrome && chrome.runtime) {
 8 | 			chrome.runtime.sendMessage({type: "pageinsertcss", csscode: csscode}, function(res) {
 9 | 				callback(res);
10 | 			});
11 | 		} else {
12 | 			callback();
13 | 		}
14 | 	},
15 | 	man: {
16 | 		desc: 'Inserts css code in the context of the current page',
17 | 		format: 'pageinsertcss [css code]',
18 | 		examples: [
19 | 			{text: 'Command line', code: 'pageinsertcss body { background: #F00 !important; }'},
20 | 			{text: 'In script', code: 'pageinsertcss("body { background: #F00 !important; }", function() {\n\
21 | 	console.log("CSS applied.");\n\
22 | });'}
23 | 		],
24 | 		returns: 'string',
25 | 		group: 'page'
26 | 	}	
27 | })


--------------------------------------------------------------------------------
/src/js/commands/tabs/screenshot.js:
--------------------------------------------------------------------------------
 1 | Commands.register("screenshot", {
 2 | 	requiredArguments: 0,
 3 | 	run: function(args, callback) {
 4 | 		if(chrome && chrome.runtime) {
 5 | 			chrome.runtime.sendMessage({type: "screenshot"}, function(data) {
 6 | 				if(data) {
 7 | 					exec("newtab " + data + " false", function() {
 8 | 						callback();
 9 | 					});
10 | 				} else {
11 | 					exec("error There was a problem creating the screenshot.", callback);
12 | 				}
13 | 			});
14 | 		} else {
15 | 			callback();
16 | 		}
17 | 	},
18 | 	man: {
19 | 		desc: 'Makes a screenshot of the current tab and loads it in a new tab.',
20 | 		format: 'screenshot',
21 | 		examples: [
22 | 			{text: 'Command line', code: 'screenshot'},
23 | 			{text: 'In script', code: 'screenshot(function() {\n\
24 | 	console.log("The screenshot is made.");\n\
25 | });'}
26 | 		],
27 | 		returns: 'null',
28 | 		group: 'tabs'
29 | 	}	
30 | })


--------------------------------------------------------------------------------
/tpl/README.md:
--------------------------------------------------------------------------------
 1 | # auxilio
 2 | 
 3 | - - -
 4 | 
 5 | Extension to Google Chrome Developer Tools. If you wonder what you can do with it, simply open Auxilio tab in DevTools and type *man*.
 6 | 
 7 | ## In Google Chrome web store
 8 | 
 9 | [Auxilio](https://chrome.google.com/webstore/detail/auxilio/ddkgloamdhkoohfgmopdicfcinddpnhh)
10 | 
11 | ## Installing the extension
12 | 
13 | Follow the link above and click the green button *Add to Chrome* or check the steps below
14 | 
15 |   - Download the source code of the extension (you will use the content of the *src* folder)
16 |   - Open Google Chrome and type the following thing in the address bar
17 | 
18 | 		chrome://extensions
19 | 
20 |   - Check the *Developer mode* option
21 |   - Click on *Load unpacked extension...* and browse the *src* folder
22 | 
23 | ## Installing the node module
24 | 
25 | 	npm install -g auxilio-backend
26 | 
27 | # Documentation


--------------------------------------------------------------------------------
/src/js/global.js:
--------------------------------------------------------------------------------
 1 | var exec = function(commandStr, callback, arg) {
 2 | 	App.execute(commandStr, callback, arg);
 3 | }
 4 | // console.log in the background page
 5 | var bglog = function(obj) {
 6 | 	if(chrome && chrome.runtime) {
 7 | 		chrome.runtime.sendMessage({type: "bglog", obj: obj});
 8 | 	}
 9 | }
10 | // change the current directory
11 | var gotoClick = function(e) {
12 | 	if(e.target.getAttribute("data-type") === "file") {
13 | 		exec('shell ' + e.target.getAttribute("data-path"));
14 | 	} else {
15 | 		exec('shell cd ' + e.target.getAttribute("data-path"));
16 | 	}
17 | }
18 | var attachGotoEvents = function() {
19 | 	var gotolinks = document.querySelectorAll(".goto");
20 | 	for(var i=0; link = gotolinks[i]; i++) {
21 | 		(function(link){
22 | 			link.removeEventListener("click", gotoClick)
23 | 			link.addEventListener("click", gotoClick);
24 | 		})(link);
25 | 	};
26 | 	setTimeout(attachGotoEvents, 500);
27 | }
28 | attachGotoEvents();


--------------------------------------------------------------------------------
/src/js/commands/page/pageinsertjs.js:
--------------------------------------------------------------------------------
 1 | Commands.register("pageinsertjs", {
 2 | 	requiredArguments: 1,
 3 | 	lookForQuotes: false,
 4 | 	run: function(args, callback) {
 5 | 		var jscode = args.join(" ");
 6 | 		if(chrome && chrome.runtime) {
 7 | 			chrome.runtime.sendMessage({type: "pageinsertjs", jscode: jscode}, function(res) {
 8 | 				if(res) {
 9 | 					res = JSON.parse(res);
10 | 					if(res.length === 1) res = res[0];
11 | 				}
12 | 				callback(res);
13 | 			});
14 | 		} else {
15 | 			callback();
16 | 		}
17 | 	},
18 | 	man: {
19 | 		desc: 'Executes javascript code in the context of the current page',
20 | 		format: 'pageinsertjs [js code]',
21 | 		examples: [
22 | 			{text: 'Command line', code: 'pageinsertjs "document.querySelector(\'body\').click();"'},
23 | 			{text: 'In script', code: 'pageinsertjs("document.querySelector(\'body\').click();", function(res) {\n\
24 | 	console.log(res);\n\
25 | });'}
26 | 		],
27 | 		returns: 'string',
28 | 		group: 'page'
29 | 	}	
30 | })


--------------------------------------------------------------------------------
/src/js/commands/page/pageinsertjsw.js:
--------------------------------------------------------------------------------
 1 | Commands.register("pageinsertjsw", {
 2 | 	requiredArguments: 1,
 3 | 	lookForQuotes: false,
 4 | 	run: function(args, callback) {
 5 | 		var jscode = args.join(" ");
 6 | 		if(chrome && chrome.runtime) {
 7 | 			chrome.runtime.sendMessage({type: "pageinsertjsw", jscode: jscode}, function(res) {
 8 | 				if(res) {
 9 | 					res = JSON.parse(res);
10 | 					if(res.length === 1) res = res[0];
11 | 				}
12 | 				callback(res);
13 | 			});
14 | 		} else {
15 | 			callback();
16 | 		}
17 | 	},
18 | 	man: {
19 | 		desc: 'Executes javascript code in the context of the current page and waits till the current page is updated',
20 | 		format: 'pageinsertjsw [js code]',
21 | 		examples: [
22 | 			{text: 'Command line', code: 'pageinsertjsw "document.querySelector(\'body\').click();"'},
23 | 			{text: 'In script', code: 'pageinsertjsw("document.querySelector(\'body\').click();", function(res) {\n\
24 | 	console.log(res);\n\
25 | });'}
26 | 		],
27 | 		returns: 'string',
28 | 		group: 'page'
29 | 	}	
30 | })


--------------------------------------------------------------------------------
/src/js/commands/os/shell.js:
--------------------------------------------------------------------------------
 1 | Commands.register("shell", {
 2 | 	requiredArguments: 0,
 3 | 	lookForQuotes: false,
 4 | 	concatArgs: true,
 5 | 	run: function(args, callback) {
 6 | 		var command = args.join(" ");
 7 | 		if(Shell.connected()) {
 8 | 			if(command !== '') {
 9 | 				Shell.send(command, function(res) {
10 | 					callback(res);
11 | 				});
12 | 			} else {
13 | 				callback();
14 | 			}
15 | 		} else {
16 | 			if(args.length === 0) {
17 | 				Shell.connect();
18 | 			} else {
19 | 				NoShellError("shell: shell is not connected");
20 | 			}
21 | 			callback();
22 | 		}
23 | 	},
24 | 	man: {
25 | 		desc: 'Executes shell command. Have in mind that once you type something in the console and it doesn\'t match any of the auxilio\'s commands it is send to the shell',
26 | 		format: 'shell [command]',
27 | 		examples: [
28 | 			{text: 'Command line', code: 'shell ls'},
29 | 			{text: 'In script', code: 'shell("ls", function(res) {\n\
30 | 	console.log(res);\n\
31 | });'}
32 | 		],
33 | 		returns: 'string',
34 | 		group: 'os'
35 | 	}	
36 | })


--------------------------------------------------------------------------------
/src/js/commands/page/pagehighlight.js:
--------------------------------------------------------------------------------
 1 | Commands.register("pagehighlight", {
 2 | 	requiredArguments: 1,
 3 | 	format: '
',
 4 | 	run: function(args, callback) {
 5 | 		var selector = args.shift();
 6 | 		var filter = args.length > 0 ? args.join(" ") : null;
 7 | 		if(chrome && chrome.runtime) {
 8 | 			chrome.runtime.sendMessage({type: "pagehighlight", selector: selector, filter: filter}, function(res) {
 9 | 				callback(res);
10 | 			});
11 | 		} else {
12 | 			callback();
13 | 		}
14 | 	},
15 | 	man: {
16 | 		desc: 'Highlights element/elements on the page. Use filter parameter to filter the selected elements. Actually performs indexOf method agains the html markup of the selected element.',
17 | 		format: 'pagehighlight [selector] [filter]',
18 | 		examples: [
19 | 			{text: 'Command line', code: 'pagehighlight a'},
20 | 			{text: 'In script', code: 'pagehighlight("a", function(res) {\n\
21 | 	console.log(res);\n\
22 | });'}
23 | 		],
24 | 		returns: 'Object containing the matched elements.',
25 | 		group: 'page'
26 | 	}	
27 | })


--------------------------------------------------------------------------------
/src/js/commands/tabs/newtab.js:
--------------------------------------------------------------------------------
 1 | Commands.register("newtab", {
 2 | 	requiredArguments: 0,
 3 | 	run: function(args, callback) {
 4 | 		if(chrome && chrome.runtime) {
 5 | 			if(args[0]) {
 6 | 				var url = args.shift();
 7 | 				var active = args.length > 0 ? args.shift() : "true";
 8 | 				if(url.indexOf("http") == -1 && url.indexOf("data:image") == -1) {
 9 | 					url = "http://" + url;
10 | 				}
11 | 				chrome.runtime.sendMessage({type: "newtab", url: url, active: active}, function() {
12 | 					callback();
13 | 				});
14 | 			}else {
15 | 				chrome.runtime.sendMessage({type: "newtab"}, callback);
16 | 			}
17 | 		} else {
18 | 			callback();
19 | 		}
20 | 	},
21 | 	man: {
22 | 		desc: 'Creates a new tab.',
23 | 		format: 'newtab
newtab [url] [active (true | false)]', 24 | examples: [ 25 | {text: 'Command line', code: 'newtab github.com'}, 26 | {text: 'In script', code: 'newtab("github.com", "false", function() {\n\ 27 | console.log("new tab loaded");\n\ 28 | });'} 29 | ], 30 | returns: 'null', 31 | group: 'tabs' 32 | } 33 | }) -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | grunt.initConfig({ 4 | concat: { 5 | commands: { 6 | src: ['src/js/commands/**/*.js'], 7 | dest: 'src/js/commands.js' 8 | }, 9 | readme: { 10 | src: ['tpl/README.md', 'commands.md'], 11 | dest: 'README.md' 12 | } 13 | }, 14 | less: { 15 | auxilio: { 16 | options: { 17 | paths: ['src/css/less'], 18 | yuicompress: true 19 | }, 20 | src: ['src/css/less/index.less'], 21 | dest: 'src/css/auxilio.css' 22 | } 23 | }, 24 | watch: { 25 | commands: { 26 | files: ['<%= concat.commands.src[0] %>'], 27 | tasks: ['concat'] 28 | }, 29 | css: { 30 | files: ['src/css/less/**/*.less'], 31 | tasks: ['less'] 32 | } 33 | } 34 | }); 35 | 36 | grunt.loadNpmTasks('grunt-contrib-concat'); 37 | grunt.loadNpmTasks('grunt-contrib-watch'); 38 | grunt.loadNpmTasks('assemble-less'); 39 | 40 | // grunt.registerTask('default', ['concat', 'less']); 41 | grunt.registerTask('default', ['concat', 'less', 'watch']); 42 | 43 | } -------------------------------------------------------------------------------- /src/js/lib/Commands.js: -------------------------------------------------------------------------------- 1 | var Commands = { 2 | register: function(name, logic) { 3 | this[name] = logic; 4 | if(typeof window != 'undefined') { 5 | (function(name) { 6 | window[name] = function() { 7 | var args = [], 8 | callback = function() {}; 9 | for(var i=0; argument = arguments[i]; i++) { 10 | if(i == arguments.length-1 && typeof argument === 'function') { 11 | callback = argument; 12 | } else { 13 | args.push(argument); 14 | } 15 | } 16 | var argsString = ''; 17 | if(args && args.length > 0) { 18 | for(var i=0; arg = args[i]; i++) { 19 | argsString += arg; 20 | if(i < args.length-1) { 21 | argsString += ' '; 22 | } 23 | } 24 | } 25 | exec(name + " " + argsString, callback); 26 | } 27 | })(name); 28 | } 29 | }, 30 | get: function(name) { 31 | if(name && name != "" && name != " " && this[name]) { 32 | return _.extend({}, CommandBase, {name: name}, this[name]); 33 | } else { 34 | return false; 35 | } 36 | } 37 | }; -------------------------------------------------------------------------------- /src/css/less/tree.less: -------------------------------------------------------------------------------- 1 | .tree { 2 | padding: 6px; 3 | background: lighten(@color-tree, 10%); 4 | .tree-wrapper { 5 | 6 | } 7 | .tree-wrapper-indent { 8 | padding: 0 0 0 10px; 9 | } 10 | .tree-wrapper-no-indent { 11 | padding: 0 0 0 10px; 12 | } 13 | .tree-item { 14 | a { 15 | .transition(~"all 200ms ease-out"); 16 | font-size: 12px; 17 | color: darken(@color-a, 100%); 18 | display: block; 19 | width: 100%; 20 | text-decoration: none; 21 | &:hover { 22 | padding: 0 0 0 5px; 23 | span { 24 | color: @color-c; 25 | background: darken(@color-a, 100%); 26 | } 27 | } 28 | .tree-filter-match { 29 | background: @color-alert; 30 | color: @color-c; 31 | font-weight: bold; 32 | } 33 | } 34 | } 35 | .tree-item-file { 36 | a { 37 | color: darken(@color-a, 10%); 38 | } 39 | } 40 | .tree-item-dir { 41 | a { 42 | font-weight: bold; 43 | } 44 | } 45 | .tree-item-hidden { 46 | display: none; 47 | } 48 | .tree-item-filter-match { 49 | background: lighten(@color-a, 20%); 50 | } 51 | } -------------------------------------------------------------------------------- /src/js/commands/common/history.js: -------------------------------------------------------------------------------- 1 | Commands.register("history", { 2 | requiredArguments: 0, 3 | format: '
',
 4 | 	run: function(args, callback) {
 5 | 		var message = 'History:
';
 6 | 		for(var i=App.commandsHistory.length-2; i>=0; i--) {
 7 | 			var str = App.commandsHistory[i];
 8 | 			if(str != '' && str != ' ') {
 9 | 				var linkId = _.uniqueId("historylink");
10 | 				message += "" + str.toString().replace(/&/g, '&') + "\n";
11 | 				(function(command, linkId){
12 | 					setTimeout(function() {
13 | 						document.querySelector("#" + linkId).addEventListener("click", function() {
14 | 							exec(command);
15 | 						});
16 | 					}, 200);
17 | 				})(str, linkId);
18 | 			}
19 | 		}
20 | 		message += '
'; 21 | exec('info ' + message, callback); 22 | }, 23 | man: { 24 | desc: 'Outputs the current console\'s history.', 25 | format: 'history', 26 | examples: [ 27 | {text: 'Command line', code: 'history'} 28 | ], 29 | returns: 'null', 30 | group: 'common' 31 | } 32 | }) -------------------------------------------------------------------------------- /tasks/generate-man-in-markdown.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var fs = require("fs"); 4 | 5 | module.exports = function(grunt) { 6 | grunt.registerMultiTask('generate-man-in-markdown', 'generate markdownfile', function() { 7 | 8 | var tmp = grunt.file.read(this.data.src, {}), 9 | content = '', 10 | self = this; 11 | 12 | content = "var Absurd = (function(w) {\n"; 13 | 14 | if(fs.existsSync(__dirname + "/../client-side/lib")) { 15 | var libs = fs.readdirSync(__dirname + "/../client-side/lib"); 16 | for(var i=0; i 0 ? args.join(" ") : null; 6 | if(chrome && chrome.runtime) { 7 | chrome.runtime.sendMessage({type: "pagequery", selector: selector, filter: filter}, function(res) { 8 | callback(res); 9 | }); 10 | } else { 11 | callback(); 12 | } 13 | }, 14 | man: { 15 | desc: 'Returns the number of matched elements and the elements in raw html string format. Use filter parameter to filter the selected elements. Actually performs indexOf method agains the html markup of the selected element.', 16 | format: 'pagequery [selector] [filter]', 17 | examples: [ 18 | {text: 'Command line', code: 'pagequery a "label of the link"'}, 19 | {text: 'In script (checks if there is links on the page)', code: 'pagequery("a", function(res) {\n\ 20 | console.log(res);\n\ 21 | });'} 22 | ], 23 | returns: 'Object containing the matched elements.', 24 | group: 'page' 25 | } 26 | }) -------------------------------------------------------------------------------- /src/js/commands/develop/runjasmine.js: -------------------------------------------------------------------------------- 1 | Commands.register("runjasmine", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var path = args.join(" "); 7 | var id = _.uniqueId("jasminetest"); 8 | (function(id) { 9 | var markup = '
'; 10 | App.setOutputPanelContent(markup); 11 | exec("run " + path, function(totalFilesProcessed) { 12 | var jasmineEnv = jasmine.getEnv(); 13 | var htmlReporter = new jasmine.HtmlReporter(null, document.getElementById(id)); 14 | jasmineEnv.updateInterval = 1000; 15 | jasmineEnv.clearReporters(); 16 | jasmineEnv.addReporter(htmlReporter); 17 | jasmineEnv.specFilter = function(spec) { 18 | return htmlReporter.specFilter(spec); 19 | }; 20 | jasmineEnv.execute(); 21 | }); 22 | })(id); 23 | callback(); 24 | }, 25 | man: { 26 | desc: 'Runs jasmine tests.', 27 | format: 'runjasmine [path]', 28 | examples: [ 29 | {text: 'Command line', code: 'runjasmine ./tests'} 30 | ], 31 | returns: 'null', 32 | group: 'develop' 33 | } 34 | }) -------------------------------------------------------------------------------- /src/css/less/messages.less: -------------------------------------------------------------------------------- 1 | .regular { 2 | background: lighten(@color-a, 30%); 3 | color: darken(@color-a, 100%); 4 | padding: 6px; 5 | margin: 0 0 4px 0; 6 | border-radius: 5px; 7 | a { 8 | color: darken(@color-a, 30%); 9 | text-decoration: none; 10 | &:hover { 11 | color: darken(@color-a, 80%); 12 | text-decoration: underline; 13 | } 14 | } 15 | } 16 | .error { 17 | .regular(); 18 | background: @color-error; 19 | color: darken(@color-error, 100%); 20 | } 21 | .warning { 22 | .regular(); 23 | background: @color-warning; 24 | color: darken(@color-warning, 100%); 25 | } 26 | .success { 27 | .regular(); 28 | background: @color-success; 29 | color: darken(@color-success, 100%); 30 | } 31 | .info { 32 | .regular(); 33 | background: @color-info; 34 | color: darken(@color-info, 100%); 35 | } 36 | .small { 37 | margin: 0 0 4px 0; 38 | font-size: 12px; 39 | color: darken(@color-a, 50%); 40 | a { 41 | color: darken(@color-a, 50%); 42 | text-decoration: none; 43 | &:hover { 44 | text-decoration: underline; 45 | color: darken(@color-a, 100%); 46 | } 47 | } 48 | } 49 | .hidden { 50 | display: none; 51 | } -------------------------------------------------------------------------------- /src/newtab/newtab.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | 3 | var index = Math.floor((Math.random()*quotes.length)); 4 | var quote = quotes[index]; 5 | document.getElementById("quote").innerHTML = quote[0]; 6 | document.getElementById("author").innerHTML = quote[1]; 7 | document.getElementById("get-the-old").onclick = function() { 8 | chrome.tabs.update({ 9 | url: 'chrome-internal://newtab/' 10 | }); 11 | } 12 | 13 | // time and date 14 | var formatDigit = function(d) { 15 | if(d < 10) { 16 | return "0" + d; 17 | } else { 18 | return d; 19 | } 20 | } 21 | var setDateAndTime = function() { 22 | var currentDate = new Date(); 23 | var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; 24 | document.getElementById("time").innerHTML = formatDigit(currentDate.getHours()) + ":" + formatDigit(currentDate.getMinutes()); 25 | document.getElementById("date").innerHTML = currentDate.getDate() + " " + months[currentDate.getMonth()] + " " + currentDate.getFullYear(); 26 | setTimeout(setDateAndTime, 30000); 27 | } 28 | setDateAndTime(); 29 | 30 | } -------------------------------------------------------------------------------- /src/css/less/form.less: -------------------------------------------------------------------------------- 1 | .form { 2 | width: 100%; 3 | padding: 6px; 4 | .box-sizing(); 5 | .input{ 6 | .box-sizing(); 7 | display: block; 8 | border-radius: 4px; 9 | width: 100%; 10 | height: 150px; 11 | border: solid 1px @color-a; 12 | padding: 10px; 13 | font-family: @font; 14 | margin: 0 0 10px 0; 15 | } 16 | textarea { 17 | .input(); 18 | } 19 | input { 20 | .input(); 21 | height: auto; 22 | } 23 | .btn { 24 | .transition(~"all 400ms ease-out"); 25 | display: inline-block; 26 | text-decoration: none; 27 | padding: 10px; 28 | color: darken(@color-a, 100%); 29 | background: @color-a; 30 | border-radius: 4px; 31 | font-weight: bold; 32 | } 33 | .confirm { 34 | background: @color-success; 35 | &:hover { 36 | background: darken(@color-success, 30%); 37 | } 38 | } 39 | .deny { 40 | background: @color-error; 41 | &:hover { 42 | background: darken(@color-error, 30%); 43 | } 44 | } 45 | .buttons { 46 | margin: 0 0 10px 0; 47 | } 48 | .file-content { 49 | display: none; 50 | border-left: solid 6px #999; 51 | padding: 0 0 0 10px; 52 | } 53 | .form-hint { 54 | color: @color-a; 55 | } 56 | } -------------------------------------------------------------------------------- /src/js/commands/page/pageclick.js: -------------------------------------------------------------------------------- 1 | Commands.register("pageclick", { 2 | requiredArguments: 1, 3 | run: function(args, callback) { 4 | var selector = args.shift(); 5 | var filter = args.length > 0 ? args.join(" ") : null; 6 | if(chrome && chrome.runtime) { 7 | chrome.runtime.sendMessage({type: "pageclick", selector: selector, filter: filter}, function(res) { 8 | callback(res); 9 | }); 10 | } else { 11 | callback(); 12 | } 13 | }, 14 | man: { 15 | desc: 'Clicks an element on the page and returns the result immediately. Use filter parameter to filter the selected elements. Actually performs indexOf method agains the html markup of the selected element.', 16 | format: 'pageclick [selector] [filter]', 17 | examples: [ 18 | {text: 'Command line', code: 'pageclick "body > .my-link-class"'}, 19 | {text: 'Filter the selected elements', code: 'pageclick "body > .my-link-class" "link label"'}, 20 | {text: 'In script', code: 'pageclick("body > .my-link-class", function(res) {\n\ 21 | console.log("Element clicked.");\n\ 22 | });'} 23 | ], 24 | returns: 'Object containing the matched elements.', 25 | group: 'page' 26 | } 27 | }) -------------------------------------------------------------------------------- /src/js/vendor/jasmine-1.3.1/MIT.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2011 Pivotal Labs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/js/commands/page/pageclickw.js: -------------------------------------------------------------------------------- 1 | Commands.register("pageclickw", { 2 | requiredArguments: 1, 3 | run: function(args, callback) { 4 | var selector = args.shift(); 5 | var filter = args.length > 0 ? args.join(" ") : null; 6 | if(chrome && chrome.runtime) { 7 | chrome.runtime.sendMessage({type: "pageclickw", selector: selector, filter: filter}, function(res) { 8 | callback(res); 9 | }); 10 | } else { 11 | callback(); 12 | } 13 | }, 14 | man: { 15 | desc: 'Clicks an element on the page and waits till the page is updated. Use filter parameter to filter the selected elements. Actually performs indexOf method agains the html markup of the selected element.', 16 | format: 'pageclickw [selector] [filter]', 17 | examples: [ 18 | {text: 'Command line', code: 'pageclickw "body > .my-link-class"'}, 19 | {text: 'Filter the selected elements', code: 'pageclickw "body > .my-link-class" "link label"'}, 20 | {text: 'In script', code: 'pageclickw("body > .my-link-class", function() {\n\ 21 | console.log("Element clicked.");\n\ 22 | });'} 23 | ], 24 | returns: 'Object containing the matched elements.', 25 | group: 'page' 26 | } 27 | }) -------------------------------------------------------------------------------- /src/css/less/editor.less: -------------------------------------------------------------------------------- 1 | .editor-holder { 2 | margin: 59px 0 32px 0; 3 | } 4 | .editor-ace { 5 | width: 100%; 6 | height: 430px; 7 | padding: 2px; 8 | background: #FFF; 9 | box-sizing: border-box; 10 | padding: 0; 11 | border: solid 1px #CFCFCF; 12 | .editor { 13 | width: 100%; 14 | height: 400px; 15 | box-sizing: border-box; 16 | } 17 | .editor-hint { 18 | color: #8D8D8D; 19 | font-size: 12px; 20 | background: #F0F0F0; 21 | padding: 4px 6px 4px 6px; 22 | } 23 | .editor-toolbar { 24 | .editor-hint(); 25 | background: #FFFFFF; 26 | border-bottom: dotted 1px #8E8E8E; 27 | border-top: dotted 1px #8E8E8E; 28 | padding: 6px; 29 | a { 30 | display: inline-block; 31 | text-decoration: none; 32 | color: #FFF; 33 | background: #8E8E8E; 34 | font-size: 12px; 35 | padding: 2px 6px 2px 6px; 36 | margin: 0 2px 0 0; 37 | border-radius: 2px; 38 | &:hover { 39 | background: #5C5C5C; 40 | } 41 | } 42 | a.current-file { 43 | background: #000; 44 | } 45 | } 46 | } 47 | .shell-off { 48 | .editor-holder { 49 | margin: 30px 0 37px 0; 50 | } 51 | } -------------------------------------------------------------------------------- /src/js/commands/os/writefile.js: -------------------------------------------------------------------------------- 1 | Commands.register("writefile", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var file = args.shift(); 7 | var content = args.join(" "); 8 | if(Shell.connected() && Shell.socket()) { 9 | var onFileSaved = function(res) { 10 | Shell.socket().removeListener("writefile", onFileSaved); 11 | if(res.error) { 12 | exec("error " + res.error); 13 | } else if(res.content) { 14 | exec("success " + res.content + ""); 15 | } 16 | callback(); 17 | } 18 | Shell.socket().on("writefile", onFileSaved); 19 | Shell.socket().emit("writefile", {file: file, content: content}); 20 | } else { 21 | NoShellError("writefile: no shell"); 22 | callback(); 23 | } 24 | }, 25 | man: { 26 | desc: 'Write content to a file.', 27 | format: 'writefile [file] [content]', 28 | examples: [ 29 | {text: 'Command line', code: 'writefile ./test.txt Sample text here.'}, 30 | {text: 'In script', code: 'writefile("./test.txt", "Sample text here", function(res) {\n\ 31 | console.log("File saved successfully.");\n\ 32 | });'} 33 | ], 34 | returns: 'string', 35 | group: 'os' 36 | } 37 | }) -------------------------------------------------------------------------------- /src/css/less/manual.less: -------------------------------------------------------------------------------- 1 | .manual { 2 | padding: 6px; 3 | background: lighten(@color-a, 35%); 4 | border-radius: 4px; 5 | p { 6 | margin: 0; 7 | padding: 0; 8 | } 9 | pre { 10 | font-size: 14px; 11 | line-height: 16px; 12 | } 13 | .c1, .c2 { 14 | box-sizing: border-box; 15 | float: left; 16 | } 17 | .c1 { 18 | width: 30%; 19 | padding: 0 10px 0 0; 20 | .title { 21 | font-size: 16px; 22 | background: @color-tree; 23 | padding: 2px 6px 2px 6px; 24 | border-radius: 4px; 25 | font-weight: bold; 26 | margin: 0 0 4px 0; 27 | border: solid 1px darken(@color-tree, 20%); 28 | } 29 | .title-small { 30 | font-size: 14px; 31 | font-weight: bold; 32 | margin: 8px 0 0 0; 33 | } 34 | .desc { 35 | font-size: 14px; 36 | } 37 | } 38 | .c2 { 39 | width: 70%; 40 | border-left: solid 1px @color-a; 41 | font-size: 11px; 42 | padding: 2px 4px 2px 10px; 43 | border-radius: 2px; 44 | .title { 45 | font-size: 14px; 46 | margin: 0 0 10px 0; 47 | } 48 | } 49 | } 50 | .man-holder { 51 | -webkit-column-count: 3; 52 | -webkit-column-gap: 6px; 53 | .man-group { 54 | padding: 10px; 55 | background: @color-c; 56 | border-radius: 6px; 57 | margin: 0 6px 6px 0; 58 | -webkit-column-break-inside: avoid; 59 | } 60 | } -------------------------------------------------------------------------------- /src/js/commands/os/readfile.js: -------------------------------------------------------------------------------- 1 | Commands.register("readfile", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var file = args.shift(); 7 | if(Shell.connected() && Shell.socket()) { 8 | var id = _.uniqueId("shellcommand"); 9 | var onFileRead = function(res) { 10 | if(res.id !== id) return; 11 | Shell.socket().removeListener("readfile", onFileRead); 12 | if(res.error) { 13 | if(typeof res.error === 'object') { 14 | res.error = JSON.stringify(res.error); 15 | } 16 | exec("error " + res.error); 17 | callback(null); 18 | } else if(res.content) { 19 | callback(res.content); 20 | } else { 21 | callback(res); 22 | } 23 | } 24 | Shell.socket().on("readfile", onFileRead); 25 | Shell.socket().emit("readfile", {file: file, id: id}); 26 | } else { 27 | NoShellError("readfile: no shell"); 28 | callback(); 29 | } 30 | }, 31 | man: { 32 | desc: 'Read content of a file.', 33 | format: 'readfile [file]', 34 | examples: [ 35 | {text: 'Command line', code: 'readfile ./README.md'}, 36 | {text: 'In script', code: 'readfile("./README.md", function(content) {\n\ 37 | console.log(content);\n\ 38 | });'} 39 | ], 40 | returns: 'string', 41 | group: 'os' 42 | } 43 | }) -------------------------------------------------------------------------------- /src/js/commands/os/block.js: -------------------------------------------------------------------------------- 1 | var CurrentBlockDirectory = null; 2 | Commands.register("block", { 3 | requiredArguments: 0, 4 | lookForQuotes: true, 5 | concatArgs: true, 6 | run: function(args, callback) { 7 | var operation = args.shift(); 8 | if(operation === "start") { 9 | exec("cwd", function(dir) { 10 | CurrentBlockDirectory = dir; 11 | callback(); 12 | }) 13 | } else if(operation === "end") { 14 | if(CurrentBlockDirectory) { 15 | exec("cd " + CurrentBlockDirectory, function() { 16 | callback(); 17 | }) 18 | } else { 19 | exec("error block already ended."); 20 | callback(); 21 | } 22 | } else { 23 | exec("error block accepts only start and end operations. " + operation + " given."); 24 | callback(); 25 | } 26 | }, 27 | man: { 28 | desc: 'Sometimes you need to execute a series of commands, but you want to keep the context, i.e. the current directory.', 29 | format: 'block [operation]', 30 | examples: [ 31 | {text: 'Command line', code: 'block start && cd ../../ && echo Do some stuff here && block end'}, 32 | {text: 'In script', code: 'block("start", function() {\n\ 33 | shell("cd ../../", function() {\n\ 34 | block("end");\n\ 35 | });\n\ 36 | });'} 37 | ], 38 | returns: 'null', 39 | group: 'os' 40 | } 41 | }) -------------------------------------------------------------------------------- /tests/site/b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Auxilio Test Site 5 | 6 | 13 | 14 | 15 |
16 |

Page B - Auxilio Test Site

17 |

Back to home page

18 |
19 |
20 |

Name:

21 |

Email:

22 |

Job:

23 |

Sex: (Male: Female )

24 |

Subscribe:

25 |

Bio:

26 |

27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /src/js/commands/develop/jshint.js: -------------------------------------------------------------------------------- 1 | Commands.register("jshint", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var data = args.shift(); 7 | if(data.jshint && typeof data.jshint === 'object') { 8 | var jshintData = data.jshint; 9 | if(jshintData.errors && jshintData.errors.length > 0) { 10 | var str = 'JSHint (' + data.filePath + '):
'; 11 | for(var i=0; error = jshintData.errors[i]; i++) { 12 | str += error.line + ':' + error.character + ' -> ' + error.reason + ' -> ' + error.evidence + '
'; 13 | } 14 | exec("error " + str); 15 | } else { 16 | this.noError(data.filePath); 17 | } 18 | } else { 19 | this.noError(data.filePath); 20 | } 21 | callback(data); 22 | }, 23 | noError: function(filePath) { 24 | if(filePath && filePath.split('.').pop().toLowerCase() === '.js') { 25 | exec("success JSHint: No errors in " + filePath + "."); 26 | } 27 | }, 28 | man: { 29 | desc: 'Formats an output of jshint execution. The command is meant to be used together with watch.', 30 | format: 'jshint [{filePath: [path], jshint: [jshint]}]', 31 | examples: [ 32 | {text: 'Watching a javascript file for changes and passing the result to jshint.', code: 'watch start ./code.js jshint'} 33 | ], 34 | returns: 'null', 35 | group: 'develop' 36 | } 37 | }) -------------------------------------------------------------------------------- /src/js/commands/common/var.js: -------------------------------------------------------------------------------- 1 | var VarStorage = {}; 2 | var ApplyVariables = function(str) { 3 | for(var name in VarStorage) { 4 | var r = new RegExp("\\$\\$" + name, 'g'); 5 | str = str.replace(r, VarStorage[name]); 6 | } 7 | return str; 8 | } 9 | Commands.register("var", { 10 | requiredArguments: 0, 11 | format: '
var [name] [value]
', 12 | lookForQuotes: false, 13 | concatArgs: true, 14 | run: function(args, callback) { 15 | var name = args.length > 0 ? args.shift() : false; 16 | var value = args.length > 0 ? args.join(' ') : false; 17 | if(name === false) { 18 | for(var name in VarStorage) { 19 | exec("echo " + name + ":
" + VarStorage[name] + "
"); 20 | } 21 | callback(); 22 | return; 23 | } else if(value === false) { 24 | if(VarStorage[name]) { 25 | value = VarStorage[name]; 26 | } else { 27 | exec("error There is no variable with name " + name + "."); 28 | } 29 | } else { 30 | VarStorage[name] = value; 31 | Autocomplete.prepareDictionary(); 32 | } 33 | callback(value); 34 | }, 35 | man: { 36 | desc: 'Define a variable.', 37 | format: 'var [name] [value]', 38 | examples: [ 39 | {text: 'Command line', code: 'var n 10\necho $$n is a great position'}, 40 | {text: 'Command line (chaining)', code: 'date && var currentDate\necho Current date is $$currentDate'}, 41 | ], 42 | returns: 'The value of the variable', 43 | group: 'common' 44 | } 45 | }) -------------------------------------------------------------------------------- /src/css/less/shell.less: -------------------------------------------------------------------------------- 1 | .shell-indicator { 2 | .transition(~"all 300ms ease-out"); 3 | position: fixed; 4 | width: 12px; 5 | height: 12px; 6 | border-radius: 6px; 7 | top: 0; 8 | right: 0; 9 | margin: 8px 8px 0 0; 10 | border: solid 1px lighten(@color-a, 15%); 11 | z-index: 300; 12 | } 13 | .shell-cwd { 14 | .transition(~"all 300ms ease-out"); 15 | position: fixed; 16 | top: 0; 17 | left: 0; 18 | z-index: 100; 19 | width: 100%; 20 | font-size: 12px; 21 | padding: 6px 30px 6px 8px; 22 | border-bottom: solid 1px @color-a; 23 | overflow: hidden; 24 | margin-top: -33px; 25 | background: lighten(@color-a, 30%); 26 | a { 27 | text-decoration: none; 28 | color: darken(@color-a, 100%); 29 | &:hover { 30 | background: darken(@color-a, 100%); 31 | color: @color-c; 32 | } 33 | } 34 | } 35 | .shell-wrapper { 36 | display: none; 37 | } 38 | .regular-shell { 39 | font-size: 12px; 40 | background: lighten(@color-a, 35%); 41 | color: darken(@color-a, 100%); 42 | padding: 6px; 43 | margin: 0 0 4px 0; 44 | border-radius: 5px; 45 | } 46 | .shell-error { 47 | .regular-shell(); 48 | background: @color-error; 49 | color: darken(@color-error, 100%); 50 | } 51 | 52 | .shell-on { 53 | .shell-indicator { 54 | background: darken(@color-success, 20%); 55 | } 56 | .shell-cwd { 57 | margin-top: 0px; 58 | } 59 | } 60 | .shell-off { 61 | .shell-indicator { 62 | background: lighten(@color-a, 25%); 63 | } 64 | .shell-cwd { 65 | margin-top: -40px; 66 | } 67 | } -------------------------------------------------------------------------------- /src/css/less/main.less: -------------------------------------------------------------------------------- 1 | @font: 'Open Sans', sans-serif; 2 | @color-a: #999; 3 | @color-b: #3F3F3F; 4 | @color-c: #FFF; 5 | @color-input: #000; 6 | @color-error: #F5A3A3; 7 | @color-warning: #FDF293; 8 | @color-success: #A7DD95; 9 | @color-info: #BFEBEC; 10 | @color-tree: #D2DEE6; 11 | @color-alert: #F00; 12 | 13 | body, html { 14 | margin: 0; 15 | padding: 0; 16 | width: 100%; 17 | height: 100%; 18 | font-size: 14px; 19 | font-family: @font; 20 | color: @color-b; 21 | } 22 | h1, h2, h3, h4, h5, h6 { 23 | font-weight: normal; 24 | padding: 0; 25 | margin: 0 0 10px 0; 26 | } 27 | h1 .icon-emo-thumbsup { 28 | font-size: 20px; 29 | } 30 | pre { 31 | font-family: @font; 32 | padding: 6px; 33 | margin: 3px 0 3px 0; 34 | border: solid 1px darken(@color-c, 30%); 35 | border-radius: 4px; 36 | font-size: 10px; 37 | line-height: 12px; 38 | color: darken(@color-a, 20%); 39 | background: @color-c; 40 | } 41 | hr { 42 | border-top: none; 43 | border-bottom: solid 1px @color-a; 44 | margin: 10px 0 10px 0; 45 | } 46 | pre { 47 | white-space: pre-wrap; 48 | } 49 | .main-title { 50 | font-size: 100px; 51 | color: lighten(@color-a, 35%); 52 | text-align: center; 53 | } 54 | .left { 55 | float: left; 56 | } 57 | .right { 58 | float: right; 59 | } 60 | .clear { 61 | clear: both; 62 | } 63 | .center { 64 | text-align: center; 65 | } 66 | .box-sizing { 67 | -webkit-box-sizing: border-box; 68 | -moz-box-sizing: border-box; 69 | box-sizing: border-box; 70 | } 71 | .bordered { 72 | border: solid 1px @color-a; 73 | } -------------------------------------------------------------------------------- /src/css/less/console.less: -------------------------------------------------------------------------------- 1 | .console { 2 | width: 100%; 3 | box-sizing: border-box; 4 | padding: 10px; 5 | .console-output-content { 6 | .transition(~"all 400ms ease-out"); 7 | width: 100%; 8 | overflow: hidden; 9 | box-sizing: border-box; 10 | border-radius: 4px; 11 | .item { 12 | .transition(~"all 300ms ease-out"); 13 | .opacity(0); 14 | } 15 | .item-shown { 16 | .opacity(1); 17 | } 18 | } 19 | .inputs { 20 | .transition(~"all 400ms ease-out"); 21 | width: 100%; 22 | position: fixed; 23 | top: -2px; 24 | left: 0; 25 | input { 26 | .transition(~"all 400ms ease-out"); 27 | display: block; 28 | box-sizing: border-box; 29 | font-family: @font; 30 | padding: 4px 10px 6px 10px; 31 | width: 100%; 32 | border: none; 33 | border-bottom: solid 2px lighten(@color-a, 30%); 34 | position: absolute; 35 | top: 0; 36 | left: 0; 37 | &:focus { 38 | border: none; 39 | border-bottom: solid 2px lighten(@color-a, 10%); 40 | outline: 0; 41 | } 42 | } 43 | input[disabled] { 44 | background: lighten(@color-a, 20%); 45 | } 46 | } 47 | .suggest { 48 | z-index: 2; 49 | border: solid 2px #FFF; 50 | color: lighten(@color-input, 70%); 51 | } 52 | .command { 53 | color: @color-input; 54 | z-index: 3; 55 | background: none; 56 | } 57 | .history-panel { 58 | a { 59 | color: darken(@color-a, 50%); 60 | text-decoration: none; 61 | &:hover { 62 | text-decoration: underline; 63 | color: darken(@color-a, 100%); 64 | } 65 | } 66 | } 67 | } 68 | 69 | 70 | .shell-on { 71 | .inputs { 72 | top: 27px; 73 | } 74 | } -------------------------------------------------------------------------------- /src/js/commands/page/pageexpect.js: -------------------------------------------------------------------------------- 1 | Commands.register("pageexpect", { 2 | requiredArguments: 1, 3 | run: function(args, callback) { 4 | var selector = args.shift(); 5 | var filter = args.length > 0 ? args.join(" ") : null; 6 | var command = filter ? "pagequery \"" + selector + "\" " + filter : "pagequery \"" + selector + "\""; 7 | exec(command, function(res) { 8 | if(res.elements && res.elements > 0) { 9 | if(res.elements === 1) { 10 | exec('success There is one element matching "' + selector + '" selector. ' + (filter ? '(filter: ' + filter + ')' : '')); 11 | } else { 12 | exec('success There are ' + res.elements + ' elements matching "' + selector + '" selector. ' + (filter ? '(filter: ' + filter + ')' : '')); 13 | } 14 | callback(res); 15 | } else { 16 | exec('error There are no elements matching "' + selector + '" selector. ' + (filter ? '(filter: ' + filter + ')' : '')) 17 | callback(res); 18 | } 19 | }); 20 | }, 21 | man: { 22 | desc: 'Checks if there is an element matching the provided selector. Use filter parameter to filter the selected elements. Actually performs indexOf method agains the html markup of the selected element', 23 | format: 'pageexpect [selector] [filter]', 24 | examples: [ 25 | {text: 'Command line', code: 'pageexpect a.my-link-class label'}, 26 | {text: 'In script', code: 'pageexpect("a.my-link-class", "label, function(res) {\n\ 27 | console.log(res);\n\ 28 | });'} 29 | ], 30 | returns: 'Object containing the matched elements.', 31 | group: 'page' 32 | } 33 | }) -------------------------------------------------------------------------------- /src/js/commands/forms/formconfirm.js: -------------------------------------------------------------------------------- 1 | Commands.register("formconfirm", { 2 | requiredArguments: 1, 3 | run: function(args, callback) { 4 | 5 | var id = _.uniqueId("formconfirm"); 6 | var question = args.join(" "); 7 | var html = '\ 8 |
\ 9 |
\ 10 | NO\ 11 | YES\ 12 |
\ 13 |

' + question + '

\ 14 | \ 15 |
\ 16 | '; 17 | App.setOutputPanelContent('
' + html + '
'); 18 | 19 | var form = document.getElementById(id); 20 | var buttonYes = document.getElementById(id + '_buttonyes'); 21 | var buttonNo = document.getElementById(id + '_buttonno'); 22 | buttonYes.addEventListener("click", function() { 23 | form.parentNode.style.display = "none"; 24 | callback(true); 25 | App.commandInputFocus(); 26 | }); 27 | buttonNo.addEventListener("click", function() { 28 | form.parentNode.style.display = "none"; 29 | callback(false); 30 | App.commandInputFocus(); 31 | }); 32 | 33 | }, 34 | man: { 35 | desc: 'Shows a text (question) with two options - YES and NO.', 36 | format: 'formconfirm [question]', 37 | examples: [ 38 | {text: 'Command line', code: 'formconfirm Are you sure?'}, 39 | {text: 'In script', code: 'formconfirm(\'"Are you sure?"\', function(res) {\n\ 40 | console.log(res ? "yes" : "no");\n\ 41 | });'} 42 | ], 43 | returns: 'Boolean (true | false)', 44 | group: 'forms' 45 | } 46 | }) -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/ext-statusbar.js: -------------------------------------------------------------------------------- 1 | ace.define('ace/ext/statusbar', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/lang'], function(require, exports, module) { 2 | var dom = require("ace/lib/dom"); 3 | var lang = require("ace/lib/lang"); 4 | 5 | var StatusBar = function(editor, parentNode) { 6 | this.element = dom.createElement("div"); 7 | this.element.className = "ace_status-indicator"; 8 | this.element.style.cssText = "display: inline-block;"; 9 | parentNode.appendChild(this.element); 10 | 11 | var statusUpdate = lang.delayedCall(function(){ 12 | this.updateStatus(editor) 13 | }.bind(this)); 14 | editor.on("changeStatus", function() { 15 | statusUpdate.schedule(100); 16 | }); 17 | editor.on("changeSelection", function() { 18 | statusUpdate.schedule(100); 19 | }); 20 | }; 21 | 22 | (function(){ 23 | this.updateStatus = function(editor) { 24 | var status = []; 25 | function add(str, separator) { 26 | str && status.push(str, separator || "|"); 27 | } 28 | 29 | if (editor.$vimModeHandler) 30 | add(editor.$vimModeHandler.getStatusText()); 31 | else if (editor.commands.recording) 32 | add("REC"); 33 | 34 | var c = editor.selection.lead; 35 | add(c.row + ":" + c.column, " "); 36 | if (!editor.selection.isEmpty()) { 37 | var r = editor.getSelectionRange(); 38 | add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")"); 39 | } 40 | status.pop(); 41 | this.element.textContent = status.join(""); 42 | }; 43 | }).call(StatusBar.prototype); 44 | 45 | exports.StatusBar = StatusBar; 46 | 47 | }); -------------------------------------------------------------------------------- /src/js/commands/common/date.js: -------------------------------------------------------------------------------- 1 | Commands.register("date", { 2 | requiredArguments: 0, 3 | format: '
',
 4 | 	run: function(args, callback) {
 5 | 		var asObject = args.length > 0 ? args.shift() === "true" : false;
 6 | 		var currentDate = new Date();
 7 | 		var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
 8 | 		if(asObject) { 
 9 | 			callback({
10 | 				year: currentDate.getFullYear(),
11 | 				month: currentDate.getMonth(),
12 | 				monthName: months[currentDate.getMonth()],
13 | 				day: currentDate.getDate(),
14 | 				hour: currentDate.getHours(),
15 | 				minutes: currentDate.getMinutes()
16 | 			});
17 | 		} else {
18 | 			var str = '';
19 | 			str += currentDate.getDate() + " " + months[currentDate.getMonth()] + " " + currentDate.getFullYear();
20 | 			str += ' ';
21 | 			str += this.formatDigit(currentDate.getHours()) + ":" + this.formatDigit(currentDate.getMinutes());
22 | 			callback(str);
23 | 		}
24 | 	},
25 | 	formatDigit: function(d) {
26 | 		if(d < 10) {
27 | 			return "0" + d;
28 | 		} else {
29 | 			return d;
30 | 		}
31 | 	},
32 | 	man: {
33 | 		desc: 'Gets the current date.',
34 | 		format: 'date [true | false]',
35 | 		examples: [
36 | 			{text: 'Command line', code: 'date'},
37 | 			{text: 'Command line (chaining)', code: 'date true && read monthName && info'},
38 | 			{text: 'In script', code: 'date("true", function(date) {\n\
39 | 	console.log(date.year);\n\
40 | })'}
41 | 		],
42 | 		returns: 'String if you use just date and object if use data true
6 July 2013 14:43
\
43 | Object {\n\
44 | 	day: 6\n\
45 | 	hour: 14\n\
46 | 	minutes: 41\n\
47 | 	month: 6\n\
48 | 	monthName: "July"\n\
49 | 	year: 2013\n\
50 | }\
51 | 		
', 52 | group: 'common' 53 | } 54 | }) -------------------------------------------------------------------------------- /src/js/commands/common/read.js: -------------------------------------------------------------------------------- 1 | Commands.register("read", { 2 | requiredArguments: 2, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var path = args.shift(); 7 | var obj = args.shift(); 8 | 9 | if(typeof obj == 'object' && path != '') { 10 | 11 | var parse = function(currentPath, o) { 12 | if(currentPath.length === 0) { 13 | callback(o); 14 | return; 15 | } 16 | var part = currentPath.shift(), 17 | index = null, 18 | arrName = null; 19 | if(part.indexOf("[") >= 0 && part.indexOf("]") > 0) { 20 | var subParts = part.split('['); 21 | var arrName = subParts.shift(); 22 | var index = parseInt(subParts.shift().replace(']', '')); 23 | } 24 | if(index !== null) { 25 | if(o[arrName] && typeof o[arrName].length !== 'undefined' && o[arrName][index]) { 26 | parse(currentPath, o[arrName][index]); 27 | } else { 28 | exec('error read: wrong path (error working with arrays)'); 29 | } 30 | } else { 31 | if(o[part]) { 32 | parse(currentPath, o[part]); 33 | } else { 34 | exec('error read: wrong path'); 35 | callback(); 36 | } 37 | } 38 | } 39 | 40 | parse(path.split('.'), obj); 41 | 42 | } else { 43 | exec('error Second argument of read should be an object.'); 44 | callback(); 45 | } 46 | }, 47 | man: { 48 | desc: 'Extracts a value from json object', 49 | format: 'read [path] [json object]', 50 | examples: [ 51 | {text: 'Command line (chaining)', code: 'date true && read day && success Today is '}, 52 | {text: 'If you have a complex object like this one {data: { users: [10, 11, 12] }}', code: 'read data.users[1]'}, 53 | ], 54 | returns: 'Value of a property of the sent object', 55 | group: 'common' 56 | } 57 | }); -------------------------------------------------------------------------------- /src/js/commands/data/storage.js: -------------------------------------------------------------------------------- 1 | Commands.register("storage", { 2 | requiredArguments: 1, 3 | lookForQuotes: false, 4 | run: function(args, callback) { 5 | var operation = args.shift(); 6 | var key = args.length > 0 ? args.shift() : null; 7 | var value = args.length > 0 ? args.join(" ") : null; 8 | if(operation !== "put" && operation != "get" && operation != "remove") { 9 | exec("error profile: Operation parameter could be 'put', 'get' or 'remove' (not '" + operation + "')."); 10 | callback(); 11 | return; 12 | } 13 | if((operation === "put" || operation === "remove") && !key) { 14 | exec("error profile: 'key' is missing."); 15 | callback(); 16 | return; 17 | } 18 | if(operation === "put" && !value) { 19 | exec("error profile: 'put' operation used, but 'value' is missing."); 20 | callback(); 21 | return; 22 | } 23 | if(chrome && chrome.runtime) { 24 | chrome.runtime.sendMessage({type: "storage", operation: operation, key: key, value: value}, function(res) { 25 | if(res.error) { 26 | exec("error " + error.error); 27 | } else { 28 | if(operation === "get") { 29 | // exec("info " + JSON.stringify(res.value)) 30 | callback(res.value); 31 | } else { 32 | callback(); 33 | } 34 | } 35 | }); 36 | } 37 | }, 38 | man: { 39 | desc: 'Stores key-value pairs by using chrome.storage.sync API.', 40 | format: 'storage [operation] [key] [value]', 41 | examples: [ 42 | {text: 'Storing variable', code: 'storage put username Auxilio'}, 43 | {text: 'Getting variable', code: 'storage get username'}, 44 | {text: 'Removing variable', code: 'storage remove username'}, 45 | {text: 'Get all variable', code: 'storage get'} 46 | ], 47 | returns: 'The result of the executed command.', 48 | group: 'data' 49 | } 50 | }) -------------------------------------------------------------------------------- /tests/site/c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Auxilio Test Site 5 | 6 | 7 | 8 |
9 |

Page C - Auxilio Test Site

10 |

Back to home page

11 |
12 |
form submit results here ...
13 |
14 | 15 | 16 | 43 | -------------------------------------------------------------------------------- /src/js/commands/page/pagecontains.js: -------------------------------------------------------------------------------- 1 | Commands.register("pagecontains", { 2 | requiredArguments: 2, 3 | run: function(args, callback) { 4 | var selector = args.shift(); 5 | var text = args.join(" "); 6 | exec("pagequery " + selector, function(res) { 7 | if(res.elements && res.elements > 0) { 8 | var matching = 0; 9 | var matchedTags = ''; 10 | var r = new RegExp("(" + text + ")", "gi"); 11 | for(var i=0; i$1') + ''; 15 | } 16 | } 17 | if(matching === 1) { 18 | exec('success There is one element matching "' + selector + '" selector and contains "' + text + '" text.
' + matchedTags); 19 | } else if(matching > 1) { 20 | exec('success There are ' + matching + ' elements matching "' + selector + '" selector and contains "' + text + '" text.
' + matchedTags); 21 | } else { 22 | exec('error There are element/s(' + res.elements + ') matching "' + selector + '" but non of them contain "' + text + '" text.'); 23 | } 24 | callback(true); 25 | } else { 26 | exec('error There are no elements matching "' + selector + '" selector.') 27 | callback(false); 28 | } 29 | }); 30 | }, 31 | man: { 32 | desc: 'Checks if there is an element matching the provided selector and containing the provided text.', 33 | format: 'pagecontains [selector] [text]', 34 | examples: [ 35 | {text: 'Command line', code: 'pagecontains "body > a" "my link"'}, 36 | {text: 'In script', code: 'pagecontains("body > a", "my link", function(res) {\n\ 37 | console.log(res ? "yes" : "no");\n\ 38 | });'} 39 | ], 40 | returns: 'Boolean (true | false)', 41 | group: 'page' 42 | } 43 | }) -------------------------------------------------------------------------------- /src/js/commands/common/request.js: -------------------------------------------------------------------------------- 1 | Commands.register("request", { 2 | requiredArguments: 1, 3 | run: function(args, finished) { 4 | var self = this; 5 | var url = args.shift(); 6 | var showRawOutput = args.length > 0 && args[0] === "true"; 7 | if(url.indexOf("http") == -1) url = "http://" + url; 8 | var callback = function(response) { 9 | if(response.error) { 10 | exec('error request: ' + response.error, finished); 11 | } else { 12 | var responseText = response.responseText; 13 | if(!showRawOutput) { 14 | responseText = responseText.replace(//g, '>'); 16 | responseText = '
' + responseText + '
'; 17 | } 18 | finished(responseText); 19 | } 20 | } 21 | if(chrome && chrome.runtime) { 22 | chrome.runtime.sendMessage({type: "request", url: url}, callback); 23 | } else { 24 | request(url, callback); 25 | } 26 | }, 27 | man: { 28 | desc: 'Sends ajax request and returns the result.', 29 | format: 'request [url]
request [url] [raw (true | false)]', 30 | examples: [ 31 | {text: 'Command line', code: 'request github.com && echo'}, 32 | {text: 'Getting raw html', code: 'request github.com true && echo'}, 33 | {text: 'In script', code: 'This command is not supported in external scripts.'} 34 | ], 35 | returns: 'Response of the given url or the raw output if raw parameter is passed.', 36 | group: 'common' 37 | } 38 | }) 39 | 40 | // Used in development mode 41 | var request = function(url, callback) { 42 | var xhr = new XMLHttpRequest(); 43 | xhr.open("GET", url, true); 44 | xhr.onreadystatechange = function() { 45 | if (xhr.readyState == 4 && xhr.status == 200) { 46 | callback({responseText: xhr.responseText}); 47 | } else if(xhr.readyState == 4) { 48 | callback({error: "Error requesting '" + url + "'. (xhr.status=" + xhr.status + ")"}); 49 | } 50 | } 51 | xhr.send(); 52 | } -------------------------------------------------------------------------------- /src/newtab/newtab.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin: 0; 3 | padding: 0; 4 | width: 100%; 5 | font-size: 18px; 6 | font-family: 'Open Sans Light', sans-serif; 7 | color: #737373; 8 | } 9 | a { 10 | color: #737373; 11 | } 12 | h1 { 13 | font-size: 18px; 14 | font-weight: normal; 15 | text-align: center; 16 | margin: 0 auto; 17 | padding: 0 0 12px 0; 18 | font-family: 'Open Sans', sans-serif; 19 | } 20 | h4 { 21 | padding: 0; 22 | margin: 0 auto; 23 | font-size: 18px; 24 | font-weight: normal; 25 | color: #999; 26 | text-align: center; 27 | } 28 | hr { 29 | border-top: dotted 1px #999; 30 | border-bottom: none; 31 | width: 600px; 32 | margin: 10px auto 10px auto; 33 | } 34 | .time-holder { 35 | position: absolute; 36 | top: 50%; 37 | left: 50%; 38 | width: 430px; 39 | height: 340px; 40 | margin: -200px 0 0 -215px; 41 | text-align: center; 42 | } 43 | .quote-holder { 44 | position: absolute; 45 | bottom: 0; 46 | left: 0; 47 | background: #E3E3E3; 48 | border-top-left-radius: 30px; 49 | border-bottom-right-radius: 30px; 50 | margin: 0 0 30px 30px; 51 | max-width: 400px; 52 | } 53 | .quote-holder-inner { 54 | padding: 20px; 55 | } 56 | .clear { 57 | clear: both; 58 | } 59 | .btn { 60 | font-family: 'Open Sans', sans-serif; 61 | display: inline-block; 62 | font-size: 18px; 63 | text-decoration: none; 64 | padding: 10px 20px; 65 | background: #E3E3E3; 66 | border-top-left-radius: 13px; 67 | border-bottom-right-radius: 13px; 68 | } 69 | .btn:hover { 70 | color: #000; 71 | } 72 | #sound { 73 | display: inline-block; 74 | margin: 0 0 0 4px; 75 | width: 16px; 76 | height: 16px; 77 | background: url(../img/audio.png) no-repeat; 78 | } 79 | #time { 80 | font-size: 240px; 81 | color: #D4D4D4; 82 | font-family: 'Economica'; 83 | line-height: 210px; 84 | } 85 | #date { 86 | font-size: 30px; 87 | } 88 | #get-the-old { 89 | position: absolute; 90 | bottom: 0; 91 | right: 0; 92 | margin: 0 30px 30px 0; 93 | } -------------------------------------------------------------------------------- /src/js/scripts/marker.js: -------------------------------------------------------------------------------- 1 | var AuxilioMarker = { 2 | curtain: null, 3 | body: null, 4 | markers: [], 5 | markersHolder: null, 6 | init: function() { 7 | var self = this; 8 | this.markers = []; 9 | this.curtain = document.createElement("DIV"); 10 | this.curtain.className = "auxilio-marker-curtain"; 11 | this.curtain.id = "js-auxilio-marker-curtain"; 12 | this.curtain.innerHTML = '\ 13 |
\ 14 |

CLICK HERE!
Press Esc key to exit.

\ 15 |
\ 16 | '; 17 | this.body = document.querySelector("body"); 18 | 19 | if(this.body) { 20 | 21 | setTimeout(function() { 22 | self.markersHolder = document.querySelector(".auxilio-markers"); 23 | }, 300); 24 | this.body.appendChild(this.curtain); 25 | this.curtain.addEventListener("click", function(e) { 26 | self.hideCurtain(); 27 | self.placeMarker(e); 28 | }); 29 | 30 | var onKeyDown = function(e) { 31 | if(e.keyCode == 27) { 32 | self.body.removeEventListener("keydown", onKeyDown); 33 | self.body.removeChild(self.curtain); 34 | } 35 | } 36 | this.body.addEventListener("keydown", onKeyDown); 37 | } 38 | 39 | }, 40 | hideCurtain: function() { 41 | if(this.markers.length === 0) { 42 | document.querySelector(".auxilio-marker-curtain-bg").style.opacity = 0; 43 | document.querySelector(".auxilio-marker-curtain h1").style.opacity = 0; 44 | } 45 | }, 46 | placeMarker: function(e) { 47 | var marker = document.createElement("DIV"); 48 | marker.className = "auxilio-marker-item"; 49 | marker.innerHTML = this.markers.length + 1; 50 | marker.style.top = (e.pageY-15) + "px"; 51 | marker.style.left = (e.pageX-15) + "px"; 52 | this.markers.push(marker); 53 | this.markersHolder.appendChild(marker); 54 | }, 55 | error: function(msg) { 56 | alert(msg); 57 | } 58 | }; 59 | 60 | (function() { 61 | AuxilioMarker.init(); 62 | })(); -------------------------------------------------------------------------------- /src/js/commands/data/profile.js: -------------------------------------------------------------------------------- 1 | var Profile = (function() { 2 | 3 | var init = function() { 4 | var onSocketConnect = function() { 5 | exec("profile", function(path) { 6 | if(path && path !== '') { 7 | exec("run " + path); 8 | } 9 | }); 10 | Shell.socket().removeListener("updatecontext", onSocketConnect); 11 | } 12 | Shell.socket().on("updatecontext", onSocketConnect); 13 | } 14 | 15 | return { 16 | init: init 17 | } 18 | 19 | })(); 20 | 21 | Commands.register("profile", { 22 | requiredArguments: 0, 23 | lookForQuotes: true, 24 | concatArgs: true, 25 | run: function(args, callback) { 26 | var path = args.join(" "); 27 | var self = this; 28 | if(path === '') { 29 | exec("storage get profiledata", function(data) { 30 | if(data.profiledata && data.profiledata !== "") { 31 | callback(data.profiledata); 32 | } else { 33 | callback(null); 34 | } 35 | }); 36 | } else if(path === 'clear') { 37 | exec("storage remove profiledata " + path, function() { 38 | exec('success Profile removed.', callback); 39 | }); 40 | } else { 41 | exec("storage put profiledata " + path, function() { 42 | Profile.init(); 43 | exec('success Profile changed successfully.', callback); 44 | }); 45 | } 46 | }, 47 | man: { 48 | desc: 'Manages your current profile file. Every time when you start auxilio the extension reads the files of the given directory (recursively). It searches for files which start with function and register them as commands. If the file starts with exec. directly executes the function inside the file. Check man run for more information.', 49 | format: 'profile [path]', 50 | examples: [ 51 | {text: 'Getting current profile path', code: 'profile'}, 52 | {text: 'Setting profile', code: 'profile D:/work/auxilio/profile'}, 53 | {text: 'Clearing profile', code: 'profile clear'} 54 | ], 55 | returns: 'Check examples.', 56 | group: 'data' 57 | } 58 | }) -------------------------------------------------------------------------------- /src/js/lib/CommandBase.js: -------------------------------------------------------------------------------- 1 | var CommandBase = { 2 | name: '', 3 | requiredArguments: 0, 4 | format: '', 5 | lookForQuotes: true, 6 | concatArgs: false, 7 | run: function(args, callback) { 8 | callback(); 9 | }, 10 | man: function() { 11 | return '' + this.name + ' has no manual page.'; 12 | }, 13 | validate: function(args) { 14 | if(this.requiredArguments === 0 || (args && args.length && args.length >= this.requiredArguments)) { return true; } 15 | else { 16 | var message = '' + this.name + ' requires at least ' + this.requiredArguments + ' arguments.'; 17 | this.format != '' ? message += '
' + this.format : null; 18 | exec("error " + message); 19 | } 20 | }, 21 | formatter: function(args, usePreTag, skipHTMLFormatting, convertHTMLToString) { 22 | var formatJSON = function(data) { 23 | data = JSON.stringify(data, null, '\t') 24 | data = nl2br(data); 25 | data = tabsToSpaces(data); 26 | return data; 27 | } 28 | var nl2br = function(data) { 29 | if(skipHTMLFormatting) return data; 30 | return data.replace(/\n/g, '
'); 31 | } 32 | var tabsToSpaces = function(data) { 33 | if(skipHTMLFormatting) return data; 34 | return data.replace(/\t/g, '    '); 35 | } 36 | var html2String = function(data) { 37 | return data.replace(//g, '>'); 38 | } 39 | if(args.length > 0) { 40 | var firstArgument = args[0]; 41 | var data = ''; 42 | if(typeof firstArgument === 'object') { 43 | data = formatJSON(firstArgument); 44 | } else { 45 | data = args.join(' '); 46 | try { 47 | var json = JSON.parse(data); 48 | data = formatJSON(json); 49 | } catch(e) { 50 | data = nl2br(data); 51 | } 52 | } 53 | if(convertHTMLToString) { 54 | data = html2String(data); 55 | } 56 | if(usePreTag) { 57 | return '
' + data + '
'; 58 | } else { 59 | return data; 60 | } 61 | } else { 62 | return ''; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /src/js/commands/common/compare.js: -------------------------------------------------------------------------------- 1 | Commands.register("compare", { 2 | requiredArguments: 4, 3 | lookForQuotes: true, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | var title = args.shift(); 7 | var value1 = this.prepareValue(args.shift().toString()); 8 | var expression = args.shift(); 9 | var value2 = this.prepareValue(args.shift().toString()); 10 | var success = false; 11 | if(expression === "==" || expression === "===") { 12 | success = value1 === value2; 13 | } else if(expression === ">") { 14 | success = value1 > value2; 15 | } else if(expression === "<") { 16 | success = value1 < value2; 17 | } else if(expression === ">=") { 18 | success = value1 >= value2; 19 | } else if(expression === "<=") { 20 | success = value1 <= value2; 21 | } else if(expression === "!=" || expression === "!==") { 22 | success = value1 !== value2; 23 | } else { 24 | exec("error compare: Unrecognized expression. (" + expression + ")"); 25 | callback(success); 26 | return; 27 | } 28 | if(success) { 29 | exec("success " + title + "
" + value1 + " " + expression + " " + value2); 30 | } else { 31 | exec("error " + title + "
" + value1 + " " + expression + " " + value2); 32 | } 33 | callback(success); 34 | }, 35 | prepareValue: function(v) { 36 | if(isNaN(v) === true) { 37 | return v.toString(); 38 | } else { 39 | return parseInt(v); 40 | } 41 | }, 42 | man: { 43 | desc: 'Compares values. (Have in mind that it works only with strings and numbers.)', 44 | format: 'compare [title] [value1] [expression] [value2]', 45 | examples: [ 46 | {text: 'Command line', code: 'compare "Check those values" 10 == 20'}, 47 | {text: 'Command line (chaining)', code: 'date true && read monthName && compare "Is it July?" July =='}, 48 | {text: 'In script', code: 'compare(\'"My title here"\', 10, "==", 10, function(res) {\n\ 49 | console.log(res);\n\ 50 | })'}, 51 | ], 52 | returns: 'Boolean (true | false)', 53 | group: 'common' 54 | } 55 | }) -------------------------------------------------------------------------------- /tests/site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auxilio 6 | 7 | 14 | 20 | 21 | 22 |
23 |

Auxilio

24 |

Auxilio is a handy Google Chrome extension.

25 | 32 |
33 |
34 | 35 |
36 |
37 | GitHub | 38 | Login 39 |
40 |
41 | 42 | 43 | 44 |
45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /src/js/chain.js: -------------------------------------------------------------------------------- 1 | var Chain = function() { 2 | 3 | var _listeners = {}, 4 | _resultOfPreviousFunc = null, 5 | _self = this, 6 | _api = {}, 7 | _funcs = [], 8 | _errors = []; 9 | 10 | var on = function(type, listener) { 11 | if(!_listeners[type]) _listeners[type] = []; 12 | _listeners[type].push(listener); 13 | return _api; 14 | } 15 | var off = function(type, listener) { 16 | if(_listeners[type]) { 17 | var arr = []; 18 | for(var i=0; f=_listeners[type][i]; i++) { 19 | if(f !== listener) { 20 | arr.push(f); 21 | } 22 | } 23 | _listeners[type] = arr; 24 | } 25 | return _api; 26 | } 27 | var dispatch = function(type, param) { 28 | if(_listeners[type]) { 29 | for(var i=0; f=_listeners[type][i]; i++) { 30 | f(param, _api); 31 | } 32 | } 33 | } 34 | var run = function() { 35 | if(arguments.length > 0) { 36 | _funcs = []; 37 | for(var i=0; f=arguments[i]; i++) _funcs.push(f); 38 | var element = _funcs.shift(); 39 | if(typeof element === 'function') { 40 | element(_resultOfPreviousFunc, _api); 41 | } else if(typeof element === 'object' && element.length > 0) { 42 | var f = element.shift(); 43 | f.apply(f, element.concat([_api.next])); 44 | } 45 | 46 | } else { 47 | dispatch("done", _resultOfPreviousFunc); 48 | } 49 | return _api; 50 | } 51 | var next = function(res) { 52 | _resultOfPreviousFunc = res; 53 | run.apply(_self, _funcs); 54 | } 55 | var error = function(err) { 56 | if(typeof err != 'undefined') { 57 | _errors.push(err); 58 | return _api; 59 | } else { 60 | return _errors; 61 | } 62 | } 63 | var process = function() { 64 | if(arguments.length > 0) { 65 | // on method 66 | if(arguments.length === 2 && typeof arguments[0] === 'string' && typeof arguments[1] === 'function') { 67 | on.apply(self, arguments); 68 | // run method 69 | } else { 70 | run.apply(self, arguments); 71 | } 72 | } 73 | return process; 74 | } 75 | 76 | _api = { 77 | on: on, 78 | off: off, 79 | next: next, 80 | error: error 81 | } 82 | 83 | return process; 84 | 85 | }; -------------------------------------------------------------------------------- /src/js/lib/Context.js: -------------------------------------------------------------------------------- 1 | var Context = (function() { 2 | 3 | var _body, 4 | _contextEl, 5 | _context, 6 | _gitstatus; 7 | 8 | var on = function() { 9 | _body.className = "shell-on"; 10 | } 11 | var off = function() { 12 | _body.className = "shell-off"; 13 | } 14 | var updateContext = function(res) { 15 | _context = res.context; 16 | _gitstatus = res.git; 17 | setContext(); 18 | } 19 | var init = function() { 20 | _body = document.querySelector("body"); 21 | _contextEl = document.getElementById("js-shell-cwd"); 22 | } 23 | var setContext = function() { 24 | var gitStatusMarkup = ''; 25 | if(_gitstatus && _gitstatus.branch) { 26 | gitStatusMarkup += '   '; 27 | gitStatusMarkup += '' + _gitstatus.branch + ''; 28 | if(_gitstatus.status) { 29 | gitStatusMarkup += ' / '; 30 | for(var i in _gitstatus.status) { 31 | gitStatusMarkup += ''; 32 | switch(i) { 33 | case "M": gitStatusMarkup += "∼"; break; 34 | case "A": gitStatusMarkup += "+"; break; 35 | case "D": gitStatusMarkup += "−"; break; 36 | case "??": gitStatusMarkup += "⊕"; break; 37 | default: gitStatusMarkup += i; break; 38 | } 39 | gitStatusMarkup += _gitstatus.status[i] + ' '; 40 | } 41 | } 42 | gitStatusMarkup += ''; 43 | } 44 | _contextEl.innerHTML = convertContextToLinks() + gitStatusMarkup; 45 | } 46 | var convertContextToLinks = function() { 47 | var str = _context; 48 | str = str.replace(/\\/g, '/'); 49 | var parts = str.split('/'); 50 | var currentPath = str = parts[0] + '/'; 51 | for(var i=1; i' + parts[i] + ''; 54 | str += link + '/'; 55 | } 56 | return str; 57 | } 58 | 59 | return { 60 | init: init, 61 | on: on, 62 | off: off, 63 | updateContext: updateContext, 64 | get: function() { return _context; } 65 | } 66 | 67 | })(); -------------------------------------------------------------------------------- /src/js/commands/forms/forminput.js: -------------------------------------------------------------------------------- 1 | Commands.register("forminput", { 2 | requiredArguments: 0, 3 | run: function(args, callback) { 4 | 5 | var id = _.uniqueId("forminput"); 6 | var title = args.length > 0 ? args.shift() : "Type something:"; 7 | var text = args.length > 0 ? args.join(" ") : ''; 8 | var html = '\ 9 |
\ 10 |
\ 11 | CANCEL\ 12 | OK\ 13 |
\ 14 |

' + title + '

\ 15 | \ 16 | Ctrl+Enter = OK, Esc = CANCEL\ 17 |
\ 18 | '; 19 | App.setOutputPanelContent('
' + html + '
'); 20 | 21 | var form = document.getElementById(id); 22 | var button = document.getElementById(id + '_button'); 23 | var buttonCancel = document.getElementById(id + '_button_cancel'); 24 | var textarea = document.getElementById(id + '_area'); 25 | var onKeyDown = function(e) { 26 | if(e.ctrlKey && e.keyCode === 13) { 27 | button.click(); 28 | } else if(e.keyCode == 27) { 29 | buttonCancel.click(); 30 | } 31 | } 32 | 33 | textarea.focus(); 34 | button.addEventListener("click", function() { 35 | form.parentNode.style.display = "none"; 36 | var value = textarea.value.replace(/ && /g, '\n'); 37 | callback(value); 38 | textarea.removeEventListener("keydown", onKeyDown); 39 | App.commandInputFocus(); 40 | }); 41 | buttonCancel.addEventListener("click", function() { 42 | form.parentNode.style.display = "none"; 43 | callback(); 44 | App.commandInputFocus(); 45 | }); 46 | textarea.addEventListener("keydown", onKeyDown); 47 | 48 | }, 49 | man: { 50 | desc: 'Shows a simple form with input and button.', 51 | format: 'forminput
forminput [title]
forminput [title] [default text]', 52 | examples: [ 53 | {text: 'Command line', code: 'forminput "Please type your age." 18'}, 54 | {text: 'In script', code: 'forminput(\'"Please type your age."\', 18, function(age) {\n\ 55 | console.log(age);\n\ 56 | });'} 57 | ], 58 | returns: 'string', 59 | group: 'forms' 60 | } 61 | }) -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Auxilio 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 | 18 | 19 |
20 |
21 |
22 |
...
23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/mode-lucene.js: -------------------------------------------------------------------------------- 1 | ace.define('ace/mode/lucene', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lucene_highlight_rules'], function(require, exports, module) { 2 | 3 | 4 | var oop = require("../lib/oop"); 5 | var TextMode = require("./text").Mode; 6 | var Tokenizer = require("../tokenizer").Tokenizer; 7 | var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules; 8 | 9 | var Mode = function() { 10 | this.$tokenizer = new Tokenizer(new LuceneHighlightRules().getRules()); 11 | }; 12 | 13 | oop.inherits(Mode, TextMode); 14 | 15 | exports.Mode = Mode; 16 | });ace.define('ace/mode/lucene_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 17 | 18 | 19 | var oop = require("../lib/oop"); 20 | var lang = require("../lib/lang"); 21 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 22 | 23 | var LuceneHighlightRules = function() { 24 | this.$rules = { 25 | "start" : [ 26 | { 27 | token : "constant.character.negation", 28 | regex : "[\\-]" 29 | }, { 30 | token : "constant.character.interro", 31 | regex : "[\\?]" 32 | }, { 33 | token : "constant.character.asterisk", 34 | regex : "[\\*]" 35 | }, { 36 | token: 'constant.character.proximity', 37 | regex: '~[0-9]+\\b' 38 | }, { 39 | token : 'keyword.operator', 40 | regex: '(?:AND|OR|NOT)\\b' 41 | }, { 42 | token : "paren.lparen", 43 | regex : "[\\(]" 44 | }, { 45 | token : "paren.rparen", 46 | regex : "[\\)]" 47 | }, { 48 | token : "keyword", 49 | regex : "[\\S]+:" 50 | }, { 51 | token : "string", // " string 52 | regex : '".*?"' 53 | }, { 54 | token : "text", 55 | regex : "\\s+" 56 | } 57 | ] 58 | }; 59 | }; 60 | 61 | oop.inherits(LuceneHighlightRules, TextHighlightRules); 62 | 63 | exports.LuceneHighlightRules = LuceneHighlightRules; 64 | }); 65 | -------------------------------------------------------------------------------- /src/js/commands/forms/formtextarea.js: -------------------------------------------------------------------------------- 1 | Commands.register("formtextarea", { 2 | requiredArguments: 0, 3 | concatArgs: true, 4 | run: function(args, callback) { 5 | 6 | var id = _.uniqueId("formtextarea"); 7 | var title = args.length > 0 ? args.shift() : "Type something:"; 8 | var text = args.length > 0 ? args.join(" ") : ''; 9 | var html = '\ 10 |
\ 11 |
\ 12 | CANCEL\ 13 | OK\ 14 |
\ 15 |

' + title + '

\ 16 | \ 17 | Ctrl+Enter = OK, Esc = CANCEL\ 18 |
\ 19 | '; 20 | App.setOutputPanelContent('
' + html + '
'); 21 | 22 | var form = document.getElementById(id); 23 | var button = document.getElementById(id + '_button'); 24 | var buttonCancel = document.getElementById(id + '_button_cancel'); 25 | var textarea = document.getElementById(id + '_area'); 26 | var onKeyDown = function(e) { 27 | if(e.ctrlKey && e.keyCode === 13) { 28 | button.click(); 29 | } else if(e.keyCode == 27) { 30 | buttonCancel.click(); 31 | } 32 | } 33 | 34 | textarea.focus(); 35 | button.addEventListener("click", function() { 36 | form.parentNode.style.display = "none"; 37 | var value = textarea.value.replace(/ && /g, '\n'); 38 | callback(value); 39 | textarea.removeEventListener("keydown", onKeyDown); 40 | App.commandInputFocus(); 41 | }); 42 | buttonCancel.addEventListener("click", function() { 43 | form.parentNode.style.display = "none"; 44 | callback(); 45 | App.commandInputFocus(); 46 | }); 47 | textarea.addEventListener("keydown", onKeyDown); 48 | 49 | }, 50 | man: { 51 | desc: 'Shows a simple form with textarea and button. Use the callback of the command to get the text submitted by the form.', 52 | format: 'formtextarea
formtextarea [title]
formtextarea [title] [text]', 53 | examples: [ 54 | {text: 'Command line', code: 'formtextarea "Please type your bio." "Sample text" && echo'}, 55 | {text: 'In script', code: 'formtextarea(\'"Please type your bio."\', \'"Sample text"\', function(bio) {\n\ 56 | console.log(bio);\n\ 57 | });'} 58 | ], 59 | returns: 'string', 60 | group: 'forms' 61 | } 62 | }) -------------------------------------------------------------------------------- /src/newtab/font.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Open Sans'; 3 | font-style: normal; 4 | font-weight: 300; 5 | src: local('Open Sans Light'), local('OpenSans-Light'), url(./fonts/DXI1ORHCpsQm3Vp6mXoaTVMBBrntOh5tSEdJ1aeglyY.woff) format('woff'); 6 | } 7 | @font-face { 8 | font-family: 'Open Sans'; 9 | font-style: normal; 10 | font-weight: 400; 11 | src: local('Open Sans'), local('OpenSans'), url(./fonts/K88pR3goAWT7BTt32Z01m7O3LdcAZYWl9Si6vvxL-qU.woff) format('woff'); 12 | } 13 | @font-face { 14 | font-family: 'Open Sans'; 15 | font-style: normal; 16 | font-weight: 600; 17 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(./fonts/MTP_ySUJH_bn48VBG8sNSlMBBrntOh5tSEdJ1aeglyY.woff) format('woff'); 18 | } 19 | @font-face { 20 | font-family: 'Open Sans'; 21 | font-style: normal; 22 | font-weight: 700; 23 | src: local('Open Sans Bold'), local('OpenSans-Bold'), url(./fonts/k3k702ZOKiLJc3WVjuplzFMBBrntOh5tSEdJ1aeglyY.woff) format('woff'); 24 | } 25 | @font-face { 26 | font-family: 'Open Sans'; 27 | font-style: normal; 28 | font-weight: 800; 29 | src: local('Open Sans Extrabold'), local('OpenSans-Extrabold'), url(./fonts/EInbV5DfGHOiMmvb1Xr-hlMBBrntOh5tSEdJ1aeglyY.woff) format('woff'); 30 | } 31 | @font-face { 32 | font-family: 'Open Sans'; 33 | font-style: italic; 34 | font-weight: 300; 35 | src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url(./fonts/PRmiXeptR36kaC0GEAetxnAs8Wu_YJ_iPyCHUNPN6JQ.woff) format('woff'); 36 | } 37 | @font-face { 38 | font-family: 'Open Sans'; 39 | font-style: italic; 40 | font-weight: 400; 41 | src: local('Open Sans Italic'), local('OpenSans-Italic'), url(./fonts/xjAJXh38I15wypJXxuGMBhsKoB_2lT5BZsH32Y4e7So.woff) format('woff'); 42 | } 43 | @font-face { 44 | font-family: 'Open Sans'; 45 | font-style: italic; 46 | font-weight: 600; 47 | src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(./fonts/PRmiXeptR36kaC0GEAetxq_HxB5EqkbxBlcMADog12k.woff) format('woff'); 48 | } 49 | @font-face { 50 | font-family: 'Open Sans'; 51 | font-style: italic; 52 | font-weight: 700; 53 | src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(./fonts/PRmiXeptR36kaC0GEAetxtmPLRxFEEE7es7tC2X2zcQ.woff) format('woff'); 54 | } 55 | @font-face { 56 | font-family: 'Open Sans'; 57 | font-style: italic; 58 | font-weight: 800; 59 | src: local('Open Sans Extrabold Italic'), local('OpenSans-ExtraboldItalic'), url(./fonts/PRmiXeptR36kaC0GEAetxr6z-VYxiFCB6NAIKy3J77w.woff) format('woff'); 60 | } 61 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/ext-spellcheck.js: -------------------------------------------------------------------------------- 1 | ace.define('ace/ext/spellcheck', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/editor', 'ace/config'], function(require, exports, module) { 2 | 3 | var event = require("../lib/event"); 4 | 5 | exports.contextMenuHandler = function(e){ 6 | var host = e.target; 7 | var text = host.textInput.getElement(); 8 | if (!host.selection.isEmpty()) 9 | return; 10 | var c = host.getCursorPosition(); 11 | var r = host.session.getWordRange(c.row, c.column); 12 | var w = host.session.getTextRange(r); 13 | 14 | host.session.tokenRe.lastIndex = 0; 15 | if (!host.session.tokenRe.test(w)) 16 | return; 17 | var PLACEHOLDER = "\x01\x01"; 18 | var value = w + " " + PLACEHOLDER; 19 | text.value = value; 20 | text.setSelectionRange(w.length + 1, w.length + 1); 21 | text.setSelectionRange(0, 0); 22 | 23 | var afterKeydown = false; 24 | event.addListener(text, "keydown", function onKeydown() { 25 | event.removeListener(text, "keydown", onKeydown); 26 | afterKeydown = true; 27 | }); 28 | 29 | host.textInput.setInputHandler(function(newVal) { 30 | console.log(newVal , value, text.selectionStart, text.selectionEnd) 31 | if (newVal == value) 32 | return ''; 33 | if (newVal.lastIndexOf(value, 0) === 0) 34 | return newVal.slice(value.length); 35 | if (newVal.substr(text.selectionEnd) == value) 36 | return newVal.slice(0, -value.length); 37 | if (newVal.slice(-2) == PLACEHOLDER) { 38 | var val = newVal.slice(0, -2); 39 | if (val.slice(-1) == " ") { 40 | if (afterKeydown) 41 | return val.substring(0, text.selectionEnd); 42 | val = val.slice(0, -1); 43 | host.session.replace(r, val); 44 | return ""; 45 | } 46 | } 47 | 48 | return newVal; 49 | }); 50 | }; 51 | var Editor = require("../editor").Editor; 52 | require("../config").defineOptions(Editor.prototype, "editor", { 53 | spellcheck: { 54 | set: function(val) { 55 | var text = this.textInput.getElement(); 56 | text.spellcheck = !!val; 57 | if (!val) 58 | this.removeListener("nativecontextmenu", exports.contextMenuHandler); 59 | else 60 | this.on("nativecontextmenu", exports.contextMenuHandler); 61 | }, 62 | value: true 63 | } 64 | }); 65 | 66 | }); 67 | 68 | -------------------------------------------------------------------------------- /src/js/commands/forms/formfile.js: -------------------------------------------------------------------------------- 1 | Commands.register("formfile", { 2 | requiredArguments: 0, 3 | run: function(args, callback) { 4 | 5 | var id = _.uniqueId("formfile"); 6 | var title = args.length > 0 ? args.join(' ') : "Please choose file/s:"; 7 | var html = '\ 8 |
\ 9 |
\ 10 | CANCEL\ 11 | OK\ 12 |
\ 13 |

' + title + '

\ 14 | \ 15 |
\ 16 |
\ 17 | '; 18 | App.setOutputPanelContent('
' + html + '
'); 19 | 20 | var form = document.getElementById(id); 21 | var button = document.getElementById(id + '_button'); 22 | var buttonCancel = document.getElementById(id + '_button_cancel'); 23 | var area = document.getElementById(id + '_area'); 24 | var fileContent = document.getElementById(id + '_filecontent'); 25 | var value = null; 26 | area.addEventListener("change", function(e) { 27 | var files = e.target.files; 28 | var file = null; 29 | if(file = files[0]) { 30 | var reader = new FileReader(); 31 | reader.onload = function(e) { 32 | if(e.target.result) { 33 | value = e.target.result; 34 | fileContent.style.display = "block"; 35 | fileContent.innerText = value; 36 | } 37 | }; 38 | reader.readAsText(file); 39 | } 40 | }) 41 | button.addEventListener("click", function() { 42 | if(value != null) { 43 | form.parentNode.style.display = "none"; 44 | callback(value); 45 | App.commandInputFocus(); 46 | } else { 47 | exec("error Please choose a file.") 48 | } 49 | }); 50 | buttonCancel.addEventListener("click", function() { 51 | form.parentNode.style.display = "none"; 52 | callback(); 53 | App.commandInputFocus(); 54 | }); 55 | 56 | }, 57 | man: { 58 | desc: 'Shows a simple form with input[type="file"] and button. Use the callback of the command to get the content of the file.', 59 | format: 'formfile [title]', 60 | examples: [ 61 | {text: 'Command line', code: 'formfile Please choose a file.'}, 62 | {text: 'In script', code: 'formfile(\'"Please choose a file."\', function(fileContent) {\n\ 63 | console.log(fileContent);\n\ 64 | })'} 65 | ], 66 | returns: 'Content of the file', 67 | group: 'forms' 68 | } 69 | }) -------------------------------------------------------------------------------- /tests/site/a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Auxilio Test Site 5 | 6 | 7 | 8 |
9 |

Page A - Auxilio Test Site

10 |

Back to home page

11 |
12 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut massa tincidunt, pretium nisl at, scelerisque augue. In non erat nec libero tincidunt placerat feugiat id ipsum. Aliquam sed ornare sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales metus erat, in aliquam orci interdum a. Sed gravida quam felis. Integer volutpat convallis purus, non porta dolor lobortis varius. Integer justo turpis, blandit dignissim lectus vitae, adipiscing auctor lacus. Aliquam eros tellus, tincidunt nec metus vitae, fermentum convallis turpis. Vivamus sit amet sem interdum, pharetra enim sit amet, lobortis mauris. Integer dapibus dignissim nibh, sit amet lacinia ligula dapibus quis. Phasellus in nulla in elit feugiat eleifend nec tincidunt odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut mattis nisi sed nulla gravida bibendum sed vitae sem. Vestibulum vitae pulvinar tortor, vitae egestas augue.

13 |

Nullam bibendum commodo mi, hendrerit semper lacus lacinia ac. Pellentesque accumsan eros sed dignissim porta. Fusce gravida leo urna, sit amet pulvinar arcu fringilla sit amet. Vivamus eu magna vitae massa adipiscing molestie vel ac urna. Cras congue nisl non placerat pretium. Ut mi massa, porta eget justo vitae, venenatis rhoncus quam. Sed aliquet diam mauris, in lobortis mauris elementum a. Proin egestas luctus justo, quis pulvinar massa rutrum et. Duis vulputate tincidunt erat luctus varius.

14 |

Nunc tortor nunc, vehicula sed luctus non, tempor quis quam. Nulla pretium feugiat ipsum id sagittis. Curabitur non tellus sodales augue fermentum luctus. Duis placerat non ante nec lobortis. Nunc ultrices tellus a porttitor rhoncus. Curabitur tincidunt ac enim a rutrum. Nulla lacinia erat at facilisis ornare. Cras egestas lacinia nisi in lobortis. Donec malesuada justo sed odio tempus porttitor. Nullam luctus risus id luctus facilisis. Vestibulum venenatis sem in nunc vestibulum, sed hendrerit massa luctus. Suspendisse hendrerit neque nec arcu feugiat aliquam. Donec ante purus, volutpat in leo quis, lacinia fringilla ipsum. Maecenas in porta eros.

15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /src/js/commands/common/diff.js: -------------------------------------------------------------------------------- 1 | Commands.register("diff", { 2 | requiredArguments: 0, 3 | lookForQuotes: true, 4 | concatArgs: true, 5 | run: function(args, callback) { 6 | if(args.length >= 2) { 7 | var self = this; 8 | var file1 = args[0]; 9 | var file2 = args[1]; 10 | exec("readfile " + file1, function(resFile1) { 11 | exec("readfile " + file2, function(resFile2) { 12 | var file1Ext = self.getExt(file1); 13 | var file2Ext = self.getExt(file2); 14 | if(file1Ext === file2Ext && file1Ext === "json") { 15 | var file1JSON, file2JSON; 16 | try { 17 | file1JSON = JSON.parse(resFile1); 18 | } catch(e) { 19 | exec("error File " + file1 + " contains invalid json."); 20 | callback(); 21 | return; 22 | } 23 | try { 24 | file2JSON = JSON.parse(resFile2); 25 | } catch(e) { 26 | exec("error File " + file2 + " contains invalid json."); 27 | callback(); 28 | return; 29 | } 30 | self.compareJSON(file1JSON, file2JSON, callback); 31 | } else { 32 | self.compareText(resFile1, resFile2, callback); 33 | } 34 | }) 35 | }); 36 | } else { 37 | exec("error Sorry, but diff requires two arguments.") 38 | } 39 | // this.compareText("Krasimir Tsonev is web developer", "Krasimir tyonev is developer", callback); 40 | // this.compareJSON({a: 20}, {a: 20, b: { c: 20 }}, callback); 41 | }, 42 | compareJSON: function(ob1, ob2, callback) { 43 | var diff = objectDiff.diffOwnProperties(ob1, ob2); 44 | var markup = '
' + objectDiff.convertToXMLString(diff) + '
'; 45 | exec("echo " + markup); 46 | callback(diff); 47 | }, 48 | compareText: function(t1, t2, callback) { 49 | var dmp = new diff_match_patch(); 50 | var d = dmp.diff_main(t1, t2); 51 | // dmp.diff_cleanupSemantic(d); 52 | // dmp.diff_cleanupEfficiency(d); 53 | var result = ''; 54 | var diff = dmp.diff_prettyHtml(d); 55 | result += 'Difference:
' + diff + '
'; 56 | // result += 'Text #1:
' + t1 + '
'; 57 | // result += 'Text #2:
' + t2 + '
'; 58 | exec("echo " + result); 59 | callback(d); 60 | }, 61 | getExt: function(filename) { 62 | var parts = filename.split("."); 63 | return parts[parts.length-1].toLowerCase(); 64 | }, 65 | man: { 66 | desc: 'Comparison of files (text and json).', 67 | format: 'diff [file1] [file2]', 68 | examples: [ 69 | {text: 'Compare two files', code: 'diff ./file1.txt ./file2.txt'}, 70 | {text: 'In script', code: 'diff(\'"file1.txt"\', \'"file2.txt"\', function(res) {\n\ 71 | console.log(res);\n\ 72 | })'} 73 | ], 74 | returns: 'Object containing the differences.', 75 | group: 'common' 76 | } 77 | }) -------------------------------------------------------------------------------- /src/css/marker.css: -------------------------------------------------------------------------------- 1 | .auxilio-marker-curtain { 2 | width: 100%; 3 | height: 100%; 4 | position: fixed; 5 | z-index: 999; 6 | top: 0; 7 | left: 0; 8 | } 9 | .auxilio-marker-curtain-bg { 10 | width: 100%; 11 | height: 100%; 12 | opacity: 0.21; 13 | background-color: hsl(34, 53%, 82%); 14 | background-image: repeating-linear-gradient(45deg, transparent 5px, hsla(197, 62%, 11%, 0.5) 5px, hsla(197, 62%, 11%, 0.5) 10px, 15 | hsla(5, 53%, 63%, 0) 10px, hsla(5, 53%, 63%, 0) 35px, hsla(5, 53%, 63%, 0.5) 35px, hsla(5, 53%, 63%, 0.5) 40px, 16 | hsla(197, 62%, 11%, 0.5) 40px, hsla(197, 62%, 11%, 0.5) 50px, hsla(197, 62%, 11%, 0) 50px, hsla(197, 62%, 11%, 0) 60px, 17 | hsla(5, 53%, 63%, 0.5) 60px, hsla(5, 53%, 63%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 80px, 18 | hsla(35, 91%, 65%, 0) 80px, hsla(35, 91%, 65%, 0) 90px, hsla(5, 53%, 63%, 0.5) 90px, hsla(5, 53%, 63%, 0.5) 110px, 19 | hsla(5, 53%, 63%, 0) 110px, hsla(5, 53%, 63%, 0) 120px, hsla(197, 62%, 11%, 0.5) 120px, hsla(197, 62%, 11%, 0.5) 140px 20 | ), 21 | repeating-linear-gradient(135deg, transparent 5px, hsla(197, 62%, 11%, 0.5) 5px, hsla(197, 62%, 11%, 0.5) 10px, 22 | hsla(5, 53%, 63%, 0) 10px, hsla(5, 53%, 63%, 0) 35px, hsla(5, 53%, 63%, 0.5) 35px, hsla(5, 53%, 63%, 0.5) 40px, 23 | hsla(197, 62%, 11%, 0.5) 40px, hsla(197, 62%, 11%, 0.5) 50px, hsla(197, 62%, 11%, 0) 50px, hsla(197, 62%, 11%, 0) 60px, 24 | hsla(5, 53%, 63%, 0.5) 60px, hsla(5, 53%, 63%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 70px, hsla(35, 91%, 65%, 0.5) 80px, 25 | hsla(35, 91%, 65%, 0) 80px, hsla(35, 91%, 65%, 0) 90px, hsla(5, 53%, 63%, 0.5) 90px, hsla(5, 53%, 63%, 0.5) 110px, 26 | hsla(5, 53%, 63%, 0) 110px, hsla(5, 53%, 63%, 0) 140px, hsla(197, 62%, 11%, 0.5) 140px, hsla(197, 62%, 11%, 0.5) 160px 27 | ); 28 | } 29 | .auxilio-marker-curtain h1 { 30 | font-size: 70px; 31 | color: #6D6D6D; 32 | margin: 0; 33 | padding: 0; 34 | font-weight: bold; 35 | font-family: Arial; 36 | width: 500px; 37 | height: 90px; 38 | text-align: center; 39 | margin: -45px 0 0 -250px; 40 | position: absolute; 41 | left: 50%; 42 | top: 50%; 43 | cursor: default; 44 | text-shadow: 3px 3px #FFF; 45 | line-height: 50px; 46 | } 47 | .auxilio-marker-curtain h1 small { 48 | font-size: 30px; 49 | } 50 | .auxilio-markers { 51 | position: absolute; 52 | left: 0; 53 | top: 0; 54 | width: 100%; 55 | height: 100%; 56 | } 57 | .auxilio-marker-item { 58 | position: absolute; 59 | width: 30px; 60 | height: 30px; 61 | border-radius: 18px; 62 | background: #FFF; 63 | font-weight: bold; 64 | font-size: 18px; 65 | text-align: center; 66 | border: solid 4px #F00; 67 | line-height: 28px; 68 | cursor: default; 69 | box-shadow: 3px 3px 5px #888888; 70 | } -------------------------------------------------------------------------------- /src/css/OpenSans.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Open Sans'; 3 | font-style: normal; 4 | font-weight: 300; 5 | src: local('Open Sans Light'), local('OpenSans-Light'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTZ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); 6 | } 7 | @font-face { 8 | font-family: 'Open Sans'; 9 | font-style: normal; 10 | font-weight: 400; 11 | src: local('Open Sans'), local('OpenSans'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); 12 | } 13 | @font-face { 14 | font-family: 'Open Sans'; 15 | font-style: normal; 16 | font-weight: 600; 17 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNSp1r3JsPcQLi8jytr04NNhU.woff) format('woff'); 18 | } 19 | @font-face { 20 | font-family: 'Open Sans'; 21 | font-style: normal; 22 | font-weight: 700; 23 | src: local('Open Sans Bold'), local('OpenSans-Bold'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/k3k702ZOKiLJc3WVjuplzJ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); 24 | } 25 | @font-face { 26 | font-family: 'Open Sans'; 27 | font-style: normal; 28 | font-weight: 800; 29 | src: local('Open Sans Extrabold'), local('OpenSans-Extrabold'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/EInbV5DfGHOiMmvb1Xr-hp1r3JsPcQLi8jytr04NNhU.woff) format('woff'); 30 | } 31 | @font-face { 32 | font-family: 'Open Sans'; 33 | font-style: italic; 34 | font-weight: 300; 35 | src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/PRmiXeptR36kaC0GEAetxsRNPnluThgqn2COyNuxrUo.woff) format('woff'); 36 | } 37 | @font-face { 38 | font-family: 'Open Sans'; 39 | font-style: italic; 40 | font-weight: 400; 41 | src: local('Open Sans Italic'), local('OpenSans-Italic'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/xjAJXh38I15wypJXxuGMBifE9Gpc2xZQgtwyMvPhThE.woff) format('woff'); 42 | } 43 | @font-face { 44 | font-family: 'Open Sans'; 45 | font-style: italic; 46 | font-weight: 600; 47 | src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/PRmiXeptR36kaC0GEAetxgrbXMBDTAXVIvvFtPvELgE.woff) format('woff'); 48 | } 49 | @font-face { 50 | font-family: 'Open Sans'; 51 | font-style: italic; 52 | font-weight: 700; 53 | src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/PRmiXeptR36kaC0GEAetxjpEpsbGv0WCalYSBSSLSDI.woff) format('woff'); 54 | } 55 | @font-face { 56 | font-family: 'Open Sans'; 57 | font-style: italic; 58 | font-weight: 800; 59 | src: local('Open Sans Extrabold Italic'), local('OpenSans-ExtraboldItalic'), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/PRmiXeptR36kaC0GEAetxi4vOOdiOOuj151rH_Riw3A.woff) format('woff'); 60 | } 61 | -------------------------------------------------------------------------------- /src/js/lib/Shell.js: -------------------------------------------------------------------------------- 1 | var Shell = (function() { 2 | 3 | var _host = "localhost", 4 | _port = 3443, 5 | _retryInterval = 30000, 6 | _retryTries = 0, 7 | _retryTriesMax = 20, 8 | _socket, 9 | _connected = false, 10 | _cache = {}, 11 | _suppressErrorsOnce = false; 12 | 13 | var connect = function() { 14 | if(_connected) { return; } 15 | _socket = io.connect('http://' + _host + ":" + _port, { 16 | 'force new connection': true 17 | }); 18 | _socket.on('connect', function (data) { 19 | _connected = true; 20 | Context.on(); 21 | }); 22 | _socket.on('disconnect', function() { 23 | _connected = false; 24 | Context.off(); 25 | }); 26 | _socket.on("command", function(res) { 27 | if(res.id && _cache[res.id]) { 28 | var output = document.getElementById(res.id); 29 | if(output) { 30 | if(res.stderr !== "" && !_suppressErrorsOnce) { 31 | output.style.display = "block"; 32 | output.innerHTML += '
' + formatOutput(res.stderr) + '
'; 33 | } else { 34 | _suppressErrorsOnce = false; 35 | } 36 | if(res.stdout !== '') { 37 | output.style.display = "block"; 38 | output.innerHTML += '
' + formatOutput(res.stdout) + '
'; 39 | } 40 | } 41 | _cache[res.id](res); 42 | _cache[res.id] = null; 43 | } 44 | }); 45 | _socket.on("updatecontext", function(res) { 46 | Context.updateContext(res); 47 | Autocomplete.setContextFiles(res.files); 48 | }) 49 | _socket.on("error", function(res) { 50 | if(res.stderr && res.stderr !== "") { 51 | exec("error " + res.stderr); 52 | } 53 | }) 54 | } 55 | var init = function() { 56 | connect(); 57 | setTimeout(function() { 58 | retry(); 59 | }, _retryInterval); 60 | } 61 | var retry = function() { 62 | if(!_connected) { 63 | connect(); 64 | setTimeout(function() { 65 | if(++_retryTries < _retryTriesMax) { 66 | retry(); 67 | } 68 | }, _retryInterval); 69 | } 70 | } 71 | var connected = function() { 72 | return _connected; 73 | } 74 | var send = function(command, callback, data, preventResultShowing) { 75 | var id = _.uniqueId("shellcommand"); 76 | if(!preventResultShowing) { 77 | App.setOutputPanelContent('
'); 78 | } 79 | _cache[id] = callback; 80 | _socket.emit("command", _.extend(data || {}, { 81 | command: command, 82 | id: id 83 | })); 84 | } 85 | var formatOutput = function(str) { 86 | return str.replace(/\n/g, '
').replace(/\t/g, '    '); 87 | } 88 | var suppressErrorsOnce = function() { 89 | _suppressErrorsOnce = true; 90 | } 91 | 92 | return { 93 | init: init, 94 | send: send, 95 | connected: connected, 96 | connect: connect, 97 | socket: function() { return _socket; }, 98 | suppressErrorsOnce: suppressErrorsOnce 99 | } 100 | 101 | })(); 102 | 103 | var NoShellError = function(reason) { 104 | exec("\ 105 | error Sorry, there is no back-end running or you misspell the command.\ 106 |
To install the auxilio's nodejs module type:\ 107 |
npm install -g auxilio-backend\n\
108 | auxilio-backend
\ 109 | " + (reason ? "Reason:
" + reason + "
" : "") + "\ 110 | "); 111 | } -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/ext-themelist.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl 5 | * All rights reserved. 6 | * 7 | * Contributed to Ajax.org under the BSD license. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * * Neither the name of Ajax.org B.V. nor the 17 | * names of its contributors may be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * ***** END LICENSE BLOCK ***** */ 32 | 33 | ace.define('ace/ext/themelist', ['require', 'exports', 'module' , 'ace/ext/themelist_utils/themes'], function(require, exports, module) { 34 | module.exports.themes = require('ace/ext/themelist_utils/themes').themes; 35 | module.exports.ThemeDescription = function(name) { 36 | this.name = name; 37 | this.desc = name.split('_' 38 | ).map( 39 | function(namePart) { 40 | return namePart[0].toUpperCase() + namePart.slice(1); 41 | } 42 | ).join(' '); 43 | this.theme = "ace/theme/" + name; 44 | }; 45 | 46 | module.exports.themesByName = {}; 47 | 48 | module.exports.themes = module.exports.themes.map(function(name) { 49 | module.exports.themesByName[name] = new module.exports.ThemeDescription(name); 50 | return module.exports.themesByName[name]; 51 | }); 52 | 53 | }); 54 | 55 | ace.define('ace/ext/themelist_utils/themes', ['require', 'exports', 'module' ], function(require, exports, module) { 56 | 57 | module.exports.themes = [ 58 | "ambiance", 59 | "chaos", 60 | "chrome", 61 | "clouds", 62 | "clouds_midnight", 63 | "cobalt", 64 | "crimson_editor", 65 | "dawn", 66 | "dreamweaver", 67 | "eclipse", 68 | "github", 69 | "idle_fingers", 70 | "kr_theme", 71 | "merbivore", 72 | "merbivore_soft", 73 | "monokai", 74 | "mono_industrial", 75 | "pastel_on_dark", 76 | "solarized_dark", 77 | "solarized_light", 78 | "terminal", 79 | "textmate", 80 | "tomorrow", 81 | "tomorrow_night", 82 | "tomorrow_night_blue", 83 | "tomorrow_night_bright", 84 | "tomorrow_night_eighties", 85 | "twilight", 86 | "vibrant_ink", 87 | "xcode" 88 | ]; 89 | 90 | }); -------------------------------------------------------------------------------- /src/js/content.js: -------------------------------------------------------------------------------- 1 | // helper methods 2 | var filterDOMElements = function(elements, filter) { 3 | if(filter === null || filter === false || typeof filter === "undefined") { 4 | return elements; 5 | } 6 | var filteredElements = []; 7 | var r = new RegExp(filter, "gi"); 8 | for(var i=0; i 0) { 43 | elements[0].click(); 44 | sendResponse({elements: elements.length, raw: getRawOfDOMElements(elements)}); 45 | } else { 46 | sendResponse({elements: 0}); 47 | } 48 | break; 49 | case "pagehighlight": 50 | var elements = filterDOMElements(queryAll(message.selector), message.filter); 51 | sendResponse({elements: elements && elements.length > 0 ? elements.length : 0}); 52 | for(var i=0; i 0 ? elements.length : 0, 68 | raw: getRawOfDOMElements(elements) 69 | }); 70 | break; 71 | } 72 | return true; 73 | }); 74 | 75 | // request 76 | var request = function(url, callback) { 77 | var xhr = new XMLHttpRequest(); 78 | xhr.open("GET", url, true); 79 | xhr.onreadystatechange = function() { 80 | if (xhr.readyState == 4 && xhr.status == 200) { 81 | callback({responseText: xhr.responseText}); 82 | } else if(xhr.readyState == 4) { 83 | callback({error: "Error requesting '" + url + "'."}); 84 | } 85 | } 86 | xhr.send(null); 87 | } 88 | 89 | 90 | // ----------------------------------------------------------------------------------- Boot code 91 | // var onWindowLoad = function() { 92 | 93 | // } 94 | // if(window) { 95 | // if(document && document.readyState == "complete") { 96 | // onWindowLoad(); 97 | // } else { 98 | // window.addEventListener("load", onWindowLoad, true); 99 | // } 100 | // } 101 | -------------------------------------------------------------------------------- /src/js/commands/os/tree.js: -------------------------------------------------------------------------------- 1 | var TreeCommandIsSoketAdded = false; 2 | Commands.register("tree", { 3 | requiredArguments: 0, 4 | lookForQuotes: true, 5 | concatArgs: true, 6 | run: function(args, callback) { 7 | var self = this; 8 | var deep = -1; 9 | var regex = args.length > 0 ? args.shift() : ''; 10 | var suppressdisplay = args.length > 0 ? args.shift() : false; 11 | regex = typeof regex != 'string' ? '' : regex; 12 | if(!isNaN(regex)) { 13 | deep = parseInt(regex); 14 | regex = ''; 15 | } 16 | if(Shell.connected() && Shell.socket()) { 17 | var onTreeDataReceived = function(res) { 18 | Shell.socket().removeListener("tree", onTreeDataReceived); 19 | if(suppressdisplay === false && res.result) { 20 | self.formatResult(res.result, regex, deep); 21 | } 22 | callback(res); 23 | } 24 | Shell.socket().on("tree", onTreeDataReceived); 25 | Shell.socket().emit("tree", {dir: './'}); 26 | } else { 27 | NoShellError("tree: no shell"); 28 | callback(); 29 | } 30 | }, 31 | formatResult: function(dirs, regex, deep) { 32 | 33 | var result = '', 34 | self = this, 35 | id = _.uniqueId("treeoutput"); 36 | r = regex != '' ? new RegExp(regex, 'gi') : false; 37 | 38 | var formatItem = function(name, item, skipIndenting, path, currentDepth) { 39 | if(deep > 0 && currentDepth == deep) { 40 | return ''; 41 | } 42 | var res = '', 43 | visible = regex != '' ? (path + '/' + name).match(r) : true; 44 | res += '
'; 45 | if(typeof item == "object") { // directory 46 | var subfolders = !self.isEmpty(item); 47 | res += '\ 48 | \ 54 | '; 55 | for(var i in item) { 56 | res += formatItem(i, item[i], false, path + name + "/", currentDepth+1); 57 | } 58 | } else { // file 59 | var filePath = (Context.get().replace(/\\/g, '/') + '/' + path + name).replace(/\.\//g, ''); 60 | res += '\ 61 | \ 67 | '; 68 | } 69 | res += '
'; 70 | return res; 71 | } 72 | 73 | for(var name in dirs) { 74 | result += formatItem(name, dirs[name], true, './', 0); 75 | } 76 | 77 | App.setOutputPanelContent('
' + result + '
'); 78 | 79 | }, 80 | isEmpty: function(obj) { 81 | for(var prop in obj) { 82 | if(obj.hasOwnProperty(prop)) 83 | return false; 84 | } 85 | return true; 86 | }, 87 | man: { 88 | desc: 'Shows a directory tree.', 89 | format: 'tree
tree [regex]
tree [deep]
tree [suppressdisplay]', 90 | examples: [ 91 | {text: 'Command line', code: 'tree'}, 92 | {text: 'Showing files by type', code: 'tree \\\.css'}, 93 | {text: 'Showing only two levels', code: 'tree 2'}, 94 | {text: 'Suppress the output to the console', code: 'tree suppressdisplay'}, 95 | {text: 'In script', code: 'tree(2, function(res) {\n\ 96 | console.log(res);\n\ 97 | });'} 98 | ], 99 | returns: 'string', 100 | group: 'os' 101 | } 102 | }) -------------------------------------------------------------------------------- /src/css/fontello.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @font-face { 4 | font-family: 'fontello'; 5 | src: url('../font/fontello.eot?70022626'); 6 | src: url('../font/fontello.eot?70022626#iefix') format('embedded-opentype'), 7 | url('../font/fontello.woff?70022626') format('woff'), 8 | url('../font/fontello.ttf?70022626') format('truetype'), 9 | url('../font/fontello.svg?70022626#fontello') format('svg'); 10 | font-weight: normal; 11 | font-style: normal; 12 | } 13 | /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */ 14 | /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */ 15 | /* 16 | @media screen and (-webkit-min-device-pixel-ratio:0) { 17 | @font-face { 18 | font-family: 'fontello'; 19 | src: url('../font/fontello.svg?70022626#fontello') format('svg'); 20 | } 21 | } 22 | */ 23 | 24 | [class^="icon-"]:before, [class*=" icon-"]:before { 25 | font-family: "fontello"; 26 | font-style: normal; 27 | font-weight: normal; 28 | speak: none; 29 | 30 | display: inline-block; 31 | text-decoration: inherit; 32 | width: 1em; 33 | margin-right: .2em; 34 | text-align: center; 35 | /* opacity: .8; */ 36 | 37 | /* For safety - reset parent styles, that can break glyph codes*/ 38 | font-variant: normal; 39 | text-transform: none; 40 | 41 | /* fix buttons height, for twitter bootstrap */ 42 | line-height: 1em; 43 | 44 | /* Animation center compensation - margins should be symmetric */ 45 | /* remove if not needed */ 46 | margin-left: .2em; 47 | 48 | /* you can be more comfortable with increased icons size */ 49 | /* font-size: 120%; */ 50 | 51 | /* Uncomment for 3D effect */ 52 | /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ 53 | } 54 | 55 | .icon-plus:before { content: '\e80a'; } /* '' */ 56 | .icon-digg:before { content: '\3b'; } /* ';' */ 57 | .icon-home:before { content: '\2302'; } /* '⌂' */ 58 | .icon-right-hand:before { content: '\e804'; } /* '' */ 59 | .icon-menu:before { content: '\2630'; } /* '☰' */ 60 | .icon-attention:before { content: '\e810'; } /* '' */ 61 | .icon-feather:before { content: '\2712'; } /* '✒' */ 62 | .icon-ok:before { content: '\e808'; } /* '' */ 63 | .icon-ok-circled:before { content: '\e809'; } /* '' */ 64 | .icon-cancel:before { content: '\e80e'; } /* '' */ 65 | .icon-cancel-circled:before { content: '\e80d'; } /* '' */ 66 | .icon-plus-circled:before { content: '\e80b'; } /* '' */ 67 | .icon-forward:before { content: '\27a6'; } /* '➦' */ 68 | .icon-right-open:before { content: '\e801'; } /* '' */ 69 | .icon-group-circled:before { content: '\e802'; } /* '' */ 70 | .icon-info-circled:before { content: '\e811'; } /* '' */ 71 | .icon-eye:before { content: '\e814'; } /* '' */ 72 | .icon-reply:before { content: '\e712'; } /* '' */ 73 | .icon-code:before { content: '\e714'; } /* '' */ 74 | .icon-vcard:before { content: '\e722'; } /* '' */ 75 | .icon-address:before { content: '\e723'; } /* '' */ 76 | .icon-rss:before { content: '\e73a'; } /* '' */ 77 | .icon-cc-share:before { content: '\e806'; } /* '' */ 78 | .icon-emo-thumbsup:before { content: '\e807'; } /* '' */ 79 | .icon-link-ext:before { content: '\e80c'; } /* '' */ 80 | .icon-magic:before { content: '\e805'; } /* '' */ 81 | .icon-mail-alt:before { content: '\e803'; } /* '' */ 82 | .icon-user-md:before { content: '\e80f'; } /* '' */ 83 | .icon-github:before { content: '\f300'; } /* '' */ 84 | .icon-twitter:before { content: '\f309'; } /* '' */ 85 | .icon-facebook-squared:before { content: '\f30e'; } /* '' */ 86 | .icon-linkedin:before { content: '\f318'; } /* '' */ 87 | .icon-user:before { content: '👤'; } /* '\1f464' */ 88 | .icon-folder:before { content: '\e813'; } /* '' */ 89 | .icon-folder-open:before { content: '\e812'; } /* '' */ 90 | .icon-pin:before { content: '\e800'; } /* '' */ 91 | .icon-search:before { content: '🔍'; } /* '\1f50d' */ -------------------------------------------------------------------------------- /src/js/commands/os/watch.js: -------------------------------------------------------------------------------- 1 | var WatchHelper = (function() { 2 | 3 | var _isSocketListenerAttached = false; 4 | var _callbacks = {}; 5 | var _initCallback = null; 6 | 7 | var callInitCallback = function() { 8 | if(_initCallback) { 9 | _initCallback(); 10 | } 11 | } 12 | var attachSocketListeners = function() { 13 | if(!_isSocketListenerAttached) { 14 | _isSocketListenerAttached = true; 15 | Shell.socket().on("watch-change", function(res) { 16 | if(_callbacks[res.auxilioId] && _callbacks[res.auxilioId].length > 0) { 17 | var line = _callbacks[res.auxilioId].join(" && "); 18 | if(line != '') { 19 | exec(_callbacks[res.auxilioId].join(" && "), null, res); 20 | } 21 | } 22 | }); 23 | Shell.socket().on("watch-started", function(res) { 24 | exec('success Watcher started (' + res.path + ').'); 25 | callInitCallback(); 26 | }); 27 | Shell.socket().on("watch-stopped", function(res) { 28 | exec('success Watcher stopped (' + res.path + ').'); 29 | callInitCallback(); 30 | }); 31 | Shell.socket().on("watch-list", function(res) { 32 | var watchers = res.watchers ? res.watchers : []; 33 | if(watchers.length == 0) { 34 | exec("info There is no watchers."); 35 | } else { 36 | var str = ''; 37 | for(var i=0; w=watchers[i]; i++) { 38 | str += 'ID: ' + w.id + ', Path: ' + w.path + '
'; 39 | } 40 | exec("info Watchers:
" + str); 41 | } 42 | callInitCallback(); 43 | }); 44 | Shell.socket().on("watch-stopped-all", function(res) { 45 | exec('success All watchers are stopped.'); 46 | callInitCallback(); 47 | }); 48 | } 49 | } 50 | var init = function(data, callback) { 51 | if(Shell.connected() && Shell.socket()) { 52 | attachSocketListeners(); 53 | var auxilioId = _.uniqueId("watch"); 54 | if(data.operation == 'start') { 55 | _callbacks[auxilioId] = data.watchCallback; 56 | } 57 | _initCallback = callback; 58 | Shell.socket().emit("watch", _.extend({auxilioId: auxilioId}, data)); 59 | } else { 60 | NoShellError("watch: no shell"); 61 | callback(); 62 | } 63 | } 64 | 65 | return { 66 | init: init 67 | } 68 | 69 | })(); 70 | 71 | Commands.register("watch", { 72 | requiredArguments: 0, 73 | format: '
',
 74 | 	lookForQuotes: true,
 75 | 	concatArgs: true,
 76 | 	run: function(args, callback) {
 77 | 		var operation = args.length > 0 ? args.shift() : 'list';
 78 | 		var parameter = args.length > 0 ? args.shift() : '';
 79 | 		var watchCallback = args.length > 0 ? args.shift() : '';
 80 | 		if(operation != 'list' && operation != 'start' && operation != 'stop' && operation != 'stopall') {
 81 | 			exec("error Wrong watch operation. User start, stop or stopall. Type man watch to get more information.")
 82 | 			callback();
 83 | 		} else {
 84 | 			if(watchCallback.indexOf(",") >= 0) {
 85 | 				watchCallback = watchCallback.replace(/, /g, ',').split(',');
 86 | 			} else {
 87 | 				watchCallback = [watchCallback];
 88 | 			}
 89 | 			WatchHelper.init({
 90 | 				operation: operation,
 91 | 				parameter: parameter,
 92 | 				watchCallback: watchCallback
 93 | 			}, callback);
 94 | 		}
 95 | 	},
 96 | 	man: {
 97 | 		desc: 'Watch directory or file for changes.',
 98 | 		format: 'watch [operation] [id or path] [callback command]',
 99 | 		examples: [
100 | 			{text: 'Get the current watchers and their ids', code: 'watch'},
101 | 			{text: 'Start watching', code: 'watch start ./ echo'},
102 | 			{text: 'Start watching and call multiple callbacks', code: 'watch start ./ "jshint, echo"'},
103 | 			{text: 'Stop watcher', code: 'watch stop 1'},
104 | 			{text: 'Stop all watchers', code: 'watch stopall'},
105 | 			{text: 'In script', code: 'watch("start", "./", "echo", function(res) {\n\
106 | 	console.log(res);\n\
107 | });'}
108 | 		],
109 | 		returns: 'string',
110 | 		group: 'os'
111 | 	}	
112 | })


--------------------------------------------------------------------------------
/src/js/commands/common/man.js:
--------------------------------------------------------------------------------
  1 | Commands.register("man", {
  2 | 	requiredArguments: 0,
  3 | 	run: function(args, callback) {
  4 | 		var commandToViewName = args.shift();
  5 | 		if(commandToViewName) {
  6 | 			if(commandToViewName === "exporttomarkdown") {
  7 | 				var groups = this.getCommandsSortedByGroup();
  8 | 				var markdown = '# Auxilio commands\n\n';
  9 | 				for(var groupName in groups) {
 10 | 					markdown += '- - -\n\n';
 11 | 					markdown += '## ' + groupName + '\n\n';
 12 | 					for(var i=0; command = groups[groupName][i]; i++) {
 13 | 						markdown += '### ' + command.name + "\n\n";
 14 | 						markdown += command.man.desc + "\n\n";
 15 | 						markdown += "  - format: " + command.man.format + "\n";
 16 | 						markdown += "  - returns: " + command.man.returns + "\n";
 17 | 						markdown += "\n#### Examples:\n\n";
 18 | 						for(var j=0; example = command.man.examples[j]; j++) {
 19 | 							var code = example.code.replace(/\n";
 22 | 						}
 23 | 					}
 24 | 				}
 25 | 				writefile("commands.md", markdown, callback);
 26 | 				return;
 27 | 			} else {
 28 | 				for(var commandName in Commands) {
 29 | 					var r = new RegExp(commandToViewName, "g");
 30 | 					if(commandName != "get" && commandName != "register" && commandName.match(r)) {
 31 | 						this.showCommand(commandName);
 32 | 					}
 33 | 				}
 34 | 			}
 35 | 		} else {
 36 | 			var groups = this.getCommandsSortedByGroup();
 37 | 			var markup = '

Auxilio manual pages

'; 38 | for(var groupName in groups) { 39 | markup += '
'; 40 | markup += '

' + groupName + '

'; 41 | for(var i=0; command = groups[groupName][i]; i++) { 42 | markup += '' + command.name + '
'; 43 | } 44 | markup += '
'; 45 | } 46 | markup += '
'; 47 | markup += '
'; 48 | exec("echo " + markup, function() { 49 | var links = document.querySelectorAll(".man-group-link"); 50 | for(var i=0; link=links[i]; i++) { 51 | link.addEventListener("click", function(e) { 52 | exec("man " + e.target.getAttribute("data")); 53 | }) 54 | } 55 | }); 56 | } 57 | callback(); 58 | }, 59 | getCommandsSortedByGroup: function() { 60 | var groups = {} 61 | for(var commandName in Commands) { 62 | var c = Commands[commandName]; 63 | if(c.man && c.man.group) { 64 | if(!groups[c.man.group]) groups[c.man.group] = []; 65 | groups[c.man.group].push({name: commandName, man: c.man}); 66 | } 67 | } 68 | return groups; 69 | }, 70 | showCommand:function(commandName) { 71 | var c = Commands.get(commandName); 72 | var manual = c.man; 73 | if(typeof manual === 'object') { 74 | var examples = ''; 75 | for(var i=0; e = manual.examples[i]; i++) { 76 | examples += e.text != '' ? '

' + e.text + '

': ''; 77 | examples += '
' + e.code + '
'; 78 | } 79 | var markup = '\ 80 |
\ 81 |
\ 82 |

' + commandName + '

\ 83 |

' + manual.desc + '

\ 84 |

Format:

\ 85 |

' + manual.format + '

\ 86 |

Returns:

\ 87 |

' + manual.returns + '

\ 88 |
\ 89 |
\ 90 |

Examples:

\ 91 | ' + examples + '\ 92 |
\ 93 |
\ 94 |
\ 95 | '; 96 | App.setOutputPanelContent(markup); 97 | } 98 | }, 99 | man: { 100 | desc: 'Shows manual page about available commands.', 101 | format: 'man
man [regex | name of a command]
man exporttomarkdown', 102 | examples: [ 103 | {text: 'Command line', code: 'man'} 104 | ], 105 | returns: 'Manual page/s', 106 | group: 'common' 107 | } 108 | }); -------------------------------------------------------------------------------- /src/js/commands/data/alias.js: -------------------------------------------------------------------------------- 1 | Commands.register("alias", { 2 | requiredArguments: 0, 3 | lookForQuotes: false, 4 | concatArgs: true, 5 | aliases: {}, 6 | run: function(args, callback) { 7 | var name = args.length > 0 ? args.shift() : null; 8 | var aliasValue = args.length > 0 ? args.join(" ").replace(/\\n/g, '\n') : null; 9 | var self = this; 10 | aliases = {}; 11 | if(name === "clearallplease") { 12 | this.storeAliases(callback) 13 | return; 14 | } 15 | if(name === "exportallplease") { 16 | this.exportAliases(callback) 17 | return; 18 | } 19 | exec("storage get aliases", function(data) { 20 | if(data.aliases && data.aliases != "") { 21 | self.aliases = JSON.parse(data.aliases); 22 | } 23 | if(name) { 24 | var currentValue = self.aliases[name] || ''; 25 | if(aliasValue) { 26 | self.aliases[name] = aliasValue; 27 | self.storeAliases(callback); 28 | } else { 29 | exec('formtextarea "alias:' + name + '" ' + currentValue, function(newValue) { 30 | if(newValue == null) { callback(); return; } 31 | if(newValue === '') { delete self.aliases[name]; } 32 | else { self.aliases[name] = newValue; } 33 | self.storeAliases(callback); 34 | }); 35 | } 36 | } else { 37 | var str = ''; 38 | var names = []; 39 | for(var i in self.aliases) { 40 | names.push(i); 41 | } 42 | names.sort(); 43 | for(var i=0; a = names[i]; i++) { 44 | str += '' + a + ' '; 45 | str += '
'; 46 | } 47 | if(str != '') { 48 | exec('echo ' + str); 49 | setTimeout(function() { 50 | var links = document.querySelectorAll(".js-alias-list-link"); 51 | for(var i=0; link=links[i]; i++) { 52 | link.addEventListener("click", function(e) { 53 | exec(e.target.getAttribute("data")); 54 | }); 55 | } 56 | var linksView = document.querySelectorAll(".js-alias-list-link-view"); 57 | for(var i=0; linkView=linksView[i]; i++) { 58 | (function(data, linkView) { 59 | linkView.addEventListener("click", function(e) { 60 | linkView.innerHTML = '
' + self.aliases[data] + '
'; 61 | }); 62 | })(linkView.getAttribute("data"), linkView); 63 | } 64 | }, 100); 65 | } else { 66 | exec('info No data.'); 67 | } 68 | callback(); 69 | } 70 | }); 71 | }, 72 | storeAliases: function(callback) { 73 | exec("storage put aliases " + JSON.stringify(this.aliases), function() { 74 | exec('success Aliases saved succesfully.', function() { 75 | App.registerAliases(); 76 | callback(); 77 | }); 78 | }); 79 | }, 80 | exportAliases: function(callback) { 81 | exec("storage get aliases", function(data) { 82 | var result = ''; 83 | if(data.aliases && data.aliases != "") { 84 | self.aliases = JSON.parse(data.aliases); 85 | var names = []; 86 | for(var i in self.aliases) { 87 | names.push(i); 88 | } 89 | names.sort(); 90 | for(var i=0; name=names[i]; i++) { 91 | result += 'alias ' + name + ' ' + self.aliases[name].toString().replace(/\n/g, "\\n") + '\n'; 92 | } 93 | } 94 | callback(result); 95 | }); 96 | }, 97 | man: { 98 | desc: 'Managing aliases.', 99 | format: 'alias [name] [value]', 100 | examples: [ 101 | {text: 'Showing current added aliases', code: 'alias'}, 102 | {text: 'Opening an editor for adding alias', code: 'alias my-alias-name'}, 103 | {text: 'Directly pass the content of the alias', code: 'alias my-alias-name date && echo'}, 104 | {text: 'Clearing all aliases', code: 'alias clearallplease'}, 105 | {text: 'Exporting all aliases', code: 'alias exportallplease'}, 106 | {text: 'Command line (chaining)', code: 'readfile showing-date.aux && exec'}, 107 | {text: 'In script', code: 'alias(\'"my-alias-name"\', "date && echo", function() {\n\ 108 | console.log("Alias added.");\n\ 109 | })'} 110 | ], 111 | returns: 'Check the examples.', 112 | group: 'data' 113 | } 114 | }) -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/mode-properties.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/properties', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/properties_highlight_rules'], function(require, exports, module) { 32 | 33 | 34 | var oop = require("../lib/oop"); 35 | var TextMode = require("./text").Mode; 36 | var Tokenizer = require("../tokenizer").Tokenizer; 37 | var PropertiesHighlightRules = require("./properties_highlight_rules").PropertiesHighlightRules; 38 | 39 | var Mode = function() { 40 | var highlighter = new PropertiesHighlightRules(); 41 | this.$tokenizer = new Tokenizer(highlighter.getRules()); 42 | }; 43 | oop.inherits(Mode, TextMode); 44 | 45 | exports.Mode = Mode; 46 | }); 47 | 48 | ace.define('ace/mode/properties_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 49 | 50 | 51 | var oop = require("../lib/oop"); 52 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 53 | 54 | var PropertiesHighlightRules = function() { 55 | 56 | var escapeRe = /\\u[0-9a-fA-F]{4}|\\/; 57 | 58 | this.$rules = { 59 | "start" : [ 60 | { 61 | token : "comment", 62 | regex : /[!#].*$/ 63 | }, { 64 | token : "keyword", 65 | regex : /[=:]$/ 66 | }, { 67 | token : "keyword", 68 | regex : /[=:]/, 69 | next : "value" 70 | }, { 71 | token : "constant.language.escape", 72 | regex : escapeRe, 73 | }, { 74 | defaultToken: "variable" 75 | } 76 | ], 77 | "value" : [ 78 | { 79 | regex : /\\$/, 80 | token : "string", 81 | next : "value" 82 | }, { 83 | regex : /$/, 84 | token : "string", 85 | next : "start" 86 | }, { 87 | token : "constant.language.escape", 88 | regex : escapeRe 89 | }, { 90 | defaultToken: "string" 91 | } 92 | ] 93 | }; 94 | 95 | }; 96 | 97 | oop.inherits(PropertiesHighlightRules, TextHighlightRules); 98 | 99 | exports.PropertiesHighlightRules = PropertiesHighlightRules; 100 | }); 101 | 102 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-eclipse.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/eclipse', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | 34 | exports.isDark = false; 35 | exports.cssText = ".ace-eclipse .ace_gutter {\ 36 | background: #ebebeb;\ 37 | border-right: 1px solid rgb(159, 159, 159);\ 38 | color: rgb(136, 136, 136);\ 39 | }\ 40 | .ace-eclipse .ace_print-margin {\ 41 | width: 1px;\ 42 | background: #ebebeb;\ 43 | }\ 44 | .ace-eclipse {\ 45 | background-color: #FFFFFF;\ 46 | }\ 47 | .ace-eclipse .ace_fold {\ 48 | background-color: rgb(60, 76, 114);\ 49 | }\ 50 | .ace-eclipse .ace_cursor {\ 51 | border-left: 2px solid black;\ 52 | }\ 53 | .ace-eclipse .ace_storage,\ 54 | .ace-eclipse .ace_keyword,\ 55 | .ace-eclipse .ace_variable {\ 56 | color: rgb(127, 0, 85);\ 57 | }\ 58 | .ace-eclipse .ace_constant.ace_buildin {\ 59 | color: rgb(88, 72, 246);\ 60 | }\ 61 | .ace-eclipse .ace_constant.ace_library {\ 62 | color: rgb(6, 150, 14);\ 63 | }\ 64 | .ace-eclipse .ace_function {\ 65 | color: rgb(60, 76, 114);\ 66 | }\ 67 | .ace-eclipse .ace_string {\ 68 | color: rgb(42, 0, 255);\ 69 | }\ 70 | .ace-eclipse .ace_comment {\ 71 | color: rgb(113, 150, 130);\ 72 | }\ 73 | .ace-eclipse .ace_comment.ace_doc {\ 74 | color: rgb(63, 95, 191);\ 75 | }\ 76 | .ace-eclipse .ace_comment.ace_doc.ace_tag {\ 77 | color: rgb(127, 159, 191);\ 78 | }\ 79 | .ace-eclipse .ace_constant.ace_numeric {\ 80 | color: darkblue;\ 81 | }\ 82 | .ace-eclipse .ace_tag {\ 83 | color: rgb(25, 118, 116);\ 84 | }\ 85 | .ace-eclipse .ace_type {\ 86 | color: rgb(127, 0, 127);\ 87 | }\ 88 | .ace-eclipse .ace_xml-pe {\ 89 | color: rgb(104, 104, 91);\ 90 | }\ 91 | .ace-eclipse .ace_marker-layer .ace_selection {\ 92 | background: rgb(181, 213, 255);\ 93 | }\ 94 | .ace-eclipse .ace_marker-layer .ace_bracket {\ 95 | margin: -1px 0 0 -1px;\ 96 | border: 1px solid rgb(192, 192, 192);\ 97 | }\ 98 | .ace-eclipse .ace_meta.ace_tag {\ 99 | color:rgb(25, 118, 116);\ 100 | }\ 101 | .ace-eclipse .ace_invisible {\ 102 | color: #ddd;\ 103 | }\ 104 | .ace-eclipse .ace_entity.ace_other.ace_attribute-name {\ 105 | color:rgb(127, 0, 127);\ 106 | }\ 107 | .ace-eclipse .ace_marker-layer .ace_step {\ 108 | background: rgb(255, 255, 0);\ 109 | }\ 110 | .ace-eclipse .ace_marker-layer .ace_active-line {\ 111 | background: rgb(232, 242, 254);\ 112 | }\ 113 | .ace-eclipse .ace_marker-layer .ace_selected-word {\ 114 | border: 1px solid rgb(181, 213, 255);\ 115 | }\ 116 | .ace-eclipse .ace_indent-guide {\ 117 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ 118 | }"; 119 | 120 | exports.cssClass = "ace-eclipse"; 121 | 122 | var dom = require("../lib/dom"); 123 | dom.importCssString(exports.cssText, exports.cssClass); 124 | }); 125 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-xcode.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/xcode', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | exports.isDark = false; 34 | exports.cssClass = "ace-xcode"; 35 | exports.cssText = "/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */\ 36 | .ace-xcode .ace_gutter {\ 37 | background: #e8e8e8;\ 38 | color: #333\ 39 | }\ 40 | .ace-xcode .ace_print-margin {\ 41 | width: 1px;\ 42 | background: #e8e8e8\ 43 | }\ 44 | .ace-xcode {\ 45 | background-color: #FFFFFF;\ 46 | color: #000000\ 47 | }\ 48 | .ace-xcode .ace_cursor {\ 49 | border-left: 2px solid #000000\ 50 | }\ 51 | .ace-xcode .ace_overwrite-cursors .ace_cursor {\ 52 | border-left: 0px;\ 53 | border-bottom: 1px solid #000000\ 54 | }\ 55 | .ace-xcode .ace_marker-layer .ace_selection {\ 56 | background: #B5D5FF\ 57 | }\ 58 | .ace-xcode.ace_multiselect .ace_selection.ace_start {\ 59 | box-shadow: 0 0 3px 0px #FFFFFF;\ 60 | border-radius: 2px\ 61 | }\ 62 | .ace-xcode .ace_marker-layer .ace_step {\ 63 | background: rgb(198, 219, 174)\ 64 | }\ 65 | .ace-xcode .ace_marker-layer .ace_bracket {\ 66 | margin: -1px 0 0 -1px;\ 67 | border: 1px solid #BFBFBF\ 68 | }\ 69 | .ace-xcode .ace_marker-layer .ace_active-line {\ 70 | background: rgba(0, 0, 0, 0.071)\ 71 | }\ 72 | .ace-xcode .ace_gutter-active-line {\ 73 | background-color: rgba(0, 0, 0, 0.071)\ 74 | }\ 75 | .ace-xcode .ace_marker-layer .ace_selected-word {\ 76 | border: 1px solid #B5D5FF\ 77 | }\ 78 | .ace-xcode .ace_constant.ace_language,\ 79 | .ace-xcode .ace_keyword,\ 80 | .ace-xcode .ace_meta,\ 81 | .ace-xcode .ace_variable.ace_language {\ 82 | color: #C800A4\ 83 | }\ 84 | .ace-xcode .ace_invisible {\ 85 | color: #BFBFBF\ 86 | }\ 87 | .ace-xcode .ace_constant.ace_character,\ 88 | .ace-xcode .ace_constant.ace_other {\ 89 | color: #275A5E\ 90 | }\ 91 | .ace-xcode .ace_constant.ace_numeric {\ 92 | color: #3A00DC\ 93 | }\ 94 | .ace-xcode .ace_entity.ace_other.ace_attribute-name,\ 95 | .ace-xcode .ace_support.ace_constant,\ 96 | .ace-xcode .ace_support.ace_function {\ 97 | color: #450084\ 98 | }\ 99 | .ace-xcode .ace_fold {\ 100 | background-color: #C800A4;\ 101 | border-color: #000000\ 102 | }\ 103 | .ace-xcode .ace_entity.ace_name.ace_tag,\ 104 | .ace-xcode .ace_support.ace_class,\ 105 | .ace-xcode .ace_support.ace_type {\ 106 | color: #790EAD\ 107 | }\ 108 | .ace-xcode .ace_storage {\ 109 | color: #C900A4\ 110 | }\ 111 | .ace-xcode .ace_string {\ 112 | color: #DF0002\ 113 | }\ 114 | .ace-xcode .ace_comment {\ 115 | color: #008E00\ 116 | }\ 117 | .ace-xcode .ace_indent-guide {\ 118 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y\ 119 | }"; 120 | 121 | var dom = require("../lib/dom"); 122 | dom.importCssString(exports.cssText, exports.cssClass); 123 | }); 124 | -------------------------------------------------------------------------------- /src/css/Tetris.css: -------------------------------------------------------------------------------- 1 | #tetris { 2 | position: relative; 3 | width: 300px; 4 | height: 310px; 5 | padding: 10px; 6 | margin: 0 auto; 7 | } 8 | 9 | /*** left ***/ 10 | 11 | #tetris .left { 12 | width: 130px; 13 | float: left; 14 | } 15 | #tetris .left h1 { 16 | font-size: 11px; 17 | text-align: center; 18 | } 19 | #tetris .left h1 a { 20 | color: #000; 21 | text-decoration: none; 22 | } 23 | #tetris .left h1 a:hover { 24 | color: #FF6600; 25 | text-decoration: none; 26 | } 27 | 28 | /* menu */ 29 | 30 | #tetris .left .menu { 31 | text-align: center; 32 | display: block; 33 | } 34 | #tetris .left input { 35 | font: 10px tahoma; 36 | color: #333333; 37 | text-transform: uppercase; 38 | background: #EAE0D1; 39 | } 40 | #tetris .left .menu input { 41 | width: 90px; 42 | } 43 | 44 | /* keyboard */ 45 | 46 | #tetris .left .keyboard { 47 | width: 85px; 48 | height: 55px; 49 | overflow: visible; 50 | display: none; 51 | } 52 | #tetris .left .keyboard input { 53 | font: 11px tahoma; 54 | width: 25px; 55 | height: 25px; 56 | padding-bottom: 2px; 57 | text-transform: none; 58 | } 59 | * html #tetris .left .keyboard input { 60 | padding-left: 1px; 61 | } 62 | #tetris .left .keyboard .up { 63 | position: absolute; 64 | left: 30px; 65 | top: 0px; 66 | width: 30px; 67 | height: 30px; 68 | } 69 | #tetris .left .keyboard .up input { 70 | font: 15px tahoma; 71 | padding-top: 3px; 72 | } 73 | #tetris .left .keyboard .down { 74 | position: absolute; 75 | left: 30px; 76 | top: 30px; 77 | width: 30px; 78 | height: 30px; 79 | } 80 | #tetris .left .keyboard .down input { 81 | font: 14px tahoma; 82 | } 83 | #tetris .left .keyboard .left { 84 | position: absolute; 85 | left: 0px; 86 | top: 30px; 87 | width: 30px; 88 | height: 30px; 89 | } 90 | #tetris .left .keyboard .right { 91 | position: absolute; 92 | left: 60px; 93 | top: 30px; 94 | width: 30px; 95 | height: 30px; 96 | } 97 | 98 | /* game over */ 99 | 100 | #tetris-gameover { 101 | position: absolute; 102 | width: 100%; 103 | top: 50%; 104 | text-align: center; 105 | font-weight: bold; 106 | display: none; 107 | } 108 | 109 | /* next puzzle */ 110 | #tetris-nextpuzzle { 111 | display: block; 112 | overflow: visible; 113 | position: absolute; 114 | top: 8px; 115 | left: 311px; 116 | } 117 | 118 | /* stats */ 119 | 120 | #tetris .left .stats { 121 | display: block; 122 | margin: 10px auto; 123 | text-align: center; 124 | } 125 | /*** area ***/ 126 | 127 | #tetris-area { 128 | background: #FFFFFF; 129 | position: absolute; 130 | width: 168px; 131 | height: 308px; 132 | left: 131px; 133 | top: 1px; 134 | overflow: hidden; 135 | } 136 | #tetris .block0, 137 | #tetris .block1, 138 | #tetris .block2, 139 | #tetris .block3, 140 | #tetris .block4, 141 | #tetris .block5, 142 | #tetris .block6 { 143 | position: absolute; 144 | width: 13px; 145 | height: 13px; 146 | border: 0.5px solid #ffffff; 147 | /* with margin 0.5px there were problems with offsetLeft and offsetTop */ 148 | } 149 | #tetris .block0, 150 | #tetris .block1 { 151 | background: #6699FF; 152 | } 153 | #tetris .block2, 154 | #tetris .block3 { 155 | background: #FF6600; 156 | } 157 | #tetris .block4 { 158 | background: #FFAC1C; 159 | } 160 | #tetris .block5 { 161 | background: #BAA68E; 162 | } 163 | #tetris .block6 { 164 | background: #FF0000; 165 | } 166 | 167 | /*** window ***/ 168 | 169 | #tetris .window { 170 | background: #EFE8DE; 171 | position: absolute; 172 | width: 168px; 173 | height: 308px; 174 | left: 131px; 175 | top: 1px; 176 | z-index: 5; 177 | display: none; 178 | } 179 | #tetris .window .top { 180 | position: relative; 181 | background: #EAE0D1; 182 | color: #666666; 183 | font: 10px tahoma; 184 | letter-spacing: +1px; 185 | height: 20px; 186 | line-height: 20px; 187 | vertical-align: middle; 188 | border-bottom: 1px solid #ffffff; 189 | text-indent: 10px; 190 | } 191 | #tetris .window .top .close { 192 | position: absolute; 193 | background: #EAE0D1; 194 | font: 11px verdana; 195 | font-weight: bold; 196 | right: 0px; 197 | top: 0px; 198 | height: 20px; 199 | line-height: 19px; 200 | text-indent: 7px; 201 | width: 21px; 202 | border-left: 1px solid #ffffff; 203 | cursor: pointer; 204 | } 205 | #tetris .window .top .close:hover { 206 | background: #EFE8DE; 207 | } 208 | #tetris .window .content { 209 | font: 10px tahoma; 210 | margin: 10px; 211 | } -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/mode-sql.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/sql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sql_highlight_rules', 'ace/range'], function(require, exports, module) { 32 | 33 | 34 | var oop = require("../lib/oop"); 35 | var TextMode = require("./text").Mode; 36 | var Tokenizer = require("../tokenizer").Tokenizer; 37 | var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules; 38 | var Range = require("../range").Range; 39 | 40 | var Mode = function() { 41 | this.$tokenizer = new Tokenizer(new SqlHighlightRules().getRules()); 42 | }; 43 | oop.inherits(Mode, TextMode); 44 | 45 | (function() { 46 | 47 | this.lineCommentStart = "--"; 48 | 49 | }).call(Mode.prototype); 50 | 51 | exports.Mode = Mode; 52 | 53 | }); 54 | 55 | ace.define('ace/mode/sql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 56 | 57 | 58 | var oop = require("../lib/oop"); 59 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 60 | 61 | var SqlHighlightRules = function() { 62 | 63 | var keywords = ( 64 | "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" + 65 | "when|else|end|type|left|right|join|on|outer|desc|asc" 66 | ); 67 | 68 | var builtinConstants = ( 69 | "true|false|null" 70 | ); 71 | 72 | var builtinFunctions = ( 73 | "count|min|max|avg|sum|rank|now|coalesce" 74 | ); 75 | 76 | var keywordMapper = this.createKeywordMapper({ 77 | "support.function": builtinFunctions, 78 | "keyword": keywords, 79 | "constant.language": builtinConstants 80 | }, "identifier", true); 81 | 82 | this.$rules = { 83 | "start" : [ { 84 | token : "comment", 85 | regex : "--.*$" 86 | }, { 87 | token : "string", // " string 88 | regex : '".*?"' 89 | }, { 90 | token : "string", // ' string 91 | regex : "'.*?'" 92 | }, { 93 | token : "constant.numeric", // float 94 | regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" 95 | }, { 96 | token : keywordMapper, 97 | regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" 98 | }, { 99 | token : "keyword.operator", 100 | regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" 101 | }, { 102 | token : "paren.lparen", 103 | regex : "[\\(]" 104 | }, { 105 | token : "paren.rparen", 106 | regex : "[\\)]" 107 | }, { 108 | token : "text", 109 | regex : "\\s+" 110 | } ] 111 | }; 112 | }; 113 | 114 | oop.inherits(SqlHighlightRules, TextHighlightRules); 115 | 116 | exports.SqlHighlightRules = SqlHighlightRules; 117 | }); 118 | 119 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-clouds.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/clouds', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | exports.isDark = false; 34 | exports.cssClass = "ace-clouds"; 35 | exports.cssText = ".ace-clouds .ace_gutter {\ 36 | background: #ebebeb;\ 37 | color: #333\ 38 | }\ 39 | .ace-clouds .ace_print-margin {\ 40 | width: 1px;\ 41 | background: #e8e8e8\ 42 | }\ 43 | .ace-clouds {\ 44 | background-color: #FFFFFF;\ 45 | color: #000000\ 46 | }\ 47 | .ace-clouds .ace_cursor {\ 48 | border-left: 2px solid #000000\ 49 | }\ 50 | .ace-clouds .ace_overwrite-cursors .ace_cursor {\ 51 | border-left: 0px;\ 52 | border-bottom: 1px solid #000000\ 53 | }\ 54 | .ace-clouds .ace_marker-layer .ace_selection {\ 55 | background: #BDD5FC\ 56 | }\ 57 | .ace-clouds.ace_multiselect .ace_selection.ace_start {\ 58 | box-shadow: 0 0 3px 0px #FFFFFF;\ 59 | border-radius: 2px\ 60 | }\ 61 | .ace-clouds .ace_marker-layer .ace_step {\ 62 | background: rgb(255, 255, 0)\ 63 | }\ 64 | .ace-clouds .ace_marker-layer .ace_bracket {\ 65 | margin: -1px 0 0 -1px;\ 66 | border: 1px solid #BFBFBF\ 67 | }\ 68 | .ace-clouds .ace_marker-layer .ace_active-line {\ 69 | background: #FFFBD1\ 70 | }\ 71 | .ace-clouds .ace_gutter-active-line {\ 72 | background-color : #dcdcdc\ 73 | }\ 74 | .ace-clouds .ace_marker-layer .ace_selected-word {\ 75 | border: 1px solid #BDD5FC\ 76 | }\ 77 | .ace-clouds .ace_invisible {\ 78 | color: #BFBFBF\ 79 | }\ 80 | .ace-clouds .ace_keyword,\ 81 | .ace-clouds .ace_meta,\ 82 | .ace-clouds .ace_support.ace_constant.ace_property-value {\ 83 | color: #AF956F\ 84 | }\ 85 | .ace-clouds .ace_keyword.ace_operator {\ 86 | color: #484848\ 87 | }\ 88 | .ace-clouds .ace_keyword.ace_other.ace_unit {\ 89 | color: #96DC5F\ 90 | }\ 91 | .ace-clouds .ace_constant.ace_language {\ 92 | color: #39946A\ 93 | }\ 94 | .ace-clouds .ace_constant.ace_numeric {\ 95 | color: #46A609\ 96 | }\ 97 | .ace-clouds .ace_constant.ace_character.ace_entity {\ 98 | color: #BF78CC\ 99 | }\ 100 | .ace-clouds .ace_invalid {\ 101 | background-color: #FF002A\ 102 | }\ 103 | .ace-clouds .ace_fold {\ 104 | background-color: #AF956F;\ 105 | border-color: #000000\ 106 | }\ 107 | .ace-clouds .ace_storage,\ 108 | .ace-clouds .ace_support.ace_class,\ 109 | .ace-clouds .ace_support.ace_function,\ 110 | .ace-clouds .ace_support.ace_other,\ 111 | .ace-clouds .ace_support.ace_type {\ 112 | color: #C52727\ 113 | }\ 114 | .ace-clouds .ace_string {\ 115 | color: #5D90CD\ 116 | }\ 117 | .ace-clouds .ace_comment {\ 118 | color: #BCC8BA\ 119 | }\ 120 | .ace-clouds .ace_entity.ace_name.ace_tag,\ 121 | .ace-clouds .ace_entity.ace_other.ace_attribute-name {\ 122 | color: #606060\ 123 | }\ 124 | .ace-clouds .ace_markup.ace_underline {\ 125 | text-decoration: underline\ 126 | }\ 127 | .ace-clouds .ace_indent-guide {\ 128 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y\ 129 | }"; 130 | 131 | var dom = require("../lib/dom"); 132 | dom.importCssString(exports.cssText, exports.cssClass); 133 | }); 134 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/ext-static_highlight.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/ext/static_highlight', ['require', 'exports', 'module' , 'ace/edit_session', 'ace/layer/text', 'ace/config'], function(require, exports, module) { 32 | 33 | 34 | var EditSession = require("../edit_session").EditSession; 35 | var TextLayer = require("../layer/text").Text; 36 | var baseStyles = ".ace_editor {\ 37 | font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;\ 38 | font-size: 12px;\ 39 | }\ 40 | .ace_editor .ace_gutter {\ 41 | width: 25px !important;\ 42 | display: block;\ 43 | float: left;\ 44 | text-align: right;\ 45 | padding: 0 3px 0 0;\ 46 | margin-right: 3px;\ 47 | }\ 48 | .ace_line { clear: both; }\ 49 | *.ace_gutter-cell {\ 50 | -moz-user-select: -moz-none;\ 51 | -khtml-user-select: none;\ 52 | -webkit-user-select: none;\ 53 | user-select: none;\ 54 | }"; 55 | var config = require("../config"); 56 | 57 | exports.render = function(input, mode, theme, lineStart, disableGutter, callback) { 58 | var waiting = 0 59 | if (typeof theme == "string") { 60 | waiting++; 61 | config.loadModule(['theme', theme], function(m) { 62 | theme = m; 63 | --waiting || done(); 64 | }); 65 | } 66 | 67 | if (typeof mode == "string") { 68 | waiting++; 69 | config.loadModule(['mode', mode], function(m) { 70 | mode = new m.Mode() 71 | --waiting || done(); 72 | }); 73 | } 74 | function done() { 75 | var result = exports.renderSync(input, mode, theme, lineStart, disableGutter); 76 | return callback ? callback(result) : result; 77 | } 78 | return waiting || done(); 79 | }; 80 | 81 | exports.renderSync = function(input, mode, theme, lineStart, disableGutter) { 82 | lineStart = parseInt(lineStart || 1, 10); 83 | 84 | var session = new EditSession(""); 85 | session.setUseWorker(false); 86 | session.setMode(mode); 87 | 88 | var textLayer = new TextLayer(document.createElement("div")); 89 | textLayer.setSession(session); 90 | textLayer.config = { 91 | characterWidth: 10, 92 | lineHeight: 20 93 | }; 94 | 95 | session.setValue(input); 96 | 97 | var stringBuilder = []; 98 | var length = session.getLength(); 99 | 100 | for(var ix = 0; ix < length; ix++) { 101 | stringBuilder.push("
"); 102 | if (!disableGutter) 103 | stringBuilder.push("" + (ix + lineStart) + ""); 104 | textLayer.$renderLine(stringBuilder, ix, true, false); 105 | stringBuilder.push("
"); 106 | } 107 | var html = "
\ 108 |
\ 109 | :code\ 110 |
\ 111 |
".replace(/:cssClass/, theme.cssClass).replace(/:code/, stringBuilder.join("")); 112 | 113 | textLayer.destroy(); 114 | 115 | return { 116 | css: baseStyles + theme.cssText, 117 | html: html 118 | }; 119 | }; 120 | 121 | }); 122 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-vibrant_ink.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/vibrant_ink', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | exports.isDark = true; 34 | exports.cssClass = "ace-vibrant-ink"; 35 | exports.cssText = ".ace-vibrant-ink .ace_gutter {\ 36 | background: #1a1a1a;\ 37 | color: #BEBEBE\ 38 | }\ 39 | .ace-vibrant-ink .ace_print-margin {\ 40 | width: 1px;\ 41 | background: #1a1a1a\ 42 | }\ 43 | .ace-vibrant-ink {\ 44 | background-color: #0F0F0F;\ 45 | color: #FFFFFF\ 46 | }\ 47 | .ace-vibrant-ink .ace_cursor {\ 48 | border-left: 2px solid #FFFFFF\ 49 | }\ 50 | .ace-vibrant-ink .ace_overwrite-cursors .ace_cursor {\ 51 | border-left: 0px;\ 52 | border-bottom: 1px solid #FFFFFF\ 53 | }\ 54 | .ace-vibrant-ink .ace_marker-layer .ace_selection {\ 55 | background: #6699CC\ 56 | }\ 57 | .ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {\ 58 | box-shadow: 0 0 3px 0px #0F0F0F;\ 59 | border-radius: 2px\ 60 | }\ 61 | .ace-vibrant-ink .ace_marker-layer .ace_step {\ 62 | background: rgb(102, 82, 0)\ 63 | }\ 64 | .ace-vibrant-ink .ace_marker-layer .ace_bracket {\ 65 | margin: -1px 0 0 -1px;\ 66 | border: 1px solid #404040\ 67 | }\ 68 | .ace-vibrant-ink .ace_marker-layer .ace_active-line {\ 69 | background: #333333\ 70 | }\ 71 | .ace-vibrant-ink .ace_gutter-active-line {\ 72 | background-color: #333333\ 73 | }\ 74 | .ace-vibrant-ink .ace_marker-layer .ace_selected-word {\ 75 | border: 1px solid #6699CC\ 76 | }\ 77 | .ace-vibrant-ink .ace_invisible {\ 78 | color: #404040\ 79 | }\ 80 | .ace-vibrant-ink .ace_keyword,\ 81 | .ace-vibrant-ink .ace_meta {\ 82 | color: #FF6600\ 83 | }\ 84 | .ace-vibrant-ink .ace_constant,\ 85 | .ace-vibrant-ink .ace_constant.ace_character,\ 86 | .ace-vibrant-ink .ace_constant.ace_character.ace_escape,\ 87 | .ace-vibrant-ink .ace_constant.ace_other {\ 88 | color: #339999\ 89 | }\ 90 | .ace-vibrant-ink .ace_constant.ace_numeric {\ 91 | color: #99CC99\ 92 | }\ 93 | .ace-vibrant-ink .ace_invalid,\ 94 | .ace-vibrant-ink .ace_invalid.ace_deprecated {\ 95 | color: #CCFF33;\ 96 | background-color: #000000\ 97 | }\ 98 | .ace-vibrant-ink .ace_fold {\ 99 | background-color: #FFCC00;\ 100 | border-color: #FFFFFF\ 101 | }\ 102 | .ace-vibrant-ink .ace_entity.ace_name.ace_function,\ 103 | .ace-vibrant-ink .ace_support.ace_function,\ 104 | .ace-vibrant-ink .ace_variable {\ 105 | color: #FFCC00\ 106 | }\ 107 | .ace-vibrant-ink .ace_variable.ace_parameter {\ 108 | font-style: italic\ 109 | }\ 110 | .ace-vibrant-ink .ace_string {\ 111 | color: #66FF00\ 112 | }\ 113 | .ace-vibrant-ink .ace_string.ace_regexp {\ 114 | color: #44B4CC\ 115 | }\ 116 | .ace-vibrant-ink .ace_comment {\ 117 | color: #9933CC\ 118 | }\ 119 | .ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\ 120 | font-style: italic;\ 121 | color: #99CC99\ 122 | }\ 123 | .ace-vibrant-ink .ace_indent-guide {\ 124 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y;\ 125 | }"; 126 | 127 | var dom = require("../lib/dom"); 128 | dom.importCssString(exports.cssText, exports.cssClass); 129 | }); 130 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-merbivore.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/merbivore', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | exports.isDark = true; 34 | exports.cssClass = "ace-merbivore"; 35 | exports.cssText = ".ace-merbivore .ace_gutter {\ 36 | background: #202020;\ 37 | color: #E6E1DC\ 38 | }\ 39 | .ace-merbivore .ace_print-margin {\ 40 | width: 1px;\ 41 | background: #555651\ 42 | }\ 43 | .ace-merbivore {\ 44 | background-color: #161616;\ 45 | color: #E6E1DC\ 46 | }\ 47 | .ace-merbivore .ace_cursor {\ 48 | border-left: 2px solid #FFFFFF\ 49 | }\ 50 | .ace-merbivore .ace_overwrite-cursors .ace_cursor {\ 51 | border-left: 0px;\ 52 | border-bottom: 1px solid #FFFFFF\ 53 | }\ 54 | .ace-merbivore .ace_marker-layer .ace_selection {\ 55 | background: #454545\ 56 | }\ 57 | .ace-merbivore.ace_multiselect .ace_selection.ace_start {\ 58 | box-shadow: 0 0 3px 0px #161616;\ 59 | border-radius: 2px\ 60 | }\ 61 | .ace-merbivore .ace_marker-layer .ace_step {\ 62 | background: rgb(102, 82, 0)\ 63 | }\ 64 | .ace-merbivore .ace_marker-layer .ace_bracket {\ 65 | margin: -1px 0 0 -1px;\ 66 | border: 1px solid #404040\ 67 | }\ 68 | .ace-merbivore .ace_marker-layer .ace_active-line {\ 69 | background: #333435\ 70 | }\ 71 | .ace-merbivore .ace_gutter-active-line {\ 72 | background-color: #333435\ 73 | }\ 74 | .ace-merbivore .ace_marker-layer .ace_selected-word {\ 75 | border: 1px solid #454545\ 76 | }\ 77 | .ace-merbivore .ace_invisible {\ 78 | color: #404040\ 79 | }\ 80 | .ace-merbivore .ace_entity.ace_name.ace_tag,\ 81 | .ace-merbivore .ace_keyword,\ 82 | .ace-merbivore .ace_meta,\ 83 | .ace-merbivore .ace_meta.ace_tag,\ 84 | .ace-merbivore .ace_storage,\ 85 | .ace-merbivore .ace_support.ace_function {\ 86 | color: #FC6F09\ 87 | }\ 88 | .ace-merbivore .ace_constant,\ 89 | .ace-merbivore .ace_constant.ace_character,\ 90 | .ace-merbivore .ace_constant.ace_character.ace_escape,\ 91 | .ace-merbivore .ace_constant.ace_other,\ 92 | .ace-merbivore .ace_support.ace_type {\ 93 | color: #1EDAFB\ 94 | }\ 95 | .ace-merbivore .ace_constant.ace_character.ace_escape {\ 96 | color: #519F50\ 97 | }\ 98 | .ace-merbivore .ace_constant.ace_language {\ 99 | color: #FDC251\ 100 | }\ 101 | .ace-merbivore .ace_constant.ace_library,\ 102 | .ace-merbivore .ace_string,\ 103 | .ace-merbivore .ace_support.ace_constant {\ 104 | color: #8DFF0A\ 105 | }\ 106 | .ace-merbivore .ace_constant.ace_numeric {\ 107 | color: #58C554\ 108 | }\ 109 | .ace-merbivore .ace_invalid {\ 110 | color: #FFFFFF;\ 111 | background-color: #990000\ 112 | }\ 113 | .ace-merbivore .ace_fold {\ 114 | background-color: #FC6F09;\ 115 | border-color: #E6E1DC\ 116 | }\ 117 | .ace-merbivore .ace_comment {\ 118 | font-style: italic;\ 119 | color: #AD2EA4\ 120 | }\ 121 | .ace-merbivore .ace_entity.ace_other.ace_attribute-name {\ 122 | color: #FFFF89\ 123 | }\ 124 | .ace-merbivore .ace_markup.ace_underline {\ 125 | text-decoration: underline\ 126 | }\ 127 | .ace-merbivore .ace_indent-guide {\ 128 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y;\ 129 | }"; 130 | 131 | var dom = require("../lib/dom"); 132 | dom.importCssString(exports.cssText, exports.cssClass); 133 | }); 134 | -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/mode-ada.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/ada', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ada_highlight_rules', 'ace/range'], function(require, exports, module) { 32 | 33 | 34 | var oop = require("../lib/oop"); 35 | var TextMode = require("./text").Mode; 36 | var Tokenizer = require("../tokenizer").Tokenizer; 37 | var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules; 38 | var Range = require("../range").Range; 39 | 40 | var Mode = function() { 41 | this.$tokenizer = new Tokenizer(new AdaHighlightRules().getRules()); 42 | }; 43 | oop.inherits(Mode, TextMode); 44 | 45 | (function() { 46 | 47 | this.lineCommentStart = "--"; 48 | 49 | }).call(Mode.prototype); 50 | 51 | exports.Mode = Mode; 52 | 53 | }); 54 | 55 | ace.define('ace/mode/ada_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 56 | 57 | 58 | var oop = require("../lib/oop"); 59 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 60 | 61 | var AdaHighlightRules = function() { 62 | var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" + 63 | "access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" + 64 | "array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" + 65 | "body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" + 66 | "|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor"; 67 | 68 | var builtinConstants = ( 69 | "true|false|null" 70 | ); 71 | 72 | var builtinFunctions = ( 73 | "count|min|max|avg|sum|rank|now|coalesce|main" 74 | ); 75 | 76 | var keywordMapper = this.createKeywordMapper({ 77 | "support.function": builtinFunctions, 78 | "keyword": keywords, 79 | "constant.language": builtinConstants 80 | }, "identifier", true); 81 | 82 | this.$rules = { 83 | "start" : [ { 84 | token : "comment", 85 | regex : "--.*$" 86 | }, { 87 | token : "string", // " string 88 | regex : '".*?"' 89 | }, { 90 | token : "string", // ' string 91 | regex : "'.*?'" 92 | }, { 93 | token : "constant.numeric", // float 94 | regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" 95 | }, { 96 | token : keywordMapper, 97 | regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" 98 | }, { 99 | token : "keyword.operator", 100 | regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" 101 | }, { 102 | token : "paren.lparen", 103 | regex : "[\\(]" 104 | }, { 105 | token : "paren.rparen", 106 | regex : "[\\)]" 107 | }, { 108 | token : "text", 109 | regex : "\\s+" 110 | } ] 111 | }; 112 | }; 113 | 114 | oop.inherits(AdaHighlightRules, TextHighlightRules); 115 | 116 | exports.AdaHighlightRules = AdaHighlightRules; 117 | }); -------------------------------------------------------------------------------- /src/js/vendor/ace/src-noconflict/theme-github.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/github', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | exports.isDark = false; 34 | exports.cssClass = "ace-github"; 35 | exports.cssText = "/* CSS style content from github's default pygments highlighter template.\ 36 | Cursor and selection styles from textmate.css. */\ 37 | .ace-github .ace_gutter {\ 38 | background: #e8e8e8;\ 39 | color: #AAA;\ 40 | }\ 41 | .ace-github {\ 42 | background: #fff;\ 43 | color: #000;\ 44 | }\ 45 | .ace-github .ace_keyword {\ 46 | font-weight: bold;\ 47 | }\ 48 | .ace-github .ace_string {\ 49 | color: #D14;\ 50 | }\ 51 | .ace-github .ace_variable.ace_class {\ 52 | color: teal;\ 53 | }\ 54 | .ace-github .ace_constant.ace_numeric {\ 55 | color: #099;\ 56 | }\ 57 | .ace-github .ace_constant.ace_buildin {\ 58 | color: #0086B3;\ 59 | }\ 60 | .ace-github .ace_support.ace_function {\ 61 | color: #0086B3;\ 62 | }\ 63 | .ace-github .ace_comment {\ 64 | color: #998;\ 65 | font-style: italic;\ 66 | }\ 67 | .ace-github .ace_variable.ace_language {\ 68 | color: #0086B3;\ 69 | }\ 70 | .ace-github .ace_paren {\ 71 | font-weight: bold;\ 72 | }\ 73 | .ace-github .ace_boolean {\ 74 | font-weight: bold;\ 75 | }\ 76 | .ace-github .ace_string.ace_regexp {\ 77 | color: #009926;\ 78 | font-weight: normal;\ 79 | }\ 80 | .ace-github .ace_variable.ace_instance {\ 81 | color: teal;\ 82 | }\ 83 | .ace-github .ace_constant.ace_language {\ 84 | font-weight: bold;\ 85 | }\ 86 | .ace-github .ace_cursor {\ 87 | border-left: 2px solid black;\ 88 | }\ 89 | .ace-github .ace_overwrite-cursors .ace_cursor {\ 90 | border-left: 0px;\ 91 | border-bottom: 1px solid black;\ 92 | }\ 93 | .ace-github .ace_marker-layer .ace_active-line {\ 94 | background: rgb(255, 255, 204);\ 95 | }\ 96 | .ace-github .ace_marker-layer .ace_selection {\ 97 | background: rgb(181, 213, 255);\ 98 | }\ 99 | .ace-github.ace_multiselect .ace_selection.ace_start {\ 100 | box-shadow: 0 0 3px 0px white;\ 101 | border-radius: 2px;\ 102 | }\ 103 | /* bold keywords cause cursor issues for some fonts */\ 104 | /* this disables bold style for editor and keeps for static highlighter */\ 105 | .ace-github.ace_nobold .ace_line > span {\ 106 | font-weight: normal !important;\ 107 | }\ 108 | .ace-github .ace_marker-layer .ace_step {\ 109 | background: rgb(252, 255, 0);\ 110 | }\ 111 | .ace-github .ace_marker-layer .ace_stack {\ 112 | background: rgb(164, 229, 101);\ 113 | }\ 114 | .ace-github .ace_marker-layer .ace_bracket {\ 115 | margin: -1px 0 0 -1px;\ 116 | border: 1px solid rgb(192, 192, 192);\ 117 | }\ 118 | .ace-github .ace_gutter-active-line {\ 119 | background-color : rgba(0, 0, 0, 0.07);\ 120 | }\ 121 | .ace-github .ace_marker-layer .ace_selected-word {\ 122 | background: rgb(250, 250, 255);\ 123 | border: 1px solid rgb(200, 200, 250);\ 124 | }\ 125 | .ace-github .ace_print-margin {\ 126 | width: 1px;\ 127 | background: #e8e8e8;\ 128 | }\ 129 | .ace-github .ace_indent-guide {\ 130 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ 131 | }"; 132 | 133 | var dom = require("../lib/dom"); 134 | dom.importCssString(exports.cssText, exports.cssClass); 135 | }); 136 | --------------------------------------------------------------------------------