From 6d0d6f05ffb2602a39d32aa3f72121cc3746148e Mon Sep 17 00:00:00 2001 From: Asaf Shakarzy Date: Sat, 20 Dec 2014 22:18:40 +0200 Subject: [PATCH] Initial Commit of the component code as an ember addon. --- .bowerrc | 4 + .editorconfig | 33 +++ .ember-cli | 9 + .gitignore | 17 ++ .jshintrc | 32 +++ .travis.yml | 20 ++ Brocfile.js | 33 +++ LICENSE.md | 201 ++++++++++++++++++ README.md | 31 +++ addon/.gitkeep | 0 addon/accordion-item.js | 134 ++++++++++++ addon/accordion.js | 58 +++++ app/.gitkeep | 0 app/components/em-accordion-item.js | 2 + app/components/em-accordion.js | 2 + app/initializers/idx-accordion-config.js | 34 +++ .../components/em-accordion-item.hbs | 16 ++ bower.json | 22 ++ config/environment.js | 5 + index.js | 6 + package.json | 48 +++++ testem.json | 11 + tests/.jshintrc | 74 +++++++ tests/dummy/app/app.js | 16 ++ tests/dummy/app/components/.gitkeep | 0 tests/dummy/app/controllers/.gitkeep | 0 tests/dummy/app/controllers/c1.js | 5 + tests/dummy/app/controllers/c2.js | 5 + tests/dummy/app/controllers/query-params.js | 6 + tests/dummy/app/controllers/sidebar.js | 11 + tests/dummy/app/helpers/.gitkeep | 0 tests/dummy/app/index.html | 25 +++ tests/dummy/app/initializers/highlight.js | 18 ++ tests/dummy/app/models/.gitkeep | 0 tests/dummy/app/router.js | 15 ++ tests/dummy/app/routes/.gitkeep | 0 tests/dummy/app/styles/app.css | 121 +++++++++++ tests/dummy/app/templates/application.hbs | 11 + tests/dummy/app/templates/c1.hbs | 1 + tests/dummy/app/templates/c2.hbs | 1 + tests/dummy/app/templates/components/.gitkeep | 0 .../app/templates/controller_per_item.hbs | 44 ++++ tests/dummy/app/templates/gettingstarted.hbs | 19 ++ tests/dummy/app/templates/navbar.hbs | 45 ++++ tests/dummy/app/templates/query_params.hbs | 37 ++++ tests/dummy/app/templates/sidebar.hbs | 12 ++ tests/dummy/app/templates/simple.hbs | 43 ++++ tests/dummy/app/views/.gitkeep | 0 tests/dummy/config/environment.js | 47 ++++ tests/dummy/public/.gitkeep | 0 tests/dummy/public/crossdomain.xml | 15 ++ tests/dummy/public/robots.txt | 2 + tests/helpers/resolver.js | 11 + tests/helpers/start-app.js | 19 ++ tests/index.html | 49 +++++ tests/test-helper.js | 12 ++ tests/unit/.gitkeep | 0 vendor/.gitkeep | 0 58 files changed, 1382 insertions(+) create mode 100644 .bowerrc create mode 100644 .editorconfig create mode 100644 .ember-cli create mode 100644 .gitignore create mode 100644 .jshintrc create mode 100644 .travis.yml create mode 100644 Brocfile.js create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 addon/.gitkeep create mode 100644 addon/accordion-item.js create mode 100644 addon/accordion.js create mode 100644 app/.gitkeep create mode 100644 app/components/em-accordion-item.js create mode 100644 app/components/em-accordion.js create mode 100644 app/initializers/idx-accordion-config.js create mode 100644 app/templates/components/em-accordion-item.hbs create mode 100644 bower.json create mode 100644 config/environment.js create mode 100644 index.js create mode 100644 package.json create mode 100644 testem.json create mode 100644 tests/.jshintrc create mode 100644 tests/dummy/app/app.js create mode 100644 tests/dummy/app/components/.gitkeep create mode 100644 tests/dummy/app/controllers/.gitkeep create mode 100644 tests/dummy/app/controllers/c1.js create mode 100644 tests/dummy/app/controllers/c2.js create mode 100644 tests/dummy/app/controllers/query-params.js create mode 100644 tests/dummy/app/controllers/sidebar.js create mode 100644 tests/dummy/app/helpers/.gitkeep create mode 100644 tests/dummy/app/index.html create mode 100644 tests/dummy/app/initializers/highlight.js create mode 100644 tests/dummy/app/models/.gitkeep create mode 100644 tests/dummy/app/router.js create mode 100644 tests/dummy/app/routes/.gitkeep create mode 100644 tests/dummy/app/styles/app.css create mode 100644 tests/dummy/app/templates/application.hbs create mode 100644 tests/dummy/app/templates/c1.hbs create mode 100644 tests/dummy/app/templates/c2.hbs create mode 100644 tests/dummy/app/templates/components/.gitkeep create mode 100644 tests/dummy/app/templates/controller_per_item.hbs create mode 100644 tests/dummy/app/templates/gettingstarted.hbs create mode 100644 tests/dummy/app/templates/navbar.hbs create mode 100644 tests/dummy/app/templates/query_params.hbs create mode 100644 tests/dummy/app/templates/sidebar.hbs create mode 100644 tests/dummy/app/templates/simple.hbs create mode 100644 tests/dummy/app/views/.gitkeep create mode 100644 tests/dummy/config/environment.js create mode 100644 tests/dummy/public/.gitkeep create mode 100644 tests/dummy/public/crossdomain.xml create mode 100644 tests/dummy/public/robots.txt create mode 100644 tests/helpers/resolver.js create mode 100644 tests/helpers/start-app.js create mode 100644 tests/index.html create mode 100644 tests/test-helper.js create mode 100644 tests/unit/.gitkeep create mode 100644 vendor/.gitkeep diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..959e169 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,4 @@ +{ + "directory": "bower_components", + "analytics": false +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d5dea4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,33 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.hbs] +indent_style = space +indent_size = 2 + +[*.css] +indent_style = space +indent_size = 2 + +[*.html] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.ember-cli b/.ember-cli new file mode 100644 index 0000000..ee64cfe --- /dev/null +++ b/.ember-cli @@ -0,0 +1,9 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": false +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86fceae --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp + +# dependencies +/node_modules +/bower_components + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..08096ef --- /dev/null +++ b/.jshintrc @@ -0,0 +1,32 @@ +{ + "predef": [ + "document", + "window", + "-Promise" + ], + "browser": true, + "boss": true, + "curly": true, + "debug": false, + "devel": true, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true, + "unused": true +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cf23938 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +--- +language: node_js + +sudo: false + +cache: + directories: + - node_modules + +before_install: + - "npm config set spin false" + - "npm install -g npm@^2" + +install: + - npm install -g bower + - npm install + - bower install + +script: + - npm test diff --git a/Brocfile.js b/Brocfile.js new file mode 100644 index 0000000..a0c97ed --- /dev/null +++ b/Brocfile.js @@ -0,0 +1,33 @@ +/* jshint node: true */ +/* global require, module */ + +var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); +var mergeTrees = require('broccoli-merge-trees'); +var pickFiles = require('broccoli-static-compiler'); + +var app = new EmberAddon(); + +// Use `app.import` to add additional libraries to the generated +// output files. +// +// If you need to use different assets in different +// environments, specify an object as the first parameter. That +// object's keys should be the environment name and the values +// should be the asset to use in that environment. +// +// If the library that you are including contains AMD or ES6 +// modules that you would like to import into your application +// please specify an object with the list of modules as keys +// along with the exports of each module as its value. +app.import('bower_components/bootstrap/dist/css/bootstrap.css'); +app.import('bower_components/fontawesome/css/font-awesome.min.css'); +app.import('bower_components/highlightjs/highlight.pack.js'); +app.import('bower_components/highlightjs/styles/tomorrow.css'); + +var extraAssets = pickFiles('bower_components/fontawesome', { + srcDir: '/', + files: ['**/*.woff', '**/*.eot', '**/*.svg', '**/*.ttf'], + destDir: '/' +}); + +module.exports = mergeTrees([app.toTree(), extraAssets]) \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..6df5a22 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Indexia Technologies, ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f132c48 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Ember-idx-accordion + +ember-idx-accordion is a multi panels defined with 1 single planel selected at a time rendered as an accordion. + +## Installation & Tutorial + +### With Ember-CLI: + +npm install --save-dev ember-idx-accordion + +Please visit the documentation for installation & usage documentations: http://indexiatech.github.io/ember-idx-accordion + +## Plugin Development + +* `git clone` this repository +* `npm install` +* `bower install` + +## Running + +* `ember server` +* Visit your app at http://localhost:4200. + +## Running Tests + +* `ember test` +* `ember test --server` + +## Building + +* `ember build` \ No newline at end of file diff --git a/addon/.gitkeep b/addon/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/addon/accordion-item.js b/addon/accordion-item.js new file mode 100644 index 0000000..5602f0f --- /dev/null +++ b/addon/accordion-item.js @@ -0,0 +1,134 @@ +//(c) 2014 Indexia, Inc. +import Em from 'ember'; +import WithConfigMixin from 'ember-idx-utils/mixin/with-config'; +import StyleBindingsMixin from 'ember-idx-utils/mixin/style-bindings'; +var computed = Em.computed; + +/** + * AccordionItem component + * + * @class AccordionItem + */ +export default Em.Component.extend(WithConfigMixin, { + classNameBindings: ['styleClasses', 'selectedClass'], + accordion: computed.alias('parentView'), + content: Em.computed.alias('accordion.content'), + + /** + * Bind the specified attributes to the DOM element + * + * @property attributeBindings + * @type Array + */ + attributeBindings: ['active'], + selectedClass: (function() { + var _ref; + if (this.get('selected')) { + return (_ref = this.get('config.accordion.itemSelectedClasses')) != null ? _ref.join(" ") : void 0; + } else { + return null; + } + }).property('selected'), + styleClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.itemClasses')) != null ? _ref.join(" ") : void 0; + }).property(), + panelHeaderClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.panelHeaderClasses')) != null ? _ref.join(" ") : void 0; + }).property(), + panelTitleClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.panelTitleClasses')) != null ? _ref.join(" ") : void 0; + }).property(), + panelTogglerClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.panelTogglerClasses')) != null ? _ref.join(" ") : void 0; + }).property(), + panelBodyContainerClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.panelBodyContainerClasses')) != null ? _ref.join(" ") : void 0; + }).property(), + panelBodyClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.panelBodyClasses')) != null ? _ref.join(" ") : void 0; + }).property(), + index: (function() { + return this.get('accordion.items').indexOf(this); + }).property('accordion.items.@each'), + register: (function() { + return this.get('accordion').addItem(this); + }).on('init'), + unregister: (function() { + return this.get('accordion').removeItem(this); + }).on('willDestroyElement'), + + /** + * true if this item is currently selected. + * + * @property selected + * @type Boolean + */ + selected: (function() { + return this.get('accordion.selected') === this; + }).property('accordion.selected'), + active: (function() { + if (this.get('selected')) { + return "true"; + } else { + return null; + } + }).property('selected'), + + /** + * Select this item. + * + * Bound to `click` event. + * + * @method select + */ + select: (function() { + return this.get('accordion').select(this); + }).on('click'), + + /** + * Select this item if it matches the {{#crossLink "Accordiong/select:method"}}selected-idx{{/crossLink}} property set by the Accordion component. + * + * @method selectByAccordionParam + * @private + */ + selectByParam: (function() { + var idx; + if ((this.get('accordion.selected') != null) === this) { + return; + } + idx = parseInt(this.get('accordion.selected-idx', 10)); + if (idx === this.get('index')) { + return this.select(); + } + }).observes('accordion.selected-idx').on('didInsertElement'), + + /** + * Listen to `active` property changes and show / hide the item's content according to its state + * + * We use observes instead of properties as we need to invoke a method instead of calculating classes only + * so in the future we can support a transition animation. + */ + activeDidChange: (function() { + if (this.get('active')) { + return this.show(); + } else { + return this.hide(); + } + }).observes('active'), + hide: function() { + var $accordionBody; + $accordionBody = this.$('.panel-collapse'); + return $accordionBody.removeClass('in'); + }, + show: function() { + var $accordionBody; + $accordionBody = this.$('.panel-collapse'); + return $accordionBody.addClass('in'); + } +}); diff --git a/addon/accordion.js b/addon/accordion.js new file mode 100644 index 0000000..6114a2d --- /dev/null +++ b/addon/accordion.js @@ -0,0 +1,58 @@ +//(c) 2014 Indexia, Inc. +import Em from 'ember'; +import WithConfigMixin from 'ember-idx-utils/mixin/with-config'; +import StyleBindingsMixin from 'ember-idx-utils/mixin/style-bindings'; + +/** + * Accordion component + * + * @class Accordion + */ +export default Em.Component.extend(WithConfigMixin, { + classNameBindings: ['styleClasses'], + styleClasses: (function() { + var _ref; + return (_ref = this.get('config.accordion.classes')) != null ? _ref.join(" ") : void 0; + }).property(), + 'selected-idx': 0, + + /** + * A list of {{#crossLink "AccordionItem"}}accordion-item{{/crossLink}} instances. + */ + items: void 0, + selected: void 0, + initItems: (function() { + return this.set('items', Em.ArrayProxy.create({ + content: [] + })); + }).on('init'), + + /** + * Add the given `AccordionItem` instance. + */ + addItem: function(item) { + return this.get('items').addObject(item); + }, + + /** + * Remove the given `AccordionItem` instance. + */ + removeItem: function(item) { + return this.get('items').removeObject(item); + }, + + /** + * Select the given item. + * + * @method select + * @param {Object} an item instance to select. + */ + select: function(item) { + if (!item) { + return; + } + Em.debug("Selecting item: " + (item.get('index'))); + this.set('selected', item); + return this.set('selected-idx', item.get('index')); + } +}); \ No newline at end of file diff --git a/app/.gitkeep b/app/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/components/em-accordion-item.js b/app/components/em-accordion-item.js new file mode 100644 index 0000000..c731d9a --- /dev/null +++ b/app/components/em-accordion-item.js @@ -0,0 +1,2 @@ +import AccordionItemComponent from 'ember-idx-accordion/accordion-item'; +export default AccordionItemComponent; \ No newline at end of file diff --git a/app/components/em-accordion.js b/app/components/em-accordion.js new file mode 100644 index 0000000..0daa100 --- /dev/null +++ b/app/components/em-accordion.js @@ -0,0 +1,2 @@ +import AccordionComponent from 'ember-idx-accordion/accordion'; +export default AccordionComponent; \ No newline at end of file diff --git a/app/initializers/idx-accordion-config.js b/app/initializers/idx-accordion-config.js new file mode 100644 index 0000000..1b080fc --- /dev/null +++ b/app/initializers/idx-accordion-config.js @@ -0,0 +1,34 @@ +import Em from 'ember'; +import Config from 'ember-idx-utils/config' + +export default { + name: 'ember-idx-tabs', + initialize: function() { + if (!Em.Config) { + Em.Config = Config = Config.create() + } + + var defaultConfig = Config.getConfig('default'); + if (!defaultConfig) { + Config.addConfig('default'); + defaultConfig = Config.getConfig('default'); + } + + //Bootstrap + var bsConfig = Config.getConfig('bs'); + if (!bsConfig) { + Config.addConfig('bs'); + bsConfig = Config.getConfig('bs'); + } + bsConfig['accordion'] = { + classes: ['panel-group'], + itemClasses: ['panel', 'panel-default'], + itemSelectedClasses: ['active'], + panelHeaderClasses: ['panel-heading'], + panelTitleClasses: ['panel-title'], + panelTogglerClasses: ['accordion-toggle'], + panelBodyContainerClasses: ['panel-collapse','collapse'], + panelBodyClasses: ['panel-body'] + } + } +}; \ No newline at end of file diff --git a/app/templates/components/em-accordion-item.hbs b/app/templates/components/em-accordion-item.hbs new file mode 100644 index 0000000..176f744 --- /dev/null +++ b/app/templates/components/em-accordion-item.hbs @@ -0,0 +1,16 @@ + + + + + + +
+

+ + {{view.title}} + +

+
+
+
{{yield}}
+
\ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..cdb5001 --- /dev/null +++ b/bower.json @@ -0,0 +1,22 @@ +{ + "name": "ember-idx-accordion", + "dependencies": { + "handlebars": "~1.3.0", + "jquery": "^1.11.1", + "ember": "1.8.1", + "ember-data": "1.0.0-beta.12", + "ember-resolver": "~0.1.10", + "loader.js": "stefanpenner/loader.js#1.0.1", + "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3", + "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4", + "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2", + "ember-qunit": "0.1.8", + "ember-qunit-notifications": "0.0.4", + "qunit": "~1.15.0" + }, + "devDependencies": { + "bootstrap": "~3.3.1", + "highlightjs": "~8.4.0", + "fontawesome": "~4.2.0" + } +} diff --git a/config/environment.js b/config/environment.js new file mode 100644 index 0000000..0dfaed4 --- /dev/null +++ b/config/environment.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function(/* environment, appConfig */) { + return { }; +}; diff --git a/index.js b/index.js new file mode 100644 index 0000000..c6c93bc --- /dev/null +++ b/index.js @@ -0,0 +1,6 @@ +/* jshint node: true */ +'use strict'; + +module.exports = { + name: 'ember-idx-accordion' +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..abe9b9d --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "ember-idx-accordion", + "version": "0.1.0", + "directories": { + "doc": "doc", + "test": "tests" + }, + "scripts": { + "start": "ember server", + "build": "ember build", + "test": "ember test" + }, + "repository": "https://github.com/indexiatech/ember-idx-accordion", + "engines": { + "node": ">= 0.10.0" + }, + "license": "ASF2", + "devDependencies": { + "broccoli-asset-rev": "^1.0.0", + "broccoli-ember-hbs-template-compiler": "^1.6.1", + "broccoli-merge-trees": "^0.2.1", + "broccoli-static-compiler": "^0.2.1", + "ember-cli": "0.1.4", + "ember-cli-content-security-policy": "0.3.0", + "ember-cli-dependency-checker": "0.0.6", + "ember-cli-esnext": "0.1.1", + "ember-cli-ic-ajax": "0.1.1", + "ember-cli-inject-live-reload": "^1.3.0", + "ember-cli-qunit": "0.1.2", + "ember-data": "1.0.0-beta.12", + "ember-export-application-global": "^1.0.0", + "express": "^4.8.5", + "glob": "^4.0.5" + }, + "description": "Ambitious Accordion Component for Ember.js", + "authors": [ + "Indexia Technologies, ltd." + ], + "keywords": [ + "ember-addon" + ], + "ember-addon": { + "configPath": "tests/dummy/config" + }, + "dependencies": { + "ember-idx-utils": "^0.2.1" + } +} diff --git a/testem.json b/testem.json new file mode 100644 index 0000000..eff93f9 --- /dev/null +++ b/testem.json @@ -0,0 +1,11 @@ +{ + "framework": "qunit", + "test_page": "tests/index.html", + "launch_in_ci": [ + "PhantomJS" + ], + "launch_in_dev": [ + "PhantomJS", + "Chrome" + ] +} diff --git a/tests/.jshintrc b/tests/.jshintrc new file mode 100644 index 0000000..6ebf71a --- /dev/null +++ b/tests/.jshintrc @@ -0,0 +1,74 @@ +{ + "predef": [ + "document", + "window", + "location", + "setTimeout", + "$", + "-Promise", + "QUnit", + "define", + "console", + "equal", + "notEqual", + "notStrictEqual", + "test", + "asyncTest", + "testBoth", + "testWithDefault", + "raises", + "throws", + "deepEqual", + "start", + "stop", + "ok", + "strictEqual", + "module", + "moduleFor", + "moduleForComponent", + "moduleForModel", + "process", + "expect", + "visit", + "exists", + "fillIn", + "click", + "keyEvent", + "triggerEvent", + "find", + "findWithAssert", + "wait", + "DS", + "isolatedContainer", + "startApp", + "andThen", + "currentURL", + "currentPath", + "currentRouteName" + ], + "node": false, + "browser": false, + "boss": true, + "curly": false, + "debug": false, + "devel": false, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true +} diff --git a/tests/dummy/app/app.js b/tests/dummy/app/app.js new file mode 100644 index 0000000..757df38 --- /dev/null +++ b/tests/dummy/app/app.js @@ -0,0 +1,16 @@ +import Ember from 'ember'; +import Resolver from 'ember/resolver'; +import loadInitializers from 'ember/load-initializers'; +import config from './config/environment'; + +Ember.MODEL_FACTORY_INJECTIONS = true; + +var App = Ember.Application.extend({ + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix, + Resolver: Resolver +}); + +loadInitializers(App, config.modulePrefix); + +export default App; diff --git a/tests/dummy/app/components/.gitkeep b/tests/dummy/app/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/app/controllers/.gitkeep b/tests/dummy/app/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/app/controllers/c1.js b/tests/dummy/app/controllers/c1.js new file mode 100644 index 0000000..20009fc --- /dev/null +++ b/tests/dummy/app/controllers/c1.js @@ -0,0 +1,5 @@ +import Em from 'ember'; + +export default Em.Controller.extend({ + label: 'Hello from C1 Controller.' +}); \ No newline at end of file diff --git a/tests/dummy/app/controllers/c2.js b/tests/dummy/app/controllers/c2.js new file mode 100644 index 0000000..85419d2 --- /dev/null +++ b/tests/dummy/app/controllers/c2.js @@ -0,0 +1,5 @@ +import Em from 'ember'; + +export default Em.Controller.extend({ + label: 'Hello from C2 Controller.' +}); \ No newline at end of file diff --git a/tests/dummy/app/controllers/query-params.js b/tests/dummy/app/controllers/query-params.js new file mode 100644 index 0000000..fc8f54c --- /dev/null +++ b/tests/dummy/app/controllers/query-params.js @@ -0,0 +1,6 @@ +import Em from "ember"; + +export default Em.ObjectController.extend({ + queryParams: ['item_idx'], + item_idx: 0 +}); \ No newline at end of file diff --git a/tests/dummy/app/controllers/sidebar.js b/tests/dummy/app/controllers/sidebar.js new file mode 100644 index 0000000..24d8f70 --- /dev/null +++ b/tests/dummy/app/controllers/sidebar.js @@ -0,0 +1,11 @@ +import Em from 'ember'; + +export default Em.ArrayController.extend({ + needs: ['application'], + model: [ + {route: 'gettingstarted', text: 'Getting Started'}, + {route: 'simple', text: 'Simple'}, + {route: 'query_params', text: 'Query Params'}, + {route: 'controller_per_item', text: 'Controller Per Item'} + ] +}); \ No newline at end of file diff --git a/tests/dummy/app/helpers/.gitkeep b/tests/dummy/app/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/app/index.html b/tests/dummy/app/index.html new file mode 100644 index 0000000..1c49d36 --- /dev/null +++ b/tests/dummy/app/index.html @@ -0,0 +1,25 @@ + + + + + + Dummy + + + + {{content-for 'head'}} + + + + + {{content-for 'head-footer'}} + + + {{content-for 'body'}} + + + + + {{content-for 'body-footer'}} + + diff --git a/tests/dummy/app/initializers/highlight.js b/tests/dummy/app/initializers/highlight.js new file mode 100644 index 0000000..f7eee71 --- /dev/null +++ b/tests/dummy/app/initializers/highlight.js @@ -0,0 +1,18 @@ +import Em from 'ember'; +/*global hljs*/ + +export default { + name: 'hightlightjs', + initialize: function() { + return Em.Route.reopen({ + renderTemplate: function() { + this._super(); + return Em.run.next(this, function() { + return $('pre code').each(function(i, e) { + return hljs.highlightBlock(e); + }); + }); + } + }); + } +}; \ No newline at end of file diff --git a/tests/dummy/app/models/.gitkeep b/tests/dummy/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/app/router.js b/tests/dummy/app/router.js new file mode 100644 index 0000000..c988448 --- /dev/null +++ b/tests/dummy/app/router.js @@ -0,0 +1,15 @@ +import Ember from 'ember'; +import config from './config/environment'; + +var Router = Ember.Router.extend({ + location: config.locationType +}); + +Router.map(function() { + this.route( 'gettingstarted' ); + this.route( 'simple' ); + this.route( 'query_params' ); + this.route( 'controller_per_item' ); +}); + +export default Router; diff --git a/tests/dummy/app/routes/.gitkeep b/tests/dummy/app/routes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/app/styles/app.css b/tests/dummy/app/styles/app.css new file mode 100644 index 0000000..e06ffa1 --- /dev/null +++ b/tests/dummy/app/styles/app.css @@ -0,0 +1,121 @@ +.navbar-brand { + background: url("./img/ember_logo.png") left center no-repeat; + background-size: 50px; + padding-left: 100px; + margin-left: 0 !important; +} + +@media screen and (max-width: 750px) { + .sidebar { + position: static; + margin-top: 65px; + width: 100%; + } +} + +@media screen and (max-width: 970px) { + #socials { + display: none; + } +} + +@media screen and (min-width: 750px) { + .sidebar { + position: fixed; + top: 65px; + width: 170px; + } + + .page { + top: 65px; + } + +} + +@media screen and (min-width: 970px) { + .sidebar { + width: 220px; + } +} + +.sidebar > .nav > li > a { + padding: 5px 15px 5px 5px; + font-size: 1.2em; +} + +.sidebar > .nav > li > .nav > li > a { + padding: 5px 15px 5px 15px; + font-size: .9em; +} + +.sidebar li.active > a { + color: #2a6496; + font-weight: bold; +} + +@media screen and (min-width: 750px) { + .sidebar > .nav > li > .nav { + height: 0; + max-height: 0; + overflow: hidden; + opacity: 0; + -webkit-transition: max-height 0.5s ease-in, opacity 0.3s ease-out; + } + + .sidebar > .nav > li.active > .nav { + display: block; + height: auto; + max-height: 400px; + opacity: 1; + } +} + +@media screen and (max-width: 750px) { + .sidebar > .nav > li > .nav { + display: none; + } +} + + +/* overwrite ugly google-prettify style */ +pre.prettyprint { + padding: 10px !important; + border: 1px solid #cccccc !important; +} + +.line-example { + min-height: 75px; +} + + +.jsbin { + margin: 5px; +} + + +/* + * Social buttons + * + * Twitter and GitHub social action buttons (for homepage and footer). + */ + +.socials { + margin-top: 10px; + text-align: center; +} +.bs-social-buttons { + display: inline-block; + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.bs-social-buttons li { + display: inline-block; + line-height: 1; + padding: 5px 8px; +} +/* Style the GitHub buttons via CSS instead of inline attributes */ +.github-btn { + border: 0; + overflow: hidden; +} diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs new file mode 100644 index 0000000..2658b46 --- /dev/null +++ b/tests/dummy/app/templates/application.hbs @@ -0,0 +1,11 @@ +{{render 'navbar'}} +
+
+
+ {{render "sidebar"}} +
+
+ {{outlet}} +
+
+
\ No newline at end of file diff --git a/tests/dummy/app/templates/c1.hbs b/tests/dummy/app/templates/c1.hbs new file mode 100644 index 0000000..d9a3701 --- /dev/null +++ b/tests/dummy/app/templates/c1.hbs @@ -0,0 +1 @@ +{{controller.label}} \ No newline at end of file diff --git a/tests/dummy/app/templates/c2.hbs b/tests/dummy/app/templates/c2.hbs new file mode 100644 index 0000000..d9a3701 --- /dev/null +++ b/tests/dummy/app/templates/c2.hbs @@ -0,0 +1 @@ +{{controller.label}} \ No newline at end of file diff --git a/tests/dummy/app/templates/components/.gitkeep b/tests/dummy/app/templates/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/app/templates/controller_per_item.hbs b/tests/dummy/app/templates/controller_per_item.hbs new file mode 100644 index 0000000..f157b0a --- /dev/null +++ b/tests/dummy/app/templates/controller_per_item.hbs @@ -0,0 +1,44 @@ +

Controller per Accordion Item

+ +If your _accordion items_ are more advanced and contains large template & logic you can have a separated +template / controller pair per _accordion item_ by using the \{{render}} handlebars helper. +

+

Please check Ember \{{render}} doc for more info.

+ +

Demo

+ +{{#em-accordion configName='bs' selected-idx=1}} + {{#em-accordion-item title="Panel 1"}} + {{render 'c1'}} + {{/em-accordion-item}} + {{#em-accordion-item title="Panel 2"}} + {{render 'c2'}} + {{/em-accordion-item}} +{{/em-accordion}} + + +

Markup

+ +
+

+        \{{#em-accordion configName='bs' selected-idx=1}}
+            \{{#em-accordion-item title="Panel 1"}}
+                \{{render 'c1'}}
+            \{{/em-accordion-item}}
+            \{{#em-accordion-item title="Panel 2"}}
+                \{{render 'c2'}}
+            \{{/em-accordion-item}}
+        \{{/em-accordion}}
+    
+ +

+    //c1 controller
+    export default Em.Controller.extend({
+        label: 'Hello from C1 Controller.'
+    })
+    //c2 controller
+    export default Em.Controller.extend({
+        label: 'Hello from C2 Controller.'
+    })
+    
+
\ No newline at end of file diff --git a/tests/dummy/app/templates/gettingstarted.hbs b/tests/dummy/app/templates/gettingstarted.hbs new file mode 100644 index 0000000..11fc789 --- /dev/null +++ b/tests/dummy/app/templates/gettingstarted.hbs @@ -0,0 +1,19 @@ +

Getting Started

+ +

+ Ember-Idx-Accordion is a multi panels defined with 1 single planel selected at a time rendered as an accordion. +

+ +

+ Ember-Idx-Accordion is an Ember CLI module and can be simply installed by: +

+ +

+

    +
  1. +
    npm install --save-dev ember-idx-accordion
    +
  2. +
+

+ +

Want to see some code? check out the {{#link-to 'simple'}}Simple{{/link-to}} page

\ No newline at end of file diff --git a/tests/dummy/app/templates/navbar.hbs b/tests/dummy/app/templates/navbar.hbs new file mode 100644 index 0000000..d69d10a --- /dev/null +++ b/tests/dummy/app/templates/navbar.hbs @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/tests/dummy/app/templates/query_params.hbs b/tests/dummy/app/templates/query_params.hbs new file mode 100644 index 0000000..05411cf --- /dev/null +++ b/tests/dummy/app/templates/query_params.hbs @@ -0,0 +1,37 @@ +

Accordiong with Query Params

+ +It is possible to bound the current selected accordion item to a controller parameter (usually a query param) +by bindingthe selected-idx property on the \{{em-accordion}} tag. + +

Demo

+ +{{#em-accordion configName='bs' selected-idx=item_idx}} + {{#em-accordion-item title="Panel 1"}} + Content of panel #1 + {{/em-accordion-item}} + {{#em-accordion-item title="Panel 2"}} + Content of panel #2 + {{/em-accordion-item}} + {{#em-accordion-item title="Panel 3"}} + Content of panel #3 + {{/em-accordion-item}} +{{/em-accordion}} + + +

Markup

+ +
+

+        \{{#em-accordion configName='bs' selected-idx=item_idx}}
+            \{{#em-accordion-item title="Panel 1"}}
+                Content of panel #1
+            \{{/em-accordion-item}}
+            \{{#em-accordion-item title="Panel 2"}}
+                Content of panel #2
+            \{{/em-accordion-item}}
+            \{{#em-accordion-item title="Panel 3"}}
+                Content of panel #3
+            \{{/em-accordion-item}}
+        \{{/em-accordion}}
+    
+
\ No newline at end of file diff --git a/tests/dummy/app/templates/sidebar.hbs b/tests/dummy/app/templates/sidebar.hbs new file mode 100644 index 0000000..d9da47d --- /dev/null +++ b/tests/dummy/app/templates/sidebar.hbs @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/tests/dummy/app/templates/simple.hbs b/tests/dummy/app/templates/simple.hbs new file mode 100644 index 0000000..aeb4d9c --- /dev/null +++ b/tests/dummy/app/templates/simple.hbs @@ -0,0 +1,43 @@ +

Simple Accordion

+ +

+The simplest form of the accordion component is simply laying down accordion items statically where each item has a title and a block of content. +

+ +

+Note: Currently the configuration allows only the bs config name, so bootstrap CSS is required, +it is possible to customize the configuration, for more information, take a look at idx-accordion-config.js file. +

+ +

Demo

+ +{{#em-accordion configName='bs' selected-idx=1}} + {{#em-accordion-item title="Panel 1"}} + Content of panel #1 + {{/em-accordion-item}} + {{#em-accordion-item title="Panel 2"}} + Content of panel #2 + {{/em-accordion-item}} + {{#em-accordion-item title="Panel 3"}} + Content of panel #3 + {{/em-accordion-item}} +{{/em-accordion}} + + +

Markup

+ +
+

+        \{{#em-accordion configName='bs' selected-idx=1}}
+            \{{#em-accordion-item title="Panel 1"}}
+                Content of panel #1
+            \{{/em-accordion-item}}
+            \{{#em-accordion-item title="Panel 2"}}
+                Content of panel #2
+            \{{/em-accordion-item}}
+            \{{#em-accordion-item title="Panel 3"}}
+                Content of panel #3
+            \{{/em-accordion-item}}
+        \{{/em-accordion}}
+    
+
\ No newline at end of file diff --git a/tests/dummy/app/views/.gitkeep b/tests/dummy/app/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js new file mode 100644 index 0000000..35bbb43 --- /dev/null +++ b/tests/dummy/config/environment.js @@ -0,0 +1,47 @@ +/* jshint node: true */ + +module.exports = function(environment) { + var ENV = { + modulePrefix: 'dummy', + environment: environment, + baseURL: '/ember-idx-accordion', + locationType: 'hash', + EmberENV: { + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. 'with-controller': true + } + }, + + APP: { + // Here you can pass flags/options to your application instance + // when it is created + } + }; + + if (environment === 'development') { + // ENV.APP.LOG_RESOLVER = true; + ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_TRANSITIONS = true; + // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; + ENV.APP.LOG_VIEW_LOOKUPS = true; + } + + if (environment === 'test') { + // Testem prefers this... + ENV.baseURL = '/'; + ENV.locationType = 'none'; + + // keep test console output quieter + ENV.APP.LOG_ACTIVE_GENERATION = false; + ENV.APP.LOG_VIEW_LOOKUPS = false; + + ENV.APP.rootElement = '#ember-testing'; + } + + if (environment === 'production') { + + } + + return ENV; +}; diff --git a/tests/dummy/public/.gitkeep b/tests/dummy/public/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/dummy/public/crossdomain.xml b/tests/dummy/public/crossdomain.xml new file mode 100644 index 0000000..29a035d --- /dev/null +++ b/tests/dummy/public/crossdomain.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/tests/dummy/public/robots.txt b/tests/dummy/public/robots.txt new file mode 100644 index 0000000..5debfa4 --- /dev/null +++ b/tests/dummy/public/robots.txt @@ -0,0 +1,2 @@ +# http://www.robotstxt.org +User-agent: * diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js new file mode 100644 index 0000000..28f4ece --- /dev/null +++ b/tests/helpers/resolver.js @@ -0,0 +1,11 @@ +import Resolver from 'ember/resolver'; +import config from '../../config/environment'; + +var resolver = Resolver.create(); + +resolver.namespace = { + modulePrefix: config.modulePrefix, + podModulePrefix: config.podModulePrefix +}; + +export default resolver; diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js new file mode 100644 index 0000000..e087e48 --- /dev/null +++ b/tests/helpers/start-app.js @@ -0,0 +1,19 @@ +import Ember from 'ember'; +import Application from '../../app'; +import Router from '../../router'; +import config from '../../config/environment'; + +export default function startApp(attrs) { + var App; + + var attributes = Ember.merge({}, config.APP); + attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; + + Ember.run(function() { + App = Application.create(attributes); + App.setupForTesting(); + App.injectTestHelpers(); + }); + + return App; +} diff --git a/tests/index.html b/tests/index.html new file mode 100644 index 0000000..4112b61 --- /dev/null +++ b/tests/index.html @@ -0,0 +1,49 @@ + + + + + + Dummy Tests + + + + {{content-for 'head'}} + {{content-for 'test-head'}} + + + + + + + {{content-for 'head-footer'}} + {{content-for 'test-head-footer'}} + + + + {{content-for 'body'}} + {{content-for 'test-body'}} + + + + + + + {{content-for 'body-footer'}} + {{content-for 'test-body-footer'}} + + diff --git a/tests/test-helper.js b/tests/test-helper.js new file mode 100644 index 0000000..b5f6449 --- /dev/null +++ b/tests/test-helper.js @@ -0,0 +1,12 @@ +import resolver from './helpers/resolver'; +import { + setResolver +} from 'ember-qunit'; + +setResolver(resolver); + +document.write('
'); + +QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'}); +var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible'; +document.getElementById('ember-testing-container').style.visibility = containerVisibility; diff --git a/tests/unit/.gitkeep b/tests/unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/.gitkeep b/vendor/.gitkeep new file mode 100644 index 0000000..e69de29