Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: examples/js/hello.js

Issue 821403003: Changes magic sequence to '!#mojo ' and strips 'mojo ' when building url (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: two more Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « examples/js/cube.js ('k') | examples/js/share_echo.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!mojo:js_content_handler 1 #!mojo mojo:js_content_handler
2 // Demonstrate one JS Mojo application connecting to another to emit "hello 2 // Demonstrate one JS Mojo application connecting to another to emit "hello
3 // world". To run this application with mojo_shell, set DIR to be the absolute 3 // world". To run this application with mojo_shell, set DIR to be the absolute
4 // path for this directory, then: 4 // path for this directory, then:
5 // mojo_shell "file://$DIR/hello.js file://$DIR/world.js" 5 // mojo_shell "file://$DIR/hello.js file://$DIR/world.js"
6 // Launches the Mojo hello.js application which connects to the application 6 // Launches the Mojo hello.js application which connects to the application
7 // URL specified as a Mojo application argument, world.js in this case. 7 // URL specified as a Mojo application argument, world.js in this case.
8 8
9 define("main", [ 9 define("main", [
10 "console", 10 "console",
11 "mojo/services/public/js/application", 11 "mojo/services/public/js/application",
12 ], function(console, application) { 12 ], function(console, application) {
13 13
14 var Application = application.Application; 14 var Application = application.Application;
15 15
16 class Hello extends Application { 16 class Hello extends Application {
17 initialize(args) { 17 initialize(args) {
18 console.log(this.url + ": Hello"); 18 console.log(this.url + ": Hello");
19 if (args && args.length == 2) // args is a nullable parameter 19 if (args && args.length == 2) // args is a nullable parameter
20 this.shell.connectToApplication(args[1]); 20 this.shell.connectToApplication(args[1]);
21 else 21 else
22 console.log("Error: expected hello.js <URL for world.js>"); 22 console.log("Error: expected hello.js <URL for world.js>");
23 this.quit(); 23 this.quit();
24 } 24 }
25 } 25 }
26 26
27 return Hello; 27 return Hello;
28 }); 28 });
OLDNEW
« no previous file with comments | « examples/js/cube.js ('k') | examples/js/share_echo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698