Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refresh of the kitchen sink app sample
- Loading branch information
1 parent
473ede1
commit 469ef98
Showing
13 changed files
with
99 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1>Embedded HTML</h1> | ||
|
||
<p>This HTML fragment was loaded dynamically. The joHTML control | ||
also intercepts <a href="htmltestlink.html">links</a> so you | ||
can keep them on the page. This is useful for pure content cases | ||
such as disclaimers, app info, and help.</p> | ||
|
||
<p><em>Note that since Jo uses custom tag names for its controls, | ||
you should have little if any CSS overlap with your App UI.</em></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<h1>Embedded HTML Link</h1> | ||
|
||
<p>You tapped a link, the app code listened for it and | ||
handled loading a different HTML fragment into the file source...</p> | ||
|
||
<p>Which automatically updated the UI. You could also | ||
push these "pages" onto your UI stack, but that's a little more | ||
involved.</p> | ||
|
||
<a href="htmltest.html">Back to the original file</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
App = { | ||
load: function() { | ||
// loading Jo is required | ||
jo.load(); | ||
|
||
// grab the HTML for our about box | ||
var about = joDOM.get("about").innerHTML; | ||
|
||
// this is a more complex UI with a nav bar and a toolbar | ||
this.scn = new joScreen( | ||
new joContainer([ | ||
new joFlexcol([ | ||
this.nav = new joNavbar(), | ||
this.stack = new joStackScroller() | ||
]), | ||
this.toolbar = new joToolbar("This is a footer") | ||
// typical card stack, nav and footer | ||
this.screen = new joScreen( | ||
new joFlexcol([ | ||
this.nav = new joNavbar(), | ||
this.stack = new joStackScroller(), | ||
this.toolbar = new joToolbar("This is a toolbar") | ||
]) | ||
); | ||
|
||
// attach the nav to our stack | ||
this.nav.setStack(this.stack); | ||
|
||
joCache.set("about", function() { | ||
var card = new joCard(about).setTitle("About"); | ||
|
||
return card; | ||
}); | ||
|
||
|
||
// push our menu card | ||
this.stack.push(joCache.get("menu")); | ||
console.log(this); | ||
} | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
joCache.set("html", function() { | ||
// create an HTML file loader | ||
var file = new joFileSource("htmltest.html"); | ||
|
||
// HTML control, hook it up to file and subscribe to URL clicks | ||
var html = new joHTML() | ||
.setDataSource(file) | ||
.selectEvent.subscribe(function(url) { | ||
// a link was clicked, tell our file source to load its url | ||
file.setQuery(url).load(); | ||
}); | ||
|
||
// for added fun, subscribe to the filesource and | ||
// keep a display of its URL and file size. | ||
var info = new joLabel(); | ||
file.changeEvent.subscribe(function(data) { | ||
info.setData(file.query + " (" + data.length + " characters)"); | ||
}); | ||
|
||
// the UI for this card | ||
card = new joCard([ | ||
new joGroup([ | ||
new joHTML("<h1>Inline HTML</h1><p>This HTML was included inline, click the load button below to pull in another file asynchronously.</p>"), | ||
new joButton("Load HTML File") | ||
.selectEvent.subscribe(function() { file.load(); }, this) | ||
]), | ||
// this is our dynamic HTML control defined above | ||
new joGroup(html), | ||
info | ||
]).setTitle("Embedded HTML Browser"); | ||
|
||
console.log(card); | ||
|
||
return card; | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
joCache.set("table", function() { | ||
var back; | ||
|
||
var card = new joCard([ | ||
new joTable([ | ||
["Name", "Phone", "Email"], | ||
["Bob", "555-1234", "bob@bob.not"], | ||
["Candy", "555-2345", "candy@candy.not"], | ||
["Doug", "555-3456", "doug@doug.not"], | ||
["Evan", "555-4567", "evan@evan.not"], | ||
["Frank", "555-5678", "frank@frank.not"] | ||
]).selectEvent.subscribe(function(index, table) { | ||
console.log(table.getNodeData(table.getRow())); | ||
}, this) | ||
]).setTitle("Table Demo"); | ||
|
||
return card; | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters