diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..d76bff27 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "third_party/mocha"] + path = third_party/mocha + url = https://github.com/visionmedia/mocha.git +[submodule "third_party/expect.js"] + path = third_party/expect.js + url = https://github.com/LearnBoost/expect.js.git diff --git a/src/css/g-tabs.css b/src/css/g-tabs.css new file mode 100644 index 00000000..9ece9d83 --- /dev/null +++ b/src/css/g-tabs.css @@ -0,0 +1,46 @@ +/* + * Copyright 2012 The Toolkitchen Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ +@host { + display: block; + height: 28px; + line-height: 28px; + border: 0; + border-bottom: 1px solid #ccc; +} + +.vertical { + display: inline-block; + width: 71px; + height: 100%; + border: 0; + border-right: 1px solid #ccc; +} + +.tabContainer > * { + display: inline-block; + min-width: 54px; + height: 27px; + line-height: 27px; + text-align: center; + padding: 0 8px; + cursor: default; + border: 1px solid transparent; + border-radius: 2px 2px 0 0; + -webkit-transition: all 0.218s; +} + +.vertical .tabContainer > * { + border-radius: 2px 0 0 2px; +} + +.tabContainer > :hover { + color: #555; +} + +.tabContainer > .selected { + color: #202020; + border: 1px solid #ccc; +} \ No newline at end of file diff --git a/src/g-selection.html b/src/g-selection.html index b11e72ce..534d9b93 100644 --- a/src/g-selection.html +++ b/src/g-selection.html @@ -8,15 +8,11 @@ + diff --git a/src/g-togglebutton.html b/src/g-togglebutton.html index 88c22312..30b5ef0a 100644 --- a/src/g-togglebutton.html +++ b/src/g-togglebutton.html @@ -5,7 +5,7 @@ * license that can be found in the LICENSE file. */ --> - + + + + + + + + + + + +
+ + +
+ + + + + + + + diff --git a/test/togglebutton.js b/test/togglebutton.js new file mode 100644 index 00000000..ad5d0b4b --- /dev/null +++ b/test/togglebutton.js @@ -0,0 +1,40 @@ +/* + * Copyright 2012 The Toolkitchen Authors. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +suite('g-togglebutton', function() { + var togglebutton; + + setup(function() { + togglebutton = document.createElement('g-togglebutton'); + work.appendChild(togglebutton); + }); + + teardown(function() { + work.textContent = ''; + }); + + test('initial value', function() { + expect(togglebutton.value).to.not.be.ok(); + }); + + test('toggle', function() { + var t = ShadowDOM.localQuery(togglebutton.shadow, '.toggle'); + togglebutton.toggle(); + expect(t.classList.contains('on')).to.be(true); + togglebutton.toggle(); + expect(t.classList.contains('on')).to.be(false); + }); + + suite('attributes', function() { + test('value', function() { + var t = ShadowDOM.localQuery(togglebutton.shadow, '.toggle'); + togglebutton.value = true; + expect(t.classList.contains('on')).to.be(true); + togglebutton.value = false; + expect(t.classList.contains('on')).to.be(false); + }); + }); +}); diff --git a/third_party/expect.js b/third_party/expect.js new file mode 160000 index 00000000..9aa632fb --- /dev/null +++ b/third_party/expect.js @@ -0,0 +1 @@ +Subproject commit 9aa632fb2f16784fbfe050eef08d60596e649229 diff --git a/third_party/mocha b/third_party/mocha new file mode 160000 index 00000000..39e2890f --- /dev/null +++ b/third_party/mocha @@ -0,0 +1 @@ +Subproject commit 39e2890f884597c14b4d4ac4da5dc17284b3feca diff --git a/workbench/ratings.html b/workbench/ratings.html index c48b4b84..3701949c 100644 --- a/workbench/ratings.html +++ b/workbench/ratings.html @@ -6,7 +6,7 @@ license that can be found in the LICENSE file. - Icon + Ratings diff --git a/workbench/tabs.html b/workbench/tabs.html new file mode 100644 index 00000000..c82cab21 --- /dev/null +++ b/workbench/tabs.html @@ -0,0 +1,23 @@ + + + + Tabs + + + + + + One + Two + Three + Four + +

+ + One + Two + Three + Four + + +