├── .bowerrc ├── .editorconfig ├── .ember-cli ├── .gitignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── .watchmanconfig ├── Brocfile.js ├── LICENSE.md ├── README.md ├── addon ├── .gitkeep ├── components │ ├── jqui-accordion │ │ ├── component.js │ │ └── template.hbs │ ├── jqui-autocomplete │ │ └── component.js │ ├── jqui-button │ │ ├── component.js │ │ └── template.hbs │ ├── jqui-datepicker │ │ └── component.js │ ├── jqui-menu │ │ ├── component.js │ │ └── template.hbs │ ├── jqui-progress-bar │ │ └── component.js │ ├── jqui-slider │ │ └── component.js │ ├── jqui-spinner │ │ └── component.js │ └── jqui-tabs │ │ ├── component.js │ │ └── template.hbs └── mixins │ └── jqui-widget.js ├── app ├── .gitkeep └── components │ ├── jqui-accordion │ └── component.js │ ├── jqui-autocomplete │ └── component.js │ ├── jqui-button │ └── component.js │ ├── jqui-datepicker │ └── component.js │ ├── jqui-menu │ └── component.js │ ├── jqui-progress-bar │ └── component.js │ ├── jqui-slider │ └── component.js │ ├── jqui-spinner │ └── component.js │ └── jqui-tabs │ └── component.js ├── blueprints └── ember-cli-jquery-ui │ └── index.js ├── bower.json ├── config ├── ember-try.js └── environment.js ├── index.js ├── package.json ├── testem.json ├── tests ├── .jshintrc ├── dummy │ ├── .jshintrc │ ├── app │ │ ├── app.js │ │ ├── components │ │ │ └── .gitkeep │ │ ├── controllers │ │ │ └── .gitkeep │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── index.html │ │ ├── models │ │ │ └── .gitkeep │ │ ├── router.js │ │ ├── routes │ │ │ └── .gitkeep │ │ ├── styles │ │ │ ├── .gitkeep │ │ │ └── app.css │ │ ├── templates │ │ │ ├── .gitkeep │ │ │ ├── application.hbs │ │ │ └── components │ │ │ │ └── .gitkeep │ │ └── views │ │ │ └── .gitkeep │ ├── config │ │ └── environment.js │ └── public │ │ ├── .gitkeep │ │ ├── crossdomain.xml │ │ └── robots.txt ├── helpers │ ├── resolver.js │ └── start-app.js ├── index.html ├── test-helper.js └── unit │ ├── .gitkeep │ ├── components │ ├── jqui-accordion-test.js │ ├── jqui-autocomplete-test.js │ ├── jqui-button-test.js │ ├── jqui-datepicker-test.js │ ├── jqui-menu-test.js │ ├── jqui-progress-bar-test.js │ ├── jqui-slider-test.js │ ├── jqui-spinner-test.js │ └── jqui-tabs-test.js │ └── mixins │ └── jqui-widget-test.js └── vendor └── .gitkeep /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [*.hbs] 21 | insert_final_newline = false 22 | indent_style = space 23 | indent_size = 2 24 | 25 | [*.css] 26 | indent_style = space 27 | indent_size = 2 28 | 29 | [*.html] 30 | indent_style = space 31 | indent_size = 2 32 | 33 | [*.{diff,md}] 34 | trim_trailing_whitespace = false 35 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # misc 12 | /.idea 13 | /.sass-cache 14 | /connect.lock 15 | /coverage/* 16 | /libpeerconnection.log 17 | npm-debug.log 18 | testem.log 19 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser": true, 8 | "boss": true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components/ 2 | tests/ 3 | tmp/ 4 | dist/ 5 | 6 | .bowerrc 7 | .editorconfig 8 | .ember-cli 9 | .travis.yml 10 | .npmignore 11 | **/.gitkeep 12 | bower.json 13 | Brocfile.js 14 | testem.json 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | - "0.12" 5 | 6 | sudo: false 7 | 8 | cache: 9 | directories: 10 | - node_modules 11 | 12 | env: 13 | - EMBER_TRY_SCENARIO=default 14 | - EMBER_TRY_SCENARIO=ember-release 15 | - EMBER_TRY_SCENARIO=ember-beta 16 | - EMBER_TRY_SCENARIO=ember-canary 17 | 18 | matrix: 19 | fast_finish: true 20 | allow_failures: 21 | - env: EMBER_TRY_SCENARIO=ember-beta 22 | - env: EMBER_TRY_SCENARIO=ember-canary 23 | 24 | before_install: 25 | - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH 26 | - "npm config set spin false" 27 | - "npm install -g npm@^2" 28 | 29 | install: 30 | - npm install -g bower 31 | - npm install 32 | - bower install 33 | 34 | script: 35 | - ember try $EMBER_TRY_SCENARIO test 36 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp"] 3 | } 4 | -------------------------------------------------------------------------------- /Brocfile.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | /* global require, module */ 3 | 4 | var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | var app = new EmberAddon(); 7 | 8 | // Use `app.import` to add additional libraries to the generated 9 | // output files. 10 | // 11 | // If you need to use different assets in different 12 | // environments, specify an object as the first parameter. That 13 | // object's keys should be the environment name and the values 14 | // should be the asset to use in that environment. 15 | // 16 | // If the library that you are including contains AMD or ES6 17 | // modules that you would like to import into your application 18 | // please specify an object with the list of modules as keys 19 | // along with the exports of each module as its value. 20 | 21 | app.import('bower_components/jquery-ui/jquery-ui.js'); 22 | 23 | module.exports = app.toTree(); 24 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ember-cli-jquery-ui 2 | 3 | **This package is deprecated. I no longer recommend using JQuery plugins in Ember.js generally.** 4 | 5 | [![Join the chat at https://gitter.im/Gaurav0/ember-cli-jquery-ui](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Gaurav0/ember-cli-jquery-ui?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | A simple addon to add jquery-ui as a dependency to your app. Also includes a small library of components wrapping JQuery UI widgets. 8 | 9 | [![Build Status](https://travis-ci.org/Gaurav0/ember-cli-jquery-ui.svg?branch=master)](https://travis-ci.org/Gaurav0/ember-cli-jquery-ui) 10 | 11 | [![Ember Observer Score](http://emberobserver.com/badges/ember-cli-jquery-ui.svg)](http://emberobserver.com/addons/ember-cli-jquery-ui) 12 | 13 | ## Example Application 14 | 15 | An example application demonstrating how to use ember-cli-jquery-ui is available at 16 | http://github.com/gaurav0/ember-cli-jquery-ui-example 17 | 18 | You can see the example application online at 19 | http://ember-cli-jquery-ui-example.herokuapp.com/ 20 | 21 | ## Installation 22 | 23 | * `ember install ember-cli-jquery-ui` 24 | 25 | ## Change your jquery-ui theme 26 | 27 | By default, your application will run with the base theme. If you would like to select another jquery-ui standard theme, 28 | you may do so by editing your Brocfile.js like this: 29 | 30 | var EmberApp = require('ember-cli/lib/broccoli/ember-app'); 31 | 32 | var app = new EmberApp({ 33 | 'ember-cli-jquery-ui': { 34 | 'theme': 'ui-darkness' 35 | } 36 | }); 37 | 38 | The list of available standard themes (with JQuery UI 1.11.1): 39 | 40 | * base 41 | * black-tie 42 | * blitzer 43 | * cupertino 44 | * dark-hive 45 | * dot-luv 46 | * eggplant 47 | * excite-bike 48 | * flick 49 | * hot-sneaks 50 | * humanity 51 | * le-frog 52 | * mint-choc 53 | * overcast 54 | * pepper-grinder 55 | * redmond 56 | * smoothness 57 | * south-street 58 | * start 59 | * sunny 60 | * swanky-purse 61 | * trontastic 62 | * ui-darkness 63 | * ui-lightness 64 | * vader 65 | 66 | If you'd prefer not to include any of the above jquery-ui themes, you can set 67 | the theme to 'none'. *Warning:* Components do not work correctly without styling. 68 | 69 | ## Included Components 70 | 71 | At the moment, ember-cli-jquery-ui includes nine of the eleven jquery ui widgets wrapped in components: 72 | 73 | 1. `jqui-accordion`, which can be used in your application like this: 74 | 75 | {{#jqui-accordion}} 76 |

Section

77 |
78 |

79 | Mauris mauris ante, ... 80 |

81 |
82 |

Section 2

83 |
84 |

85 | Sed non urna. ... 86 |

87 |
88 | ... 89 | {{/jqui-accordion}} 90 | 91 | 2. `jqui-autocomplete`, which can be used in your application like this: 92 | 93 | {{jqui-autocomplete value=text source=languages}} {{text}} 94 | 95 | 3. `jqui-button`, which can be used in your application like this: 96 | 97 | {{#jqui-button icon="ui-icon-gear" action="buttonClicked" disabled=disabledProperty}}Button Text{{/jqui-button}} 98 | 99 | 4. `jqui-datepicker`, which can be used in your application like this: 100 | 101 | {{jqui-datepicker value=myDate yearRange="2013:2015"}} {{myDate}} 102 | 103 | 5. `jqui-menu`, which can be used in your application like this: 104 | 105 | {{#jqui-menu}} 106 |
  • Item 1
  • 107 |
  • Item 2
  • 108 |
  • Item 3 109 | 113 |
  • 114 |
  • Item 4
  • 115 |
  • -
  • {{!-- divider --}} 116 |
  • Item 5
  • 117 | {{/jqui-menu}} 118 | 119 | 6. `jqui-progress-bar`, which can be used in your application like this: 120 | 121 | {{jqui-progress-bar value=37 max=100}} 122 | 123 | 7. `jqui-slider`, which can be used in your application like this: 124 | 125 | {{jqui-slider value=num min=0 max=100 step=10 slide="slideAction"}} {{num}} 126 | 127 | 8. `jqui-spinner`, which can be used in your application like this: 128 | 129 | {{jqui-spinner value=num min=100 max=2000 step=100}} {{num}} 130 | 131 | 9. `jqui-tabs`, which can be used in your application like this: 132 | 133 | {{#jqui-tabs}} 134 | 139 |
    140 |

    Proin elit arcu, ....

    141 |
    142 |
    143 |

    Morbi tincidunt, ...

    144 |
    145 |
    146 |

    Mauris eleifend ....

    147 |

    Duis cursus. ...

    148 |
    149 | {{/jqui-tabs}} 150 | 151 | I would appreciate contributions of additional components wrapping jquery-ui widgets. 152 | 153 | ## Running 154 | 155 | * `ember server` 156 | * Visit your app at http://localhost:4200. 157 | 158 | ## Running Tests 159 | 160 | * `ember test` 161 | * `ember test --server` 162 | 163 | ## Building 164 | 165 | * `ember build` 166 | 167 | For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/). 168 | -------------------------------------------------------------------------------- /addon/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/addon/.gitkeep -------------------------------------------------------------------------------- /addon/components/jqui-accordion/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.Component.extend(jquiWidget, { 5 | uiType: 'accordion', 6 | uiOptions: ['active', 'animate', 'collapsible', 'disabled', 'event', 'header', 'heightStyle', 'icons'], 7 | uiEvents: ['activate', 'beforeActivate', 'create'] 8 | }); -------------------------------------------------------------------------------- /addon/components/jqui-accordion/template.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/components/jqui-autocomplete/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.TextField.extend(jquiWidget, { 5 | uiType: 'autocomplete', 6 | uiOptions: ['autofocus', 'delay', 'disabled', 'minLength', 'position', 'source' ], 7 | uiEvents: ['close', 'search'] 8 | }); -------------------------------------------------------------------------------- /addon/components/jqui-button/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.Component.extend(jquiWidget, { 5 | uiType: 'button', 6 | uiOptions: ['disabled'], 7 | uiEvents: [], 8 | tagName: 'button', 9 | disabled: false, 10 | icon: "", 11 | 12 | didInsertElement: function() { 13 | var _this = this; 14 | Ember.run.next(function() { 15 | _this.$().button("option", "icons", { 16 | primary: _this.get('icon') 17 | }); 18 | }); 19 | }, 20 | 21 | click: function() { 22 | this.sendAction(); 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /addon/components/jqui-button/template.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/components/jqui-datepicker/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.TextField.extend(jquiWidget, { 5 | uiType: 'datepicker', 6 | uiOptions: ["altField", "altFormat", "appendText", "autoSize", 7 | "beforeShow", "beforeShowDay", "buttonImage", "buttonImageOnly", 8 | "buttonText", "calculateWeek", "changeMonth", "changeYear", "closeText", 9 | "constrainInput", "currentText", "dateFormat", "dayNames", "dayNamesMin", 10 | "dayNamesShort", "defaultDate", "duration", "firstDay", "gotoCurrent", 11 | "hideIfNoPrevNext", "isRTL", "maxDate", "minDate", "monthNames", 12 | "monthNamesShort", "navigationAsDateFormat", "nextText", "numberOfMonths", 13 | "onChangeMonthYear", "onClose", "onSelect", "prevText", 14 | "selectOtherMonths", "shortYearCutoff", "showAnim", "showButtonPanel", 15 | "showCurrentAtPos", "showMonthAfterYear", "showOn", "showOptions", 16 | "showOtherMonths", "showWeek", "stepMonths", "weekHeader", "yearRange", 17 | "yearSuffix"] 18 | }); 19 | -------------------------------------------------------------------------------- /addon/components/jqui-menu/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.Component.extend(jquiWidget, { 5 | uiType: 'menu', 6 | uiOptions: ['disabled'], 7 | uiEvents: ['blur', 'create', 'focus', 'select'] 8 | }); 9 | -------------------------------------------------------------------------------- /addon/components/jqui-menu/template.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/components/jqui-progress-bar/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.Component.extend(jquiWidget, { 5 | uiType: 'progressbar', 6 | uiOptions: ['value', 'max'], 7 | uiEvents: ['change', 'complete'] 8 | }); 9 | -------------------------------------------------------------------------------- /addon/components/jqui-slider/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.Component.extend(jquiWidget, { 5 | uiType: 'slider', 6 | uiOptions: ['animate', 'disabled', 'max', 'min', 'orientation', 'range', 'step', 'value', 'values' ], 7 | uiEvents: ['change', 'create', 'slide', 'start', 'stop'], 8 | uiActions: { 9 | slide: function(event, ui) { 10 | this.set('value', ui.value); 11 | this.set('values', ui.values); 12 | } 13 | } 14 | }); -------------------------------------------------------------------------------- /addon/components/jqui-spinner/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.TextField.extend(jquiWidget, { 5 | uiType: 'spinner', 6 | uiOptions: ['culture', 'disabled', 'incremental', 'max', 'min', 'numberFormat', 'page', 'step'], 7 | uiEvents: ['change', 'create', 'spin', 'start', 'stop'] 8 | }); 9 | -------------------------------------------------------------------------------- /addon/components/jqui-tabs/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget'; 3 | 4 | export default Ember.Component.extend(jquiWidget, { 5 | uiType: 'tabs', 6 | uiOptions: ['active', 'collapsible', 'disabled', 'event', 'heightStyle', 'hide', 'show'], 7 | uiEvents: ['activate', 'beforeActivate', 'beforeLoad', 'create', 'load'], 8 | 9 | uiActions: { 10 | // Hacky workaround for bug in JQuery UI Tabs _isLocal method 11 | // Source: http://stackoverflow.com/questions/13837304/jquery-ui-non-ajax-tab-loading-whole-website-into-itself 12 | create: function(event){ 13 | var $ = Ember.$; 14 | var tabsData = $(event.target).data('ui-tabs'); 15 | tabsData.anchors.each(function(idx, anchor){ 16 | var contentId = $(anchor).attr('href'); 17 | var $panel = $(tabsData.panels[idx]); 18 | $panel.html($(contentId).remove().html()); 19 | }); 20 | }, 21 | beforeLoad: function(event){ 22 | event.preventDefault(); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /addon/components/jqui-tabs/template.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/mixins/jqui-widget.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import $ from 'jquery'; 3 | 4 | // Create a new mixin for jQuery UI widgets using the Ember 5 | // mixin syntax. 6 | export default Ember.Mixin.create({ 7 | 8 | // When Ember creates the view's DOM element, it will call this 9 | // method. 10 | setup: Ember.on('didInsertElement', function() { 11 | var _this = this; 12 | Ember.run.scheduleOnce('afterRender', function() { 13 | 14 | // Make jQuery UI options available as Ember properties 15 | var options = _this._gatherOptions(); 16 | 17 | // Make sure that jQuery UI events trigger methods on this view. 18 | _this._gatherEvents(options); 19 | 20 | var ui; 21 | var uiType = _this.get('uiType'); 22 | 23 | // Workaround for bug in jQuery UI datepicker 24 | // $.ui.datepicker is not a function 25 | if (uiType === "datepicker") { 26 | _this.$().datepicker( 27 | $.extend(options, { 28 | onSelect: function() { _this.$().change(); } 29 | }) 30 | ); 31 | ui = { 32 | option: function(key, value) { 33 | _this.$().datepicker('option', key, value); 34 | }, 35 | _destroy: function() { 36 | _this.$().datepicker('destroy'); 37 | } 38 | }; 39 | } else { 40 | 41 | // Create a new instance of the jQuery UI widget based on its `uiType` 42 | // and the current element. 43 | ui = Ember.$.ui[_this.get('uiType')](options, _this.get('element')); 44 | } 45 | 46 | // Save off the instance of the jQuery UI widget as the `ui` property 47 | // on this Ember view. 48 | _this.set('ui', ui); 49 | 50 | }); 51 | }), 52 | 53 | // When Ember tears down the view's DOM element, it will call 54 | // this method. 55 | tearDown: Ember.on('willDestroyElement', function() { 56 | var ui = this.get('ui'); 57 | 58 | if (ui) { 59 | // Tear down any observers that were created to make jQuery UI 60 | // options available as Ember properties. 61 | var observers = this._observers; 62 | for (var prop in observers) { 63 | if (observers.hasOwnProperty(prop)) { 64 | this.removeObserver(prop, observers[prop]); 65 | } 66 | } 67 | ui._destroy(); 68 | } 69 | }), 70 | 71 | // Each jQuery UI widget has a series of options that can be configured. 72 | // For instance, to disable a button, you call 73 | // `button.options('disabled', true)` in jQuery UI. To make this compatible 74 | // with Ember bindings, any time the Ember property for a 75 | // given jQuery UI option changes, we update the jQuery UI widget. 76 | _gatherOptions: function() { 77 | var uiOptions = this.get('uiOptions'), options = {}; 78 | 79 | // The view can specify a list of jQuery UI options that should be treated 80 | // as Ember properties. 81 | uiOptions.forEach(function(key) { 82 | options[key] = this.get(key); 83 | 84 | // Set up an observer on the Ember property. When it changes, 85 | // call jQuery UI's `option` method to reflect the property onto 86 | // the jQuery UI widget. 87 | var observer = function() { 88 | var value = this.get(key); 89 | this.get('ui').option(key, value); 90 | }; 91 | this.addObserver(key, observer); 92 | 93 | // Insert the observer in a Hash so we can remove it later. 94 | this._observers = this._observers || {}; 95 | this._observers[key] = observer; 96 | }, this); 97 | return options; 98 | }, 99 | 100 | // Each jQuery UI widget has a number of custom events that they can 101 | // trigger. For instance, the progressbar widget triggers a `complete` 102 | // event when the progress bar finishes. Make these events behave like 103 | // normal Ember events. For instance, a subclass of JQ.ProgressBar 104 | // could implement the `complete` method to be notified when the jQuery 105 | // UI widget triggered the event. 106 | _gatherEvents: function(options) { 107 | var uiEvents = this.get('uiEvents') || [], self = this; 108 | uiEvents.forEach(function(eventName) { 109 | var callback = self.uiActions && self.uiActions[eventName]; 110 | 111 | // You can register a handler for a jQuery UI event by passing 112 | // it in along with the creation options. Update the options hash 113 | // to include any event callbacks. 114 | options[eventName] = function(event, ui) { 115 | if (callback) { 116 | callback.call(self, event, ui); 117 | } 118 | 119 | self.sendAction(eventName, event, ui); 120 | }; 121 | }); 122 | } 123 | }); 124 | -------------------------------------------------------------------------------- /app/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/app/.gitkeep -------------------------------------------------------------------------------- /app/components/jqui-accordion/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiAccordion from 'ember-cli-jquery-ui/components/jqui-accordion/component'; 3 | 4 | export default jquiAccordion; -------------------------------------------------------------------------------- /app/components/jqui-autocomplete/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiAutocomplete from 'ember-cli-jquery-ui/components/jqui-autocomplete/component'; 3 | 4 | export default jquiAutocomplete; -------------------------------------------------------------------------------- /app/components/jqui-button/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiButton from 'ember-cli-jquery-ui/components/jqui-button/component'; 3 | 4 | export default jquiButton; 5 | -------------------------------------------------------------------------------- /app/components/jqui-datepicker/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiDatepicker from 'ember-cli-jquery-ui/components/jqui-datepicker/component'; 3 | 4 | export default jquiDatepicker; 5 | -------------------------------------------------------------------------------- /app/components/jqui-menu/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiMenu from 'ember-cli-jquery-ui/components/jqui-menu/component'; 3 | 4 | export default jquiMenu; 5 | -------------------------------------------------------------------------------- /app/components/jqui-progress-bar/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiProgressBar from 'ember-cli-jquery-ui/components/jqui-progress-bar/component'; 3 | 4 | export default jquiProgressBar; -------------------------------------------------------------------------------- /app/components/jqui-slider/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiSlider from 'ember-cli-jquery-ui/components/jqui-slider/component'; 3 | 4 | export default jquiSlider; 5 | -------------------------------------------------------------------------------- /app/components/jqui-spinner/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiSpinner from 'ember-cli-jquery-ui/components/jqui-spinner/component'; 3 | 4 | export default jquiSpinner; 5 | -------------------------------------------------------------------------------- /app/components/jqui-tabs/component.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import jquiTabs from 'ember-cli-jquery-ui/components/jqui-tabs/component'; 3 | 4 | export default jquiTabs; -------------------------------------------------------------------------------- /blueprints/ember-cli-jquery-ui/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | normalizeEntityName: function() {}, 3 | afterInstall: function() { 4 | return this.addBowerPackageToProject('jquery-ui', '1.11.4'); 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-jquery-ui", 3 | "dependencies": { 4 | "ember": "1.12.0", 5 | "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", 6 | "ember-cli-test-loader": "ember-cli-test-loader#0.1.3", 7 | "ember-data": "1.0.0-beta.18", 8 | "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4", 9 | "ember-qunit": "0.3.3", 10 | "ember-qunit-notifications": "0.0.7", 11 | "ember-resolver": "~0.1.15", 12 | "jquery": "^1.11.1", 13 | "loader.js": "ember-cli/loader.js#3.2.0", 14 | "qunit": "~1.17.1", 15 | "jquery-ui": "~1.11.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | scenarios: [ 3 | { 4 | name: 'default', 5 | dependencies: { } 6 | }, 7 | { 8 | name: 'ember-release', 9 | dependencies: { 10 | 'ember': 'components/ember#release' 11 | }, 12 | resolutions: { 13 | 'ember': 'release' 14 | } 15 | }, 16 | { 17 | name: 'ember-beta', 18 | dependencies: { 19 | 'ember': 'components/ember#beta' 20 | }, 21 | resolutions: { 22 | 'ember': 'beta' 23 | } 24 | }, 25 | { 26 | name: 'ember-canary', 27 | dependencies: { 28 | 'ember': 'components/ember#canary' 29 | }, 30 | resolutions: { 31 | 'ember': 'canary' 32 | } 33 | } 34 | ] 35 | }; 36 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(/* environment, appConfig */) { 4 | return { }; 5 | }; 6 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 'use strict'; 3 | 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | 7 | module.exports = { 8 | name: 'ember-cli-jquery-ui', 9 | 10 | blueprintsPath: function() { 11 | return path.join(__dirname, 'blueprints'); 12 | }, 13 | 14 | included: function(app) { 15 | this._super.included(app); 16 | 17 | var options = app.options['ember-cli-jquery-ui'] || {}; 18 | var theme = options.theme || "base"; 19 | 20 | app.import(path.join(app.bowerDirectory, 'jquery-ui', 'jquery-ui.js')); 21 | 22 | if (theme != 'none') { 23 | var cssFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme); 24 | var cssFiles = fs.readdirSync(cssFileDir); 25 | 26 | cssFiles.forEach(function(file) { 27 | if (/^.*\.css$/.test(file) && !/^.*\.min\.css$/.test(file)) 28 | app.import(path.join(cssFileDir, file)); 29 | }); 30 | 31 | var imgFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme, 'images'); 32 | var imgFiles = fs.readdirSync(imgFileDir); 33 | 34 | imgFiles.forEach(function(file) { 35 | app.import(path.join(imgFileDir, file), { 36 | destDir: "/assets/images" 37 | }); 38 | }); 39 | } 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-jquery-ui", 3 | "description": "A simple addon to add jquery-ui as a dependency to your app. Also includes a small library of components wrapping JQuery UI widgets.", 4 | "version": "0.0.20", 5 | "directories": { 6 | "doc": "doc", 7 | "test": "tests" 8 | }, 9 | "scripts": { 10 | "start": "ember server", 11 | "build": "ember build", 12 | "test": "ember test" 13 | }, 14 | "repository": "https://github.com/gaurav0/ember-cli-jquery-ui", 15 | "engines": { 16 | "node": ">= 0.10.0" 17 | }, 18 | "author": "Gaurav Munjal", 19 | "license": "MIT", 20 | "devDependencies": { 21 | "broccoli-asset-rev": "^2.0.2", 22 | "ember-cli": "0.2.7", 23 | "ember-cli-app-version": "0.3.3", 24 | "ember-cli-content-security-policy": "0.4.0", 25 | "ember-cli-dependency-checker": "^1.0.0", 26 | "ember-cli-ic-ajax": "0.1.1", 27 | "ember-cli-inject-live-reload": "^1.3.0", 28 | "ember-cli-qunit": "0.3.13", 29 | "ember-cli-uglify": "^1.0.1", 30 | "ember-data": "1.0.0-beta.18", 31 | "ember-disable-proxy-controllers": "^1.0.0", 32 | "ember-export-application-global": "^1.0.2", 33 | "ember-disable-prototype-extensions": "^1.0.0", 34 | "ember-try": "0.0.4" 35 | }, 36 | "dependencies": { 37 | "ember-cli-babel": "^5.0.0", 38 | "ember-cli-htmlbars": "^1.0.8" 39 | }, 40 | "keywords": [ 41 | "ember-addon", 42 | "jquery-ui" 43 | ], 44 | "ember-addon": { 45 | "configPath": "tests/dummy/config", 46 | "demoURL": "http://ember-cli-jquery-ui-example.herokuapp.com/" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "framework": "qunit", 3 | "test_page": "tests/index.html?hidepassed", 4 | "disable_watching": true, 5 | "launch_in_ci": [ 6 | "PhantomJS" 7 | ], 8 | "launch_in_dev": [ 9 | "PhantomJS", 10 | "Chrome" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "location", 6 | "setTimeout", 7 | "$", 8 | "-Promise", 9 | "QUnit", 10 | "define", 11 | "console", 12 | "equal", 13 | "notEqual", 14 | "notStrictEqual", 15 | "test", 16 | "asyncTest", 17 | "testBoth", 18 | "testWithDefault", 19 | "raises", 20 | "throws", 21 | "deepEqual", 22 | "start", 23 | "stop", 24 | "ok", 25 | "strictEqual", 26 | "module", 27 | "moduleFor", 28 | "moduleForComponent", 29 | "moduleForModel", 30 | "process", 31 | "expect", 32 | "visit", 33 | "exists", 34 | "fillIn", 35 | "click", 36 | "keyEvent", 37 | "triggerEvent", 38 | "find", 39 | "findWithAssert", 40 | "wait", 41 | "DS", 42 | "isolatedContainer", 43 | "startApp", 44 | "andThen", 45 | "currentURL", 46 | "currentPath", 47 | "currentRouteName" 48 | ], 49 | "node": false, 50 | "browser": false, 51 | "boss": true, 52 | "curly": false, 53 | "debug": false, 54 | "devel": false, 55 | "eqeqeq": true, 56 | "evil": true, 57 | "forin": false, 58 | "immed": false, 59 | "laxbreak": false, 60 | "newcap": true, 61 | "noarg": true, 62 | "noempty": false, 63 | "nonew": false, 64 | "nomen": false, 65 | "onevar": false, 66 | "plusplus": false, 67 | "regexp": false, 68 | "undef": true, 69 | "sub": true, 70 | "strict": false, 71 | "white": false, 72 | "eqnull": true, 73 | "esnext": true 74 | } 75 | -------------------------------------------------------------------------------- /tests/dummy/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser" : true, 8 | "boss" : true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from 'ember/resolver'; 3 | import loadInitializers from 'ember/load-initializers'; 4 | import config from './config/environment'; 5 | 6 | var App; 7 | 8 | Ember.MODEL_FACTORY_INJECTIONS = true; 9 | 10 | App = Ember.Application.extend({ 11 | modulePrefix: config.modulePrefix, 12 | podModulePrefix: config.podModulePrefix, 13 | Resolver: Resolver 14 | }); 15 | 16 | loadInitializers(App, config.modulePrefix); 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/controllers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | 12 | 13 | 14 | 15 | {{content-for 'head-footer'}} 16 | 17 | 18 | {{content-for 'body'}} 19 | 20 | 21 | 22 | 23 | {{content-for 'body-footer'}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | var Router = Ember.Router.extend({ 5 | location: config.locationType 6 | }); 7 | 8 | Router.map(function() { 9 | }); 10 | 11 | export default Router; 12 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/routes/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/styles/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/styles/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/templates/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 |

    Welcome to Ember.js

    2 | 3 | {{outlet}} 4 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/templates/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/views/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/app/views/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function(environment) { 4 | var ENV = { 5 | modulePrefix: 'dummy', 6 | environment: environment, 7 | baseURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. 'with-controller': true 13 | } 14 | }, 15 | 16 | APP: { 17 | // Here you can pass flags/options to your application instance 18 | // when it is created 19 | } 20 | }; 21 | 22 | if (environment === 'development') { 23 | // ENV.APP.LOG_RESOLVER = true; 24 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 25 | // ENV.APP.LOG_TRANSITIONS = true; 26 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 27 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 28 | } 29 | 30 | if (environment === 'test') { 31 | // Testem prefers this... 32 | ENV.baseURL = '/'; 33 | ENV.locationType = 'none'; 34 | 35 | // keep test console output quieter 36 | ENV.APP.LOG_ACTIVE_GENERATION = false; 37 | ENV.APP.LOG_VIEW_LOOKUPS = false; 38 | 39 | ENV.APP.rootElement = '#ember-testing'; 40 | } 41 | 42 | if (environment === 'production') { 43 | 44 | } 45 | 46 | return ENV; 47 | }; 48 | -------------------------------------------------------------------------------- /tests/dummy/public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/dummy/public/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember/resolver'; 2 | import config from '../../config/environment'; 3 | 4 | var resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Application from '../../app'; 3 | import Router from '../../router'; 4 | import config from '../../config/environment'; 5 | 6 | export default function startApp(attrs) { 7 | var application; 8 | 9 | var attributes = Ember.merge({}, config.APP); 10 | attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; 11 | 12 | Ember.run(function() { 13 | application = Application.create(attributes); 14 | application.setupForTesting(); 15 | application.injectTestHelpers(); 16 | }); 17 | 18 | return application; 19 | } 20 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dummy Tests 7 | 8 | 9 | 10 | {{content-for 'head'}} 11 | {{content-for 'test-head'}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for 'head-footer'}} 18 | {{content-for 'test-head-footer'}} 19 | 20 | 21 | 22 | {{content-for 'body'}} 23 | {{content-for 'test-body'}} 24 | 25 | 26 | 27 | 28 | 29 | 30 | {{content-for 'body-footer'}} 31 | {{content-for 'test-body-footer'}} 32 | 33 | 34 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { 3 | setResolver 4 | } from 'ember-qunit'; 5 | 6 | setResolver(resolver); 7 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/tests/unit/.gitkeep -------------------------------------------------------------------------------- /tests/unit/components/jqui-accordion-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-accordion', 'JquiAccordionComponent', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // appends the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-autocomplete-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-autocomplete', 'JquiAutocompleteComponent', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // appends the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-button-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-button', 'JquiButtonComponent', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // appends the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-datepicker-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | import Ember from 'ember'; 6 | 7 | moduleForComponent('jqui-datepicker', 'JquiDatepickerComponent', { 8 | // specify the other units that are required for this test 9 | // needs: ['component:foo', 'helper:bar'] 10 | }); 11 | 12 | test('it renders', function(assert) { 13 | assert.expect(2); 14 | 15 | // creates the component instance 16 | var component = this.subject(); 17 | assert.equal(component._state, 'preRender'); 18 | 19 | // appends the component to the page 20 | this.render(); 21 | assert.equal(component._state, 'inDOM'); 22 | }); 23 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-menu-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-menu', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // renders the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-progress-bar-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-progress-bar', 'JquiProgressBarComponent', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // appends the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-slider-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-slider', 'JquiSliderComponent', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // appends the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-spinner-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-spinner', 'JquiSpinnerComponent', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // appends the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/components/jqui-tabs-test.js: -------------------------------------------------------------------------------- 1 | import { 2 | moduleForComponent, 3 | test 4 | } from 'ember-qunit'; 5 | 6 | moduleForComponent('jqui-tabs', { 7 | // specify the other units that are required for this test 8 | // needs: ['component:foo', 'helper:bar'] 9 | }); 10 | 11 | test('it renders', function(assert) { 12 | assert.expect(2); 13 | 14 | // creates the component instance 15 | var component = this.subject(); 16 | assert.equal(component._state, 'preRender'); 17 | 18 | // renders the component to the page 19 | this.render(); 20 | assert.equal(component._state, 'inDOM'); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/unit/mixins/jqui-widget-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import {module, test} from 'qunit'; 3 | import JquiWidgetMixin from 'ember-cli-jquery-ui/mixins/jqui-widget'; 4 | 5 | module('JquiWidgetMixin'); 6 | 7 | test('it works', function(assert) { 8 | var JquiWidgetObject = Ember.Object.extend(JquiWidgetMixin); 9 | var subject = JquiWidgetObject.create(); 10 | assert.ok(subject); 11 | }); 12 | 13 | test('gathers options', function(assert) { 14 | var JquiWidgetObject = Ember.Object.extend(JquiWidgetMixin, { 15 | uiOptions: ['option1', 'option2'] 16 | }); 17 | var subject = JquiWidgetObject.create(); 18 | var options = subject._gatherOptions(); 19 | assert.ok('option1' in options); 20 | assert.ok('option2' in options); 21 | }); 22 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gaurav0/ember-cli-jquery-ui/4be1b35316610d8a12e3d03c8ba8c9efb1cad2b7/vendor/.gitkeep --------------------------------------------------------------------------------