├── README.md ├── angularjs └── .empty ├── dart_web_ui ├── .empty └── .gitignore ├── js ├── .gitignore ├── lib │ ├── dialog │ │ ├── index.js │ │ └── Dialog.js │ ├── splitter │ │ └── index.js │ ├── tab │ │ ├── index.js │ │ └── TabPage.js │ ├── decorators │ │ └── index.js │ ├── serialization │ │ ├── index.js │ │ ├── DockGraphSerializer.js │ │ └── DockGraphDeserializer.js │ ├── utils │ │ ├── index.js │ │ ├── EventHandler.js │ │ └── DockUtils.js │ ├── dock │ │ ├── index.js │ │ ├── Exception.js │ │ ├── DockManagerContext.js │ │ └── DockModel.js │ ├── containers │ │ ├── index.js │ │ ├── VerticalDockContainer.js │ │ ├── HorizontalDockContainer.js │ │ ├── FillDockContainer.js │ │ ├── SplitterDockContainer.js │ │ └── DocumentManagerContainer.js │ └── combine.js ├── out │ ├── images │ │ ├── dock_fill.png │ │ ├── dock_left.png │ │ ├── dock_top.png │ │ ├── dock_bottom.png │ │ ├── dock_right.png │ │ ├── dock_top_sel.png │ │ ├── dock_fill_sel.png │ │ ├── dock_left_sel.png │ │ ├── dock_right_sel.png │ │ └── dock_bottom_sel.png │ ├── font │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── proximanova-webfont.eot │ │ ├── proximanova-webfont.ttf │ │ └── fontawesome-webfont.woff │ └── demos │ │ └── ide │ │ ├── infovis │ │ ├── jit-base.css │ │ ├── dock_tree_vis.html │ │ └── Spacetree.css │ │ └── demo.css └── build.bat ├── dart-dock-spawn ├── web │ ├── demos │ │ ├── dock_spawn_demo_ide │ │ │ ├── .children │ │ │ ├── resources │ │ │ │ ├── jstree │ │ │ │ │ └── themes │ │ │ │ │ │ ├── apple │ │ │ │ │ │ ├── bg.jpg │ │ │ │ │ │ ├── d.png │ │ │ │ │ │ ├── dot_for_ie.gif │ │ │ │ │ │ └── throbber.gif │ │ │ │ │ │ ├── classic │ │ │ │ │ │ ├── d.gif │ │ │ │ │ │ ├── d.png │ │ │ │ │ │ ├── throbber.gif │ │ │ │ │ │ └── dot_for_ie.gif │ │ │ │ │ │ ├── default │ │ │ │ │ │ ├── d.gif │ │ │ │ │ │ ├── d.png │ │ │ │ │ │ └── throbber.gif │ │ │ │ │ │ └── default-rtl │ │ │ │ │ │ ├── d.gif │ │ │ │ │ │ ├── d.png │ │ │ │ │ │ ├── dots.gif │ │ │ │ │ │ └── throbber.gif │ │ │ │ ├── codemirror │ │ │ │ │ ├── mode │ │ │ │ │ │ ├── rpm │ │ │ │ │ │ │ ├── spec │ │ │ │ │ │ │ │ ├── spec.css │ │ │ │ │ │ │ │ └── spec.js │ │ │ │ │ │ │ └── changes │ │ │ │ │ │ │ │ ├── changes.js │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── tiddlywiki │ │ │ │ │ │ │ └── tiddlywiki.css │ │ │ │ │ │ ├── tiki │ │ │ │ │ │ │ ├── tiki.css │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── xquery │ │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ │ ├── testEmptySequenceKeyword.js │ │ │ │ │ │ │ │ ├── testProcessingInstructions.js │ │ │ │ │ │ │ │ ├── testMultiAttr.js │ │ │ │ │ │ │ │ ├── testQuotes.js │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ └── LICENSE │ │ │ │ │ │ ├── diff │ │ │ │ │ │ │ └── diff.js │ │ │ │ │ │ ├── vbscript │ │ │ │ │ │ │ ├── vbscript.js │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── pascal │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── ntriples │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── python │ │ │ │ │ │ │ └── LICENSE.txt │ │ │ │ │ │ ├── perl │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── vb │ │ │ │ │ │ │ └── LICENSE.txt │ │ │ │ │ │ ├── jinja2 │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ └── jinja2.js │ │ │ │ │ │ ├── coffeescript │ │ │ │ │ │ │ └── LICENSE │ │ │ │ │ │ ├── rust │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── ecl │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── css │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── mysql │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── pig │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── properties │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ └── properties.js │ │ │ │ │ │ ├── sparql │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── shell │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── gfm │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── r │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── ruby │ │ │ │ │ │ │ └── LICENSE │ │ │ │ │ │ ├── php │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── smalltalk │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── htmlmixed │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── xml │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── plsql │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── htmlembedded │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ └── htmlembedded.js │ │ │ │ │ │ ├── lua │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── erlang │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── haskell │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── yaml │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── groovy │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── go │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── clojure │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── haxe │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── scheme │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── smarty │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ └── javascript │ │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── lib │ │ │ │ │ │ └── util │ │ │ │ │ │ │ ├── simple-hint.css │ │ │ │ │ │ │ ├── dialog.css │ │ │ │ │ │ │ ├── runmode.js │ │ │ │ │ │ │ ├── match-highlighter.js │ │ │ │ │ │ │ ├── loadmode.js │ │ │ │ │ │ │ ├── overlay.js │ │ │ │ │ │ │ └── dialog.js │ │ │ │ │ └── theme │ │ │ │ │ │ ├── neat.css │ │ │ │ │ │ ├── elegant.css │ │ │ │ │ │ ├── cobalt.css │ │ │ │ │ │ ├── eclipse.css │ │ │ │ │ │ ├── night.css │ │ │ │ │ │ ├── monokai.css │ │ │ │ │ │ ├── erlang-dark.css │ │ │ │ │ │ ├── blackboard.css │ │ │ │ │ │ ├── rubyblue.css │ │ │ │ │ │ ├── vibrant-ink.css │ │ │ │ │ │ ├── lesser-dark.css │ │ │ │ │ │ └── xq-dark.css │ │ │ │ └── ide │ │ │ │ │ ├── js │ │ │ │ │ └── demo-ide.js │ │ │ │ │ └── css │ │ │ │ │ └── dock_spawn_demo_ide.css │ │ │ ├── dock_spawn_demo_ide.dart │ │ │ ├── .project │ │ │ └── ide │ │ │ │ ├── panels │ │ │ │ └── editor_panel.dart │ │ │ │ └── spawn_ide.dart │ │ └── dock_spawn_demo_simple │ │ │ ├── .children │ │ │ ├── .project │ │ │ ├── resources │ │ │ └── css │ │ │ │ └── dock_spawn_demo_simple.css │ │ │ ├── dock_spawn_demo_simple.html │ │ │ └── dock_spawn_demo_simple.dart │ └── resources │ │ ├── images │ │ ├── dock_fill.png │ │ ├── dock_left.png │ │ ├── dock_top.png │ │ ├── dock_bottom.png │ │ ├── dock_right.png │ │ ├── dock_fill_sel.png │ │ ├── dock_left_sel.png │ │ ├── dock_right_sel.png │ │ ├── dock_top_sel.png │ │ └── dock_bottom_sel.png │ │ └── font │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── proximanova-webfont.eot │ │ └── proximanova-webfont.ttf ├── lib │ ├── splitter │ │ └── splitter_exception.dart │ ├── dock │ │ ├── dock_exception.dart │ │ ├── dock_manager_context.dart │ │ └── dock_model.dart │ ├── containers │ │ ├── horizontal_dock_container.dart │ │ ├── vertical_dock_container.dart │ │ ├── dock_container.dart │ │ ├── fill_dock_container.dart │ │ ├── document_dock_container.dart │ │ └── splitter_dock_container.dart │ ├── utils │ │ ├── debug_utils.dart │ │ ├── bounding_box.dart │ │ ├── dock_utils.dart │ │ ├── image_repository.dart │ │ ├── undock_initiator.dart │ │ └── geometric_primitives.dart │ ├── serialization │ │ └── dock_graph_serializer.dart │ ├── dock_spawn.dart │ ├── tab │ │ └── tab_page.dart │ └── dialog │ │ └── dialog.dart ├── .gitignore └── pubspec.yaml ├── AUTHORS ├── .gitignore └── MIT-LICENSE.txt /README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angularjs/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dart_web_ui/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /js/lib/dialog/index.js: -------------------------------------------------------------------------------- 1 | import "Dialog"; 2 | -------------------------------------------------------------------------------- /js/lib/splitter/index.js: -------------------------------------------------------------------------------- 1 | import "SplitterBar"; 2 | import "SplitterPanel"; 3 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/.children: -------------------------------------------------------------------------------- 1 | dock_spawn_demo_ide.dart 2 | -------------------------------------------------------------------------------- /js/lib/tab/index.js: -------------------------------------------------------------------------------- 1 | import "TabHandle"; 2 | import "TabHost"; 3 | import "TabPage"; 4 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_simple/.children: -------------------------------------------------------------------------------- 1 | dock_spawn_demo_simple.dart 2 | -------------------------------------------------------------------------------- /js/lib/decorators/index.js: -------------------------------------------------------------------------------- 1 | import "DraggableContainer"; 2 | import "ResizableContainer"; 3 | -------------------------------------------------------------------------------- /js/lib/serialization/index.js: -------------------------------------------------------------------------------- 1 | import "DockGraphDeserializer"; 2 | import "DockGraphSerializer"; 3 | -------------------------------------------------------------------------------- /js/lib/utils/index.js: -------------------------------------------------------------------------------- 1 | import "DockUtils"; 2 | import "EventHandler"; 3 | import "UndockInitiator"; 4 | -------------------------------------------------------------------------------- /js/out/images/dock_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_fill.png -------------------------------------------------------------------------------- /js/out/images/dock_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_left.png -------------------------------------------------------------------------------- /js/out/images/dock_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_top.png -------------------------------------------------------------------------------- /js/out/images/dock_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_bottom.png -------------------------------------------------------------------------------- /js/out/images/dock_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_right.png -------------------------------------------------------------------------------- /js/out/images/dock_top_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_top_sel.png -------------------------------------------------------------------------------- /js/out/images/dock_fill_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_fill_sel.png -------------------------------------------------------------------------------- /js/out/images/dock_left_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_left_sel.png -------------------------------------------------------------------------------- /js/out/images/dock_right_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_right_sel.png -------------------------------------------------------------------------------- /js/out/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /js/out/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /js/out/font/proximanova-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/font/proximanova-webfont.eot -------------------------------------------------------------------------------- /js/out/font/proximanova-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/font/proximanova-webfont.ttf -------------------------------------------------------------------------------- /js/out/images/dock_bottom_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/images/dock_bottom_sel.png -------------------------------------------------------------------------------- /js/out/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/js/out/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /js/build.bat: -------------------------------------------------------------------------------- 1 | REM Smash .js files together: npm install smash 2 | node node_modules/smash/smash lib/combine.js > out/js/dockspawn.js 3 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Dock Spawn Authors 2 | 3 | Ali Akbar 4 | Marius Volkhart 5 | Fil Mackay 6 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_fill.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_left.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_top.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_bottom.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_right.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_fill_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_fill_sel.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_left_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_left_sel.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_right_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_right_sel.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_top_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_top_sel.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/images/dock_bottom_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/images/dock_bottom_sel.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/font/proximanova-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/font/proximanova-webfont.eot -------------------------------------------------------------------------------- /dart-dock-spawn/web/resources/font/proximanova-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/resources/font/proximanova-webfont.ttf -------------------------------------------------------------------------------- /js/lib/dock/index.js: -------------------------------------------------------------------------------- 1 | import "Exception"; 2 | import "DockLayoutEngine"; 3 | import "DockManager"; 4 | import "DockManagerContext"; 5 | import "DockModel"; 6 | import "DockWheel"; 7 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/splitter/splitter_exception.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class SplitterException { 4 | String message; 5 | SplitterException(this.message); 6 | } 7 | -------------------------------------------------------------------------------- /js/out/demos/ide/infovis/jit-base.css: -------------------------------------------------------------------------------- 1 | #infovis { 2 | position:relative; 3 | width:500px; 4 | height:500px; 5 | overflow:hidden; 6 | background-color:#1a1a1a; 7 | color:#ccc; 8 | } 9 | -------------------------------------------------------------------------------- /dart-dock-spawn/.gitignore: -------------------------------------------------------------------------------- 1 | # Dart Excludes # 2 | ################# 3 | 4 | *~ 5 | *.js 6 | *.js_ 7 | .children 8 | .project 9 | .gitmodules 10 | *.map 11 | *.lock 12 | *.tmp 13 | packages/ 14 | out/ 15 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/dock/dock_exception.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class DockException { 4 | String message; 5 | 6 | DockException(this.message); 7 | String toString() => message; 8 | } 9 | -------------------------------------------------------------------------------- /dart_web_ui/.gitignore: -------------------------------------------------------------------------------- 1 | # Dart Excludes # 2 | ################# 3 | 4 | *~ 5 | *.js 6 | *.js_ 7 | .children 8 | .project 9 | .gitmodules 10 | *.map 11 | *.lock 12 | *.tmp 13 | packages/ 14 | out/ 15 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/bg.jpg -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/d.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/d.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/d.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default/d.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default/d.png -------------------------------------------------------------------------------- /js/lib/dock/Exception.js: -------------------------------------------------------------------------------- 1 | dockspawn.Exception = function(message) 2 | { 3 | this.message = message; 4 | } 5 | 6 | dockspawn.Exception.prototype.toString = function() 7 | { 8 | return this.message; 9 | }; 10 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/d.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/d.png -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/dot_for_ie.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/apple/throbber.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/throbber.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/dots.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/dots.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default/throbber.gif -------------------------------------------------------------------------------- /js/lib/containers/index.js: -------------------------------------------------------------------------------- 1 | import "DocumentManagerContainer"; 2 | import "FillDockContainer"; 3 | import "HorizontalDockContainer"; 4 | import "PanelContainer"; 5 | import "SplitterDockContainer"; 6 | import "VerticalDockContainer"; 7 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/classic/dot_for_ie.gif -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderespawn/dock-spawn/HEAD/dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/jstree/themes/default-rtl/throbber.gif -------------------------------------------------------------------------------- /js/lib/dock/DockManagerContext.js: -------------------------------------------------------------------------------- 1 | dockspawn.DockManagerContext = function(dockManager) 2 | { 3 | this.dockManager = dockManager; 4 | this.model = new dockspawn.DockModel(); 5 | this.documentManagerView = new dockspawn.DocumentManagerContainer(this.dockManager); 6 | }; 7 | -------------------------------------------------------------------------------- /js/lib/combine.js: -------------------------------------------------------------------------------- 1 | (function() 2 | { 3 | dockspawn = {version: "0.0.2"}; 4 | 5 | import "tab/"; 6 | import "dialog/"; 7 | import "decorators/"; 8 | import "dock/"; 9 | import "containers/"; 10 | import "splitter/"; 11 | import "serialization/"; 12 | import "utils/"; 13 | 14 | })(); 15 | -------------------------------------------------------------------------------- /dart-dock-spawn/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dock_spawn 2 | version: 1.0.4 3 | author: Ali Akbar Vathi 4 | description: Dock Spawn is a powerful web based dock layout engine. Create dockable panel windows similar to Visual Studio IDE 5 | homepage: http://www.dockspawn.com/ 6 | dependencies: 7 | browser: any 8 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/dock_spawn_demo_ide.dart: -------------------------------------------------------------------------------- 1 | library dock_spawn_demo_ide; 2 | 3 | import 'dart:html'; 4 | import 'package:dock_spawn/dock_spawn.dart'; 5 | 6 | part 'ide/spawn_ide.dart'; 7 | part 'ide/panels/editor_panel.dart'; 8 | 9 | void main() { 10 | new SpawnIDE(); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/dock/dock_manager_context.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class DockManagerContext { 4 | DockModel model; 5 | DockManager dockManager; 6 | DocumentManagerContainer documentManagerView; 7 | 8 | DockManagerContext(this.dockManager) { 9 | model = new DockModel(); 10 | documentManagerView = new DocumentManagerContainer(dockManager); 11 | } 12 | } -------------------------------------------------------------------------------- /js/lib/utils/EventHandler.js: -------------------------------------------------------------------------------- 1 | dockspawn.EventHandler = function(source, eventName, target) 2 | { 3 | // wrap the target 4 | this.target = target; 5 | this.eventName = eventName; 6 | this.source = source; 7 | 8 | this.source.addEventListener(eventName, this.target); 9 | }; 10 | 11 | dockspawn.EventHandler.prototype.cancel = function() 12 | { 13 | this.source.removeEventListener(this.eventName, this.target) 14 | }; 15 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/containers/horizontal_dock_container.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class HorizontalDockContainer extends SplitterDockContainer { 4 | 5 | HorizontalDockContainer(DockManager dockManager, List childContainers) 6 | : super(getNextId("horizontal_splitter_"), dockManager, childContainers) { 7 | containerType = "horizontal"; 8 | } 9 | 10 | bool get stackedVertical { 11 | return false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/containers/vertical_dock_container.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class VerticalDockContainer extends SplitterDockContainer { 4 | 5 | VerticalDockContainer(DockManager dockManager, List childContainers) 6 | : super(getNextId("vertical_splitter_"), dockManager, childContainers) { 7 | containerType = "vertical"; 8 | 9 | } 10 | 11 | bool get stackedVertical { 12 | return true; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | dock_spawn_demo_ide 4 | 5 | 6 | 7 | 8 | 9 | com.google.dart.tools.core.dartBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.google.dart.tools.core.dartNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_simple/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | dock_spawn_demo_ide 4 | 5 | 6 | 7 | 8 | 9 | com.google.dart.tools.core.dartBuilder 10 | 11 | 12 | 13 | 14 | 15 | com.google.dart.tools.core.dartNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /js/lib/containers/VerticalDockContainer.js: -------------------------------------------------------------------------------- 1 | import "SplitterDockContainer"; 2 | 3 | dockspawn.VerticalDockContainer = function(dockManager, childContainers) 4 | { 5 | this.stackedVertical = true; 6 | dockspawn.SplitterDockContainer.call(this, getNextId("vertical_splitter_"), dockManager, childContainers); 7 | this.containerType = "vertical"; 8 | }; 9 | dockspawn.VerticalDockContainer.prototype = new dockspawn.SplitterDockContainer(); 10 | dockspawn.VerticalDockContainer.prototype.constructor = dockspawn.VerticalDockContainer; 11 | -------------------------------------------------------------------------------- /js/lib/containers/HorizontalDockContainer.js: -------------------------------------------------------------------------------- 1 | import "SplitterDockContainer"; 2 | 3 | dockspawn.HorizontalDockContainer = function(dockManager, childContainers) 4 | { 5 | this.stackedVertical = false; 6 | dockspawn.SplitterDockContainer.call(this, getNextId("horizontal_splitter_"), dockManager, childContainers); 7 | this.containerType = "horizontal"; 8 | }; 9 | dockspawn.HorizontalDockContainer.prototype = new dockspawn.SplitterDockContainer(); 10 | dockspawn.HorizontalDockContainer.prototype.constructor = dockspawn.HorizontalDockContainer; 11 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | } -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | 25 | .CodeMirror-dialog button { 26 | font-size: 70%; 27 | } -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.exe 6 | *.dll 7 | *.o 8 | *.obj 9 | *.ncb 10 | *.so 11 | 12 | # Packages # 13 | ############ 14 | # it's better to unpack these files and commit the raw source 15 | # git has its own built in compression methods 16 | *.7z 17 | *.dmg 18 | *.gz 19 | *.iso 20 | *.jar 21 | *.rar 22 | *.tar 23 | *.zip 24 | 25 | # Logs and databases # 26 | ###################### 27 | *.log 28 | *.sql 29 | *.sqlite 30 | 31 | # OS generated files # 32 | ###################### 33 | .DS_Store* 34 | ehthumbs.db 35 | Icon? 36 | Thumbs.db 37 | .idea/ 38 | 39 | # Binary directories # 40 | ###################### 41 | bin/ 42 | obj/ 43 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/utils/debug_utils.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** 4 | * Prints out the dock layout hierarchy structure 5 | * WARNING: Assumes that the graph is acyclic 6 | */ 7 | debug_DumpTree(DockNode node, [int indent = 0]) { 8 | String message = node.container.name; 9 | 10 | for (int i = 0; i < indent; i++) { 11 | message = "\t$message"; 12 | } 13 | String parentType = node.parent == null ? "null" : node.parent.container.containerType; 14 | print (">>$message [$parentType]"); 15 | 16 | node.children.forEach((childNode) => debug_DumpTree(childNode, indent + 1)); 17 | } 18 | 19 | int dockIdCounter = 0; 20 | String getNextId(String prefix) { 21 | return "${prefix}${dockIdCounter++}"; 22 | } -------------------------------------------------------------------------------- /js/out/demos/ide/infovis/dock_tree_vis.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spacetree - Tree Animation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/serialization/dock_graph_serializer.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** 4 | * The serializer saves / loads the state of the dock layout hierarchy 5 | */ 6 | class DockGraphSerializer { 7 | 8 | String serialize(DockModel model) { 9 | var graphInfo = _buildGraphInfo(model.rootNode); 10 | return JSON.encode(graphInfo); 11 | } 12 | 13 | Map _buildGraphInfo(DockNode node) { 14 | var nodeState = new Map(); 15 | node.container.saveState(nodeState); 16 | 17 | var childrenInfo = []; 18 | node.children.forEach((childNode) { 19 | childrenInfo.add(_buildGraphInfo(childNode)); 20 | }); 21 | 22 | var nodeInfo = { }; 23 | nodeInfo['containerType'] = node.container.containerType; 24 | nodeInfo['state'] = nodeState; 25 | nodeInfo['children'] = childrenInfo; 26 | return nodeInfo; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/containers/dock_container.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** 4 | * Any dockable entity needs to implement this inteface 5 | */ 6 | abstract class IDockContainer { 7 | DockManager get dockManager; 8 | void resize(int _width, int _height); 9 | void performLayout(List children); 10 | void destroy(); 11 | void setActiveChild(IDockContainer child); 12 | void saveState(Map state); 13 | void loadState(Map state); 14 | Element get containerElement; 15 | String containerType; 16 | int get width; 17 | int get height; 18 | String name; 19 | 20 | /** 21 | * Indicates the minimum allowed child nodes a composite dock panel can have 22 | * If it's children fall below this value, the composite panel is destroyed 23 | * and it's children are moved one level up 24 | */ 25 | int get minimumAllowedChildNodes; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /js/lib/serialization/DockGraphSerializer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The serializer saves / loads the state of the dock layout hierarchy 3 | */ 4 | dockspawn.DockGraphSerializer = function() 5 | { 6 | }; 7 | 8 | dockspawn.DockGraphSerializer.prototype.serialize = function(model) 9 | { 10 | var graphInfo = this._buildGraphInfo(model.rootNode); 11 | return JSON.stringify(graphInfo); 12 | }; 13 | 14 | dockspawn.DockGraphSerializer.prototype._buildGraphInfo = function(node) 15 | { 16 | var nodeState = {}; 17 | node.container.saveState(nodeState); 18 | 19 | var childrenInfo = []; 20 | var self = this; 21 | node.childNodes.forEach(function(childNode) { 22 | childrenInfo.push(self._buildGraphInfo(childNode)); 23 | }); 24 | 25 | var nodeInfo = {}; 26 | nodeInfo.containerType = node.container.containerType; 27 | nodeInfo.state = nodeState; 28 | nodeInfo.children = childrenInfo; 29 | return nodeInfo; 30 | }; 31 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | }); -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 CodeRespawn.com and other contributors 2 | 3 | Permission is hereby granted, free 4 | of charge, to any person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, copy, modify, 7 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and 8 | to permit persons to whom the Software is furnished to do so, subject to the 9 | following conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions of the Software. 13 | 14 | THE 15 | SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/utils/bounding_box.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class BoundingBox { 4 | Size size; 5 | Point2 location; 6 | 7 | BoundingBox() { 8 | size = new Size(0, 0); 9 | location = new Point2(0, 0); 10 | } 11 | 12 | 13 | BoundingBox.copy(BoundingBox other) { 14 | size = new Size.copy(other.size); 15 | location = new Point2.copy(other.location); 16 | } 17 | 18 | 19 | num get x => location.x; 20 | set x(num value) => location.x = value; 21 | 22 | num get y => location.y; 23 | set y(num value) => location.y = value; 24 | 25 | num get width => size.width; 26 | set width(num value) => size.width = value; 27 | 28 | num get height => size.height; 29 | set height(num value) => size.height = value; 30 | 31 | num get left => location.x; 32 | set left(num value) => location.x = value; 33 | 34 | num get top => location.y; 35 | set top(num value) => location.y = value; 36 | 37 | num get right => location.x + size.width; 38 | set right(num value) => size.width = value - left; 39 | 40 | num get bottom => location.y + size.height; 41 | set bottom(num value) => size.height = value - top; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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. -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_simple/resources/css/dock_spawn_demo_simple.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #F8F8F8; 4 | font-family: 'Open Sans', sans-serif; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 1.2em; 8 | margin: 0px; 9 | overflow: hidden; 10 | position:fixed; 11 | } 12 | 13 | .my-dock-manager { 14 | } 15 | 16 | .solution-window { 17 | width: 300px; 18 | height: 200px; 19 | background-color: #844; 20 | } 21 | 22 | .output-window { 23 | width: 300px; 24 | height: 200px; 25 | background-color: #448; 26 | } 27 | 28 | .properties-window { 29 | width: 300px; 30 | height: 200px; 31 | background-color: #484; 32 | } 33 | 34 | .toolbox-window { 35 | width: 300px; 36 | height: 200px; 37 | background-color: #488; 38 | } 39 | 40 | .editor1-window { 41 | width: 300px; 42 | height: 200px; 43 | background-color: #884; 44 | } 45 | 46 | .editor2-window { 47 | width: 300px; 48 | height: 200px; 49 | background-color: #848; 50 | } 51 | 52 | .outline-window { 53 | width: 300px; 54 | height: 200px; 55 | background-color: #648; 56 | } 57 | 58 | .problems-window { 59 | width: 300px; 60 | height: 200px; 61 | background-color: #486; 62 | } -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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. -------------------------------------------------------------------------------- /js/lib/utils/DockUtils.js: -------------------------------------------------------------------------------- 1 | function getPixels(pixels) 2 | { 3 | if (pixels == null) 4 | return 0; 5 | return parseInt(pixels.replace("px", "")); 6 | } 7 | 8 | function disableGlobalTextSelection() 9 | { 10 | document.body.classList.add("disable-selection"); 11 | } 12 | 13 | function enableGlobalTextSelection() 14 | { 15 | document.body.classList.remove("disable-selection"); 16 | } 17 | 18 | function isPointInsideNode(px, py, node) 19 | { 20 | var element = node.container.containerElement; 21 | var x = element.offsetLeft; 22 | var y = element.offsetTop; 23 | var width = element.clientWidth; 24 | var height = element.clientHeight; 25 | 26 | return (px >= x && px <= x + width && py >= y && py <= y + height); 27 | } 28 | 29 | function Rectangle() 30 | { 31 | // num x; 32 | // num y; 33 | // num width; 34 | // num height; 35 | } 36 | 37 | function getNextId(prefix) 38 | { 39 | return prefix + getNextId.counter++; 40 | } 41 | getNextId.counter = 0; 42 | 43 | function removeNode(node) 44 | { 45 | if (node.parentNode == null) 46 | return false; 47 | node.parentNode.removeChild(node); 48 | return true; 49 | } 50 | 51 | function Point(x, y) 52 | { 53 | this.x = x; 54 | this.y = y; 55 | } 56 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/vb/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2012 Codility Limited, 107 Cheapside, London EC2V 6DN, UK 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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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: #447 !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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/utils/dock_utils.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | int getPixels(String pixels) { 4 | if (pixels == null) return 0; 5 | return int.parse(pixels.replaceAll("px", "")); 6 | } 7 | 8 | 9 | Point2 getMousePosition(MouseEvent e, Element element) { 10 | int parentOffsetX = element.offset.left; 11 | int parentOffsetY = element.offset.top; 12 | int parentWidth = element.client.width; 13 | int parentHeight = element.client.height; 14 | int x = e.offset.x - parentOffsetX; 15 | int y = e.offset.x - parentOffsetY; 16 | return new Point2(x, y); 17 | } 18 | 19 | void disableGlobalTextSelection() { 20 | document.body.classes.add("disable-selection"); 21 | } 22 | 23 | void enableGlobalTextSelection() { 24 | document.body.classes.remove("disable-selection"); 25 | } 26 | 27 | bool isPointInsideNode(int px, int py, DockNode node) { 28 | Element element = node.container.containerElement; 29 | int x = element.offset.left; 30 | int y = element.offset.top; 31 | int width = element.client.width; 32 | int height = element.client.height; 33 | 34 | return (px >= x && px <= x + width && py >= y && py <= y + height); 35 | } 36 | 37 | 38 | class Rectangle { 39 | num x; 40 | num y; 41 | num width; 42 | num height; 43 | } -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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. -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/utils/image_repository.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** 4 | * Downloads and caches all the images used by the application during startup. 5 | * Images can be queried through a user-friendly name rather than a URL 6 | */ 7 | class ImageRepository { 8 | Map images; 9 | 10 | ImageRepository() { 11 | images = new Map(); 12 | } 13 | 14 | /** 15 | * Initiates the download of the images. The function returns immediately. 16 | */ 17 | Future downloadImage(String name, String url) { 18 | var completer = new Completer(); 19 | ImageElement image = new ImageElement(); 20 | image.src = url; 21 | image.onLoad.listen((e) { 22 | completer.complete(image); 23 | }); 24 | return completer.future; 25 | } 26 | 27 | /** 28 | * Specify multiple images to be downloaded in the following format 29 | * [ "name1", "url1", "name2", "url2", ... "urlN", "nameN" ] 30 | */ 31 | Future downloadImages(List imageList) { 32 | var futures = []; 33 | for (int i = 0; i < imageList.length; i += 2) { 34 | String name = imageList[i]; 35 | String url = imageList[i + 1]; 36 | futures.add(downloadImage(name, url)); 37 | } 38 | 39 | // Wait for all the images to download 40 | return Future.wait(futures); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_simple/dock_spawn_demo_simple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | DockManager 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/dock_spawn.dart: -------------------------------------------------------------------------------- 1 | library dock_spawn; 2 | 3 | import 'dart:html'; 4 | import 'dart:async'; 5 | import 'dart:math'; 6 | import 'dart:convert'; 7 | 8 | part 'dialog/dialog.dart'; 9 | part 'decorators/draggable_container.dart'; 10 | part 'decorators/resizable_container.dart'; 11 | 12 | part 'dock/dock_manager.dart'; 13 | part 'dock/dock_manager_context.dart'; 14 | part 'dock/dock_layout_engine.dart'; 15 | part 'dock/dock_model.dart'; 16 | part 'dock/dock_wheel.dart'; 17 | part 'dock/dock_exception.dart'; 18 | 19 | part 'containers/dock_container.dart'; 20 | part 'containers/splitter_dock_container.dart'; 21 | part 'containers/horizontal_dock_container.dart'; 22 | part 'containers/vertical_dock_container.dart'; 23 | part 'containers/fill_dock_container.dart'; 24 | part 'containers/panel_dock_container.dart'; 25 | part 'containers/document_dock_container.dart'; 26 | 27 | part 'splitter/splitter_bar.dart'; 28 | part 'splitter/splitter_panel.dart'; 29 | part 'splitter/splitter_exception.dart'; 30 | part 'tab/tab_handle.dart'; 31 | part 'tab/tab_page.dart'; 32 | part 'tab/tab_host.dart'; 33 | 34 | part 'serialization/dock_graph_serializer.dart'; 35 | part 'serialization/dock_graph_deserializer.dart'; 36 | 37 | part 'utils/dock_utils.dart'; 38 | part 'utils/image_repository.dart'; 39 | part 'utils/debug_utils.dart'; 40 | part 'utils/undock_initiator.dart'; 41 | part 'utils/geometric_primitives.dart'; 42 | part 'utils/bounding_box.dart'; 43 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/tab/tab_page.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | 4 | class TabPage { 5 | TabHost host; 6 | TabHandle handle; 7 | IDockContainer container; 8 | Element containerElement; 9 | bool selected = false; 10 | 11 | TabPage(this.host, this.container) { 12 | handle = new TabHandle(this); 13 | containerElement = container.containerElement; 14 | 15 | if (container is PanelContainer) { 16 | PanelContainer panel = container; 17 | panel.onTitleChanged = onTitleChanged; 18 | } 19 | } 20 | 21 | void onTitleChanged(IDockContainer sender, String title) { 22 | handle.updateTitle(); 23 | } 24 | 25 | void destroy() { 26 | handle.destroy(); 27 | 28 | if (container is PanelContainer) { 29 | PanelContainer panel = container; 30 | panel.onTitleChanged = null; 31 | } 32 | } 33 | 34 | void onSelected() { 35 | host.onTabPageSelected(this); 36 | } 37 | 38 | void setSelected(bool flag) { 39 | selected = flag; 40 | handle.setSelected(flag); 41 | 42 | if (selected) { 43 | host.contentElement.nodes.add(containerElement); 44 | // force a resize again 45 | int width = host.contentElement.client.width; 46 | int height = host.contentElement.client.height; 47 | container.resize(width, height); 48 | } else { 49 | containerElement.remove(); 50 | } 51 | } 52 | 53 | void resize(int width, int height) { 54 | container.resize(width, height); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/theme/vibrant-ink.css: -------------------------------------------------------------------------------- 1 | /* Taken from the popular Visual Studio Vibrant Ink Schema */ 2 | 3 | .cm-s-vibrant-ink { background: black; color: white; } 4 | .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } 5 | 6 | .cm-s-vibrant-ink .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } 7 | .cm-s-vibrant-ink .CodeMirror-gutter-text { color: #d0d0d0; } 8 | .cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } 9 | 10 | .cm-s-vibrant-ink .cm-keyword { color: #CC7832; } 11 | .cm-s-vibrant-ink .cm-atom { color: #FC0; } 12 | .cm-s-vibrant-ink .cm-number { color: #FFEE98; } 13 | .cm-s-vibrant-ink .cm-def { color: #8DA6CE; } 14 | .cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D } 15 | .cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D } 16 | .cm-s-vibrant-ink .cm-operator { color: #888; } 17 | .cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } 18 | .cm-s-vibrant-ink .cm-string { color: #A5C25C } 19 | .cm-s-vibrant-ink .cm-string-2 { color: red } 20 | .cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } 21 | .cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } 22 | .cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } 23 | .cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } 24 | .cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } 25 | .cm-s-vibrant-ink .cm-header { color: #FF6400; } 26 | .cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } 27 | .cm-s-vibrant-ink .cm-link { color: blue; } 28 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/ide/js/demo-ide.js: -------------------------------------------------------------------------------- 1 | 2 | ///////////////////// JS Tree Views //////////////////////////// 3 | $(function () { 4 | $("#solution_window").jstree({ "plugins" : ["themes","html_data","ui"], "core" : { "initially_open" : [ "solution_window_1" ] }}) 5 | $("#toolbox_window").jstree({ "plugins" : ["themes","html_data","ui","crrm","hotkeys"], "core" : { }}) 6 | }); 7 | 8 | ///////////////////// Code Mirror Editor //////////////////////////// 9 | // Editor 1 10 | var editor1 = CodeMirror(document.getElementById("editor1_window"), { 11 | lineNumbers: true, 12 | matchBrackets: true, 13 | mode: "text/x-csrc", 14 | value: source_steering_h, 15 | onCursorActivity: function() { 16 | editor1.setLineClass(editorLine1, null, null); 17 | editorLine1 = editor1.setLineClass(editor1.getCursor().line, null, "activeline"); 18 | } 19 | }); 20 | var editorLine1 = editor1.setLineClass(0, "activeline"); 21 | 22 | // Editor 2 23 | var editor2 = CodeMirror(document.getElementById("editor2_window"), { 24 | lineNumbers: true, 25 | matchBrackets: true, 26 | mode: "text/x-csrc", 27 | value: source_steering_cpp, 28 | onCursorActivity: function() { 29 | editor2.setLineClass(editorLine2, null, null); 30 | editorLine2 = editor2.setLineClass(editor2.getCursor().line, null, "activeline"); 31 | } 32 | }); 33 | var editorLine2 = editor2.setLineClass(0, "activeline"); 34 | 35 | // Output Window 36 | var editorOutput = CodeMirror(document.getElementById("output_window"), { 37 | value: "[info] program exited with code 0" 38 | }); 39 | 40 | //////////////////////////////////////////////////////////////// 41 | 42 | -------------------------------------------------------------------------------- /js/lib/tab/TabPage.js: -------------------------------------------------------------------------------- 1 | import "TabHandle"; 2 | 3 | dockspawn.TabPage = function(host, container) 4 | { 5 | if (arguments.length == 0) 6 | return; 7 | 8 | this.selected = false; 9 | this.host = host; 10 | this.container = container; 11 | 12 | this.handle = new dockspawn.TabHandle(this); 13 | this.containerElement = container.containerElement; 14 | 15 | if (container instanceof dockspawn.PanelContainer) 16 | { 17 | var panel = container; 18 | panel.onTitleChanged = this.onTitleChanged.bind(this); 19 | } 20 | }; 21 | 22 | dockspawn.TabPage.prototype.onTitleChanged = function(sender, title) 23 | { 24 | this.handle.updateTitle(); 25 | }; 26 | 27 | dockspawn.TabPage.prototype.destroy = function() 28 | { 29 | this.handle.destroy(); 30 | 31 | if (this.container instanceof dockspawn.PanelContainer) 32 | { 33 | var panel = this.container; 34 | delete panel.onTitleChanged; 35 | } 36 | }; 37 | 38 | dockspawn.TabPage.prototype.onSelected = function() 39 | { 40 | this.host.onTabPageSelected(this); 41 | }; 42 | 43 | dockspawn.TabPage.prototype.setSelected = function(flag) 44 | { 45 | this.selected = flag; 46 | this.handle.setSelected(flag); 47 | 48 | if (this.selected) 49 | { 50 | this.host.contentElement.appendChild(this.containerElement); 51 | // force a resize again 52 | var width = this.host.contentElement.clientWidth; 53 | var height = this.host.contentElement.clientHeight; 54 | this.container.resize(width, height); 55 | } 56 | else 57 | removeNode(this.containerElement); 58 | }; 59 | 60 | dockspawn.TabPage.prototype.resize = function(width, height) 61 | { 62 | this.container.resize(width, height); 63 | }; 64 | -------------------------------------------------------------------------------- /js/out/demos/ide/demo.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #F8F8F8; 4 | font-family: 'Open Sans', sans-serif; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 1.2em; 8 | margin: 0px; 9 | overflow: hidden; 10 | position:fixed; 11 | } 12 | 13 | .demo-header { 14 | background-color: #000; 15 | color: #888; 16 | width: 100%; 17 | height: 46px; 18 | } 19 | 20 | .demo-header-title { 21 | font-family: 'Open Sans', sans-serif; 22 | font-size: 22px; 23 | padding: 15px; 24 | float: left; 25 | position:relative; 26 | } 27 | 28 | .demo-header-description { 29 | font-family: 'Open Sans', sans-serif; 30 | font-size: 12px; 31 | float: left; 32 | padding: 15px; 33 | position:relative; 34 | } 35 | 36 | .my-dock-manager { 37 | background-color: #F8F8F8; 38 | clear: both; 39 | } 40 | 41 | .solution-window { 42 | width: 300px; 43 | height: 200px; 44 | background-color: #eee; 45 | } 46 | 47 | .output-window { 48 | width: 300px; 49 | height: 200px; 50 | background-color: #eee; 51 | } 52 | 53 | .properties-window { 54 | width: 300px; 55 | height: 200px; 56 | background-color: #aac; 57 | } 58 | 59 | .toolbox-window { 60 | width: 300px; 61 | height: 200px; 62 | background-color: #eee; 63 | } 64 | 65 | .editor1-window { 66 | width: 300px; 67 | height: 200px; 68 | background-color: #fff; 69 | } 70 | 71 | .editor2-window { 72 | width: 300px; 73 | height: 200px; 74 | background-color: #fff; 75 | } 76 | 77 | .outline-window { 78 | width: 300px; 79 | height: 200px; 80 | background-color: #ddd; 81 | } 82 | 83 | .problems-window { 84 | width: 300px; 85 | height: 200px; 86 | background-color: #edd; 87 | } 88 | 89 | .editor-host { 90 | height: auto; 91 | overflow: visible; 92 | } 93 | 94 | .activeline {background: #e8f2ff !important;} 95 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /js/out/demos/ide/infovis/Spacetree.css: -------------------------------------------------------------------------------- 1 | .jit-autoadjust-label { 2 | padding: 15px; 3 | } 4 | 5 | #update, #restore { 6 | text-align: center; 7 | width: 200px; 8 | margin:0px 35px 10px 35px; 9 | color: #f00; 10 | } 11 | 12 | .button { 13 | display: inline-block; 14 | outline: none; 15 | cursor: pointer; 16 | text-align: center; 17 | text-decoration: none; 18 | font: 14px / 100% Arial, Helvetica, sans-serif; 19 | padding: 0.5em 1em 0.55em; 20 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); 21 | -webkit-border-radius: 0.5em; 22 | -moz-border-radius: 0.5em; 23 | border-radius: 0.5em; 24 | -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2); 25 | -moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2); 26 | box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2); 27 | } 28 | 29 | .button:hover { 30 | text-decoration: none; 31 | } 32 | 33 | .button:active { 34 | position: relative; 35 | top: 1px; 36 | } 37 | 38 | /* white */ 39 | .white { 40 | color: #606060; 41 | border: solid 1px #b7b7b7; 42 | background: #fff; 43 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed)); 44 | background: -moz-linear-gradient(top, #fff, #ededed); 45 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed'); 46 | } 47 | 48 | .white:hover { 49 | background: #ededed; 50 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc)); 51 | background: -moz-linear-gradient(top, #fff, #dcdcdc); 52 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc'); 53 | } 54 | 55 | .white:active { 56 | color: #999; 57 | background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff)); 58 | background: -moz-linear-gradient(top, #ededed, #fff); 59 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff'); 60 | } 61 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/ide/css/dock_spawn_demo_ide.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #F8F8F8; 4 | font-family: 'Open Sans', sans-serif; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 1.2em; 8 | margin: 0px; 9 | overflow: hidden; 10 | position:fixed; 11 | } 12 | 13 | .demo-header { 14 | background-color: #000; 15 | color: #888; 16 | width: 100%; 17 | height: 46px; 18 | } 19 | 20 | .demo-header-title { 21 | font-family: 'Open Sans', sans-serif; 22 | font-size: 22px; 23 | padding: 15px; 24 | float: left; 25 | position:relative; 26 | } 27 | 28 | .demo-header-description { 29 | font-family: 'Open Sans', sans-serif; 30 | font-size: 12px; 31 | float: left; 32 | padding: 15px; 33 | position:relative; 34 | } 35 | 36 | .my-dock-manager { 37 | background-color: #F8F8F8; 38 | clear: both; 39 | } 40 | 41 | .solution-window { 42 | width: 300px; 43 | height: 200px; 44 | background-color: #eee; 45 | } 46 | 47 | .output-window { 48 | width: 300px; 49 | height: 200px; 50 | background-color: #eee; 51 | } 52 | 53 | .properties-window { 54 | width: 300px; 55 | height: 200px; 56 | background-color: #aac; 57 | } 58 | 59 | .toolbox-window { 60 | width: 300px; 61 | height: 200px; 62 | background-color: #eee; 63 | } 64 | 65 | .editor1-window { 66 | width: 300px; 67 | height: 200px; 68 | background-color: #fff; 69 | } 70 | 71 | .editor2-window { 72 | width: 300px; 73 | height: 200px; 74 | background-color: #fff; 75 | } 76 | 77 | .outline-window { 78 | width: 300px; 79 | height: 200px; 80 | background-color: #ddd; 81 | } 82 | 83 | .problems-window { 84 | width: 300px; 85 | height: 200px; 86 | background-color: #edd; 87 | } 88 | 89 | .editor-host { 90 | height: auto; 91 | overflow: visible; 92 | } 93 | 94 | .activeline {background: #e8f2ff !important;} 95 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/containers/fill_dock_container.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class FillDockContainer implements IDockContainer { 4 | String containerType = "fill"; 5 | DivElement element; 6 | DockManager dockManager; 7 | TabHost tabHost; 8 | int tabOrientation = TabHost.DIRECTION_BOTTOM; 9 | int get minimumAllowedChildNodes { return 2; } 10 | String name; 11 | 12 | FillDockContainer(this.dockManager, [int tabStripDirection = TabHost.DIRECTION_BOTTOM]) { 13 | this.tabOrientation = tabStripDirection; 14 | name = getNextId("fill_"); 15 | element = new DivElement(); 16 | element.classes.add("dock-container"); 17 | element.classes.add("dock-container-fill"); 18 | 19 | tabHost = new TabHost(tabOrientation); 20 | element.nodes.add(tabHost.hostElement); 21 | } 22 | 23 | 24 | void setActiveChild(IDockContainer child) { 25 | tabHost.setActiveTab(child); 26 | } 27 | 28 | void resize(int _width, int _height) { 29 | element.style.width = "${_width}px"; 30 | element.style.height = "${_height}px"; 31 | tabHost.resize(_width, _height); 32 | } 33 | 34 | void performLayout(List children) { 35 | tabHost.performLayout(children); 36 | } 37 | 38 | void destroy() { 39 | element.remove(); 40 | element = null; 41 | } 42 | 43 | void saveState(Map state) { 44 | state['width'] = width; 45 | state['height'] = height; 46 | } 47 | 48 | void loadState(Map state) { 49 | width = state['width']; 50 | height = state['height']; 51 | } 52 | 53 | Element get containerElement { 54 | return element; 55 | } 56 | 57 | 58 | int get width => element.client.width; 59 | set width(int value) => element.style.width = "${value}px"; 60 | 61 | int get height => element.client.height; 62 | set height(int value) => element.style.height = "${value}px"; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | 59 | 60 |

MIME types defined: text/x-erlang.

61 | 62 | 63 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/containers/document_dock_container.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** 4 | * The document manager is then central area of the dock layout hierarchy. 5 | * This is where more important panels are placed (e.g. the text editor in an IDE, 6 | * 3D view in a modelling package etc 7 | */ 8 | class DocumentManagerContainer extends FillDockContainer { 9 | 10 | int get minimumAllowedChildNodes { return 0; } 11 | 12 | DocumentManagerContainer(DockManager dockManager) 13 | : super(dockManager, TabHost.DIRECTION_TOP) 14 | { 15 | element.classes.add("document-manager"); 16 | tabHost.createTabPage = _createDocumentTabPage; 17 | tabHost.displayCloseButton = true; 18 | } 19 | 20 | TabPage _createDocumentTabPage(TabHost _tabHost, IDockContainer container) { 21 | return new DocumentTabPage(_tabHost, container); 22 | } 23 | 24 | void saveState(Map state) { 25 | super.saveState(state); 26 | state['documentManager'] = true; 27 | } 28 | 29 | /** Returns the selected document tab */ 30 | TabPage get selectedTab => tabHost.activeTab; 31 | } 32 | 33 | /** 34 | * Specialized tab page that doesn't display the panel's frame when docked in a tab page 35 | */ 36 | class DocumentTabPage extends TabPage { 37 | PanelContainer panel = null; 38 | 39 | DocumentTabPage(TabHost _host, IDockContainer _container) : super(_host, _container) 40 | { 41 | // If the container is a panel, extract the content element and set it as the tab's content 42 | if (container.containerType == "panel") { 43 | panel = container; 44 | containerElement = panel.elementContent; 45 | 46 | // detach the container element from the panel's frame. 47 | // It will be reattached when this tab page is destroyed 48 | // This enables the panel's frame (title bar etc) to be hidden 49 | // inside the tab page 50 | containerElement.remove(); 51 | } 52 | } 53 | 54 | void destroy() { 55 | super.destroy(); 56 | 57 | // Restore the panel content element back into the panel frame 58 | panel.elementContentHost.nodes.add(containerElement); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | // overlayParser is the old, deprecated name 10 | CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) { 11 | return { 12 | startState: function() { 13 | return { 14 | base: CodeMirror.startState(base), 15 | overlay: CodeMirror.startState(overlay), 16 | basePos: 0, baseCur: null, 17 | overlayPos: 0, overlayCur: null 18 | }; 19 | }, 20 | copyState: function(state) { 21 | return { 22 | base: CodeMirror.copyState(base, state.base), 23 | overlay: CodeMirror.copyState(overlay, state.overlay), 24 | basePos: state.basePos, baseCur: null, 25 | overlayPos: state.overlayPos, overlayCur: null 26 | }; 27 | }, 28 | 29 | token: function(stream, state) { 30 | if (stream.start == state.basePos) { 31 | state.baseCur = base.token(stream, state.base); 32 | state.basePos = stream.pos; 33 | } 34 | if (stream.start == state.overlayPos) { 35 | stream.pos = stream.start; 36 | state.overlayCur = overlay.token(stream, state.overlay); 37 | state.overlayPos = stream.pos; 38 | } 39 | stream.pos = Math.min(state.basePos, state.overlayPos); 40 | if (stream.eol()) state.basePos = state.overlayPos = 0; 41 | 42 | if (state.overlayCur == null) return state.baseCur; 43 | if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; 44 | else return state.overlayCur; 45 | }, 46 | 47 | indent: base.indent && function(state, textAfter) { 48 | return base.indent(state.base, textAfter); 49 | }, 50 | electricChars: base.electricChars 51 | }; 52 | }; 53 | -------------------------------------------------------------------------------- /js/lib/containers/FillDockContainer.js: -------------------------------------------------------------------------------- 1 | import "../tab/TabHost"; 2 | 3 | dockspawn.FillDockContainer = function(dockManager, tabStripDirection) 4 | { 5 | if (arguments.length == 0) 6 | return; 7 | 8 | if (tabStripDirection === undefined) 9 | tabStripDirection = dockspawn.TabHost.DIRECTION_BOTTOM; 10 | 11 | this.dockManager = dockManager; 12 | this.tabOrientation = tabStripDirection; 13 | this.name = getNextId("fill_"); 14 | this.element = document.createElement("div"); 15 | this.containerElement = this.element; 16 | this.containerType = "fill"; 17 | this.minimumAllowedChildNodes = 2; 18 | this.element.classList.add("dock-container"); 19 | this.element.classList.add("dock-container-fill"); 20 | this.tabHost = new dockspawn.TabHost(this.tabOrientation); 21 | this.element.appendChild(this.tabHost.hostElement); 22 | } 23 | 24 | dockspawn.FillDockContainer.prototype.setActiveChild = function(child) 25 | { 26 | this.tabHost.setActiveTab(child); 27 | }; 28 | 29 | dockspawn.FillDockContainer.prototype.resize = function(width, height) 30 | { 31 | this.element.style.width = width + "px"; 32 | this.element.style.height = height + "px"; 33 | this.tabHost.resize(width, height); 34 | }; 35 | 36 | dockspawn.FillDockContainer.prototype.performLayout = function(children) 37 | { 38 | this.tabHost.performLayout(children); 39 | }; 40 | 41 | dockspawn.FillDockContainer.prototype.destroy = function() 42 | { 43 | if (removeNode(this.element)) 44 | delete this.element; 45 | }; 46 | 47 | dockspawn.FillDockContainer.prototype.saveState = function(state) 48 | { 49 | state.width = this.width; 50 | state.height = this.height; 51 | }; 52 | 53 | dockspawn.FillDockContainer.prototype.loadState = function(state) 54 | { 55 | this.width = state.width; 56 | this.height = state.height; 57 | }; 58 | 59 | Object.defineProperty(dockspawn.FillDockContainer.prototype, "width", { 60 | get: function() { return this.element.clientWidth; }, 61 | set: function(value) { this.element.style.width = value + "px" } 62 | }); 63 | 64 | Object.defineProperty(dockspawn.FillDockContainer.prototype, "height", { 65 | get: function() { return this.element.clientHeight; }, 66 | set: function(value) { this.element.style.height = value + "px" } 67 | }); 68 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/theme/lesser-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | http://lesscss.org/ dark theme 3 | Ported to CodeMirror by Peter Kroon 4 | */ 5 | .cm-s-lesser-dark { 6 | line-height: 1.3em; 7 | } 8 | .cm-s-lesser-dark { 9 | font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; 10 | } 11 | 12 | .cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } 13 | .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ 14 | .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 15 | .cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/ 16 | 17 | div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ 18 | 19 | .cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; } 20 | .cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; } 21 | 22 | .cm-s-lesser-dark span.cm-keyword { color: #599eff; } 23 | .cm-s-lesser-dark span.cm-atom { color: #C2B470; } 24 | .cm-s-lesser-dark span.cm-number { color: #B35E4D; } 25 | .cm-s-lesser-dark span.cm-def {color: white;} 26 | .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } 27 | .cm-s-lesser-dark span.cm-variable-2 { color: #669199; } 28 | .cm-s-lesser-dark span.cm-variable-3 { color: white; } 29 | .cm-s-lesser-dark span.cm-property {color: #92A75C;} 30 | .cm-s-lesser-dark span.cm-operator {color: #92A75C;} 31 | .cm-s-lesser-dark span.cm-comment { color: #666; } 32 | .cm-s-lesser-dark span.cm-string { color: #BCD279; } 33 | .cm-s-lesser-dark span.cm-string-2 {color: #f50;} 34 | .cm-s-lesser-dark span.cm-meta { color: #738C73; } 35 | .cm-s-lesser-dark span.cm-error { color: #9d1e15; } 36 | .cm-s-lesser-dark span.cm-qualifier {color: #555;} 37 | .cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } 38 | .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } 39 | .cm-s-lesser-dark span.cm-tag { color: #669199; } 40 | .cm-s-lesser-dark span.cm-attribute {color: #00c;} 41 | .cm-s-lesser-dark span.cm-header {color: #a0a;} 42 | .cm-s-lesser-dark span.cm-quote {color: #090;} 43 | .cm-s-lesser-dark span.cm-hr {color: #999;} 44 | .cm-s-lesser-dark span.cm-link {color: #00c;} 45 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/haxe/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Haxe mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Haxe mode

13 | 14 |
78 | 79 | 87 | 88 |

MIME types defined: text/x-haxe.

89 | 90 | 91 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/ide/panels/editor_panel.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn_demo_ide; 2 | 3 | /** 4 | * A custom panel that manages the Code Mirror editor control 5 | */ 6 | class EditorPanel extends PanelContainer { 7 | /** 8 | * Code Mirror source code control's wrapped elements. Save a reference for resizing later on 9 | * http://codemirror.net/doc/manual.html 10 | */ 11 | Element codeMirrorBase; 12 | Element codeMirrorScroller; 13 | Element codeMirrorScrollBar; 14 | 15 | EditorPanel(Element elementContent, DockManager dockManager, [String title = "Panel"]) 16 | : super(elementContent, dockManager, title) 17 | { 18 | _initialize(); 19 | } 20 | 21 | void resize(int _width, int _height) { 22 | super.resize(_width, _height); 23 | int clientWidth = elementContent.client.width; 24 | int clientHeight = elementContent.client.height; 25 | 26 | codeMirrorBase.style.width = "${clientWidth}px"; 27 | codeMirrorBase.style.height = "${clientHeight}px"; 28 | codeMirrorScroller.style.height = "${clientHeight}px"; 29 | codeMirrorScrollBar.style.height = "${clientHeight}px"; 30 | } 31 | 32 | void _initialize() { 33 | // Find the wrapper divs created by the code mirror control so we can resize them later on 34 | for (var element in elementContent.nodes) { 35 | if (element is DivElement) { 36 | Element div = element; 37 | if (div.classes.contains("CodeMirror")) { 38 | codeMirrorBase = div; 39 | break; 40 | } 41 | } 42 | } 43 | if (codeMirrorBase == null) { 44 | throw new IdeException("Not a valid editor control. Make sure code mirror is initailized with this panel"); 45 | } 46 | 47 | // Search for the scoll element for setting the height on resize 48 | for (var element in codeMirrorBase.nodes) { 49 | if (element is DivElement) { 50 | DivElement div = element; 51 | if (div.classes.contains("CodeMirror-scroll")) { 52 | codeMirrorScroller = div; 53 | } 54 | if (div.classes.contains("CodeMirror-scrollbar")) { 55 | codeMirrorScrollBar = div; 56 | } 57 | } 58 | } 59 | if (codeMirrorScroller == null || codeMirrorScrollBar == null) { 60 | throw new IdeException("Not a valid editor control. Cannot find scroller. Make sure code mirror is initailized with this panel"); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_simple/dock_spawn_demo_simple.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | import 'package:dock_spawn/dock_spawn.dart'; 3 | 4 | void main() { 5 | new DockManagerDemo(); 6 | } 7 | 8 | 9 | class DockManagerDemo { 10 | DockManager dockManager; 11 | 12 | DockManagerDemo() { 13 | // Convert a div to the dock manager. Panels can then be docked on to it 14 | dockManager = new DockManager(query("#my_dock_manager")); 15 | dockManager.initialize(); 16 | 17 | // Let the dock manager element fill in the entire screen 18 | window.onResize.listen(onResized); 19 | onResized(null); 20 | 21 | // Convert existing elements on the page into "Panels". 22 | // They can then be docked on to the dock manager 23 | // Panels get a titlebar and a close button, and can also be 24 | // converted to a floating dialog box which can be dragged / resized 25 | var solution = new PanelContainer(query("#solution_window"), dockManager); 26 | var output = new PanelContainer(query("#output_window"), dockManager); 27 | var properties = new PanelContainer(query("#properties_window"), dockManager); 28 | var toolbox = new PanelContainer(query("#toolbox_window"), dockManager); 29 | var outline = new PanelContainer(query("#outline_window"), dockManager); 30 | var problems = new PanelContainer(query("#problems_window"), dockManager); 31 | var editor1 = new PanelContainer(query("#editor1_window"), dockManager); 32 | var editor2 = new PanelContainer(query("#editor2_window"), dockManager); 33 | 34 | // Dock the panels on the dock manager 35 | DockNode documentNode = dockManager.context.model.documentManagerNode; 36 | DockNode solutionNode = dockManager.dockLeft(documentNode, solution, 0.20); 37 | DockNode outlineNode = dockManager.dockFill(solutionNode, outline); 38 | DockNode propertiesNode = dockManager.dockDown(outlineNode, properties, 0.6); 39 | DockNode outputNode = dockManager.dockDown(documentNode, output, 0.4); 40 | DockNode problemsNode = dockManager.dockRight(outputNode, problems, 0.40); 41 | DockNode toolboxNode = dockManager.dockRight(documentNode, toolbox, 0.20); 42 | 43 | DockNode editor1Node = dockManager.dockFill(documentNode, editor1); 44 | DockNode editor2Node = dockManager.dockFill(documentNode, editor2); 45 | } 46 | 47 | void onResized(Event event) { 48 | dockManager.resize(window.innerWidth, window.innerHeight); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/dock/dock_model.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** 4 | * The Dock Model contains the tree hierarchy that represents the state of the 5 | * panel placement within the dock manager. 6 | */ 7 | class DockModel { 8 | DockNode rootNode; 9 | DockNode documentManagerNode; 10 | 11 | DockModel() { 12 | } 13 | } 14 | 15 | 16 | class DockNode { 17 | /** The dock container represented by this node */ 18 | IDockContainer container; 19 | 20 | 21 | DockNode parent; 22 | List children; 23 | 24 | DockNode(this.container) { 25 | children = new List(); 26 | } 27 | 28 | void detachFromParent() { 29 | if (parent != null) { 30 | parent.removeChild(this); 31 | } 32 | parent = null; 33 | } 34 | 35 | void removeChild(DockNode childNode) { 36 | int index = children.indexOf(childNode); 37 | if (index >= 0) { 38 | children.removeRange(index, index + 1); 39 | } 40 | } 41 | 42 | void addChild(DockNode childNode) { 43 | childNode.detachFromParent(); 44 | childNode.parent = this; 45 | children.add(childNode); 46 | } 47 | 48 | void addChildBefore(DockNode referenceNode, DockNode childNode) { 49 | _addChildWithDirection(referenceNode, childNode, true); 50 | } 51 | 52 | void addChildAfter(DockNode referenceNode, DockNode childNode) { 53 | _addChildWithDirection(referenceNode, childNode, false); 54 | } 55 | 56 | void _addChildWithDirection(DockNode referenceNode, DockNode childNode, bool before) { 57 | // Detach this node from it's parent first 58 | childNode.detachFromParent(); 59 | childNode.parent = this; 60 | 61 | int referenceIndex = children.indexOf(referenceNode); 62 | List preList = children.sublist(0, referenceIndex); 63 | List postList = children.sublist(referenceIndex + 1, children.length); 64 | 65 | children = new List(); 66 | children.addAll(preList); 67 | if (before) { 68 | children.add(childNode); 69 | children.add(referenceNode); 70 | } else { 71 | children.add(referenceNode); 72 | children.add(childNode); 73 | } 74 | children.addAll(postList); 75 | } 76 | 77 | void performLayout() { 78 | var childContainers = new List(); 79 | children.forEach((childNode) => childContainers.add(childNode.container)); 80 | container.performLayout(childContainers); 81 | } 82 | 83 | } -------------------------------------------------------------------------------- /dart-dock-spawn/lib/containers/splitter_dock_container.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | abstract class SplitterDockContainer implements IDockContainer { 4 | String name; 5 | DockManager dockManager; 6 | SplitterPanel splitterPanel; 7 | String containerType; 8 | bool get stackedVertical; 9 | 10 | int _cachedWidth; 11 | int _cachedHeight; 12 | SplitterDockContainer(this.name, this.dockManager, List childContainers) { 13 | splitterPanel = new SplitterPanel(childContainers, stackedVertical); 14 | } 15 | 16 | 17 | void resize(int _width, int _height) { 18 | // if (_cachedWidth == _cachedWidth && _cachedHeight == _height) { 19 | // // No need to resize 20 | // return; 21 | // } 22 | splitterPanel.resize(_width, _height); 23 | _cachedWidth = _width; 24 | _cachedHeight = _height; 25 | } 26 | 27 | int get minimumAllowedChildNodes { return 2; } 28 | 29 | void performLayout(List childContainers) { 30 | splitterPanel.performLayout(childContainers); 31 | } 32 | 33 | void setActiveChild(IDockContainer child) { 34 | } 35 | 36 | void destroy() { 37 | splitterPanel.destroy(); 38 | } 39 | 40 | /** 41 | * Sets the percentage of space the specified [container] takes in the split panel 42 | * The percentage is specified in [ratio] and is between 0..1 43 | */ 44 | void setContainerRatio(IDockContainer container, num ratio) { 45 | splitterPanel.setContainerRatio(container, ratio); 46 | resize(width, height); 47 | } 48 | 49 | void saveState(Map state) { 50 | state['width'] = width; 51 | state['height'] = height; 52 | } 53 | 54 | void loadState(Map state) { 55 | num _width = state['width']; 56 | num _height = state['height']; 57 | resize(_width, _height); 58 | } 59 | 60 | Element get containerElement { 61 | return splitterPanel.panelElement; 62 | } 63 | 64 | int get width { 65 | if (_cachedWidth == null) { 66 | _cachedWidth = splitterPanel.panelElement.client.width; 67 | } 68 | return _cachedWidth; 69 | // return splitterPanel.panelElement.clientWidth; 70 | } 71 | 72 | int get height { 73 | if (_cachedHeight == null) { 74 | _cachedHeight = splitterPanel.panelElement.client.height; 75 | } 76 | return _cachedHeight; //splitterPanel.panelElement.clientHeight; 77 | // return splitterPanel.panelElement.clientHeight; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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], button; 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 | } else if (button = dialog.getElementsByTagName("button")[0]) { 33 | CodeMirror.connect(button, "click", close); 34 | button.focus(); 35 | CodeMirror.connect(button, "blur", close); 36 | } 37 | return close; 38 | }); 39 | 40 | CodeMirror.defineExtension("openConfirm", function(template, callbacks) { 41 | var dialog = dialogDiv(this, template); 42 | var buttons = dialog.getElementsByTagName("button"); 43 | var closed = false, me = this, blurring = 1; 44 | function close() { 45 | if (closed) return; 46 | closed = true; 47 | dialog.parentNode.removeChild(dialog); 48 | me.focus(); 49 | } 50 | buttons[0].focus(); 51 | for (var i = 0; i < buttons.length; ++i) { 52 | var b = buttons[i]; 53 | (function(callback) { 54 | CodeMirror.connect(b, "click", function(e) { 55 | CodeMirror.e_preventDefault(e); 56 | close(); 57 | if (callback) callback(me); 58 | }); 59 | })(callbacks[i]); 60 | CodeMirror.connect(b, "blur", function() { 61 | --blurring; 62 | setTimeout(function() { if (blurring <= 0) close(); }, 200); 63 | }); 64 | CodeMirror.connect(b, "focus", function() { ++blurring; }); 65 | } 66 | }); 67 | })(); -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/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 | -------------------------------------------------------------------------------- /js/lib/containers/SplitterDockContainer.js: -------------------------------------------------------------------------------- 1 | import "../splitter/SplitterPanel"; 2 | 3 | dockspawn.SplitterDockContainer = function(name, dockManager, childContainers) 4 | { 5 | // for prototype inheritance purposes only 6 | if (arguments.length == 0) 7 | return; 8 | 9 | this.name = name; 10 | this.dockManager = dockManager; 11 | this.splitterPanel = new dockspawn.SplitterPanel(childContainers, this.stackedVertical); 12 | this.containerElement = this.splitterPanel.panelElement; 13 | this.minimumAllowedChildNodes = 2; 14 | } 15 | 16 | dockspawn.SplitterDockContainer.prototype.resize = function(width, height) 17 | { 18 | // if (_cachedWidth == _cachedWidth && _cachedHeight == _height) { 19 | // // No need to resize 20 | // return; 21 | // } 22 | this.splitterPanel.resize(width, height); 23 | this._cachedWidth = width; 24 | this._cachedHeight = height; 25 | }; 26 | 27 | dockspawn.SplitterDockContainer.prototype.performLayout = function(childContainers) 28 | { 29 | this.splitterPanel.performLayout(childContainers); 30 | }; 31 | 32 | dockspawn.SplitterDockContainer.prototype.setActiveChild = function(child) 33 | { 34 | }; 35 | 36 | dockspawn.SplitterDockContainer.prototype.destroy = function() 37 | { 38 | this.splitterPanel.destroy(); 39 | }; 40 | 41 | /** 42 | * Sets the percentage of space the specified [container] takes in the split panel 43 | * The percentage is specified in [ratio] and is between 0..1 44 | */ 45 | dockspawn.SplitterDockContainer.prototype.setContainerRatio = function(container, ratio) 46 | { 47 | this.splitterPanel.setContainerRatio(container, ratio); 48 | this.resize(this.width, this.height); 49 | }; 50 | 51 | dockspawn.SplitterDockContainer.prototype.saveState = function(state) 52 | { 53 | state.width = this.width; 54 | state.height = this.height; 55 | }; 56 | 57 | dockspawn.SplitterDockContainer.prototype.loadState = function(state) 58 | { 59 | this.resize(state.width, state.height); 60 | }; 61 | 62 | Object.defineProperty(dockspawn.SplitterDockContainer.prototype, "width", { 63 | get: function() 64 | { 65 | if (this._cachedWidth === undefined) 66 | this._cachedWidth = this.splitterPanel.panelElement.clientWidth; 67 | return this._cachedWidth; 68 | } 69 | }); 70 | 71 | Object.defineProperty(dockspawn.SplitterDockContainer.prototype, "height", { 72 | get: function() 73 | { 74 | if (this._cachedHeight === undefined) 75 | this._cachedHeight = this.splitterPanel.panelElement.clientHeight; 76 | return this._cachedHeight; 77 | } 78 | }); 79 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/ide/spawn_ide.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn_demo_ide; 2 | 3 | class SpawnIDE { 4 | DockManager dockManager; 5 | Element header; 6 | 7 | SpawnIDE() { 8 | header = query("#header"); 9 | 10 | // Convert a div to the dock manager. Panels can then be docked on to it 11 | dockManager = new DockManager(query("#my_dock_manager")); 12 | dockManager.initialize(); 13 | 14 | // Let the dock manager element fill in the entire screen 15 | window.onResize.listen(onResized); 16 | onResized(null); 17 | 18 | // Convert existing elements on the page into "Panels". 19 | // They can then be docked on to the dock manager 20 | // Panels get a titlebar and a close button, and can also be 21 | // converted to a floating dialog box which can be dragged / resized 22 | var solution = new PanelContainer(query("#solution_window"), dockManager); 23 | var properties = new PanelContainer(query("#properties_window"), dockManager); 24 | var toolbox = new PanelContainer(query("#toolbox_window"), dockManager); 25 | var outline = new PanelContainer(query("#outline_window"), dockManager); 26 | var problems = new PanelContainer(query("#problems_window"), dockManager); 27 | var output = new EditorPanel(query("#output_window"), dockManager); 28 | var editor1 = new EditorPanel(query("#editor1_window"), dockManager); 29 | var editor2 = new EditorPanel(query("#editor2_window"), dockManager); 30 | 31 | // Dock the panels on the dock manager 32 | DockNode documentNode = dockManager.context.model.documentManagerNode; 33 | DockNode outlineNode = dockManager.dockLeft(documentNode, outline, 0.15); 34 | DockNode solutionNode = dockManager.dockFill(outlineNode, solution); 35 | DockNode propertiesNode = dockManager.dockDown(outlineNode, properties, 0.6); 36 | DockNode outputNode = dockManager.dockDown(documentNode, output, 0.2); 37 | DockNode problemsNode = dockManager.dockRight(outputNode, problems, 0.40); 38 | DockNode toolboxNode = dockManager.dockRight(documentNode, toolbox, 0.20); 39 | 40 | DockNode editor1Node = dockManager.dockFill(documentNode, editor1); 41 | DockNode editor2Node = dockManager.dockFill(documentNode, editor2); 42 | } 43 | 44 | void onResized(Event event) { 45 | int headerHeight = header.client.height; 46 | dockManager.resize(window.innerWidth, window.innerHeight - headerHeight); 47 | // dockManager.resize(600, 400); 48 | } 49 | } 50 | 51 | 52 | class IdeException { 53 | String message; 54 | IdeException(this.message); 55 | } 56 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/r/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: R mode 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 |

CodeMirror: R mode

19 |
62 | 65 | 66 |

MIME types defined: text/x-rsrc.

67 | 68 |

Development of the CodeMirror R mode was kindly sponsored 69 | by Ubalo, who hold 70 | the license.

71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 2 | 3 | //config settings 4 | var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, 5 | scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; 6 | 7 | //inner modes 8 | var scriptingMode, htmlMixedMode; 9 | 10 | //tokenizer when in html mode 11 | function htmlDispatch(stream, state) { 12 | if (stream.match(scriptStartRegex, false)) { 13 | state.token=scriptingDispatch; 14 | return scriptingMode.token(stream, state.scriptState); 15 | } 16 | else 17 | return htmlMixedMode.token(stream, state.htmlState); 18 | } 19 | 20 | //tokenizer when in scripting mode 21 | function scriptingDispatch(stream, state) { 22 | if (stream.match(scriptEndRegex, false)) { 23 | state.token=htmlDispatch; 24 | return htmlMixedMode.token(stream, state.htmlState); 25 | } 26 | else 27 | return scriptingMode.token(stream, state.scriptState); 28 | } 29 | 30 | 31 | return { 32 | startState: function() { 33 | scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); 34 | htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); 35 | return { 36 | token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, 37 | htmlState : htmlMixedMode.startState(), 38 | scriptState : scriptingMode.startState() 39 | } 40 | }, 41 | 42 | token: function(stream, state) { 43 | return state.token(stream, state); 44 | }, 45 | 46 | indent: function(state, textAfter) { 47 | if (state.token == htmlDispatch) 48 | return htmlMixedMode.indent(state.htmlState, textAfter); 49 | else 50 | return scriptingMode.indent(state.scriptState, textAfter); 51 | }, 52 | 53 | copyState: function(state) { 54 | return { 55 | token : state.token, 56 | htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), 57 | scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) 58 | } 59 | }, 60 | 61 | 62 | electricChars: "/{}:" 63 | } 64 | }, "htmlmixed"); 65 | 66 | CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); 67 | CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 68 | CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 69 | -------------------------------------------------------------------------------- /js/lib/containers/DocumentManagerContainer.js: -------------------------------------------------------------------------------- 1 | import "FillDockContainer"; 2 | 3 | /** 4 | * The document manager is then central area of the dock layout hierarchy. 5 | * This is where more important panels are placed (e.g. the text editor in an IDE, 6 | * 3D view in a modelling package etc 7 | */ 8 | dockspawn.DocumentManagerContainer = function(dockManager) 9 | { 10 | dockspawn.FillDockContainer.call(this, dockManager, dockspawn.TabHost.DIRECTION_TOP); 11 | this.minimumAllowedChildNodes = 0; 12 | this.element.classList.add("document-manager"); 13 | this.tabHost.createTabPage = this._createDocumentTabPage; 14 | this.tabHost.displayCloseButton = true; 15 | }; 16 | dockspawn.DocumentManagerContainer.prototype = new dockspawn.FillDockContainer(); 17 | dockspawn.DocumentManagerContainer.prototype.constructor = dockspawn.DocumentManagerContainer; 18 | 19 | dockspawn.DocumentManagerContainer.prototype._createDocumentTabPage = function(tabHost, container) 20 | { 21 | return new dockspawn.DocumentTabPage(tabHost, container); 22 | }; 23 | 24 | dockspawn.DocumentManagerContainer.prototype.saveState = function(state) 25 | { 26 | dockspawn.FillDockContainer.prototype.saveState.call(this, state); 27 | state.documentManager = true; 28 | }; 29 | 30 | /** Returns the selected document tab */ 31 | dockspawn.DocumentManagerContainer.prototype.selectedTab = function() 32 | { 33 | return this.tabHost.activeTab; 34 | }; 35 | 36 | /** 37 | * Specialized tab page that doesn't display the panel's frame when docked in a tab page 38 | */ 39 | dockspawn.DocumentTabPage = function(host, container) 40 | { 41 | dockspawn.TabPage.call(this, host, container); 42 | 43 | // If the container is a panel, extract the content element and set it as the tab's content 44 | if (this.container.containerType == "panel") 45 | { 46 | this.panel = container; 47 | this.containerElement = this.panel.elementContent; 48 | 49 | // detach the container element from the panel's frame. 50 | // It will be reattached when this tab page is destroyed 51 | // This enables the panel's frame (title bar etc) to be hidden 52 | // inside the tab page 53 | removeNode(this.containerElement); 54 | } 55 | }; 56 | dockspawn.DocumentTabPage.prototype = new dockspawn.TabPage(); 57 | dockspawn.DocumentTabPage.prototype.constructor = dockspawn.DocumentTabPage; 58 | 59 | dockspawn.DocumentTabPage.prototype.destroy = function() 60 | { 61 | dockspawn.TabPage.prototype.destroy.call(this); 62 | 63 | // Restore the panel content element back into the panel frame 64 | removeNode(this.containerElement); 65 | this.panel.elementContentHost.appendChild(this.containerElement); 66 | }; 67 | -------------------------------------------------------------------------------- /js/lib/dialog/Dialog.js: -------------------------------------------------------------------------------- 1 | dockspawn.Dialog = function(panel, dockManager) 2 | { 3 | this.panel = panel; 4 | this.zIndexCounter = 1000; 5 | this.dockManager = dockManager; 6 | this.eventListener = dockManager; 7 | this._initialize(); 8 | }; 9 | 10 | dockspawn.Dialog.fromElement = function(id, dockManager) 11 | { 12 | return new dockspawn.Dialog(new dockspawn.PanelContainer(document.getElementById(id), dockManager), dockManager); 13 | }; 14 | 15 | dockspawn.Dialog.prototype._initialize = function() 16 | { 17 | this.panel.floatingDialog = this; 18 | this.elementDialog = document.createElement('div'); 19 | this.elementDialog.appendChild(this.panel.elementPanel); 20 | this.draggable = new dockspawn.DraggableContainer(this, this.panel, this.elementDialog, this.panel.elementTitle); 21 | this.resizable = new dockspawn.ResizableContainer(this, this.draggable, this.draggable.topLevelElement); 22 | 23 | document.body.appendChild(this.elementDialog); 24 | this.elementDialog.classList.add("dialog-floating"); 25 | this.elementDialog.classList.add("rounded-corner-top"); 26 | this.panel.elementTitle.classList.add("rounded-corner-top"); 27 | 28 | this.mouseDownHandler = new dockspawn.EventHandler(this.elementDialog, 'mousedown', this.onMouseDown.bind(this)); 29 | this.resize(this.panel.elementPanel.clientWidth, this.panel.elementPanel.clientHeight); 30 | this.bringToFront(); 31 | }; 32 | 33 | dockspawn.Dialog.prototype.setPosition = function(x, y) 34 | { 35 | this.elementDialog.style.left = x + "px"; 36 | this.elementDialog.style.top = y + "px"; 37 | }; 38 | 39 | dockspawn.Dialog.prototype.onMouseDown = function(e) 40 | { 41 | this.bringToFront(); 42 | }; 43 | 44 | dockspawn.Dialog.prototype.destroy = function() 45 | { 46 | if (this.mouseDownHandler) 47 | { 48 | this.mouseDownHandler.cancel(); 49 | delete this.mouseDownHandler; 50 | } 51 | this.elementDialog.classList.remove("rounded-corner-top"); 52 | this.panel.elementTitle.classList.remove("rounded-corner-top"); 53 | removeNode(this.elementDialog); 54 | this.draggable.removeDecorator(); 55 | removeNode(this.panel.elementPanel); 56 | delete this.panel.floatingDialog; 57 | }; 58 | 59 | dockspawn.Dialog.prototype.resize = function(width, height) 60 | { 61 | this.resizable.resize(width, height); 62 | }; 63 | 64 | dockspawn.Dialog.prototype.setTitle = function(title) 65 | { 66 | this.panel.setTitle(title); 67 | }; 68 | 69 | dockspawn.Dialog.prototype.setTitleIcon = function(iconName) 70 | { 71 | this.panel.setTitleIcon(iconName); 72 | }; 73 | 74 | dockspawn.Dialog.prototype.bringToFront = function() 75 | { 76 | this.elementDialog.style.zIndex = this.zIndexCounter++; 77 | }; 78 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/dialog/dialog.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class Dialog { 4 | DivElement elementDialog; 5 | PanelContainer panel; 6 | DraggableContainer draggable; 7 | ResizableContainer resizable; 8 | DialogEventListener eventListener; 9 | DockManager dockManager; 10 | static int zIndexCounter = 1000; 11 | StreamSubscription mouseDownHandler; 12 | 13 | Dialog.fromElement(String id, this.dockManager) { 14 | this.panel = new PanelContainer(query(id), dockManager); 15 | this.eventListener = dockManager; 16 | _initialize(); 17 | } 18 | 19 | Dialog(this.panel, this.dockManager) { 20 | _initialize(); 21 | this.eventListener = dockManager; 22 | } 23 | 24 | void _initialize() { 25 | panel.floatingDialog = this; 26 | elementDialog = new DivElement(); 27 | elementDialog.nodes.add(panel.elementPanel); 28 | draggable = new DraggableContainer(this, panel, elementDialog, panel.elementTitle); 29 | resizable = new ResizableContainer(this, draggable, draggable.topLevelElement); 30 | 31 | document.body.nodes.add(elementDialog); 32 | elementDialog.classes.add("dialog-floating"); 33 | elementDialog.classes.add("rounded-corner-top"); 34 | panel.elementTitle.classes.add("rounded-corner-top"); 35 | 36 | mouseDownHandler = elementDialog.onMouseDown.listen(onMouseDown); 37 | resize(panel.elementPanel.client.width, panel.elementPanel.client.height); 38 | bringToFront(); 39 | } 40 | 41 | void setPosition(num x, num y) { 42 | elementDialog.style.left = "${x}px"; 43 | elementDialog.style.top = "${y}px"; 44 | } 45 | 46 | void onMouseDown(MouseEvent e) { 47 | bringToFront(); 48 | } 49 | 50 | void destroy() { 51 | if (mouseDownHandler != null) { 52 | mouseDownHandler.cancel(); 53 | mouseDownHandler = null; 54 | } 55 | elementDialog.classes.remove("rounded-corner-top"); 56 | panel.elementTitle.classes.remove("rounded-corner-top"); 57 | elementDialog.remove(); 58 | draggable.removeDecorator(); 59 | panel.elementPanel.remove(); 60 | panel.floatingDialog = null; 61 | } 62 | 63 | void resize(int width, int height) { 64 | resizable.resize(width, height); 65 | } 66 | 67 | void setTitle(String title) { 68 | panel.setTitle(title); 69 | } 70 | 71 | void setTitleIcon(String iconName) { 72 | panel.setTitleIcon(iconName); 73 | } 74 | 75 | void bringToFront() { 76 | zIndexCounter++; 77 | elementDialog.style.zIndex = "$zIndexCounter"; 78 | } 79 | } 80 | 81 | 82 | abstract class DialogEventListener { 83 | void onDialogDragStarted(Dialog sender, MouseEvent e); 84 | void onDialogDragEnded(Dialog sender, MouseEvent e); 85 | } 86 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/smarty/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Smarty mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Smarty mode

13 | 14 |
35 | 36 | 42 | 43 |
44 | 45 |
66 | 67 | 77 | 78 |

A plain text/Smarty mode which allows for custom delimiter tags (defaults to { and }).

79 | 80 |

MIME types defined: text/x-smarty

81 | 82 | 83 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/utils/undock_initiator.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | /** Listen for undock events */ 4 | typedef Dialog OnUndock(MouseEvent e, Point2 dragOffset); 5 | 6 | /** 7 | * Listens for events on the [element] and notifies the [listener] 8 | * if an undock event has been invoked. An undock event is invoked 9 | * when the user clicks on the event and drags is beyond the 10 | * specified [thresholdPixels] 11 | */ 12 | class UndockInitiator { 13 | Element element; 14 | OnUndock listener; 15 | num thresholdPixels; 16 | Point2 dragStartPosition; 17 | 18 | StreamSubscription mouseDownHandler; 19 | StreamSubscription mouseUpHandler; 20 | StreamSubscription mouseMoveHandler; 21 | 22 | bool _enabled = false; 23 | bool get enabled { 24 | return _enabled; 25 | } 26 | 27 | void set enabled(bool value) { 28 | _enabled = value; 29 | if (_enabled) { 30 | _cancelSubscription(mouseDownHandler); 31 | mouseDownHandler = element.onMouseDown.listen(onMouseDown); 32 | } else { 33 | _cancelSubscription(mouseDownHandler); 34 | _cancelSubscription(mouseUpHandler); 35 | _cancelSubscription(mouseMoveHandler); 36 | mouseDownHandler = null; 37 | mouseUpHandler = null; 38 | mouseMoveHandler = null; 39 | } 40 | } 41 | 42 | UndockInitiator(this.element, this.listener, [this.thresholdPixels = 10]) { 43 | } 44 | 45 | void _cancelSubscription(StreamSubscription sub) { 46 | if (sub != null) { 47 | sub.cancel(); 48 | } 49 | } 50 | 51 | void onMouseDown(MouseEvent e) { 52 | // Make sure we dont do this on floating dialogs 53 | if (enabled) { 54 | _cancelSubscription(mouseUpHandler); 55 | _cancelSubscription(mouseMoveHandler); 56 | mouseUpHandler = window.onMouseUp.listen(onMouseUp); 57 | mouseMoveHandler = window.onMouseMove.listen(onMouseMove); 58 | dragStartPosition = new Point2(e.page.x, e.page.y); 59 | } 60 | } 61 | void onMouseUp(MouseEvent e) { 62 | _cancelSubscription(mouseUpHandler); 63 | _cancelSubscription(mouseMoveHandler); 64 | mouseUpHandler = null; 65 | mouseMoveHandler = null; 66 | } 67 | void onMouseMove(MouseEvent e) { 68 | Point2 position = new Point2(e.page.x, e.page.y); 69 | num dx = position.x - dragStartPosition.x; 70 | num dy = position.y - dragStartPosition.y; 71 | num distance = sqrt(dx * dx + dy * dy); 72 | 73 | if (distance > thresholdPixels) { 74 | enabled = false; 75 | _requestUndock(e); 76 | } 77 | } 78 | 79 | void _requestUndock(MouseEvent e) { 80 | num dragOffsetX = dragStartPosition.x - element.offset.left; 81 | num dragOffsetY = dragStartPosition.y - element.offset.top; 82 | Point2 dragOffset = new Point2(dragOffsetX, dragOffsetY); 83 | listener(e, dragOffset); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /js/lib/serialization/DockGraphDeserializer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Deserializes the dock layout hierarchy from JSON and creates a dock hierarhcy graph 3 | */ 4 | dockspawn.DockGraphDeserializer = function(dockManager) 5 | { 6 | this.dockManager = dockManager; 7 | }; 8 | 9 | dockspawn.DockGraphDeserializer.prototype.deserialize = function(json) 10 | { 11 | var graphInfo = JSON.parse(_json); 12 | var model = new dockspawn.DockModel(); 13 | model.rootNode = this._buildGraph(graphInfo); 14 | return model; 15 | }; 16 | 17 | dockspawn.DockGraphDeserializer.prototype._buildGraph = function(nodeInfo) 18 | { 19 | var childrenInfo = nodeInfo.children; 20 | var children = []; 21 | var self = this; 22 | childrenInfo.forEach(function(childInfo) 23 | { 24 | var childNode = self._buildGraph(childInfo); 25 | children.push(childNode); 26 | }); 27 | 28 | // Build the container owned by this node 29 | var container = this._createContainer(nodeInfo, children); 30 | 31 | // Build the node for this container and attach it's children 32 | var node = new dockspawn.DockNode(container); 33 | node.children = children; 34 | node.children.forEach(function(childNode) { childNode.parent = node; }); 35 | 36 | return node; 37 | }; 38 | 39 | dockspawn.DockGraphDeserializer.prototype._createContainer = function(nodeInfo, children) 40 | { 41 | var containerType = nodeInfo.containerType; 42 | var containerState = nodeInfo.state; 43 | var container; 44 | 45 | var childContainers = []; 46 | children.forEach(function(childNode) { childContainers.push(childNode.container); }); 47 | childContainers = []; 48 | 49 | if (containerType == "panel") 50 | container = new dockspawn.PanelContainer.loadFromState(containerState, this.dockManager); 51 | else if (containerType == "horizontal") 52 | container = new dockspawn.HorizontalDockContainer(this.dockManager, childContainers); 53 | else if (containerType == "vertical") 54 | container = new dockspawn.VerticalDockContainer(this.dockManager, childContainers); 55 | else if (containerType == "fill") 56 | { 57 | // Check if this is a document manager 58 | 59 | // TODO: Layout engine compares the string "fill", so cannot create another subclass type 60 | // called document_manager and have to resort to this hack. use RTTI in layout engine 61 | var typeDocumentManager = containerState.documentManager; 62 | if (typeDocumentManager) 63 | container = new DocumentManagerContainer(this.dockManager); 64 | else 65 | container = new dockspawn.FillDockContainer(this.dockManager); 66 | } 67 | else 68 | throw new dockspawn.Exception("Cannot create dock container of unknown type: " + containerType); 69 | 70 | // Restore the state of the container 71 | container.loadState(containerState); 72 | container.performLayout(childContainers); 73 | return container; 74 | }; 75 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/javascript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: JavaScript mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: JavaScript mode

13 | 14 |
63 | 64 | 70 | 71 |

JavaScript mode supports a single configuration 72 | option, json, which will set the mode to expect JSON 73 | data rather than a JavaScript program.

74 | 75 |

MIME types defined: text/javascript, application/json.

76 | 77 | 78 | -------------------------------------------------------------------------------- /js/lib/dock/DockModel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The Dock Model contains the tree hierarchy that represents the state of the 3 | * panel placement within the dock manager. 4 | */ 5 | dockspawn.DockModel = function() 6 | { 7 | this.rootNode = this.documentManagerNode = undefined; 8 | }; 9 | 10 | dockspawn.DockNode = function(container) 11 | { 12 | /** The dock container represented by this node */ 13 | this.container = container; 14 | this.children = []; 15 | } 16 | 17 | dockspawn.DockNode.prototype.detachFromParent = function() 18 | { 19 | if (this.parent) 20 | { 21 | this.parent.removeChild(this); 22 | delete this.parent; 23 | } 24 | }; 25 | 26 | dockspawn.DockNode.prototype.removeChild = function(childNode) 27 | { 28 | var index = this.children.indexOf(childNode); 29 | if (index >= 0) 30 | this.children.splice(index, 1); 31 | }; 32 | 33 | dockspawn.DockNode.prototype.addChild = function(childNode) 34 | { 35 | childNode.detachFromParent(); 36 | childNode.parent = this; 37 | this.children.push(childNode); 38 | }; 39 | 40 | dockspawn.DockNode.prototype.addChildBefore = function(referenceNode, childNode) 41 | { 42 | this._addChildWithDirection(referenceNode, childNode, true); 43 | }; 44 | 45 | dockspawn.DockNode.prototype.addChildAfter = function(referenceNode, childNode) 46 | { 47 | this._addChildWithDirection(referenceNode, childNode, false); 48 | }; 49 | 50 | dockspawn.DockNode.prototype._addChildWithDirection = function(referenceNode, childNode, before) 51 | { 52 | // Detach this node from it's parent first 53 | childNode.detachFromParent(); 54 | childNode.parent = this; 55 | 56 | var referenceIndex = this.children.indexOf(referenceNode); 57 | var preList = this.children.slice(0, referenceIndex); 58 | var postList = this.children.slice(referenceIndex + 1, this.children.length); 59 | 60 | this.children = preList.slice(0); 61 | if (before) 62 | { 63 | this.children.push(childNode); 64 | this.children.push(referenceNode); 65 | } 66 | else 67 | { 68 | this.children.push(referenceNode); 69 | this.children.push(childNode); 70 | } 71 | Array.prototype.push.apply(this.children, postList); 72 | }; 73 | 74 | dockspawn.DockNode.prototype.performLayout = function() 75 | { 76 | var childContainers = this.children.map(function(childNode) { return childNode.container; }); 77 | this.container.performLayout(childContainers); 78 | }; 79 | 80 | dockspawn.DockNode.prototype.debug_DumpTree = function(indent) 81 | { 82 | if (indent === undefined) 83 | indent = 0; 84 | 85 | var message = this.container.name; 86 | for (var i = 0; i < indent; i++) 87 | message = "\t" + message; 88 | 89 | var parentType = this.parent === undefined ? "null" : this.parent.container.containerType; 90 | console.log(">>" + message + " [" + parentType + "]"); 91 | 92 | this.children.forEach(function(childNode) { childNode.debug_DumpTree(indent + 1) }); 93 | }; 94 | -------------------------------------------------------------------------------- /dart-dock-spawn/lib/utils/geometric_primitives.dart: -------------------------------------------------------------------------------- 1 | part of dock_spawn; 2 | 3 | class Color { 4 | num r = 0; 5 | num g = 0; 6 | num b = 0; 7 | num a = 1; 8 | 9 | int get r255 => (r * 255).toInt(); 10 | int get g255 => (g * 255).toInt(); 11 | int get b255 => (b * 255).toInt(); 12 | 13 | Color(); 14 | Color.fromRGBA(this.r, this.g, this.b, this.a); 15 | 16 | String toString() => "$r, $g, $b"; 17 | String toString255() => "$r255, $g255, $b255"; 18 | void parse(String data) { 19 | var tokens = data.split(","); 20 | if (tokens.length >= 3) { 21 | r = double.parse(tokens[0]); 22 | g = double.parse(tokens[1]); 23 | b = double.parse(tokens[2]); 24 | } 25 | } 26 | void parse255(String data) { 27 | var tokens = data.split(","); 28 | if (tokens.length < 3) { 29 | throw new Exception("Invalid color input format $data"); 30 | } 31 | r = double.parse(tokens[0]) / 255; 32 | g = double.parse(tokens[1]) / 255; 33 | b = double.parse(tokens[2]) / 255; 34 | } 35 | 36 | String toRgba() => "rgba($r255, $g255, $b255, $a)"; 37 | } 38 | 39 | class Point2 { 40 | num x; 41 | num y; 42 | 43 | Point2(this.x, this.y); 44 | Point2.copy(Point2 other) : x = other.x, y = other.y; 45 | Point2.empty() : x = 0, y = 0; 46 | 47 | Point2 operator-(Point2 other) { 48 | return new Point2(x - other.x, y - other.y); 49 | } 50 | 51 | Point2 operator+(Point2 other) { 52 | return new Point2(x + other.x, y + other.y); 53 | } 54 | 55 | Point2 operator*(num value) { 56 | return new Point2(x * value, y * value); 57 | } 58 | 59 | bool operator==(Point2 other) { 60 | return x == other.x && y == other.y; 61 | } 62 | 63 | bool inside(Point2 startLocation, Size size) { 64 | final sx = startLocation.x; 65 | final sy = startLocation.y; 66 | final width = size.width; 67 | final height = size.height; 68 | return x >= sx && y >= sy && 69 | x <= sx + width && y <= sy + height; 70 | } 71 | 72 | String toString() => "[$x, $y]"; 73 | 74 | int get hashCode { 75 | int result = 17; 76 | result = 37 * result + x.hashCode; 77 | result = 37 * result + y.hashCode; 78 | return result; 79 | } 80 | } 81 | 82 | class Size { 83 | num width = 0; 84 | num height = 0; 85 | Size.empty(); 86 | Size.copy(Size other) { 87 | this.width = other.width; 88 | this.height = other.height; 89 | } 90 | Size(this.width, this.height); 91 | 92 | Size operator-(Size other) { 93 | return new Size(width - other.width, height - other.height); 94 | } 95 | 96 | Size operator+(Size other) { 97 | return new Size(width + other.width, height + other.height); 98 | } 99 | 100 | Size operator*(num value) { 101 | return new Size(width * value, height * value); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /dart-dock-spawn/web/demos/dock_spawn_demo_ide/resources/codemirror/mode/rpm/spec/spec.js: -------------------------------------------------------------------------------- 1 | // Quick and dirty spec file highlighting 2 | 3 | CodeMirror.defineMode("spec", function(config, modeConfig) { 4 | var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; 5 | 6 | var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; 7 | var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; 8 | var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros 9 | var control_flow_simple = /^%(else|endif)/; // rpm control flow macros 10 | var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros 11 | 12 | return { 13 | startState: function () { 14 | return { 15 | controlFlow: false, 16 | macroParameters: false, 17 | section: false 18 | }; 19 | }, 20 | token: function (stream, state) { 21 | var ch = stream.peek(); 22 | if (ch == "#") { stream.skipToEnd(); return "comment"; } 23 | 24 | if (stream.sol()) { 25 | if (stream.match(preamble)) { return "preamble"; } 26 | if (stream.match(section)) { return "section"; } 27 | } 28 | 29 | if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' 30 | if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' 31 | 32 | if (stream.match(control_flow_simple)) { return "keyword"; } 33 | if (stream.match(control_flow_complex)) { 34 | state.controlFlow = true; 35 | return "keyword"; 36 | } 37 | if (state.controlFlow) { 38 | if (stream.match(operators)) { return "operator"; } 39 | if (stream.match(/^(\d+)/)) { return "number"; } 40 | if (stream.eol()) { state.controlFlow = false; } 41 | } 42 | 43 | if (stream.match(arch)) { return "number"; } 44 | 45 | // Macros like '%make_install' or '%attr(0775,root,root)' 46 | if (stream.match(/^%[\w]+/)) { 47 | if (stream.match(/^\(/)) { state.macroParameters = true; } 48 | return "macro"; 49 | } 50 | if (state.macroParameters) { 51 | if (stream.match(/^\d+/)) { return "number";} 52 | if (stream.match(/^\)/)) { 53 | state.macroParameters = false; 54 | return "macro"; 55 | } 56 | } 57 | if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' 58 | 59 | //TODO: Include bash script sub-parser (CodeMirror supports that) 60 | stream.next(); 61 | return null; 62 | } 63 | }; 64 | }); 65 | 66 | CodeMirror.defineMIME("text/x-rpm-spec", "spec"); 67 | --------------------------------------------------------------------------------