forked from kriszyp/xstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
0 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,25 @@ | ||
popup-message = { | ||
label = var: 'More information'; | ||
content: Here is more information; | ||
|
||
popup-model = module('xstyle/test/popup-model'); | ||
=> | ||
button (label) { | ||
on-click: popup-model/toggle(); | ||
}, | ||
div (content) { | ||
position: absolute; | ||
background-color: #aaa; | ||
}; | ||
} | ||
|
||
body { | ||
=> | ||
popup-message { | ||
label: Another Popup; | ||
content: Contents of another popup; | ||
} | ||
popup-message | ||
span 'Contents with a ' | ||
a[href=somepage] 'link'; | ||
} |
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,24 +1,31 @@ | ||
define(['dojo/store/Memory', 'dojo/store/Observable', 'dbind/bind', 'dbind/navigation'], function(Memory, Observable, bind, navigation){ | ||
// create an observable memory store with our test data | ||
contactStore = new Observable(new Memory({data:[ | ||
{id:1, firstName: 'Jimi', lastName:'Hendrix', email:'[email protected]'}, | ||
{id:2, firstName: 'Janis', lastName:'Joplin', email:'[email protected]'}, | ||
{id:3, firstName: 'Jim', lastName:'Morrison', email:'[email protected]'}, | ||
{id:4, firstName: 'Kurt', lastName:'Cobain', email:'[email protected]'}, | ||
{id:5, firstName: 'Amy', lastName:'Winehouse', email:'[email protected]'}, | ||
]})); | ||
// create a base binding, that we can set properties on | ||
contacts = bind({}); | ||
contacts.set('list', contactStore.query({})); | ||
contacts.set('select', function(item){ | ||
contacts.set('selected', item); | ||
}); | ||
contacts.set('selected', {firstName: '', lastName: '', id:''}); | ||
var firstName = contacts.get('selected').get('firstName'); | ||
firstName.receive(function(value){ | ||
firstName.set('error', value && value.length < 3 ? 'Name must be at least three characters' : ''); | ||
}); | ||
contacts.set('save', function(selected){ | ||
contactStore.put(selected); | ||
}); | ||
var nextId = 3; | ||
contacts.set('create', function(selected){ | ||
contacts.set('selected', {firstName:'', lastName: '', email: '', id: nextId++}); | ||
}); | ||
// add navigation support | ||
navigation(contacts.get('selected'), { | ||
store: contactStore | ||
}); | ||
|
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,16 @@ | ||
test-component { | ||
=> | ||
h1 'header' { color: red} | ||
p (content) | ||
}; | ||
body { | ||
=> | ||
test-component { | ||
=> | ||
div.nested 'nested' | ||
} | ||
test-component div.inline 'inline' | ||
test-component { | ||
content: 'as property'; | ||
}; | ||
} |
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,14 @@ | ||
<!DOCTYPE HTML> | ||
<html lang="en-US"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Test Xstyle Functionality</title> | ||
<script> | ||
document.write('<link rel="stylesheet" href="' + location.search.slice(1) + '.css" />'); | ||
</script> | ||
<script src="../../dojo/dojo.js" data-dojo-config="async:true, deps:['xstyle/main']"></script> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> |
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