Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Commit

Permalink
0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
potch committed Feb 14, 2014
1 parent 94d9781 commit 16e8db8
Show file tree
Hide file tree
Showing 47 changed files with 1,474 additions and 4,057 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.0
0.11.0
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "brick",
"description": "UI Web Components for Mobile Web Apps",
"version": "0.10.0",
"version": "0.11.0",
"keywords": [
"brick",
"custom",
Expand Down
2 changes: 1 addition & 1 deletion build/demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var generateDemoPages = avow(function(fulfill, reject, components){
}
else{
// TODO: this should use bower list --json
var componentDemoPath = path.join("bower_components", componentName,
var componentDemoPath = path.join("dev-repos", componentName,
"demo");
processComponentTemplate(componentDemoPath, componentName).then(function(){
processComponent(n+1);
Expand Down
2 changes: 1 addition & 1 deletion demos/x-tag-appbar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="navbar-header">
<a class="navbar-brand" href="../../index.html">
<img class="logo" src="../../site/img/logo.png">
Brick<small> 0.10.0</small>
Brick<small> 0.11.0</small>
</a>
</div>
<ul class="navbar-nav nav">
Expand Down
2 changes: 1 addition & 1 deletion demos/x-tag-calendar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="navbar-header">
<a class="navbar-brand" href="../../index.html">
<img class="logo" src="../../site/img/logo.png">
Brick<small> 0.10.0</small>
Brick<small> 0.11.0</small>
</a>
</div>
<ul class="navbar-nav nav">
Expand Down
40 changes: 20 additions & 20 deletions demos/x-tag-deck/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ function updateDemoSect(demoSect, isInit){
var deck = getDeck(demoSect);
var markupEl = DemoHelpers.getMarkupEl(demoSect, "html");

var ignoreAttrs = ["style","card-anim-type","_before-animation",
"reverse","selected","leaving", "class"];
var ignoreAttrs = ["style", "reverse","selected","hide", "class"];
// to indicate that initializing selected-index is not required
if(isInit) ignoreAttrs.push("selected-index");

Expand All @@ -26,13 +25,13 @@ function initShuffleButtons(){
var demoSect = DemoHelpers.controlButtonToDemoSect(button);
var deck = getDeck(demoSect);
if(xtag.hasClass(button, "forward")){
deck.shufflePrev("forward");
deck.previousCard("forward");
}
else if(xtag.hasClass(button, "reverse")){
deck.shufflePrev("reverse");
deck.previousCard("reverse");
}
else{
deck.shufflePrev();
deck.previousCard();
}
});

Expand All @@ -43,18 +42,18 @@ function initShuffleButtons(){
var deck = getDeck(demoSect);

if(xtag.hasClass(button, "forward")){
deck.shuffleNext("forward");
deck.nextCard("forward");
}
else if(xtag.hasClass(button, "reverse")){
deck.shuffleNext("reverse");
deck.nextCard("reverse");
}
else{
deck.shuffleNext();
deck.nextCard();
}
});

// set up global shuffle to handlers
xtag.addEvent(document, "click:delegate("+DemoHelpers.BUTTON_SELECTOR+".shuffleto)", function(e){
xtag.addEvent(document, "click:delegate("+DemoHelpers.BUTTON_SELECTOR+".showCard)", function(e){
var button = this;
var demoSect = DemoHelpers.controlButtonToDemoSect(button);
var deck = getDeck(demoSect);
Expand All @@ -63,13 +62,13 @@ function initShuffleButtons(){
target = parseInt(target);

if(xtag.hasClass(button, "forward")){
deck.shuffleTo(target, "forward");
deck.showCard(target, "forward");
}
else if(xtag.hasClass(button, "reverse")){
deck.shuffleTo(target, "reverse");
deck.showCard(target, "reverse");
}
else{
deck.shuffleTo(target);
deck.showCard(target);
}
});
}
Expand All @@ -81,25 +80,26 @@ function initCardAddRemoveButtons(){
var deck = getDeck(demoSect);

// deck.numCards retrieves the number of cards currently in the deck
var newIndex = deck.numCards;
var newIndex = deck.cards.length;
var newCard = document.createElement("x-card");
newCard.style.backgroundColor = DemoHelpers.randomColor();
newCard.textContent = newIndex;
deck.appendChild(newCard);
if(!button.hasAttribute("noshuffle")){
// for demo, shuffle to newly inserted card
deck.shuffleTo(newIndex);
deck.showCard(newIndex);
}
});

xtag.addEvent(document, "click:delegate("+DemoHelpers.BUTTON_SELECTOR+".remove)", function(e){
var button = this;
var demoSect = DemoHelpers.controlButtonToDemoSect(button);;
var deck = getDeck(demoSect);

if(deck.numCards > 0){
var cards = deck.cards;
var length = cards.length;
if(length > 0){
// deck.getCardAt retrieves the <x-card> at the given index
var lastCard = deck.getCardAt(deck.numCards-1);
var lastCard = cards[length-1];
deck.removeChild(lastCard);
}
});
Expand All @@ -112,7 +112,7 @@ function initRandomCardColors(){
}

function getInitEventCounter(eventDemo){
var keys = ["shufflestart", "shuffleend", "cardadd", "cardremove"];
var keys = ["show", "hide"];
return new DemoHelpers.EventCounter(keys);
}

Expand All @@ -139,7 +139,7 @@ document.addEventListener('DOMComponentsLoaded', function(){
e.detail && e.detail.toggleProp === "transitionType")
{
var deck = demoSect.querySelector("x-deck");
deck.shuffleNext("forward");
deck.nextCard("forward");
}
});

Expand All @@ -148,5 +148,5 @@ document.addEventListener('DOMComponentsLoaded', function(){
initShuffleButtons();
initCardAddRemoveButtons();
initRandomCardColors();
DemoHelpers.registerUpdateListeners(["shufflestart", "shuffleend", "cardadd", "cardremove"]);
DemoHelpers.registerUpdateListeners(["show", "hide"]);
});
Loading

0 comments on commit 16e8db8

Please sign in to comment.