Skip to content

Commit

Permalink
Bowerizing the demo. Bringing in Bootstrap 3.0. Improving style wishes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Dec 19, 2013
1 parent 65f037d commit b19d019
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 542 deletions.
16 changes: 3 additions & 13 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "genie",
"main": "genie.js",
"version": "0.1.5",
"version": "0.1.6",
"homepage": "https://github.com/kentcdodds/genie",
"authors": [
"Kent C. Dodds <[email protected]>"
Expand All @@ -10,17 +10,7 @@
"license": "MIT",
"private": false,
"ignore": [
"**/.*",
"demo-files/",
"node-modules/",
"other/",
"test/",
".travis.yml",
"bower.json",
"Gruntfile.js",
"index.html",
"LICENSE",
"package.json",
"README.md"
"*",
"!genie.js"
]
}
38 changes: 23 additions & 15 deletions demo-files/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
if (typeof magicWords === 'string') {
magicWords = magicWords.split(',');
}
var wish = genie({
return genie({
magicWords: magicWords,
action: action || function(wish) {
alert('Your "' + wish.magicWords[0] + '" wish is my command!');
Expand All @@ -52,25 +52,33 @@
}

function addStyleWish(style, altStyle, property) {
var styleLabel = 'Style Genie: ' + style;
var altStyleLabel = 'Style Genie: ' + altStyle;
addWish(styleLabel, function(wish) {
if (wish.magicWords[0] === styleLabel) {
$scope.$apply(function() {
wish.magicWords[0] = altStyleLabel;
$scope.genieStyle[property] = style.toLowerCase();
});
} else {
$scope.$apply(function() {
wish.magicWords[0] = styleLabel;
$scope.genieStyle[property] = altStyle.toLowerCase();
});
var originalWish, altWish;
function applyStyleAndSwapWishes(wish) {
$scope.genieStyle[property] = wish.data.style.toLowerCase();
genie.deregisterWish(wish);
genie(wish.data.otherWish);
}
originalWish = genie({
magicWords: 'Style the lamp: ' + style,
action: applyStyleAndSwapWishes,
data: {
style: style
}
});
altWish = genie({
magicWords: 'Style the lamp: ' + altStyle,
action: applyStyleAndSwapWishes,
data: {
style: altStyle,
otherWish: originalWish
}
});
originalWish.data.otherWish = altWish;
genie.deregisterWish(altWish);
}

function addDestinationWish(magicWord, destination) {
addWish('Go to ' + magicWord, {
addWish('Navigate: ' + magicWord, {
destination: destination,
openNewTab: true
});
Expand Down
12 changes: 12 additions & 0 deletions demo-files/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "genie-demo",
"version": "0.0.0",
"dependencies": {
"angular": "~1.2.4",
"ux-genie": "*",
"bootstrap": "3.0.3",
"angular-ga": "0.1.0"
},
"devDependencies": { },
"private": true
}
File renamed without changes
21 changes: 15 additions & 6 deletions demo-files/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ h3 {
color: #999
}

#fork-me {
position: absolute;
top: 0;
right: 0;
border: 0;
}

.btn {
margin-bottom: 12px;
}
Expand All @@ -14,6 +21,10 @@ h3 {
margin-top: 12px;
}

#bottom-stuff {
clear: both;
}

#wish-output {
color: #808080;
}
Expand Down Expand Up @@ -54,9 +65,11 @@ h3 {
-mos-border-radius: 8px;
border-radius: 8px;
margin: 0px;
width: 100%;
}

.genie-wishes {
width: 100%;
margin-top: 10px;
cursor: pointer;
overflow-y: auto;
Expand Down Expand Up @@ -101,21 +114,19 @@ h3 {

/* ng-genie large styles */
#uxLampContainer.large .genie-container {
width: 384px;
margin-left: -208px;
width: 600px;
margin-left: -300px;
padding: 16px;
}

#uxLampContainer.large .genie-container > input {
width: 358px;
line-height: 60px;
padding: 0px 12px 0px 12px;
font-size: 40px;
height: 60px;
}

#uxLampContainer.large .genie-wishes {
width: 384px;
max-height: 300px;
font-size: 30px;
}
Expand All @@ -133,15 +144,13 @@ h3 {
}

#uxLampContainer.small .genie-container > input {
width: 274px;
line-height: 50px;
padding: 0px 12px 0px 12px;
font-size: 34px;
height: 54px;
}

#uxLampContainer.small .genie-wishes {
width: 297px;
max-height: 216px;
font-size: 24px;
}
Expand Down
178 changes: 0 additions & 178 deletions demo-files/vendor/angular.min.js

This file was deleted.

9 changes: 0 additions & 9 deletions demo-files/vendor/bootstrap.min.css

This file was deleted.

62 changes: 0 additions & 62 deletions demo-files/vendor/ga.js

This file was deleted.

Loading

0 comments on commit b19d019

Please sign in to comment.