├── .gitignore ├── Better-Tray-Menu ├── LICENSE ├── README.md ├── main │ ├── index.html │ ├── script.js │ └── style.css ├── package.json ├── start.html └── tray.png ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── camera ├── app.css ├── app.html ├── app.js ├── jquery.js └── package.json ├── custom-tray-menu ├── README.md ├── custom-tray-menu.html ├── custom_tray_menu.js ├── index.html ├── index.js ├── main.css ├── package.json └── tray.png ├── file-explorer ├── README.md ├── about.html ├── bootstrap │ ├── css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ └── js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── icons │ ├── blank.png │ ├── compressed.png │ ├── css.png │ ├── developer.png │ ├── excel.png │ ├── fireworks.png │ ├── flash.png │ ├── folder.png │ ├── html.png │ ├── illustrator.png │ ├── image.png │ ├── keynote.png │ ├── movie.png │ ├── music.png │ ├── numbers.png │ ├── pages.png │ ├── pdf.png │ ├── photoshop.png │ ├── powerpoint.png │ ├── text.png │ └── word.png ├── images │ └── htmlbg.png ├── index.html ├── js │ └── jquery-1.7.2.js ├── main.js ├── node_modules │ ├── address_bar.js │ ├── folder_view.js │ ├── jade │ │ ├── index.js │ │ ├── lib │ │ │ ├── compiler.js │ │ │ ├── doctypes.js │ │ │ ├── filters.js │ │ │ ├── index.js │ │ │ ├── inline-tags.js │ │ │ ├── jade.js │ │ │ ├── lexer.js │ │ │ ├── nodes │ │ │ │ ├── attrs.js │ │ │ │ ├── block-comment.js │ │ │ │ ├── block.js │ │ │ │ ├── case.js │ │ │ │ ├── code.js │ │ │ │ ├── comment.js │ │ │ │ ├── doctype.js │ │ │ │ ├── each.js │ │ │ │ ├── filter.js │ │ │ │ ├── index.js │ │ │ │ ├── literal.js │ │ │ │ ├── mixin.js │ │ │ │ ├── node.js │ │ │ │ ├── tag.js │ │ │ │ └── text.js │ │ │ ├── parser.js │ │ │ ├── runtime.js │ │ │ ├── self-closing.js │ │ │ └── utils.js │ │ └── package.json │ ├── mime.js │ └── underscore.js ├── package.json └── style.css ├── frameless-window ├── README.md ├── bottom-titlebar.png ├── button_close.png ├── button_close_hover.png ├── frameless_window.html ├── frameless_window.js ├── icon_128.png ├── left-titlebar.png ├── package.json ├── right-titlebar.png ├── style.css ├── titlebar.js └── top-titlebar.png ├── menus ├── README.md ├── imgs │ ├── apple.png │ ├── banaba.png │ ├── cut.png │ ├── disk.png │ ├── edit.png │ ├── email.png │ ├── pear.png │ ├── play.png │ ├── strawberry.png │ └── tick.png ├── index.html ├── package.json └── script.js ├── mini-code-edit ├── README.md ├── assets │ ├── icon-128.png │ ├── screenshot-640x400.png │ └── tile-440x280.png ├── cm │ ├── LICENSE │ ├── README.md │ ├── demo │ │ ├── activeline.html │ │ ├── changemode.html │ │ ├── closetag.html │ │ ├── complete.html │ │ ├── emacs.html │ │ ├── folding.html │ │ ├── formatting.html │ │ ├── fullscreen.html │ │ ├── loadmode.html │ │ ├── marker.html │ │ ├── matchhighlighter.html │ │ ├── mustache.html │ │ ├── preview.html │ │ ├── resize.html │ │ ├── runmode.html │ │ ├── search.html │ │ ├── theme.html │ │ ├── vim.html │ │ └── visibletabs.html │ ├── doc │ │ ├── baboon.png │ │ ├── baboon_vector.svg │ │ ├── compress.html │ │ ├── docs.css │ │ ├── internals.html │ │ ├── manual.html │ │ ├── oldrelease.html │ │ ├── reporting.html │ │ └── upgrade_v2.2.html │ ├── index.html │ ├── keymap │ │ ├── emacs.js │ │ └── vim.js │ ├── lib │ │ ├── codemirror.css │ │ ├── codemirror.js │ │ └── util │ │ │ ├── closetag.js │ │ │ ├── dialog.css │ │ │ ├── dialog.js │ │ │ ├── foldcode.js │ │ │ ├── formatting.js │ │ │ ├── javascript-hint.js │ │ │ ├── loadmode.js │ │ │ ├── match-highlighter.js │ │ │ ├── overlay.js │ │ │ ├── runmode.js │ │ │ ├── search.js │ │ │ ├── searchcursor.js │ │ │ ├── simple-hint.css │ │ │ └── simple-hint.js │ ├── mode │ │ ├── clike │ │ │ ├── clike.js │ │ │ └── index.html │ │ ├── clojure │ │ │ ├── clojure.js │ │ │ └── index.html │ │ ├── coffeescript │ │ │ ├── LICENSE │ │ │ ├── coffeescript.js │ │ │ └── index.html │ │ ├── css │ │ │ ├── css.js │ │ │ └── index.html │ │ ├── diff │ │ │ ├── diff.js │ │ │ └── index.html │ │ ├── ecl │ │ │ ├── ecl.js │ │ │ └── index.html │ │ ├── erlang │ │ │ ├── erlang.js │ │ │ └── index.html │ │ ├── gfm │ │ │ ├── gfm.js │ │ │ └── index.html │ │ ├── go │ │ │ ├── go.js │ │ │ └── index.html │ │ ├── groovy │ │ │ ├── groovy.js │ │ │ └── index.html │ │ ├── haskell │ │ │ ├── haskell.js │ │ │ └── index.html │ │ ├── htmlembedded │ │ │ ├── htmlembedded.js │ │ │ └── index.html │ │ ├── htmlmixed │ │ │ ├── htmlmixed.js │ │ │ └── index.html │ │ ├── javascript │ │ │ ├── index.html │ │ │ └── javascript.js │ │ ├── jinja2 │ │ │ ├── index.html │ │ │ └── jinja2.js │ │ ├── less │ │ │ ├── index.html │ │ │ └── less.js │ │ ├── lua │ │ │ ├── index.html │ │ │ └── lua.js │ │ ├── markdown │ │ │ ├── index.html │ │ │ └── markdown.js │ │ ├── mysql │ │ │ ├── index.html │ │ │ └── mysql.js │ │ ├── ntriples │ │ │ ├── index.html │ │ │ └── ntriples.js │ │ ├── pascal │ │ │ ├── LICENSE │ │ │ ├── index.html │ │ │ └── pascal.js │ │ ├── perl │ │ │ ├── LICENSE │ │ │ ├── index.html │ │ │ └── perl.js │ │ ├── php │ │ │ ├── index.html │ │ │ └── php.js │ │ ├── pig │ │ │ ├── index.html │ │ │ └── pig.js │ │ ├── plsql │ │ │ ├── index.html │ │ │ └── plsql.js │ │ ├── properties │ │ │ ├── index.html │ │ │ └── properties.js │ │ ├── python │ │ │ ├── LICENSE.txt │ │ │ ├── index.html │ │ │ └── python.js │ │ ├── r │ │ │ ├── LICENSE │ │ │ ├── index.html │ │ │ └── r.js │ │ ├── rpm │ │ │ ├── changes │ │ │ │ ├── changes.js │ │ │ │ └── index.html │ │ │ └── spec │ │ │ │ ├── index.html │ │ │ │ ├── spec.css │ │ │ │ └── spec.js │ │ ├── rst │ │ │ ├── index.html │ │ │ └── rst.js │ │ ├── ruby │ │ │ ├── LICENSE │ │ │ ├── index.html │ │ │ └── ruby.js │ │ ├── rust │ │ │ ├── index.html │ │ │ └── rust.js │ │ ├── scheme │ │ │ ├── index.html │ │ │ └── scheme.js │ │ ├── shell │ │ │ ├── index.html │ │ │ └── shell.js │ │ ├── smalltalk │ │ │ ├── index.html │ │ │ └── smalltalk.js │ │ ├── smarty │ │ │ ├── index.html │ │ │ └── smarty.js │ │ ├── sparql │ │ │ ├── index.html │ │ │ └── sparql.js │ │ ├── stex │ │ │ ├── index.html │ │ │ ├── stex.js │ │ │ └── test.html │ │ ├── tiddlywiki │ │ │ ├── index.html │ │ │ ├── tiddlywiki.css │ │ │ └── tiddlywiki.js │ │ ├── tiki │ │ │ ├── index.html │ │ │ ├── tiki.css │ │ │ └── tiki.js │ │ ├── vbscript │ │ │ ├── index.html │ │ │ └── vbscript.js │ │ ├── velocity │ │ │ ├── index.html │ │ │ └── velocity.js │ │ ├── verilog │ │ │ ├── index.html │ │ │ └── verilog.js │ │ ├── xml │ │ │ ├── index.html │ │ │ └── xml.js │ │ ├── xquery │ │ │ ├── LICENSE │ │ │ ├── index.html │ │ │ ├── test │ │ │ │ ├── index.html │ │ │ │ ├── testBase.js │ │ │ │ ├── testEmptySequenceKeyword.js │ │ │ │ ├── testMultiAttr.js │ │ │ │ ├── testNamespaces.js │ │ │ │ ├── testProcessingInstructions.js │ │ │ │ └── testQuotes.js │ │ │ └── xquery.js │ │ └── yaml │ │ │ ├── index.html │ │ │ └── yaml.js │ ├── test │ │ ├── index.html │ │ ├── mode_test.css │ │ ├── mode_test.js │ │ └── test.js │ └── theme │ │ ├── ambiance.css │ │ ├── blackboard.css │ │ ├── cobalt.css │ │ ├── eclipse.css │ │ ├── elegant.css │ │ ├── erlang-dark.css │ │ ├── lesser-dark.css │ │ ├── monokai.css │ │ ├── neat.css │ │ ├── night.css │ │ ├── rubyblue.css │ │ └── xq-dark.css ├── editor.js ├── img │ ├── 128x128 │ │ └── file_edit.png │ ├── 16x16 │ │ ├── diskette.png │ │ ├── file.png │ │ ├── file_add.png │ │ └── file_edit.png │ ├── 32x32 │ │ ├── diskette.png │ │ ├── file.png │ │ ├── file_add.png │ │ └── file_edit.png │ ├── 48x48 │ │ └── file_edit.png │ ├── 64x64 │ │ └── file_edit.png │ └── README.txt ├── main.html ├── package.json ├── style.css └── zepto.min.js ├── mp3-encoder ├── Cakefile ├── README.md ├── index.html ├── lib │ ├── main.js │ └── nwjs_extras.js ├── package.json ├── src │ ├── main.coffee │ ├── utils │ │ └── encoder.coffee │ └── views │ │ └── form.coffee └── vendor │ ├── bin │ ├── osx │ │ └── shineenc │ └── win32 │ │ ├── libshine-1.dll │ │ └── shineenc.exe │ └── js │ ├── backbone.js │ ├── jquery.js │ └── underscore.js ├── notifications ├── README.md ├── app.css ├── app.html ├── app.js ├── icons │ ├── camera.png │ ├── car.png │ └── coffee.png ├── mac_files │ ├── app.icns │ └── app.plist ├── package-lock.json └── package.json ├── package-lock.json ├── package.json └── webgl ├── README.md ├── icon_128.png ├── img ├── button_close.png └── button_close_hover.png ├── index.html ├── js ├── Detector.js ├── nwjs_extras.js ├── showlogo3d.js └── three.min.js ├── obj └── html5rocks.js ├── package.json └── styles └── main.css /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | node_modules -------------------------------------------------------------------------------- /Better-Tray-Menu/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 JPL42 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Better-Tray-Menu/README.md: -------------------------------------------------------------------------------- 1 | # Better Tray Menu 2 | 3 | ## Overview 4 | Starts the application silently (in the tray). The main window can be opened by clicking the tray. 5 | 6 | ## Running 7 | ``` 8 | git clone https://github.com/jpl42/Better-Tray-Menu.git 9 | nw nw-sample-apps/Better-Tray-Menu/ 10 | ``` 11 | 12 | ## Disable Frameless Window 13 | Change `frame` to `true` in `package.json`. Remove anything relating to `window-button`, `exit-button` and `minimize-button` in the files `main/index.html`, `main/style.css` and `main/script.js`. 14 | 15 | ## APIs 16 | * [Tray](https://github.com/nwjs/nw.js/wiki/Tray) 17 | * [Window](https://github.com/nwjs/nw.js/wiki/Window) 18 | -------------------------------------------------------------------------------- /Better-Tray-Menu/main/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Window Title
8 | × 9 | - 10 | 11 |
12 |

Example Text

13 |
14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Better-Tray-Menu/main/script.js: -------------------------------------------------------------------------------- 1 | var gui = require('nw.gui'); 2 | var win = gui.Window.get(); 3 | 4 | $("#exit-button").click( function() { 5 | win.close(); 6 | }); 7 | 8 | $("#minimize-button").click( function() { 9 | win.minimize(); 10 | }); -------------------------------------------------------------------------------- /Better-Tray-Menu/main/style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | header { 6 | -webkit-app-region: drag; 7 | -webkit-user-select: none; 8 | height: 20px; 9 | position: fixed; 10 | top: 0; 11 | right: 0; 12 | background-color: gray; 13 | left: 0; 14 | text-align: center; 15 | padding: 5px; 16 | } 17 | main { 18 | width: 100%; 19 | height: 100%; 20 | display: block; 21 | margin-top: 30px; 22 | } 23 | main p { 24 | padding: 5px; 25 | } 26 | .window-button { 27 | -webkit-app-region: no-drag; 28 | position: fixed; 29 | top: 0; 30 | display: block; 31 | height: 30px; 32 | width: 30px; 33 | text-align: center; 34 | font-size: 26px; 35 | font-weight: bold; 36 | cursor: pointer; 37 | opacity: 0.7; 38 | z-index: 1; 39 | } 40 | .window-button:hover { 41 | opacity: 1; 42 | } 43 | #exit-button { 44 | right: 0; 45 | background-color: red; 46 | color: white; 47 | } 48 | #minimize-button { 49 | right: 30px; 50 | background-color: blue; 51 | color: white; 52 | } -------------------------------------------------------------------------------- /Better-Tray-Menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Better-Tray-Menu", 3 | "main": "start.html", 4 | "window": { 5 | "show": false, 6 | "frame": false, 7 | "toolbar": false 8 | }, 9 | "webkit": { 10 | "plugin": true 11 | } 12 | } -------------------------------------------------------------------------------- /Better-Tray-Menu/start.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /Better-Tray-Menu/tray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/Better-Tray-Menu/tray.png -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @ayushmanchhabra 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 NW.js Utilities 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NW.js Sample apps 2 | 3 | ## Getting Started 4 | 5 | 1. Clone/Fork/Download repo 6 | 1. `npm install` to node modules 7 | 1. `npm start [dir name]` to start a project 8 | 1. For example, `npm start file-explorer` 9 | -------------------------------------------------------------------------------- /camera/app.css: -------------------------------------------------------------------------------- 1 | html, body, video { 2 | height: 100%; 3 | width: 100%; 4 | margin: 0; 5 | } 6 | 7 | video { 8 | display: block; 9 | } 10 | -------------------------------------------------------------------------------- /camera/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Camera Test 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /camera/app.js: -------------------------------------------------------------------------------- 1 | var gui = require('nw.gui'); 2 | 3 | // Extend application menu for Mac OS 4 | if (process.platform == "darwin") { 5 | var menu = new gui.Menu({type: "menubar"}); 6 | menu.createMacBuiltin && menu.createMacBuiltin(window.document.title); 7 | gui.Window.get().menu = menu; 8 | } 9 | 10 | navigator.webkitGetUserMedia({video: true}, 11 | function(stream) { 12 | document.getElementById('camera').src = URL.createObjectURL(stream); 13 | }, 14 | function() { 15 | alert('could not connect stream'); 16 | } 17 | ); 18 | 19 | gui.Window.get().show(); 20 | -------------------------------------------------------------------------------- /camera/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nw-demo", 3 | "main": "app.html", 4 | "window": { 5 | "show": false, 6 | "frame": true, 7 | "position": "center", 8 | "width": 500, 9 | "height": 500 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /custom-tray-menu/README.md: -------------------------------------------------------------------------------- 1 | ## Custom tray menu 2 | 3 | It shows custom menu when click tray icon. 4 | 5 | **How to run:** 6 | 7 | ``` 8 | git clone git@github.com:zcbenz/nw-sample-apps.git 9 | nw nw-sample-apps/custom-tray-menu 10 | ``` 11 | 12 | ![custom-tray-menu screenshot](https://cloud.githubusercontent.com/assets/26019/7777492/b46bd738-00ed-11e5-8e9b-45d981cc4b0c.png) 13 | 14 | 15 | ## APIs 16 | 17 | * [Tray](https://github.com/nwjs/nw.js/wiki/Tray) 18 | * [Window](https://github.com/nwjs/nw.js/wiki/Window) 19 | * [Screen](https://github.com/nwjs/nw.js/wiki/Screen) 20 | -------------------------------------------------------------------------------- /custom-tray-menu/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NW.js Custom Tray Menu 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 |
Custom Tray Menu Example
13 | 14 | 15 |
16 | 17 |
18 | 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /custom-tray-menu/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var gui = require('nw.gui'); 4 | var CustomTrayMenu = require('./custom_tray_menu'); 5 | 6 | // Extend application menu for Mac OS 7 | if (process.platform == "darwin") { 8 | var menu = new gui.Menu({type: "menubar"}); 9 | menu.createMacBuiltin && menu.createMacBuiltin(window.document.title); 10 | gui.Window.get().menu = menu; 11 | } 12 | 13 | var $ = function (selector) { 14 | return document.querySelector(selector); 15 | } 16 | 17 | var customTray; 18 | 19 | document.addEventListener('DOMContentLoaded', function() { 20 | $('#add-tray').addEventListener('click', function () { 21 | if (!customTray) { 22 | customTray = new CustomTrayMenu('custom-tray-menu.html', 'tray.png', { 23 | width: 185, 24 | height: 143 25 | }); 26 | } 27 | }); 28 | 29 | $('#remove-tray').addEventListener('click', function () { 30 | if (customTray) { 31 | customTray.remove(); 32 | customTray = undefined; 33 | } 34 | }); 35 | 36 | // bring window to front when open via terminal 37 | gui.Window.get().focus(); 38 | 39 | // for nw-notify frameless windows 40 | gui.Window.get().on('close', function() { 41 | gui.App.quit(); 42 | }); 43 | }); 44 | 45 | var writeLog = function (msg, type) { 46 | var logElement = $("#output"); 47 | logElement.innerHTML += `${msg}
`; 48 | logElement.scrollTop = logElement.scrollHeight; 49 | }; 50 | 51 | process.on('log', function (message) { 52 | writeLog(message); 53 | }); 54 | 55 | // print error message in log window 56 | process.on("uncaughtException", function(exception) { 57 | var stack = exception.stack.split("\n"); 58 | stack.forEach(function (line) { 59 | writeLog(line, 'error'); 60 | process.stdout.write(String(line) + "\n"); 61 | }); 62 | }); 63 | -------------------------------------------------------------------------------- /custom-tray-menu/main.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | width: 100%; 4 | margin: 0; 5 | font-family: Helvetica Neue, Lucida Grande, Segoe UI, Tahoma, sans; 6 | font-size: 16px; 7 | background: #EDEDED; 8 | } 9 | 10 | section { 11 | padding: 1em 1em 0; 12 | } 13 | 14 | section .buttons-group { 15 | margin-bottom: 1em; 16 | } 17 | 18 | section .buttons-group h5 { 19 | margin-top: 0; 20 | margin-bottom: 0.65em; 21 | } 22 | 23 | #output { 24 | margin-top: 20px; 25 | box-sizing: border-box; 26 | padding: 5px; 27 | font-size: 12px; 28 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 29 | background: #fff; 30 | border: 1px solid #BEBEBE; 31 | height: 248px; 32 | max-height: 248px; 33 | overflow: auto; 34 | } 35 | 36 | #output span.error { 37 | color: red; 38 | } -------------------------------------------------------------------------------- /custom-tray-menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nw-custom-tray-window", 3 | "main": "index.html", 4 | "window": { 5 | "show": true, 6 | "frame": true, 7 | "toolbar": true, 8 | "icon": "app.icns", 9 | "width": 550, 10 | "height": 348 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /custom-tray-menu/tray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/custom-tray-menu/tray.png -------------------------------------------------------------------------------- /file-explorer/README.md: -------------------------------------------------------------------------------- 1 | # File Explorer 2 | 3 | A simple file explorer implemented with node.js modules, you can navigate through 4 | folders and open files. 5 | 6 | ## Screen shot 7 | 8 | ![screenshot](http://ww4.sinaimg.cn/large/6556d357tw1dxui6m0i9kj.jpg) 9 | 10 | ## APIs 11 | 12 | * [fs module](http://nodejs.org/api/fs.html) 13 | * [events module](http://nodejs.org/api/events.html) 14 | * [path module](http://nodejs.org/api/path.html) 15 | * [util module](http://nodejs.org/api/util.html) 16 | * [child_process module](http://nodejs.org/api/child_process.html) 17 | -------------------------------------------------------------------------------- /file-explorer/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | about FileExpolorer 4 | 15 | 16 | 17 |
18 |

FileExpolorer sample app

19 | https://github.com/zcbenz/nw-sample-apps 20 |
21 | 22 | -------------------------------------------------------------------------------- /file-explorer/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /file-explorer/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /file-explorer/icons/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/blank.png -------------------------------------------------------------------------------- /file-explorer/icons/compressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/compressed.png -------------------------------------------------------------------------------- /file-explorer/icons/css.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/css.png -------------------------------------------------------------------------------- /file-explorer/icons/developer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/developer.png -------------------------------------------------------------------------------- /file-explorer/icons/excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/excel.png -------------------------------------------------------------------------------- /file-explorer/icons/fireworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/fireworks.png -------------------------------------------------------------------------------- /file-explorer/icons/flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/flash.png -------------------------------------------------------------------------------- /file-explorer/icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/folder.png -------------------------------------------------------------------------------- /file-explorer/icons/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/html.png -------------------------------------------------------------------------------- /file-explorer/icons/illustrator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/illustrator.png -------------------------------------------------------------------------------- /file-explorer/icons/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/image.png -------------------------------------------------------------------------------- /file-explorer/icons/keynote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/keynote.png -------------------------------------------------------------------------------- /file-explorer/icons/movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/movie.png -------------------------------------------------------------------------------- /file-explorer/icons/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/music.png -------------------------------------------------------------------------------- /file-explorer/icons/numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/numbers.png -------------------------------------------------------------------------------- /file-explorer/icons/pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/pages.png -------------------------------------------------------------------------------- /file-explorer/icons/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/pdf.png -------------------------------------------------------------------------------- /file-explorer/icons/photoshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/photoshop.png -------------------------------------------------------------------------------- /file-explorer/icons/powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/powerpoint.png -------------------------------------------------------------------------------- /file-explorer/icons/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/text.png -------------------------------------------------------------------------------- /file-explorer/icons/word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/icons/word.png -------------------------------------------------------------------------------- /file-explorer/images/htmlbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/file-explorer/images/htmlbg.png -------------------------------------------------------------------------------- /file-explorer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | File Explorer 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 35 |
36 | 37 |
38 |
39 | 40 |
41 |
42 |
    43 |
    44 |
    45 |
    46 | 47 | 48 | -------------------------------------------------------------------------------- /file-explorer/main.js: -------------------------------------------------------------------------------- 1 | global.$ = $; 2 | 3 | var abar = require('address_bar'); 4 | var folder_view = require('folder_view'); 5 | var gui = require('nw.gui'); 6 | 7 | // Extend application menu for Mac OS 8 | if (process.platform == "darwin") { 9 | var menu = new gui.Menu({type: "menubar"}); 10 | menu.createMacBuiltin && menu.createMacBuiltin(window.document.title); 11 | gui.Window.get().menu = menu; 12 | } 13 | 14 | var App = { 15 | // show "about" window 16 | about: function () { 17 | var params = {toolbar: false, resizable: false, show: true, height: 120, width: 350}; 18 | var aboutWindow = gui.Window.open('about.html', params); 19 | aboutWindow.on('document-end', function() { 20 | aboutWindow.focus(); 21 | // open link in default browser 22 | $(aboutWindow.window.document).find('a').bind('click', function (e) { 23 | e.preventDefault(); 24 | gui.Shell.openExternal(this.href); 25 | }); 26 | }); 27 | }, 28 | 29 | // change folder for sidebar links 30 | cd: function (anchor) { 31 | anchor = $(anchor); 32 | 33 | $('#sidebar li').removeClass('active'); 34 | $('#sidebar i').removeClass('icon-white'); 35 | 36 | anchor.closest('li').addClass('active'); 37 | anchor.find('i').addClass('icon-white'); 38 | 39 | this.setPath(anchor.attr('nw-path')); 40 | }, 41 | 42 | // set path for file explorer 43 | setPath: function (path) { 44 | if (path.indexOf('~') == 0) { 45 | path = path.replace('~', process.env['HOME']); 46 | } 47 | this.folder.open(path); 48 | this.addressbar.set(path); 49 | } 50 | }; 51 | 52 | $(document).ready(function() { 53 | var folder = new folder_view.Folder($('#files')); 54 | var addressbar = new abar.AddressBar($('#addressbar')); 55 | 56 | folder.open(process.cwd()); 57 | addressbar.set(process.cwd()); 58 | 59 | App.folder = folder; 60 | App.addressbar = addressbar; 61 | 62 | folder.on('navigate', function(dir, mime) { 63 | if (mime.type == 'folder') { 64 | addressbar.enter(mime); 65 | } else { 66 | gui.Shell.openItem(mime.path); 67 | } 68 | }); 69 | 70 | addressbar.on('navigate', function(dir) { 71 | folder.open(dir); 72 | }); 73 | 74 | // sidebar favorites 75 | $('[nw-path]').bind('click', function (event) { 76 | event.preventDefault(); 77 | App.cd(this); 78 | }); 79 | 80 | gui.Window.get().show(); 81 | }); 82 | -------------------------------------------------------------------------------- /file-explorer/node_modules/address_bar.js: -------------------------------------------------------------------------------- 1 | var events = require("events"); 2 | var path = require('path'); 3 | var jade = require('jade'); 4 | var util = require("util"); 5 | 6 | // Template engine 7 | var gen_bar = jade.compile([ 8 | '- each item, i in sequence', 9 | ' - if (i != sequence.length - 1)', 10 | ' li(data-path="#{item.path}")', 11 | ' a(href="#") #{item.name}', 12 | ' span.divider /', 13 | ' - else', 14 | ' li.active(data-path="#{item.path}")', 15 | ' a(href="#") #{item.name}', 16 | ].join('\n')); 17 | 18 | var gen_one_fie = jade.compile([ 19 | 'li(data-path="#{item.path}")', 20 | ' a(href="#") #{item.name}', 21 | ].join('\n')); 22 | 23 | // Our real type 24 | function AddressBar(element) { 25 | events.EventEmitter.call(this); 26 | this.element = element; 27 | 28 | // Monitor click on AddressBar 29 | var self = this; 30 | element.delegate('a', 'click', function() { 31 | self.element.children('.active').removeClass('active'); 32 | $(this).parent().addClass('active'); 33 | 34 | self.emit('navigate', $(this).parent().attr('data-path')); 35 | 36 | return false; 37 | }); 38 | } 39 | 40 | util.inherits(AddressBar, events.EventEmitter); 41 | 42 | AddressBar.prototype.set = function(dir_path) { 43 | this.current_path = path.normalize(dir_path); 44 | 45 | // Split path into separate elements 46 | var sequence = this.current_path.split(path.sep); 47 | var result = []; 48 | 49 | var i = 0; 50 | for (; i < sequence.length; ++i) { 51 | result.push({ 52 | name: sequence[i], 53 | path: sequence.slice(0, 1 + i).join(path.sep), 54 | }); 55 | } 56 | 57 | // Add root for *nix 58 | if (sequence[0] == '' && process.platform != 'win32') { 59 | result[0] = { 60 | name: 'root', 61 | path: '/', 62 | }; 63 | } 64 | 65 | this.element.html(gen_bar({ sequence: result })); 66 | } 67 | 68 | AddressBar.prototype.enter = function(mine) { 69 | // Where is current 70 | var how_many = this.element.children().length; 71 | var where = this.element.children('.active').index(); 72 | if (where == how_many - 1) { 73 | // Add '/' on tail 74 | this.element.children().eq(-1).append('/'); 75 | } else { 76 | this.element.children('li:gt(' + where + ')').remove(); 77 | } 78 | 79 | // Add new folder 80 | this.element.append(gen_one_fie({ item: mine })); 81 | this.element.find('a:last').trigger('click'); 82 | } 83 | 84 | exports.AddressBar = AddressBar; 85 | -------------------------------------------------------------------------------- /file-explorer/node_modules/folder_view.js: -------------------------------------------------------------------------------- 1 | var events = require('events'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | var jade = require('jade'); 5 | var util = require('util'); 6 | var mime = require('mime'); 7 | 8 | // Template engine 9 | var gen_files_view = jade.compile([ 10 | '- each file in files', 11 | ' .file(data-path="#{file.path}")', 12 | ' .icon', 13 | ' img(src="icons/#{file.type}.png")', 14 | ' .name #{file.name}', 15 | ].join('\n')); 16 | 17 | // Our type 18 | function Folder(jquery_element) { 19 | events.EventEmitter.call(this); 20 | this.element = jquery_element; 21 | 22 | var self = this; 23 | // Click on blank 24 | this.element.parent().on('click', function() { 25 | self.element.children('.focus').removeClass('focus'); 26 | }); 27 | // Click on file 28 | this.element.delegate('.file', 'click', function(e) { 29 | self.element.children('.focus').removeClass('focus'); 30 | $(this).addClass('focus'); 31 | e.stopPropagation(); 32 | }); 33 | // Double click on file 34 | this.element.delegate('.file', 'dblclick', function() { 35 | var file_path = $(this).attr('data-path'); 36 | self.emit('navigate', file_path, mime.stat(file_path)); 37 | }); 38 | } 39 | 40 | util.inherits(Folder, events.EventEmitter); 41 | 42 | Folder.prototype.open = function(dir) { 43 | var self = this; 44 | fs.readdir(dir, function(error, files) { 45 | if (error) { 46 | console.log(error); 47 | window.alert(error); 48 | return; 49 | } 50 | 51 | for (var i = 0; i < files.length; ++i) { 52 | files[i] = mime.stat(path.join(dir, files[i])); 53 | } 54 | 55 | self.element.html(gen_files_view({ files: files })); 56 | }); 57 | } 58 | 59 | exports.Folder = Folder; 60 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = process.env.JADE_COV 3 | ? require('./lib-cov/jade') 4 | : require('./lib/jade'); -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/doctypes.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - doctypes 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | module.exports = { 9 | '5': '' 10 | , 'default': '' 11 | , 'xml': '' 12 | , 'transitional': '' 13 | , 'strict': '' 14 | , 'frameset': '' 15 | , '1.1': '' 16 | , 'basic': '' 17 | , 'mobile': '' 18 | }; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/inline-tags.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - inline tags 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | module.exports = [ 9 | 'a' 10 | , 'abbr' 11 | , 'acronym' 12 | , 'b' 13 | , 'br' 14 | , 'code' 15 | , 'em' 16 | , 'font' 17 | , 'i' 18 | , 'img' 19 | , 'ins' 20 | , 'kbd' 21 | , 'map' 22 | , 'samp' 23 | , 'small' 24 | , 'span' 25 | , 'strong' 26 | , 'sub' 27 | , 'sup' 28 | ]; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/attrs.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Attrs 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'), 13 | Block = require('./block'); 14 | 15 | /** 16 | * Initialize a `Attrs` node. 17 | * 18 | * @api public 19 | */ 20 | 21 | var Attrs = module.exports = function Attrs() { 22 | this.attrs = []; 23 | }; 24 | 25 | /** 26 | * Inherit from `Node`. 27 | */ 28 | 29 | Attrs.prototype.__proto__ = Node.prototype; 30 | 31 | /** 32 | * Set attribute `name` to `val`, keep in mind these become 33 | * part of a raw js object literal, so to quote a value you must 34 | * '"quote me"', otherwise or example 'user.name' is literal JavaScript. 35 | * 36 | * @param {String} name 37 | * @param {String} val 38 | * @param {Boolean} escaped 39 | * @return {Tag} for chaining 40 | * @api public 41 | */ 42 | 43 | Attrs.prototype.setAttribute = function(name, val, escaped){ 44 | this.attrs.push({ name: name, val: val, escaped: escaped }); 45 | return this; 46 | }; 47 | 48 | /** 49 | * Remove attribute `name` when present. 50 | * 51 | * @param {String} name 52 | * @api public 53 | */ 54 | 55 | Attrs.prototype.removeAttribute = function(name){ 56 | for (var i = 0, len = this.attrs.length; i < len; ++i) { 57 | if (this.attrs[i] && this.attrs[i].name == name) { 58 | delete this.attrs[i]; 59 | } 60 | } 61 | }; 62 | 63 | /** 64 | * Get attribute value by `name`. 65 | * 66 | * @param {String} name 67 | * @return {String} 68 | * @api public 69 | */ 70 | 71 | Attrs.prototype.getAttribute = function(name){ 72 | for (var i = 0, len = this.attrs.length; i < len; ++i) { 73 | if (this.attrs[i] && this.attrs[i].name == name) { 74 | return this.attrs[i].val; 75 | } 76 | } 77 | }; 78 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/block-comment.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - BlockComment 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `BlockComment` with the given `block`. 16 | * 17 | * @param {String} val 18 | * @param {Block} block 19 | * @param {Boolean} buffer 20 | * @api public 21 | */ 22 | 23 | var BlockComment = module.exports = function BlockComment(val, block, buffer) { 24 | this.block = block; 25 | this.val = val; 26 | this.buffer = buffer; 27 | }; 28 | 29 | /** 30 | * Inherit from `Node`. 31 | */ 32 | 33 | BlockComment.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/case.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Case 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a new `Case` with `expr`. 16 | * 17 | * @param {String} expr 18 | * @api public 19 | */ 20 | 21 | var Case = exports = module.exports = function Case(expr, block){ 22 | this.expr = expr; 23 | this.block = block; 24 | }; 25 | 26 | /** 27 | * Inherit from `Node`. 28 | */ 29 | 30 | Case.prototype.__proto__ = Node.prototype; 31 | 32 | var When = exports.When = function When(expr, block){ 33 | this.expr = expr; 34 | this.block = block; 35 | this.debug = false; 36 | }; 37 | 38 | /** 39 | * Inherit from `Node`. 40 | */ 41 | 42 | When.prototype.__proto__ = Node.prototype; 43 | 44 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/code.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Code 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Code` node with the given code `val`. 16 | * Code may also be optionally buffered and escaped. 17 | * 18 | * @param {String} val 19 | * @param {Boolean} buffer 20 | * @param {Boolean} escape 21 | * @api public 22 | */ 23 | 24 | var Code = module.exports = function Code(val, buffer, escape) { 25 | this.val = val; 26 | this.buffer = buffer; 27 | this.escape = escape; 28 | if (val.match(/^ *else/)) this.debug = false; 29 | }; 30 | 31 | /** 32 | * Inherit from `Node`. 33 | */ 34 | 35 | Code.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/comment.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Comment 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Comment` with the given `val`, optionally `buffer`, 16 | * otherwise the comment may render in the output. 17 | * 18 | * @param {String} val 19 | * @param {Boolean} buffer 20 | * @api public 21 | */ 22 | 23 | var Comment = module.exports = function Comment(val, buffer) { 24 | this.val = val; 25 | this.buffer = buffer; 26 | }; 27 | 28 | /** 29 | * Inherit from `Node`. 30 | */ 31 | 32 | Comment.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/doctype.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Doctype 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Doctype` with the given `val`. 16 | * 17 | * @param {String} val 18 | * @api public 19 | */ 20 | 21 | var Doctype = module.exports = function Doctype(val) { 22 | this.val = val; 23 | }; 24 | 25 | /** 26 | * Inherit from `Node`. 27 | */ 28 | 29 | Doctype.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/each.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Each 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize an `Each` node, representing iteration 16 | * 17 | * @param {String} obj 18 | * @param {String} val 19 | * @param {String} key 20 | * @param {Block} block 21 | * @api public 22 | */ 23 | 24 | var Each = module.exports = function Each(obj, val, key, block) { 25 | this.obj = obj; 26 | this.val = val; 27 | this.key = key; 28 | this.block = block; 29 | }; 30 | 31 | /** 32 | * Inherit from `Node`. 33 | */ 34 | 35 | Each.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/filter.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Filter 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node') 13 | , Block = require('./block'); 14 | 15 | /** 16 | * Initialize a `Filter` node with the given 17 | * filter `name` and `block`. 18 | * 19 | * @param {String} name 20 | * @param {Block|Node} block 21 | * @api public 22 | */ 23 | 24 | var Filter = module.exports = function Filter(name, block, attrs) { 25 | this.name = name; 26 | this.block = block; 27 | this.attrs = attrs; 28 | this.isASTFilter = !block.nodes.every(function(node){ return node.isText }); 29 | }; 30 | 31 | /** 32 | * Inherit from `Node`. 33 | */ 34 | 35 | Filter.prototype.__proto__ = Node.prototype; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | exports.Node = require('./node'); 9 | exports.Tag = require('./tag'); 10 | exports.Code = require('./code'); 11 | exports.Each = require('./each'); 12 | exports.Case = require('./case'); 13 | exports.Text = require('./text'); 14 | exports.Block = require('./block'); 15 | exports.Mixin = require('./mixin'); 16 | exports.Filter = require('./filter'); 17 | exports.Comment = require('./comment'); 18 | exports.Literal = require('./literal'); 19 | exports.BlockComment = require('./block-comment'); 20 | exports.Doctype = require('./doctype'); 21 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/literal.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Literal 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Literal` node with the given `str. 16 | * 17 | * @param {String} str 18 | * @api public 19 | */ 20 | 21 | var Literal = module.exports = function Literal(str) { 22 | this.str = str 23 | .replace(/\\/g, "\\\\") 24 | .replace(/\n|\r\n/g, "\\n") 25 | .replace(/'/g, "\\'"); 26 | }; 27 | 28 | /** 29 | * Inherit from `Node`. 30 | */ 31 | 32 | Literal.prototype.__proto__ = Node.prototype; 33 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/mixin.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Mixin 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Attrs = require('./attrs'); 13 | 14 | /** 15 | * Initialize a new `Mixin` with `name` and `block`. 16 | * 17 | * @param {String} name 18 | * @param {String} args 19 | * @param {Block} block 20 | * @api public 21 | */ 22 | 23 | var Mixin = module.exports = function Mixin(name, args, block, call){ 24 | this.name = name; 25 | this.args = args; 26 | this.block = block; 27 | this.attrs = []; 28 | this.call = call; 29 | }; 30 | 31 | /** 32 | * Inherit from `Attrs`. 33 | */ 34 | 35 | Mixin.prototype.__proto__ = Attrs.prototype; 36 | 37 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/node.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Node 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Initialize a `Node`. 10 | * 11 | * @api public 12 | */ 13 | 14 | var Node = module.exports = function Node(){}; 15 | 16 | /** 17 | * Clone this node (return itself) 18 | * 19 | * @return {Node} 20 | * @api private 21 | */ 22 | 23 | Node.prototype.clone = function(){ 24 | return this; 25 | }; 26 | -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/tag.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Tag 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Attrs = require('./attrs'), 13 | Block = require('./block'), 14 | inlineTags = require('../inline-tags'); 15 | 16 | /** 17 | * Initialize a `Tag` node with the given tag `name` and optional `block`. 18 | * 19 | * @param {String} name 20 | * @param {Block} block 21 | * @api public 22 | */ 23 | 24 | var Tag = module.exports = function Tag(name, block) { 25 | this.name = name; 26 | this.attrs = []; 27 | this.block = block || new Block; 28 | }; 29 | 30 | /** 31 | * Inherit from `Attrs`. 32 | */ 33 | 34 | Tag.prototype.__proto__ = Attrs.prototype; 35 | 36 | /** 37 | * Clone this tag. 38 | * 39 | * @return {Tag} 40 | * @api private 41 | */ 42 | 43 | Tag.prototype.clone = function(){ 44 | var clone = new Tag(this.name, this.block.clone()); 45 | clone.line = this.line; 46 | clone.attrs = this.attrs; 47 | clone.textOnly = this.textOnly; 48 | return clone; 49 | }; 50 | 51 | /** 52 | * Check if this tag is an inline tag. 53 | * 54 | * @return {Boolean} 55 | * @api private 56 | */ 57 | 58 | Tag.prototype.isInline = function(){ 59 | return ~inlineTags.indexOf(this.name); 60 | }; 61 | 62 | /** 63 | * Check if this tag's contents can be inlined. Used for pretty printing. 64 | * 65 | * @return {Boolean} 66 | * @api private 67 | */ 68 | 69 | Tag.prototype.canInline = function(){ 70 | var nodes = this.block.nodes; 71 | 72 | function isInline(node){ 73 | // Recurse if the node is a block 74 | if (node.isBlock) return node.nodes.every(isInline); 75 | return node.isText || (node.isInline && node.isInline()); 76 | } 77 | 78 | // Empty tag 79 | if (!nodes.length) return true; 80 | 81 | // Text-only or inline-only tag 82 | if (1 == nodes.length) return isInline(nodes[0]); 83 | 84 | // Multi-line inline-only tag 85 | if (this.block.nodes.every(isInline)) { 86 | for (var i = 1, len = nodes.length; i < len; ++i) { 87 | if (nodes[i-1].isText && nodes[i].isText) 88 | return false; 89 | } 90 | return true; 91 | } 92 | 93 | // Mixed tag 94 | return false; 95 | }; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/nodes/text.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - nodes - Text 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var Node = require('./node'); 13 | 14 | /** 15 | * Initialize a `Text` node with optional `line`. 16 | * 17 | * @param {String} line 18 | * @api public 19 | */ 20 | 21 | var Text = module.exports = function Text(line) { 22 | this.val = ''; 23 | if ('string' == typeof line) this.val = line; 24 | }; 25 | 26 | /** 27 | * Inherit from `Node`. 28 | */ 29 | 30 | Text.prototype.__proto__ = Node.prototype; 31 | 32 | /** 33 | * Flag as text. 34 | */ 35 | 36 | Text.prototype.isText = true; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/self-closing.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - self closing tags 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | module.exports = [ 9 | 'meta' 10 | , 'img' 11 | , 'link' 12 | , 'input' 13 | , 'source' 14 | , 'area' 15 | , 'base' 16 | , 'col' 17 | , 'br' 18 | , 'hr' 19 | ]; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/lib/utils.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Jade - utils 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Convert interpolation in the given string to JavaScript. 10 | * 11 | * @param {String} str 12 | * @return {String} 13 | * @api private 14 | */ 15 | 16 | var interpolate = exports.interpolate = function(str){ 17 | return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ 18 | return escape 19 | ? str 20 | : "' + " 21 | + ('!' == flag ? '' : 'escape') 22 | + "((interp = " + code.replace(/\\'/g, "'") 23 | + ") == null ? '' : interp) + '"; 24 | }); 25 | }; 26 | 27 | /** 28 | * Escape single quotes in `str`. 29 | * 30 | * @param {String} str 31 | * @return {String} 32 | * @api private 33 | */ 34 | 35 | var escape = exports.escape = function(str) { 36 | return str.replace(/'/g, "\\'"); 37 | }; 38 | 39 | /** 40 | * Interpolate, and escape the given `str`. 41 | * 42 | * @param {String} str 43 | * @return {String} 44 | * @api private 45 | */ 46 | 47 | exports.text = function(str){ 48 | return interpolate(escape(str)); 49 | }; -------------------------------------------------------------------------------- /file-explorer/node_modules/jade/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jade", 3 | "description": "Jade template engine", 4 | "version": "0.27.2", 5 | "author": "TJ Holowaychuk ", 6 | "repository": "git://github.com/visionmedia/jade", 7 | "main": "./index.js", 8 | "bin": { "jade": "./bin/jade" }, 9 | "man": "./jade.1", 10 | "dependencies": { 11 | "commander": "0.6.1", 12 | "mkdirp": "0.3.0" 13 | }, 14 | "devDependencies": { 15 | "mocha": "*", 16 | "markdown": "*", 17 | "stylus": "*", 18 | "uubench": "*", 19 | "should": "*", 20 | "less": "*", 21 | "uglify-js": "*" 22 | }, 23 | "component": { 24 | "scripts": { 25 | "jade": "runtime.js" 26 | } 27 | }, 28 | "scripts" : { "prepublish" : "npm prune" } 29 | } 30 | -------------------------------------------------------------------------------- /file-explorer/node_modules/mime.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var _ = require('underscore'); 4 | 5 | var map = { 6 | 'compressed': ['zip', 'rar', 'gz', '7z'], 7 | 'text': ['txt', 'md', ''], 8 | 'image': ['jpg', 'jpge', 'png', 'gif', 'bmp'], 9 | 'pdf': ['pdf'], 10 | 'css': ['css'], 11 | 'html': ['html'], 12 | 'word': ['doc', 'docx'], 13 | 'powerpoint': ['ppt', 'pptx'], 14 | 'movie': ['mkv', 'avi', 'rmvb'], 15 | }; 16 | 17 | var cached = {}; 18 | 19 | exports.stat = function(filepath) { 20 | var result = { 21 | name: path.basename(filepath), 22 | path: filepath, 23 | }; 24 | 25 | try { 26 | var stat = fs.statSync(filepath); 27 | if (stat.isDirectory()) { 28 | result.type = 'folder'; 29 | } else { 30 | var ext = path.extname(filepath).substr(1); 31 | result.type = cached[ext]; 32 | if (!result.type) { 33 | for (var key in map) { 34 | if (_.include(map[key], ext)) { 35 | cached[ext] = result.type = key; 36 | break; 37 | } 38 | } 39 | 40 | if (!result.type) 41 | result.type = 'blank'; 42 | } 43 | } 44 | } catch (e) { 45 | window.alert(e); 46 | } 47 | 48 | return result; 49 | } 50 | -------------------------------------------------------------------------------- /file-explorer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FileExplorer", 3 | "description": "Simple file explorer.", 4 | "version": "0.1.0", 5 | "main": "index.html", 6 | "window": { 7 | "toolbar": false, 8 | "width": 660, 9 | "height": 500 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /file-explorer/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | -webkit-user-select: none; 3 | } 4 | 5 | body { 6 | background-image: url('images/htmlbg.png') 7 | } 8 | 9 | .files { 10 | padding: 0; 11 | margin: 0; 12 | } 13 | 14 | .file { 15 | padding: 2px; 16 | margin: 2px; 17 | width: 80px; 18 | display: inline-block; 19 | 20 | text-align: center; 21 | vertical-align: top; 22 | } 23 | 24 | .file.focus { 25 | background-color: #08C; 26 | -webkit-border-radius: 4px; 27 | } 28 | 29 | .file .name { 30 | width: 80px; 31 | word-wrap: break-word; 32 | } 33 | 34 | .file.focus .name { 35 | color: white; 36 | } 37 | 38 | .file .icon { 39 | margin: auto; 40 | margin-top: 0; 41 | width: 60px; 42 | } 43 | 44 | .file.focus .icon { 45 | -webkit-filter: invert(20%); 46 | } 47 | -------------------------------------------------------------------------------- /frameless-window/README.md: -------------------------------------------------------------------------------- 1 | # Frameless window 2 | 3 | A sample application to showcase how you can use `"frame": false` windows to allow total customization of the window's real state. At beginning, the window is open with no titlebar. As long as you check one of the titlebars, it is added to the appropriate position. Notice that the added titlebars are the only parts of the window that allows dragging. This is achieved through a special CSS property applied to what is draggable or non-draggable (by default, the whole window is not draggable): `-webkit-app-region: drag|no-drag;` 4 | 5 | **This demo requires node-webkit >= v0.3.0** 6 | 7 | ## Screen shot 8 | 9 | ![screenshot](http://ww1.sinaimg.cn/large/6556d357tw1dxuhssppffj.jpg) 10 | 11 | ## APIs 12 | 13 | * [Window](https://github.com/nwjs/nw.js/wiki/Window) 14 | * [Frameless Window](https://github.com/nwjs/nw.js/wiki/Frameless-Window) 15 | 16 | -------------------------------------------------------------------------------- /frameless-window/bottom-titlebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/bottom-titlebar.png -------------------------------------------------------------------------------- /frameless-window/button_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/button_close.png -------------------------------------------------------------------------------- /frameless-window/button_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/button_close_hover.png -------------------------------------------------------------------------------- /frameless-window/frameless_window.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Frameless Window 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 |
    13 | 14 | Select the titlebar to enable: 15 |
    16 | 17 | Top Titlebar 18 |
    19 | Bottom Titlebar 20 |
    21 | Left Titlebar 22 |
    23 | Right Titlebar 24 |
    25 |
    26 | 27 | 28 |
    29 | 30 |
    31 | 32 |
    33 | 34 |
    35 | 36 | 37 |
    38 |
    39 | 40 | 41 | -------------------------------------------------------------------------------- /frameless-window/icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/icon_128.png -------------------------------------------------------------------------------- /frameless-window/left-titlebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/left-titlebar.png -------------------------------------------------------------------------------- /frameless-window/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Frameless-Window", 3 | "description": "Chrome platform app.", 4 | "version": "0.1.0", 5 | "main": "frameless_window.html", 6 | "window": { 7 | "show": false, 8 | "toolbar": false, 9 | "frame": false, 10 | "position": "center", 11 | "width": 360, 12 | "height": 300, 13 | "min_width": 220, 14 | "min_height": 220 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /frameless-window/right-titlebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/right-titlebar.png -------------------------------------------------------------------------------- /frameless-window/top-titlebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/frameless-window/top-titlebar.png -------------------------------------------------------------------------------- /menus/README.md: -------------------------------------------------------------------------------- 1 | # Menus 2 | 3 | This is a basic demo that demonstrates the flexibility of node-webkit's Menus 4 | API, there are three context menus bound to three areas in the page. 5 | 6 | menus 7 | 8 | **This demo requires node-webkit >= v0.3.0.** 9 | 10 | ## APIs 11 | 12 | * [Menu](https://github.com/nwjs/nw.js/wiki/Menu) 13 | * [MenuItem](https://github.com/nwjs/nw.js/wiki/MenuItem) 14 | -------------------------------------------------------------------------------- /menus/imgs/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/apple.png -------------------------------------------------------------------------------- /menus/imgs/banaba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/banaba.png -------------------------------------------------------------------------------- /menus/imgs/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/cut.png -------------------------------------------------------------------------------- /menus/imgs/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/disk.png -------------------------------------------------------------------------------- /menus/imgs/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/edit.png -------------------------------------------------------------------------------- /menus/imgs/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/email.png -------------------------------------------------------------------------------- /menus/imgs/pear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/pear.png -------------------------------------------------------------------------------- /menus/imgs/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/play.png -------------------------------------------------------------------------------- /menus/imgs/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/strawberry.png -------------------------------------------------------------------------------- /menus/imgs/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/menus/imgs/tick.png -------------------------------------------------------------------------------- /menus/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Menu Demo 5 | 37 | 38 | 39 |
    40 | 42 |
    43 |
    44 |
    45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /menus/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NWJS-menu-demo", 3 | "main": "index.html", 4 | "window": { 5 | "show": false, 6 | "position": "center", 7 | "width": 500, 8 | "height": 500 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mini-code-edit/README.md: -------------------------------------------------------------------------------- 1 | # Mini code editor 2 | 3 | A non-trivial sample with basic features of a code editor, like syntax detection and syntax highlight. If also uses the extended FileSystem API that allows a user to select files from the disk so the app can read and write to that file. 4 | 5 | **This demo requires node-webkit >= v0.3.0** 6 | 7 | ## Screen shot 8 | 9 | ![screenshot](http://ww3.sinaimg.cn/large/6556d357tw1dxtz5nih7oj.jpg) 10 | 11 | ## APIs 12 | 13 | * [Window](https://github.com/nwjs/nw.js/wiki/Window) 14 | * [Menu](https://github.com/nwjs/nw.js/wiki/Menu) 15 | * [MenuItem](https://github.com/nwjs/nw.js/wiki/MenuItem) 16 | * [Clipboard](https://github.com/nwjs/nw.js/wiki/Clipboard) 17 | * [fs module](http://nodejs.org/api/fs.html) 18 | -------------------------------------------------------------------------------- /mini-code-edit/assets/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/assets/icon-128.png -------------------------------------------------------------------------------- /mini-code-edit/assets/screenshot-640x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/assets/screenshot-640x400.png -------------------------------------------------------------------------------- /mini-code-edit/assets/tile-440x280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/assets/tile-440x280.png -------------------------------------------------------------------------------- /mini-code-edit/cm/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 by Marijn Haverbeke 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | Please note that some subdirectories of the CodeMirror distribution 22 | include their own LICENSE files, and are released under different 23 | licences. 24 | -------------------------------------------------------------------------------- /mini-code-edit/cm/README.md: -------------------------------------------------------------------------------- 1 | # CodeMirror 2 2 | 3 | CodeMirror 2 is a rewrite of [CodeMirror 4 | 1](http://github.com/marijnh/CodeMirror). The docs live 5 | [here](http://codemirror.net/doc/manual.html), and the project page is 6 | [http://codemirror.net/](http://codemirror.net/). 7 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/changemode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Mode-Changing Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 |

    CodeMirror: Mode-Changing demo

    17 | 18 |
    25 | 26 |

    On changes to the content of the above editor, a (crude) script 27 | tries to auto-detect the language used, and switches the editor to 28 | either JavaScript or Scheme mode based on that.

    29 | 30 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/closetag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Close-Tag Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 |

    Close-Tag Demo

    20 |
      21 |
    • Type an html tag. When you type '>' or '/', the tag will auto-close/complete. Block-level tags will indent.
    • 22 |
    • There are options for disabling tag closing or customizing the list of tags to indent.
    • 23 |
    • Works with "text/html" (based on htmlmixed.js or xml.js) mode.
    • 24 |
    • View source for key binding details.
    • 25 |

      26 | 27 |
      28 | 29 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/emacs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Emacs bindings demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 |

      CodeMirror: Emacs bindings demo

      17 | 18 |
      33 | 34 |

      The emacs keybindings are enabled by 35 | including keymap/emacs.js and setting 36 | the keyMap option to "emacs". Because 37 | CodeMirror's internal API is quite different from Emacs, they are only 38 | a loose approximation of actual emacs bindings, though.

      39 | 40 |

      Also note that a lot of browsers disallow certain keys from being 41 | captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the 42 | result that idiomatic use of Emacs keys will constantly close your tab 43 | or open a new window.

      44 | 45 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/folding.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Code Folding Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 |

      CodeMirror: Code Folding Demo

      19 | 20 |

      Demonstration of code folding using the code 21 | in foldcode.js. 22 | Press ctrl-q or click on the gutter to fold a block, again 23 | to unfold.

      24 |
      25 |
      JavaScript:
      26 |
      HTML:
      27 |
      28 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/loadmode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Lazy Mode Loading Demo 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 |

      CodeMirror: Lazy Mode Loading

      16 | 17 |
      22 |

      23 | 24 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/marker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Breakpoint Demo 5 | 6 | 7 | 8 | 9 | 10 | 19 | 20 | 21 |

      CodeMirror: Breakpoint demo

      22 | 23 |
      35 | 36 |

      Click the line-number gutter to add or remove 'breakpoints'.

      37 | 38 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/matchhighlighter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Match Highlighter Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 |

      CodeMirror: Match Highlighter Demo

      20 | 21 |
      24 | 25 | 33 | 34 |

      Highlight matches of selected text on select

      35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/mustache.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Overlay Parser Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 |

      CodeMirror: Overlay Parser Demo

      18 | 19 |
      30 | 31 | 49 | 50 |

      Demonstration of a mode that parses HTML, highlighting 51 | the Mustache templating 52 | directives inside of it by using the code 53 | in overlay.js. View 54 | source to see the 15 lines of code needed to accomplish this.

      55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: HTML5 preview 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 27 | 28 | 29 |

      CodeMirror: HTML5 preview

      30 | 53 | 54 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/resize.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Autoresize Demo 5 | 6 | 7 | 8 | 9 | 10 | 21 | 22 | 23 |

      CodeMirror: Autoresize demo

      24 | 25 |
      32 | 33 |

      By setting a few CSS properties, CodeMirror can be made to 34 | automatically resize to fit its content.

      35 | 36 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/runmode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Mode Runner Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Mode Runner Demo

      13 | 14 |
      20 | 21 |
      
      22 | 
      23 |     
      29 | 
      30 |     

      Running a CodeMirror mode outside of the editor. 31 | The CodeMirror.runMode function, defined 32 | in lib/runmode.js takes the following arguments:

      33 | 34 |
      35 |
      text (string)
      36 |
      The document to run through the highlighter.
      37 |
      mode (mode spec)
      38 |
      The mode to use (must be loaded as normal).
      39 |
      output (function or DOM node)
      40 |
      If this is a function, it will be called for each token with 41 | two arguments, the token's text and the token's style class (may 42 | be null for unstyled tokens). If it is a DOM node, 43 | the tokens will be converted to span elements as in 44 | an editor, and inserted into the node 45 | (through innerHTML).
      46 |
      47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/vim.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Vim bindings demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 |

      CodeMirror: Vim bindings demo

      17 | 18 |
      33 | 34 |

      The vim keybindings are enabled by 35 | including keymap/vim.js and setting 36 | the keyMap option to "vim". Because 37 | CodeMirror's internal API is quite different from Vim, they are only 38 | a loose approximation of actual vim bindings, though.

      39 | 40 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /mini-code-edit/cm/demo/visibletabs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Visible tabs demo 5 | 6 | 7 | 8 | 9 | 10 | 24 | 25 | 26 |

      CodeMirror: Visible tabs demo

      27 | 28 |
      43 | 44 |

      Tabs inside the editor are spans with the 45 | class cm-tab, and can be styled. This demo uses 46 | an :after pseudo-class CSS hack that will not work on old 47 | browsers. You can use a more conservative technique like a background 48 | image as an alternative.

      49 | 50 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /mini-code-edit/cm/doc/baboon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/cm/doc/baboon.png -------------------------------------------------------------------------------- /mini-code-edit/cm/doc/reporting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Reporting Bugs 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      { } CodeMirror

      13 | 14 |
      15 | /* Reporting bugs
      16 |    effectively */
      17 | 
      18 | 19 |
      20 | 21 |

      So you found a problem in CodeMirror. By all means, report it! Bug 22 | reports from users are the main drive behind improvements to 23 | CodeMirror. But first, please read over these points:

      24 | 25 |
        26 |
      1. CodeMirror is maintained by volunteers. They don't owe you 27 | anything, so be polite. Reports with an indignant or belligerent 28 | tone tend to be moved to the bottom of the pile.
      2. 29 | 30 |
      3. Include information about the browser in which the 31 | problem occurred. Even if you tested several browsers, and 32 | the problem occurred in all of them, mention this fact in the bug 33 | report. Also include browser version numbers and the operating 34 | system that you're on.
      4. 35 | 36 |
      5. Mention which release of CodeMirror you're using. Preferably, 37 | try also with the current development snapshot, to ensure the 38 | problem has not already been fixed.
      6. 39 | 40 |
      7. Mention very precisely what went wrong. "X is broken" is not a 41 | good bug report. What did you expect to happen? What happened 42 | instead? Describe the exact steps a maintainer has to take to make 43 | the problem occur. We can not fix something that we can not 44 | observe.
      8. 45 | 46 |
      9. If the problem can not be reproduced in any of the demos 47 | included in the CodeMirror distribution, please provide an HTML 48 | document that demonstrates the problem. The best way to do this is 49 | to go to jsbin.com, enter 50 | it there, press save, and include the resulting link in your bug 51 | report.
      10. 52 |
      53 | 54 |
      55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /mini-code-edit/cm/keymap/emacs.js: -------------------------------------------------------------------------------- 1 | // TODO number prefixes 2 | (function() { 3 | // Really primitive kill-ring implementation. 4 | var killRing = []; 5 | function addToRing(str) { 6 | killRing.push(str); 7 | if (killRing.length > 50) killRing.shift(); 8 | } 9 | function getFromRing() { return killRing[killRing.length - 1] || ""; } 10 | function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); } 11 | 12 | CodeMirror.keyMap.emacs = { 13 | "Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");}, 14 | "Ctrl-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");}, 15 | "Ctrl-Alt-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");}, 16 | "Alt-W": function(cm) {addToRing(cm.getSelection());}, 17 | "Ctrl-Y": function(cm) {cm.replaceSelection(getFromRing());}, 18 | "Alt-Y": function(cm) {cm.replaceSelection(popFromRing());}, 19 | "Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", 20 | "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace", 21 | "Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete", 22 | fallthrough: ["basic", "emacsy"] 23 | }; 24 | 25 | CodeMirror.keyMap["emacs-Ctrl-X"] = { 26 | "Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": "undo", "K": "close", 27 | auto: "emacs", nofallthrough: true 28 | }; 29 | })(); 30 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: relative; 3 | } 4 | 5 | .CodeMirror-dialog > div { 6 | position: absolute; 7 | top: 0; left: 0; right: 0; 8 | background: white; 9 | border-bottom: 1px solid #eee; 10 | z-index: 15; 11 | padding: .1em .8em; 12 | overflow: hidden; 13 | color: #333; 14 | } 15 | 16 | .CodeMirror-dialog input { 17 | border: none; 18 | outline: none; 19 | background: transparent; 20 | width: 20em; 21 | color: inherit; 22 | font-family: monospace; 23 | } 24 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/dialog.js: -------------------------------------------------------------------------------- 1 | // Open simple dialogs on top of an editor. Relies on dialog.css. 2 | 3 | (function() { 4 | function dialogDiv(cm, template) { 5 | var wrap = cm.getWrapperElement(); 6 | var dialog = wrap.insertBefore(document.createElement("div"), wrap.firstChild); 7 | dialog.className = "CodeMirror-dialog"; 8 | dialog.innerHTML = '
      ' + template + '
      '; 9 | return dialog; 10 | } 11 | 12 | CodeMirror.defineExtension("openDialog", function(template, callback) { 13 | var dialog = dialogDiv(this, template); 14 | var closed = false, me = this; 15 | function close() { 16 | if (closed) return; 17 | closed = true; 18 | dialog.parentNode.removeChild(dialog); 19 | } 20 | var inp = dialog.getElementsByTagName("input")[0]; 21 | if (inp) { 22 | CodeMirror.connect(inp, "keydown", function(e) { 23 | if (e.keyCode == 13 || e.keyCode == 27) { 24 | CodeMirror.e_stop(e); 25 | close(); 26 | me.focus(); 27 | if (e.keyCode == 13) callback(inp.value); 28 | } 29 | }); 30 | inp.focus(); 31 | CodeMirror.connect(inp, "blur", close); 32 | } 33 | return close; 34 | }); 35 | 36 | CodeMirror.defineExtension("openConfirm", function(template, callbacks) { 37 | var dialog = dialogDiv(this, template); 38 | var buttons = dialog.getElementsByTagName("button"); 39 | var closed = false, me = this, blurring = 1; 40 | function close() { 41 | if (closed) return; 42 | closed = true; 43 | dialog.parentNode.removeChild(dialog); 44 | me.focus(); 45 | } 46 | buttons[0].focus(); 47 | for (var i = 0; i < buttons.length; ++i) { 48 | var b = buttons[i]; 49 | (function(callback) { 50 | CodeMirror.connect(b, "click", function(e) { 51 | CodeMirror.e_preventDefault(e); 52 | close(); 53 | if (callback) callback(me); 54 | }); 55 | })(callbacks[i]); 56 | CodeMirror.connect(b, "blur", function() { 57 | --blurring; 58 | setTimeout(function() { if (blurring <= 0) close(); }, 200); 59 | }); 60 | CodeMirror.connect(b, "focus", function() { ++blurring; }); 61 | } 62 | }); 63 | })(); 64 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/loadmode.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; 3 | 4 | var loading = {}; 5 | function splitCallback(cont, n) { 6 | var countDown = n; 7 | return function() { if (--countDown == 0) cont(); } 8 | } 9 | function ensureDeps(mode, cont) { 10 | var deps = CodeMirror.modes[mode].dependencies; 11 | if (!deps) return cont(); 12 | var missing = []; 13 | for (var i = 0; i < deps.length; ++i) { 14 | if (!CodeMirror.modes.hasOwnProperty(deps[i])) 15 | missing.push(deps[i]); 16 | } 17 | if (!missing.length) return cont(); 18 | var split = splitCallback(cont, missing.length); 19 | for (var i = 0; i < missing.length; ++i) 20 | CodeMirror.requireMode(missing[i], split); 21 | } 22 | 23 | CodeMirror.requireMode = function(mode, cont) { 24 | if (typeof mode != "string") mode = mode.name; 25 | if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); 26 | if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); 27 | 28 | var script = document.createElement("script"); 29 | script.src = CodeMirror.modeURL.replace(/%N/g, mode); 30 | var others = document.getElementsByTagName("script")[0]; 31 | others.parentNode.insertBefore(script, others); 32 | var list = loading[mode] = [cont]; 33 | var count = 0, poll = setInterval(function() { 34 | if (++count > 100) return clearInterval(poll); 35 | if (CodeMirror.modes.hasOwnProperty(mode)) { 36 | clearInterval(poll); 37 | loading[mode] = null; 38 | ensureDeps(mode, function() { 39 | for (var i = 0; i < list.length; ++i) list[i](); 40 | }); 41 | } 42 | }, 200); 43 | }; 44 | 45 | CodeMirror.autoLoadMode = function(instance, mode) { 46 | if (!CodeMirror.modes.hasOwnProperty(mode)) 47 | CodeMirror.requireMode(mode, function() { 48 | instance.setOption("mode", instance.getOption("mode")); 49 | }); 50 | }; 51 | }()); 52 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/match-highlighter.js: -------------------------------------------------------------------------------- 1 | // Define match-highlighter commands. Depends on searchcursor.js 2 | // Use by attaching the following function call to the onCursorActivity event: 3 | //myCodeMirror.matchHighlight(minChars); 4 | // And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) 5 | 6 | (function() { 7 | var DEFAULT_MIN_CHARS = 2; 8 | 9 | function MatchHighlightState() { 10 | this.marked = []; 11 | } 12 | function getMatchHighlightState(cm) { 13 | return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); 14 | } 15 | 16 | function clearMarks(cm) { 17 | var state = getMatchHighlightState(cm); 18 | for (var i = 0; i < state.marked.length; ++i) 19 | state.marked[i].clear(); 20 | state.marked = []; 21 | } 22 | 23 | function markDocument(cm, className, minChars) { 24 | clearMarks(cm); 25 | minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); 26 | if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) { 27 | var state = getMatchHighlightState(cm); 28 | var query = cm.getSelection(); 29 | cm.operation(function() { 30 | if (cm.lineCount() < 2000) { // This is too expensive on big documents. 31 | for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { 32 | //Only apply matchhighlight to the matches other than the one actually selected 33 | if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch)) 34 | state.marked.push(cm.markText(cursor.from(), cursor.to(), className)); 35 | } 36 | } 37 | }); 38 | } 39 | } 40 | 41 | CodeMirror.defineExtension("matchHighlight", function(className, minChars) { 42 | markDocument(this, className, minChars); 43 | }); 44 | })(); 45 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/overlay.js: -------------------------------------------------------------------------------- 1 | // Utility function that allows modes to be combined. The mode given 2 | // as the base argument takes care of most of the normal mode 3 | // functionality, but a second (typically simple) mode is used, which 4 | // can override the style of text. Both modes get to parse all of the 5 | // text, but when both assign a non-null style to a piece of code, the 6 | // overlay wins, unless the combine argument was true, in which case 7 | // the styles are combined. 8 | 9 | CodeMirror.overlayParser = function(base, overlay, combine) { 10 | return { 11 | startState: function() { 12 | return { 13 | base: CodeMirror.startState(base), 14 | overlay: CodeMirror.startState(overlay), 15 | basePos: 0, baseCur: null, 16 | overlayPos: 0, overlayCur: null 17 | }; 18 | }, 19 | copyState: function(state) { 20 | return { 21 | base: CodeMirror.copyState(base, state.base), 22 | overlay: CodeMirror.copyState(overlay, state.overlay), 23 | basePos: state.basePos, baseCur: null, 24 | overlayPos: state.overlayPos, overlayCur: null 25 | }; 26 | }, 27 | 28 | token: function(stream, state) { 29 | if (stream.start == state.basePos) { 30 | state.baseCur = base.token(stream, state.base); 31 | state.basePos = stream.pos; 32 | } 33 | if (stream.start == state.overlayPos) { 34 | stream.pos = stream.start; 35 | state.overlayCur = overlay.token(stream, state.overlay); 36 | state.overlayPos = stream.pos; 37 | } 38 | stream.pos = Math.min(state.basePos, state.overlayPos); 39 | if (stream.eol()) state.basePos = state.overlayPos = 0; 40 | 41 | if (state.overlayCur == null) return state.baseCur; 42 | if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; 43 | else return state.overlayCur; 44 | }, 45 | 46 | indent: base.indent && function(state, textAfter) { 47 | return base.indent(state.base, textAfter); 48 | }, 49 | electricChars: base.electricChars 50 | }; 51 | }; 52 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/runmode.js: -------------------------------------------------------------------------------- 1 | CodeMirror.runMode = function(string, modespec, callback, options) { 2 | var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); 3 | var isNode = callback.nodeType == 1; 4 | var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; 5 | if (isNode) { 6 | var node = callback, accum = [], col = 0; 7 | callback = function(text, style) { 8 | if (text == "\n") { 9 | accum.push("
      "); 10 | col = 0; 11 | return; 12 | } 13 | var escaped = ""; 14 | // HTML-escape and replace tabs 15 | for (var pos = 0;;) { 16 | var idx = text.indexOf("\t", pos); 17 | if (idx == -1) { 18 | escaped += CodeMirror.htmlEscape(text.slice(pos)); 19 | col += text.length - pos; 20 | break; 21 | } else { 22 | col += idx - pos; 23 | escaped += CodeMirror.htmlEscape(text.slice(pos, idx)); 24 | var size = tabSize - col % tabSize; 25 | col += size; 26 | for (var i = 0; i < size; ++i) escaped += " "; 27 | pos = idx + 1; 28 | } 29 | } 30 | 31 | if (style) 32 | accum.push("" + escaped + ""); 33 | else 34 | accum.push(escaped); 35 | } 36 | } 37 | var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); 38 | for (var i = 0, e = lines.length; i < e; ++i) { 39 | if (i) callback("\n"); 40 | var stream = new CodeMirror.StringStream(lines[i]); 41 | while (!stream.eol()) { 42 | var style = mode.token(stream, state); 43 | callback(stream.current(), style, i, stream.start); 44 | stream.start = stream.pos; 45 | } 46 | } 47 | if (isNode) 48 | node.innerHTML = accum.join(""); 49 | }; 50 | -------------------------------------------------------------------------------- /mini-code-edit/cm/lib/util/simple-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-completions { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 6 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 7 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 8 | } 9 | .CodeMirror-completions select { 10 | background: #fafafa; 11 | outline: none; 12 | border: none; 13 | padding: 0; 14 | margin: 0; 15 | font-family: monospace; 16 | } 17 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/clojure/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Clojure mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Clojure mode

      13 |
      59 | 62 | 63 |

      MIME types defined: text/x-clojure.

      64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/coffeescript/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Jeff Pickhardt 4 | Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: CSS mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: CSS mode

      13 |
      48 | 51 | 52 |

      MIME types defined: text/css.

      53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("diff", function() { 2 | 3 | var TOKEN_NAMES = { 4 | '+': 'tag', 5 | '-': 'string', 6 | '@': 'meta' 7 | }; 8 | 9 | return { 10 | token: function(stream) { 11 | var tw_pos = stream.string.search(/[\t ]+?$/); 12 | 13 | if (!stream.sol() || tw_pos === 0) { 14 | stream.skipToEnd(); 15 | return ("error " + ( 16 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 17 | } 18 | 19 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 20 | 21 | if (tw_pos === -1) { 22 | stream.skipToEnd(); 23 | } else { 24 | stream.pos = tw_pos; 25 | } 26 | 27 | return token_name; 28 | } 29 | }; 30 | }); 31 | 32 | CodeMirror.defineMIME("text/x-diff", "diff"); 33 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | CodeMirror: ECL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: ECL mode

      13 |
      31 | 37 | 38 |

      Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

      39 |

      MIME types defined: text/x-ecl.

      40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/erlang/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Erlang mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

      CodeMirror: Erlang mode

      14 | 15 |
      50 | 51 | 58 | 59 |

      MIME types defined: text/x-erlang.

      60 | 61 | 62 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/gfm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: GFM mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

      CodeMirror: GFM mode

      17 | 18 | 19 |
      36 | 37 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/go/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Go mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

      CodeMirror: Go mode

      14 | 15 |
      58 | 59 | 69 | 70 |

      MIME type: text/x-go

      71 | 72 | 73 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/groovy/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Groovy mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Groovy mode

      13 | 14 |
      60 | 61 | 68 | 69 |

      MIME types defined: text/x-groovy

      70 | 71 | 72 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/haskell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Haskell mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

      CodeMirror: Haskell mode

      14 | 15 |
      49 | 50 | 57 | 58 |

      MIME types defined: text/x-haskell.

      59 | 60 | 61 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/htmlembedded/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Html Embedded Scripts mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

      CodeMirror: Html Embedded Scripts mode

      17 | 18 |
      30 | 31 | 42 | 43 |

      Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on 44 | JavaScript, CSS and XML.
      Other dependancies include those of the scriping language chosen.

      45 | 46 |

      MIME types defined: application/x-aspx (ASP.NET), 47 | application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

      48 | 49 | 50 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/htmlmixed/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: HTML mixed mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

      CodeMirror: HTML mixed mode

      16 |
      40 | 43 | 44 |

      The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

      45 | 46 |

      MIME types defined: text/html 47 | (redefined, only takes effect if you load this parser after the 48 | XML parser).

      49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Jinja2 mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Jinja2 mode

      13 |
      31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/jinja2/jinja2.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("jinja2", function(config, parserConf) { 2 | var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", 3 | "loop", "none", "self", "super", "if", "as", "not", "and", 4 | "else", "import", "with", "without", "context"]; 5 | keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); 6 | 7 | function tokenBase (stream, state) { 8 | var ch = stream.next(); 9 | if (ch == "{") { 10 | if (ch = stream.eat(/\{|%|#/)) { 11 | stream.eat("-"); 12 | state.tokenize = inTag(ch); 13 | return "tag"; 14 | } 15 | } 16 | } 17 | function inTag (close) { 18 | if (close == "{") { 19 | close = "}"; 20 | } 21 | return function (stream, state) { 22 | var ch = stream.next(); 23 | if ((ch == close || (ch == "-" && stream.eat(close))) 24 | && stream.eat("}")) { 25 | state.tokenize = tokenBase; 26 | return "tag"; 27 | } 28 | if (stream.match(keywords)) { 29 | return "keyword"; 30 | } 31 | return close == "#" ? "comment" : "string"; 32 | }; 33 | } 34 | return { 35 | startState: function () { 36 | return {tokenize: tokenBase}; 37 | }, 38 | token: function (stream, state) { 39 | return state.tokenize(stream, state); 40 | } 41 | }; 42 | }); 43 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/lua/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Lua mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

      CodeMirror: Lua mode

      14 |
      55 | 62 | 63 |

      Loosely based on Franciszek 64 | Wawrzak's CodeMirror 65 | 1 mode. One configuration parameter is 66 | supported, specials, to which you can provide an 67 | array of strings to have those identifiers highlighted with 68 | the lua-special style.

      69 |

      MIME types defined: text/x-lua.

      70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: MySQL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: MySQL mode

      13 |
      30 | 37 | 38 |

      MIME types defined: text/x-mysql.

      39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: NTriples mode 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |

      CodeMirror: NTriples mode

      17 |
      18 | 25 |
      26 | 27 | 30 |

      MIME types defined: text/n-triples.

      31 | 32 | 33 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/pascal/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 souceLair 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Pascal mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Pascal mode

      13 | 14 |
      37 | 38 | 45 | 46 |

      MIME types defined: text/x-pascal.

      47 | 48 | 49 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/perl/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Sabaca under the MIT license. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Perl mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Perl mode

      13 | 14 |
      52 | 53 | 59 | 60 |

      MIME types defined: text/x-perl.

      61 | 62 | 63 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/php/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: PHP mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

      CodeMirror: PHP mode

      17 | 18 |
      29 | 30 | 41 | 42 |

      Simple HTML/PHP mode based on 43 | the C-like mode. Depends on XML, 44 | JavaScript, CSS, and C-like modes.

      45 | 46 |

      MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

      47 | 48 | 49 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/pig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Pig Latin mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Pig Latin mode

      13 | 14 |
      26 | 27 | 35 | 36 |

      37 | Simple mode that handles Pig Latin language. 38 |

      39 | 40 |

      MIME type defined: text/x-pig 41 | (PIG code) 42 | 43 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/plsql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Oracle PL/SQL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Oracle PL/SQL mode

      13 | 14 |
      46 | 47 | 55 | 56 |

      57 | Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course). 58 |

      59 | 60 |

      MIME type defined: text/x-plsql 61 | (PLSQL code) 62 | 63 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Properties files mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Properties files mode

      13 |
      32 | 35 | 36 |

      MIME types defined: text/x-properties, 37 | text/x-ini.

      38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/properties/properties.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("properties", function() { 2 | return { 3 | token: function(stream, state) { 4 | var sol = stream.sol() || state.afterSection; 5 | var eol = stream.eol(); 6 | 7 | state.afterSection = false; 8 | 9 | if (sol) { 10 | if (state.nextMultiline) { 11 | state.inMultiline = true; 12 | state.nextMultiline = false; 13 | } else { 14 | state.position = "def"; 15 | } 16 | } 17 | 18 | if (eol && ! state.nextMultiline) { 19 | state.inMultiline = false; 20 | state.position = "def"; 21 | } 22 | 23 | if (sol) { 24 | while(stream.eatSpace()); 25 | } 26 | 27 | var ch = stream.next(); 28 | 29 | if (sol && (ch === "#" || ch === "!" || ch === ";")) { 30 | state.position = "comment"; 31 | stream.skipToEnd(); 32 | return "comment"; 33 | } else if (sol && ch === "[") { 34 | state.afterSection = true; 35 | stream.skipTo("]"); stream.eat("]"); 36 | return "header"; 37 | } else if (ch === "=" || ch === ":") { 38 | state.position = "quote"; 39 | return null; 40 | } else if (ch === "\\" && state.position === "quote") { 41 | if (stream.next() !== "u") { // u = Unicode sequence \u1234 42 | // Multiline value 43 | state.nextMultiline = true; 44 | } 45 | } 46 | 47 | return state.position; 48 | }, 49 | 50 | startState: function() { 51 | return { 52 | position : "def", // Current position, "def", "quote" or "comment" 53 | nextMultiline : false, // Is the next line multiline value 54 | inMultiline : false, // Is the current line a multiline value 55 | afterSection : false // Did we just open a section 56 | }; 57 | } 58 | 59 | }; 60 | }); 61 | 62 | CodeMirror.defineMIME("text/x-properties", "properties"); 63 | CodeMirror.defineMIME("text/x-ini", "properties"); 64 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/python/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 Timothy Farrell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/r/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Ubalo, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Ubalo, Inc nor the names of its 12 | contributors may be used to endorse or promote products derived 13 | from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/rpm/changes/changes.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("changes", function(config, modeConfig) { 2 | var headerSeperator = /^-+$/; 3 | var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; 4 | var simpleEmail = /^[\w+.-]+@[\w.-]+/; 5 | 6 | return { 7 | token: function(stream) { 8 | if (stream.sol()) { 9 | if (stream.match(headerSeperator)) { return 'tag'; } 10 | if (stream.match(headerLine)) { return 'tag'; } 11 | } 12 | if (stream.match(simpleEmail)) { return 'string'; } 13 | stream.next(); 14 | return null; 15 | } 16 | }; 17 | }); 18 | 19 | CodeMirror.defineMIME("text/x-rpm-changes", "changes"); 20 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/rpm/changes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: RPM changes mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: RPM changes mode

      13 | 14 |
      41 | 50 | 51 |

      MIME types defined: text/x-rpm-changes.

      52 | 53 | 54 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/rpm/spec/spec.css: -------------------------------------------------------------------------------- 1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} 2 | .cm-s-default span.cm-macro {color: #b218b2;} 3 | .cm-s-default span.cm-section {color: green; font-weight: bold;} 4 | .cm-s-default span.cm-script {color: red;} 5 | .cm-s-default span.cm-issue {color: yellow;} 6 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/ruby/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Ubalo, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Ubalo, Inc. nor the names of its 12 | contributors may be used to endorse or promote products derived 13 | from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Rust mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Rust mode

      13 | 14 |
      37 | 38 | 45 | 46 |

      MIME types defined: text/x-rustsrc.

      47 | 48 | 49 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/scheme/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Scheme mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Scheme mode

      13 |
      57 | 60 | 61 |

      MIME types defined: text/x-scheme.

      62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/shell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Shell mode 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 |

      CodeMirror: Shell mode

      16 | 17 | 41 | 42 | 49 | 50 |

      MIME types defined: text/x-sh.

      51 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/smalltalk/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Smalltalk mode 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |

      CodeMirror: Smalltalk mode

      17 | 18 |
      41 | 42 | 50 | 51 |

      Simple Smalltalk mode.

      52 | 53 |

      MIME types defined: text/x-stsrc.

      54 | 55 | 56 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/sparql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: SPARQL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: SPARQL mode

      13 |
      29 | 36 | 37 |

      MIME types defined: application/x-sparql-query.

      38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/tiki/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Tiki wiki mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: Tiki wiki mode

      13 | 14 |
      71 | 72 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFFFFF; 3 | background-color: #990000; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px ! important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: VBScript mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: VBScript mode

      13 | 14 |
      31 | 32 | 38 | 39 |

      MIME types defined: text/vbscript.

      40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/vbscript/vbscript.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("vbscript", function() { 2 | var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im; 3 | 4 | return { 5 | token: function(stream) { 6 | if (stream.eatSpace()) return null; 7 | var ch = stream.next(); 8 | if (ch == "'") { 9 | stream.skipToEnd(); 10 | return "comment"; 11 | } 12 | if (ch == '"') { 13 | stream.skipTo('"'); 14 | return "string"; 15 | } 16 | 17 | if (/\w/.test(ch)) { 18 | stream.eatWhile(/\w/); 19 | if (regexVBScriptKeyword.test(stream.current())) return "keyword"; 20 | } 21 | return null; 22 | } 23 | }; 24 | }); 25 | 26 | CodeMirror.defineMIME("text/vbscript", "vbscript"); 27 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: XML mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: XML mode

      13 |
      25 | 31 |

      The XML mode supports two configuration parameters:

      32 |
      33 |
      htmlMode (boolean)
      34 |
      This switches the mode to parse HTML instead of XML. This 35 | means attributes do not have to be quoted, and some elements 36 | (such as br) do not require a closing tag.
      37 |
      alignCDATA (boolean)
      38 |
      Setting this to true will force the opening tag of CDATA 39 | blocks to not be indented.
      40 |
      41 | 42 |

      MIME types defined: application/xml, text/html.

      43 | 44 | 45 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xquery/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by MarkLogic Corporation 2 | Author: Mike Brevoort 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xquery/test/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

      XQuery CodeMirror Mode

      21 |

      22 |

      23 |
        24 |
      25 |
      26 | 27 | 28 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xquery/test/testEmptySequenceKeyword.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testEmptySequenceKeyword"); 3 | test("testEmptySequenceKeyword", function() { 4 | expect(1); 5 | 6 | var input = '"foo" instance of empty-sequence()'; 7 | var expected = '"foo" instance of empty-sequence()'; 8 | 9 | $("#sandbox").html(''); 10 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 11 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 12 | 13 | equal(result, expected); 14 | $("#editor").html(""); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xquery/test/testMultiAttr.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testMultiAttr"); 3 | test("test1", function() { 4 | expect(1); 5 | 6 | var expected = '<p a1="foo" a2="bar">hello world</p>'; 7 | 8 | $("#sandbox").html(''); 9 | $("#editor").html('

      hello world

      '); 10 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 11 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 12 | 13 | equal(result, expected); 14 | $("#editor").html(""); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xquery/test/testProcessingInstructions.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testProcessingInstructions"); 3 | test("testProcessingInstructions", function() { 4 | expect(1); 5 | 6 | var input = 'data() instance of xs:string'; 7 | var expected = 'data(<?target content?>) instance of xs:string'; 8 | 9 | $("#sandbox").html(''); 10 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 11 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 12 | 13 | equal(result, expected); 14 | $("#editor").html(""); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/xquery/test/testQuotes.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testQuoteEscape"); 3 | test("testQuoteEscapeDouble", function() { 4 | expect(1); 5 | 6 | var input = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"\ 7 | let $keysfolder := concat($rootfolder, "keys\\")\ 8 | return\ 9 | $keysfolder'; 10 | var expected = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"let $keysfolder := concat($rootfolder, "keys\\")return$keysfolder'; 11 | 12 | $("#sandbox").html(''); 13 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 14 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 15 | 16 | equal(result, expected); 17 | $("#editor").html(""); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /mini-code-edit/cm/mode/yaml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: YAML mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

      CodeMirror: YAML mode

      13 |
      60 | 63 | 64 |

      MIME types defined: text/x-yaml.

      65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /mini-code-edit/cm/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Test Suite 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |

      CodeMirror: Test Suite

      17 | 18 |

      A limited set of programmatic sanity tests for CodeMirror.

      19 | 20 |
      
      21 | 
      22 |     
      25 | 
      26 |     
      27 |   
      28 | 
      29 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/test/mode_test.css:
      --------------------------------------------------------------------------------
       1 | .mt-output .mt-token {
       2 |   border: 1px solid #ddd;
       3 |   white-space: pre;
       4 |   font-family: "Consolas", monospace;
       5 |   text-align: center;
       6 | }
       7 | 
       8 | .mt-output .mt-style {
       9 |   font-size: x-small;
      10 | }
      11 | 
      12 | .mt-test {
      13 |   border-left: 10px solid #fff;
      14 | }
      15 | 
      16 | .mt-pass {
      17 |   border-left: 10px solid #cfc;
      18 | }
      19 | 
      20 | .mt-fail {
      21 |   border-left: 10px solid #fcc;
      22 | }
      23 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/blackboard.css:
      --------------------------------------------------------------------------------
       1 | /* Port of TextMate's Blackboard theme */
       2 | 
       3 | .cm-s-blackboard { background: #0C1021; color: #F8F8F8; }
       4 | .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
       5 | .cm-s-blackboard .CodeMirror-gutter { background: #0C1021; border-right: 0; }
       6 | .cm-s-blackboard .CodeMirror-gutter-text { color: #888; }
       7 | .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
       8 | 
       9 | .cm-s-blackboard .cm-keyword { color: #FBDE2D; }
      10 | .cm-s-blackboard .cm-atom { color: #D8FA3C; }
      11 | .cm-s-blackboard .cm-number { color: #D8FA3C; }
      12 | .cm-s-blackboard .cm-def { color: #8DA6CE; }
      13 | .cm-s-blackboard .cm-variable { color: #FF6400; }
      14 | .cm-s-blackboard .cm-operator { color: #FBDE2D;}
      15 | .cm-s-blackboard .cm-comment { color: #AEAEAE; }
      16 | .cm-s-blackboard .cm-string { color: #61CE3C; }
      17 | .cm-s-blackboard .cm-string-2 { color: #61CE3C; }
      18 | .cm-s-blackboard .cm-meta { color: #D8FA3C; }
      19 | .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
      20 | .cm-s-blackboard .cm-builtin { color: #8DA6CE; }
      21 | .cm-s-blackboard .cm-tag { color: #8DA6CE; }
      22 | .cm-s-blackboard .cm-attribute { color: #8DA6CE; }
      23 | .cm-s-blackboard .cm-header { color: #FF6400; }
      24 | .cm-s-blackboard .cm-hr { color: #AEAEAE; }
      25 | .cm-s-blackboard .cm-link { color: #8DA6CE; }
      26 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/cobalt.css:
      --------------------------------------------------------------------------------
       1 | .cm-s-cobalt { background: #002240; color: white; }
       2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
       3 | .cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
       4 | .cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
       5 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
       6 | 
       7 | .cm-s-cobalt span.cm-comment { color: #08f; }
       8 | .cm-s-cobalt span.cm-atom { color: #845dc4; }
       9 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
      10 | .cm-s-cobalt span.cm-keyword { color: #ffee80; }
      11 | .cm-s-cobalt span.cm-string { color: #3ad900; }
      12 | .cm-s-cobalt span.cm-meta { color: #ff9d00; }
      13 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
      14 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
      15 | .cm-s-cobalt span.cm-error { color: #9d1e15; }
      16 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
      17 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
      18 | .cm-s-cobalt span.cm-link { color: #845dc4; }
      19 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/eclipse.css:
      --------------------------------------------------------------------------------
       1 | .cm-s-eclipse span.cm-meta {color: #FF1717;}
       2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
       3 | .cm-s-eclipse span.cm-atom {color: #219;}
       4 | .cm-s-eclipse span.cm-number {color: #164;}
       5 | .cm-s-eclipse span.cm-def {color: #00f;}
       6 | .cm-s-eclipse span.cm-variable {color: black;}
       7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
       8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
       9 | .cm-s-eclipse span.cm-property {color: black;}
      10 | .cm-s-eclipse span.cm-operator {color: black;}
      11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;}
      12 | .cm-s-eclipse span.cm-string {color: #2A00FF;}
      13 | .cm-s-eclipse span.cm-string-2 {color: #f50;}
      14 | .cm-s-eclipse span.cm-error {color: #f00;}
      15 | .cm-s-eclipse span.cm-qualifier {color: #555;}
      16 | .cm-s-eclipse span.cm-builtin {color: #30a;}
      17 | .cm-s-eclipse span.cm-bracket {color: #cc7;}
      18 | .cm-s-eclipse span.cm-tag {color: #170;}
      19 | .cm-s-eclipse span.cm-attribute {color: #00c;}
      20 | .cm-s-eclipse span.cm-link {color: #219;}
      21 | 
      22 | .cm-s-eclipse .CodeMirror-matchingbracket {
      23 | 	border:1px solid grey;
      24 | 	color:black !important;;
      25 | }
      26 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/elegant.css:
      --------------------------------------------------------------------------------
       1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
       2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
       3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
       4 | .cm-s-elegant span.cm-variable {color: black;}
       5 | .cm-s-elegant span.cm-variable-2 {color: #b11;}
       6 | .cm-s-elegant span.cm-qualifier {color: #555;}
       7 | .cm-s-elegant span.cm-keyword {color: #730;}
       8 | .cm-s-elegant span.cm-builtin {color: #30a;}
       9 | .cm-s-elegant span.cm-error {background-color: #fdd;}
      10 | .cm-s-elegant span.cm-link {color: #762;}
      11 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/erlang-dark.css:
      --------------------------------------------------------------------------------
       1 | .cm-s-erlang-dark { background: #002240; color: white; }
       2 | .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
       3 | .cm-s-erlang-dark .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
       4 | .cm-s-erlang-dark .CodeMirror-gutter-text { color: #d0d0d0; }
       5 | .cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
       6 | 
       7 | .cm-s-erlang-dark span.cm-atom       { color: #845dc4; }
       8 | .cm-s-erlang-dark span.cm-attribute  { color: #ff80e1; }
       9 | .cm-s-erlang-dark span.cm-bracket    { color: #ff9d00; }
      10 | .cm-s-erlang-dark span.cm-builtin    { color: #eeaaaa; }
      11 | .cm-s-erlang-dark span.cm-comment    { color: #7777ff; }
      12 | .cm-s-erlang-dark span.cm-def        { color: #ee77aa; }
      13 | .cm-s-erlang-dark span.cm-error      { color: #9d1e15; }
      14 | .cm-s-erlang-dark span.cm-keyword    { color: #ffee80; }
      15 | .cm-s-erlang-dark span.cm-meta       { color: #50fefe; }
      16 | .cm-s-erlang-dark span.cm-number     { color: #ffd0d0; }
      17 | .cm-s-erlang-dark span.cm-operator   { color: #dd1111; }
      18 | .cm-s-erlang-dark span.cm-string     { color: #3ad900; }
      19 | .cm-s-erlang-dark span.cm-tag        { color: #9effff; }
      20 | .cm-s-erlang-dark span.cm-variable   { color: #50fe50; }
      21 | .cm-s-erlang-dark span.cm-variable-2 { color: #ee00ee; }
      22 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/lesser-dark.css:
      --------------------------------------------------------------------------------
       1 | /*
       2 | http://lesscss.org/ dark theme
       3 | Ported to CodeMirror by Peter Kroon
       4 | */
       5 | .CodeMirror{
       6 |   line-height: 17px;
       7 | }
       8 | .cm-s-lesser-dark {
       9 |   font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important;
      10 |   font-size:14px;
      11 | }
      12 | 
      13 | .cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
      14 | .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
      15 | .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
      16 | .cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/
      17 | 
      18 | div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/
      19 | 
      20 | .cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; }
      21 | .cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; }
      22 | 
      23 | .cm-s-lesser-dark span.cm-keyword { color: #599eff; }
      24 | .cm-s-lesser-dark span.cm-atom { color: #C2B470; }
      25 | .cm-s-lesser-dark span.cm-number { color: #B35E4D; }
      26 | .cm-s-lesser-dark span.cm-def {color: white;}
      27 | .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; }
      28 | .cm-s-lesser-dark span.cm-variable-2 { color: #669199; }
      29 | .cm-s-lesser-dark span.cm-variable-3 { color: white; }
      30 | .cm-s-lesser-dark span.cm-property {color: #92A75C;}
      31 | .cm-s-lesser-dark span.cm-operator {color: #92A75C;}
      32 | .cm-s-lesser-dark span.cm-comment { color: #666; }
      33 | .cm-s-lesser-dark span.cm-string { color: #BCD279; }
      34 | .cm-s-lesser-dark span.cm-string-2 {color: #f50;}
      35 | .cm-s-lesser-dark span.cm-meta { color: #738C73; }
      36 | .cm-s-lesser-dark span.cm-error { color: #9d1e15; }
      37 | .cm-s-lesser-dark span.cm-qualifier {color: #555;}
      38 | .cm-s-lesser-dark span.cm-builtin { color: #ff9e59; }
      39 | .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }
      40 | .cm-s-lesser-dark span.cm-tag { color: #669199; }
      41 | .cm-s-lesser-dark span.cm-attribute {color: #66c;}
      42 | .cm-s-lesser-dark span.cm-header {color: #a0a;}
      43 | .cm-s-lesser-dark span.cm-quote {color: #090;}
      44 | .cm-s-lesser-dark span.cm-hr {color: #999;}
      45 | .cm-s-lesser-dark span.cm-link {color: #00c;}
      46 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/monokai.css:
      --------------------------------------------------------------------------------
       1 | /* Based on Sublime Text's Monokai theme */
       2 | 
       3 | .cm-s-monokai {background: #272822; color: #f8f8f2;}
       4 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
       5 | .cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;}
       6 | .cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
       7 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
       8 | 
       9 | .cm-s-monokai span.cm-comment {color: #75715e;}
      10 | .cm-s-monokai span.cm-atom {color: #ae81ff;}
      11 | .cm-s-monokai span.cm-number {color: #ae81ff;}
      12 | 
      13 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
      14 | .cm-s-monokai span.cm-keyword {color: #f92672;}
      15 | .cm-s-monokai span.cm-string {color: #e6db74;}
      16 | 
      17 | .cm-s-monokai span.cm-variable {color: #a6e22e;}
      18 | .cm-s-monokai span.cm-variable-2 {color: #9effff;}
      19 | .cm-s-monokai span.cm-def {color: #fd971f;}
      20 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
      21 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;}
      22 | .cm-s-monokai span.cm-tag {color: #f92672;}
      23 | .cm-s-monokai span.cm-link {color: #ae81ff;}
      24 | 
      25 | .cm-s-monokai .CodeMirror-matchingbracket {
      26 |   text-decoration: underline;
      27 |   color: white !important;
      28 | }
      29 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/neat.css:
      --------------------------------------------------------------------------------
       1 | .cm-s-neat span.cm-comment { color: #a86; }
       2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; }
       3 | .cm-s-neat span.cm-string { color: #a22; }
       4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; }
       5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; }
       6 | .cm-s-neat span.cm-variable { color: black; }
       7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
       8 | .cm-s-neat span.cm-meta {color: #555;}
       9 | .cm-s-neat span.cm-link { color: #3a3; }
      10 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/night.css:
      --------------------------------------------------------------------------------
       1 | /* Loosely based on the Midnight Textmate theme */
       2 | 
       3 | .cm-s-night { background: #0a001f; color: #f8f8f8; }
       4 | .cm-s-night div.CodeMirror-selected { background: #a8f !important; }
       5 | .cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
       6 | .cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
       7 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
       8 | 
       9 | .cm-s-night span.cm-comment { color: #6900a1; }
      10 | .cm-s-night span.cm-atom { color: #845dc4; }
      11 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
      12 | .cm-s-night span.cm-keyword { color: #599eff; }
      13 | .cm-s-night span.cm-string { color: #37f14a; }
      14 | .cm-s-night span.cm-meta { color: #7678e2; }
      15 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
      16 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
      17 | .cm-s-night span.cm-error { color: #9d1e15; }
      18 | .cm-s-night span.cm-bracket { color: #8da6ce; }
      19 | .cm-s-night span.cm-comment { color: #6900a1; }
      20 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
      21 | .cm-s-night span.cm-link { color: #845dc4; }
      22 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/rubyblue.css:
      --------------------------------------------------------------------------------
       1 | .cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; }	/* - customized editor font - */
       2 | 
       3 | .cm-s-rubyblue { background: #112435; color: white; }
       4 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
       5 | .cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; }
       6 | .cm-s-rubyblue .CodeMirror-gutter-text { color: white; }
       7 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
       8 | 
       9 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }
      10 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; }
      11 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }
      12 | .cm-s-rubyblue span.cm-keyword { color: #F0F; }
      13 | .cm-s-rubyblue span.cm-string { color: #F08047; }
      14 | .cm-s-rubyblue span.cm-meta { color: #F0F; }
      15 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
      16 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
      17 | .cm-s-rubyblue span.cm-error { color: #AF2018; }
      18 | .cm-s-rubyblue span.cm-bracket { color: #F0F; }
      19 | .cm-s-rubyblue span.cm-link { color: #F4C20B; }
      20 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
      21 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
      22 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/cm/theme/xq-dark.css:
      --------------------------------------------------------------------------------
       1 | /*
       2 | Copyright (C) 2011 by MarkLogic Corporation
       3 | Author: Mike Brevoort 
       4 | 
       5 | Permission is hereby granted, free of charge, to any person obtaining a copy
       6 | of this software and associated documentation files (the "Software"), to deal
       7 | in the Software without restriction, including without limitation the rights
       8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
       9 | copies of the Software, and to permit persons to whom the Software is
      10 | furnished to do so, subject to the following conditions:
      11 | 
      12 | The above copyright notice and this permission notice shall be included in
      13 | all copies or substantial portions of the Software.
      14 | 
      15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
      18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
      20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
      21 | THE SOFTWARE.
      22 | */
      23 | .cm-s-xq-dark { background: #0a001f; color: #f8f8f8; }
      24 | .cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
      25 | .cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
      26 | .cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; }
      27 | .cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
      28 | 
      29 | .cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
      30 | .cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
      31 | .cm-s-xq-dark span.cm-number {color: #164;}
      32 | .cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
      33 | .cm-s-xq-dark span.cm-variable {color: #FFF;}
      34 | .cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
      35 | .cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
      36 | .cm-s-xq-dark span.cm-property {}
      37 | .cm-s-xq-dark span.cm-operator {}
      38 | .cm-s-xq-dark span.cm-comment {color: gray;}
      39 | .cm-s-xq-dark span.cm-string {color: #9FEE00;}
      40 | .cm-s-xq-dark span.cm-meta {color: yellow;}
      41 | .cm-s-xq-dark span.cm-error {color: #f00;}
      42 | .cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
      43 | .cm-s-xq-dark span.cm-builtin {color: #30a;}
      44 | .cm-s-xq-dark span.cm-bracket {color: #cc7;}
      45 | .cm-s-xq-dark span.cm-tag {color: #FFBD40;}
      46 | .cm-s-xq-dark span.cm-attribute {color: #FFF700;}
      47 | 
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/128x128/file_edit.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/128x128/file_edit.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/16x16/diskette.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/16x16/diskette.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/16x16/file.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/16x16/file.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/16x16/file_add.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/16x16/file_add.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/16x16/file_edit.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/16x16/file_edit.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/32x32/diskette.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/32x32/diskette.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/32x32/file.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/32x32/file.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/32x32/file_add.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/32x32/file_add.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/32x32/file_edit.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/32x32/file_edit.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/48x48/file_edit.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/48x48/file_edit.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/64x64/file_edit.png:
      --------------------------------------------------------------------------------
      https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mini-code-edit/img/64x64/file_edit.png
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/img/README.txt:
      --------------------------------------------------------------------------------
      1 | Icons from http://www.smashingmagazine.com/2008/09/02/simplicio-a-free-icon-set/
      
      
      --------------------------------------------------------------------------------
      /mini-code-edit/main.html:
      --------------------------------------------------------------------------------
       1 | 
       2 | 
       3 | 
       4 | Mini Code Editor
       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 | -------------------------------------------------------------------------------- /mini-code-edit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MiniCodeEdit", 3 | "version": "0.1.11", 4 | "description": "A very small code editor.", 5 | "main": "main.html", 6 | "window": { 7 | "width": 400, 8 | "height": 520, 9 | "show": false, 10 | "title": "Mini Code Editor", 11 | "toolbar": false 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /mini-code-edit/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | margin-top: 5px; 5 | overflow: hidden; 6 | } 7 | 8 | button { 9 | margin: 0; 10 | } 11 | 12 | .CodeMirror { 13 | margin: 0; 14 | padding: 0; 15 | } 16 | 17 | .CodeMirror-scroll { 18 | height: auto; 19 | overflow-y: hidden; 20 | overflow-x: auto; 21 | } 22 | 23 | #editor { 24 | position: absolute; 25 | top: 37px; 26 | bottom: 24px; 27 | left: 0; 28 | right: 0; 29 | background: #262626; 30 | } 31 | 32 | .info { 33 | font-family: monospace; 34 | white-space: nowrap; 35 | position: absolute; 36 | bottom: 0; 37 | background: #eee; 38 | padding: 2px; 39 | height: 20px; 40 | left: 0; 41 | right: 0; 42 | } 43 | 44 | .info label { 45 | font-weight: bold; 46 | } 47 | 48 | .buttons { 49 | padding: 2px; 50 | height: 25px; 51 | } 52 | -------------------------------------------------------------------------------- /mp3-encoder/Cakefile: -------------------------------------------------------------------------------- 1 | {spawn, exec} = require "child_process" 2 | 3 | task 'build', 'Compile coffee scripts into plain Javascript files', -> 4 | child = exec "coffee -c -j lib/main.js src/*.coffee src/**/*.coffee", (err, stdout, stderr) -> 5 | if err? 6 | console.error "Error :" 7 | console.dir err 8 | console.log stdout 9 | console.error stderr 10 | else 11 | console.log "Done!" 12 | -------------------------------------------------------------------------------- /mp3-encoder/README.md: -------------------------------------------------------------------------------- 1 | MP3 Encoder 2 | =============== 3 | 4 | Dummy app to test node-wekbit using an external process, coffee-script 5 | and backbone on both windows and OSX 6 | -------------------------------------------------------------------------------- /mp3-encoder/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | MP3 Encoder 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 |

      Dummy MP3 encoder

      17 |

      Pick up a .wav file

      18 |
      19 |
      20 | 21 | 22 | -------------------------------------------------------------------------------- /mp3-encoder/lib/nwjs_extras.js: -------------------------------------------------------------------------------- 1 | var gui = require("nw.gui"); 2 | 3 | // Extend application menu for Mac OS 4 | if (process.platform == "darwin") { 5 | var menu = new gui.Menu({type: "menubar"}); 6 | menu.createMacBuiltin && menu.createMacBuiltin(window.document.title); 7 | gui.Window.get().menu = menu; 8 | } 9 | 10 | gui.Window.get().show(); -------------------------------------------------------------------------------- /mp3-encoder/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mp3-encoder", 3 | "main": "index.html", 4 | "window": { 5 | "toolbar": false, 6 | "resizable": false, 7 | "width": 660, 8 | "height": 500 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mp3-encoder/src/main.coffee: -------------------------------------------------------------------------------- 1 | $ -> 2 | form = new EncodeFormView 3 | logsElem: $("div.logs") 4 | 5 | form.render().$el.appendTo $("div.form") 6 | -------------------------------------------------------------------------------- /mp3-encoder/src/utils/encoder.coffee: -------------------------------------------------------------------------------- 1 | {spawn} = require "child_process" 2 | {platform} = require "os" 3 | {chmodSync} = require "fs" 4 | 5 | 6 | class Encoder 7 | constructor: ({@source, @bitrate, @target, @log}) -> 8 | @target ||= @source.replace /\.wav$/, ".mp3" 9 | if @target == @source 10 | @target = @target.replace(/\.([^.]+)$/, ' encoded.$1') 11 | 12 | @bitrate ||= 128 13 | 14 | switch platform() 15 | when "darwin" 16 | @pathToBin = "vendor/bin/osx/shineenc" 17 | when "win32" 18 | @pathToBin = "vendor/bin/win32/shineenc.exe" 19 | 20 | # binary may not be executable due to zip compression.. 21 | chmodSync @pathToBin, 0o755 22 | 23 | process: -> 24 | @log "Starting encoding process.." 25 | 26 | @child = spawn @pathToBin, ["-b", @bitrate, @source, @target] 27 | 28 | @child.stdout.on "data", (data) => 29 | @log "#{data.toString().replace(/\n/g, '
      ')}" 30 | 31 | @child.stderr.on "data", (data) => 32 | @log "ERROR: #{data.toString().replace(/\n/g, '
      ')}", 'error' 33 | 34 | @child.on "exit", (code) => 35 | style = if code == 0 then 'good' else 'error' 36 | @log "Encoding process exited with code: #{code}", style 37 | -------------------------------------------------------------------------------- /mp3-encoder/src/views/form.coffee: -------------------------------------------------------------------------------- 1 | class EncodeFormView extends Backbone.View 2 | tagName: "form" 3 | events: 4 | "submit" : "onSubmit" 5 | 6 | initialize: ({@logsElem}) -> 7 | 8 | render: -> 9 | @$el.html """ 10 | File:
      11 | Bitrate:
      12 | 13 | """ 14 | 15 | this 16 | 17 | onSubmit: (e) -> 18 | e.preventDefault() 19 | 20 | data = 21 | source: @$("input.file").val() 22 | bitrate: parseInt @$("input.bitrate").val() 23 | log: (data, type = 'info') => 24 | @logsElem.html "#{@logsElem.html()}
      #{data}" 25 | 26 | return console.log "no file!" unless data.source? 27 | 28 | (new Encoder data).process() 29 | -------------------------------------------------------------------------------- /mp3-encoder/vendor/bin/osx/shineenc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mp3-encoder/vendor/bin/osx/shineenc -------------------------------------------------------------------------------- /mp3-encoder/vendor/bin/win32/libshine-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mp3-encoder/vendor/bin/win32/libshine-1.dll -------------------------------------------------------------------------------- /mp3-encoder/vendor/bin/win32/shineenc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/mp3-encoder/vendor/bin/win32/shineenc.exe -------------------------------------------------------------------------------- /notifications/README.md: -------------------------------------------------------------------------------- 1 | ## Notifications example 2 | 3 | Sample appication for NW.js Notification API, also include examples using external libraries 4 | 5 | **How to run:** 6 | 7 | ``` 8 | git clone git@github.com:zcbenz/nw-sample-apps.git 9 | nw nw-sample-apps/notifications 10 | ``` 11 | 12 | **How to set your icon for OS X:** 13 | 14 | ``` 15 | cd nw-sample-apps/notifications 16 | npm install nw 17 | touch node_modules/nw/nwjs/nwjs.app 18 | touch node_modules/nw/nwjs/nwjs.app/Contents/Info.plist 19 | ./node_modules/.bin/nw --mac_plist ./mac_files/app.plist --mac_icon ./mac_files/app.icns 20 | ``` 21 | 22 | ## APIs 23 | 24 | * [Notification](https://github.com/nwjs/nw.js/wiki/Notification) 25 | 26 | ## Extras 27 | 28 | * [node-notifier](https://github.com/mikaelbr/node-notifier) 29 | * [nw-notify](https://www.npmjs.com/package/nw-notify) 30 | 31 | -------------------------------------------------------------------------------- /notifications/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | width: 100%; 4 | margin: 0; 5 | font-family: Helvetica Neue, Lucida Grande, Segoe UI, Tahoma, sans; 6 | font-size: 16px; 7 | background: #EDEDED; 8 | } 9 | 10 | section { 11 | padding: 1em 1em 0; 12 | } 13 | 14 | section .buttons-group { 15 | margin-bottom: 1em; 16 | } 17 | 18 | section .buttons-group h5 { 19 | margin-top: 0; 20 | margin-bottom: 0.65em; 21 | } 22 | 23 | #output { 24 | margin-top: 20px; 25 | box-sizing: border-box; 26 | padding: 5px; 27 | font-size: 12px; 28 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 29 | background: #fff; 30 | border: 1px solid #BEBEBE; 31 | height: 248px; 32 | max-height: 248px; 33 | overflow: auto; 34 | } -------------------------------------------------------------------------------- /notifications/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NW.js Notifications Test 5 | 6 | 7 | 8 | 9 | 10 |
      11 |
      12 |
      Build in
      13 | 14 | 15 | 16 |
      17 | 18 |
      19 |
      node-notifier
      20 | 21 | 22 | 23 |
      24 | 25 |
      26 |
      nw-notify
      27 | 28 | 29 | 30 |
      31 | 32 |
      33 | 34 |
      35 |
      36 | 37 | 38 | -------------------------------------------------------------------------------- /notifications/icons/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/notifications/icons/camera.png -------------------------------------------------------------------------------- /notifications/icons/car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/notifications/icons/car.png -------------------------------------------------------------------------------- /notifications/icons/coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/notifications/icons/coffee.png -------------------------------------------------------------------------------- /notifications/mac_files/app.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/notifications/mac_files/app.icns -------------------------------------------------------------------------------- /notifications/mac_files/app.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NW.js Example 9 | CFBundleDocumentTypes 10 | 11 | CFBundleExecutable 12 | nwjs 13 | CFBundleIconFile 14 | app.icns 15 | CFBundleIdentifier 16 | org.nwjs.sample.notifications 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | NW.js Example 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 0.1 25 | CFBundleVersion 26 | First version 27 | LSFileQuarantineEnabled 28 | 29 | LSMinimumSystemVersion 30 | 10.6.0 31 | NSPrincipalClass 32 | NSApplication 33 | NSSupportsAutomaticGraphicsSwitching 34 | 35 | SCMRevision 36 | 175484 37 | UTExportedTypeDeclarations 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /notifications/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nw-notification-demo", 3 | "main": "app.html", 4 | "window": { 5 | "show": true, 6 | "frame": true, 7 | "toolbar": false, 8 | "icon": "app.icns", 9 | "width": 550, 10 | "height": 470 11 | }, 12 | "dependencies": { 13 | "node-notifier": "^4.2.1", 14 | "nw-notify": "0.2.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nw-sample-apps", 3 | "private": true, 4 | "devDependencies": { 5 | "nw": "^0.79.1-sdk" 6 | }, 7 | "scripts": { 8 | "start": "nw" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /webgl/README.md: -------------------------------------------------------------------------------- 1 | # Hello 3D World 2 | 3 | This is the most basic application that one can create, using WebGL capabilities. It loads a (cool) 3D model from a JSON file and allows for model rotation and camera zooming, based on mouse movements. 4 | 5 | **This demo requires node-webkit >= v0.3.0.** 6 | 7 | ## Screen shot 8 | 9 | ![screenshot](http://ww3.sinaimg.cn/large/6556d357tw1dxuiwtpnwwj.jpg) 10 | 11 | ## External libs 12 | 13 | * [Three.js](https://github.com/mrdoob/three.js/) 14 | -------------------------------------------------------------------------------- /webgl/icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/webgl/icon_128.png -------------------------------------------------------------------------------- /webgl/img/button_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/webgl/img/button_close.png -------------------------------------------------------------------------------- /webgl/img/button_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwutils/nw-sample-apps/f3eae74d5a968acf0f321a3f3b4fa30add1b5fd9/webgl/img/button_close_hover.png -------------------------------------------------------------------------------- /webgl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello 3D World 6 | 7 | 8 | 9 | 10 | 11 | 12 |
      13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /webgl/js/Detector.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author alteredq / http://alteredqualia.com/ 3 | * @author mr.doob / http://mrdoob.com/ 4 | */ 5 | 6 | Detector = { 7 | 8 | canvas: !! window.CanvasRenderingContext2D, 9 | webgl: ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(), 10 | workers: !! window.Worker, 11 | fileapi: window.File && window.FileReader && window.FileList && window.Blob, 12 | 13 | getWebGLErrorMessage: function () { 14 | 15 | var element = document.createElement( 'div' ); 16 | element.id = 'webgl-error-message'; 17 | element.style.fontFamily = 'monospace'; 18 | element.style.fontSize = '13px'; 19 | element.style.fontWeight = 'normal'; 20 | element.style.textAlign = 'center'; 21 | element.style.background = '#fff'; 22 | element.style.color = '#000'; 23 | element.style.padding = '1.5em'; 24 | element.style.width = '400px'; 25 | element.style.margin = '5em auto 0'; 26 | 27 | if ( ! this.webgl ) { 28 | 29 | element.innerHTML = window.WebGLRenderingContext ? [ 30 | 'Your graphics card does not seem to support WebGL.
      ', 31 | 'Find out how to get it here.' 32 | ].join( '\n' ) : [ 33 | 'Your browser does not seem to support WebGL.
      ', 34 | 'Find out how to get it here.' 35 | ].join( '\n' ); 36 | 37 | } 38 | 39 | return element; 40 | 41 | }, 42 | 43 | addGetWebGLMessage: function ( parameters ) { 44 | 45 | var parent, id, element; 46 | 47 | parameters = parameters || {}; 48 | 49 | parent = parameters.parent !== undefined ? parameters.parent : document.body; 50 | id = parameters.id !== undefined ? parameters.id : 'oldie'; 51 | 52 | element = Detector.getWebGLErrorMessage(); 53 | element.id = id; 54 | 55 | parent.appendChild( element ); 56 | 57 | } 58 | 59 | }; 60 | -------------------------------------------------------------------------------- /webgl/js/nwjs_extras.js: -------------------------------------------------------------------------------- 1 | var gui = require("nw.gui"); 2 | 3 | // Extend application menu for Mac OS 4 | if (process.platform == "darwin") { 5 | var menu = new gui.Menu({type: "menubar"}); 6 | menu.createMacBuiltin && menu.createMacBuiltin(window.document.title); 7 | gui.Window.get().menu = menu; 8 | } 9 | 10 | gui.Window.get().show(); -------------------------------------------------------------------------------- /webgl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Hello-3D-World", 3 | "version": "1.0.0", 4 | "main": "index.html", 5 | "window": { 6 | "frame": false, 7 | "width": 500, 8 | "height": 400, 9 | "toolbar": false, 10 | "position": "center", 11 | "resizable": false 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /webgl/styles/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: black; 3 | margin: 0; 4 | padding: 0; 5 | overflow: hidden; 6 | } 7 | 8 | .close { 9 | background-image: url('../img/button_close.png'); 10 | background-repeat: no-repeat; 11 | position: absolute; 12 | top: 5px; 13 | right: 5px; 14 | z-index: 1000; 15 | width: 17px; 16 | height: 17px; 17 | cursor: pointer; 18 | -webkit-app-region: no-drag; 19 | } 20 | 21 | .close:hover { 22 | background-image: url('../img/button_close_hover.png'); 23 | } 24 | 25 | --------------------------------------------------------------------------------