bootstrap-for-ember-rails 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.gitmodules +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +2 -0
- data/bootstrap-for-ember-rails.gemspec +36 -0
- data/lib/bootstrap-for-ember-rails.rb +9 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/.bowerrc +3 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/.gitignore +5 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/Gruntfile.js +459 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/LICENSE +191 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/README.md +80 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/index.html +176 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsAlertComponent.coffee +30 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBadgeComponent.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBreadcrumbs.coffee +65 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBtnGroup.coffee +19 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsBtnToolbarComponent.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsButtonComponent.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsItemsActionBar.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsLabelComponent.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsListGroupComponent.coffee +34 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsModalComponent.coffee +204 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPageHeaderComponent.coffee +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPanelComponent.coffee +35 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPill.coffee +20 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPills.coffee +9 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsPopover.coffee +443 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsProgressComponent.coffee +19 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsProgressbarComponent.coffee +22 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabPane.coffee +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabs.coffee +9 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsTabsPanes.coffee +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWellComponent.coffee +10 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/BsWizardComponent.coffee +175 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/GrowlNotifications.coffee +161 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/components/Notifications.coffee +88 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/init.coffee +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemSelection.coffee +68 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemValue.coffee +18 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/ItemsSelection.coffee +14 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Nav.coffee +13 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/NavItem.coffee +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Size.coffee +37 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/Type.coffee +17 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/mixins/WithRouter.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase.coffee +16 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsAlertController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsButtonController.coffee +24 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsItemsActionBarController.coffee +39 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsPanelController.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsPopoverController.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsProgressbarController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsTooltipBoxController.coffee +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowComponentsWellController.coffee +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentButtonGroupController.coffee +8 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentPillsController.coffee +20 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsGrowlNotifController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsListGroupController.coffee +12 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsModalController.coffee +53 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsNotificationsController.coffee +11 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsController.coffee +12 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsFooController.coffee +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsTabsPanesController.coffee +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/ShowcaseComponentsWizardController.coffee +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/controllers/UserController.coffee +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/router.coffee +29 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/routes/ApplicationRoute.coffee +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/showcase/routes/PopoverRoute.coffee +10 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/vendor/bootstrap.js +2276 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemPaneView.coffee +29 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemView.coffee +49 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemsPanesView.coffee +12 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/scripts/views/ItemsView.coffee +15 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/styles/components/growl-notifications.css +58 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/styles/main.scss +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-alert.hbs +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-badge.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-btn-toolbar.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-button.hbs +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-label.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-modal.hbs +28 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-page-header.hbs +6 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-panel.hbs +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-progress.hbs +5 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-progressbar.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/components/bs-well.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/ads.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/application.hbs +51 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/demo-template.hbs +4 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/footer.hbs +0 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/header.hbs +0 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/index.hbs +7 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/leftnav.hbs +13 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/nav-main.hbs +24 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/alert.md +115 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/badge.md +80 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/breadcrumbs.md +28 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/button.md +247 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/buttonGroup.md +99 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/growl-notif.md +70 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/items_action_bar.md +87 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/label.md +44 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/list-group.md +70 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/modal.md +167 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/notifications.md +76 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/page-header.md +15 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/panel.md +123 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/pills.md +104 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/popover.md +213 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/progressbar.md +117 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs-panes.md +42 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs-with-routes.md +64 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/tabs.md +30 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/template.jst +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/well.md +84 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/show_components/wizard.md +109 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/social-buttons.hbs +13 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/bar-tabpane.hbs +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/baz-tabpane.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/tabs/foo-tabpane.hbs +2 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user.hbs +3 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/activities.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/general.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/user/privacy.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step1.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step2.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/showcase/wizard/step3.hbs +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/app/templates/views/item-pane.hbs +3 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/bower.json +59 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/css/bs-growl-notifications.min.css +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-alert.max.js +158 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-alert.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-badge.max.js +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-badge.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-basic.max.js +230 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-basic.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-breadcrumbs.max.js +77 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-breadcrumbs.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-button.max.js +275 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-button.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-core.max.js +476 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-core.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-growl-notifications.max.js +162 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-growl-notifications.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-items-action-bar.max.js +45 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-items-action-bar.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-label.max.js +26 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-label.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-list-group.max.js +29 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-list-group.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-modal.max.js +314 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-modal.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-nav.max.js +51 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-nav.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-notifications.max.js +111 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-notifications.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-popover.max.js +402 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-popover.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-progressbar.max.js +102 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-progressbar.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-wizard.max.js +182 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/dist/js/bs-wizard.min.js +1 -0
- data/lib/bootstrap-for-ember-rails/bootstrap-for-ember/package.json +36 -0
- data/lib/bootstrap-for-ember-rails/version.rb +3 -0
- metadata +253 -0
@@ -0,0 +1 @@
|
|
1
|
+
+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),function(){var a;a=window.Bootstrap=Ember.Namespace.create()}.call(this),function(){var a,b;a=window.Bootstrap,b=Ember.get,a.WithRouter=Ember.Mixin.create({router:Ember.computed(function(){return b(this,"controller").container.lookup("router:main")})})}.call(this),function(){var a,b,c;a=window.Bootstrap,b=Ember.get,c=Ember.set,a.TypeSupport=Ember.Mixin.create({classTypePrefix:Ember.required(String),classNameBindings:["typeClass"],type:"default",typeClass:function(){var a,b;return b=this.get("type"),null==b&&(b="default"),a=this.get("classTypePrefix"),""+a+"-"+b}.property("type").cacheable()})}.call(this),function(){var a,b,c;a=window.Bootstrap,b=Ember.get,c=Ember.set,a.SizeSupport=Ember.Mixin.create({classTypePrefix:Ember.required(String),classNameBindings:["sizeClass","largeSizeClass","smallSizeClass","extraSmallSizeClass"],size:null,xs:null,small:null,large:null,extraSmallSizeClass:function(){var a;return a=this.get("classTypePrefix"),this.xs?""+a+"-xs":null}.property("xs").cacheable(),smallSizeClass:function(){var a;return a=this.get("classTypePrefix"),this.small?""+a+"-sm":null}.property("small").cacheable(),largeSizeClass:function(){var a;return a=this.get("classTypePrefix"),this.large?""+a+"-lg":null}.property("large").cacheable(),sizeClass:function(){var a,b;return b=this.get("size"),a=this.get("classTypePrefix"),b?""+a+"-"+b:null}.property("size").cacheable()})}.call(this),function(){Bootstrap.ItemValue=Ember.Mixin.create({value:function(){var a,b;return a=this.get("parentView"),null!=a?b=this.get("content"):void 0}.property("content").cacheable()})}.call(this),function(){Bootstrap.ItemSelection=Ember.Mixin.create(Bootstrap.ItemValue,Bootstrap.WithRouter,{classNameBindings:["isActive:active"],init:function(){return this._super(),this.didRouteChange()},didRouteChange:function(){var a,b,c;return b=this.get("content.linkTo"),null!=b&&(a=this.get("parentView"),null!=a)?(null!=(c=this.get("router"))?c.isActive(b):void 0)?a.set("selected",this.get("value")):void 0:void 0}.observes("router.url"),isActive:function(){var a,b,c;return a=this.get("parentView"),null==a?!1:(b=a.get("selected"),c=this.get("value"),null==c?!1:b===c)}.property("value","parentView.selected","content.linkTo").cacheable(),click:function(a){var b,c;return a.preventDefault(),c=this.get("parentView"),null==c||(b=this.get("content"),"object"==typeof b&&b.get("disabled")||null!=this.get("content.linkTo"))?void 0:c.set("selected",this.get("value"))}})}.call(this),function(){Bootstrap.ItemsSelection=Ember.Mixin.create({multiSelection:!1,selected:[]})}.call(this),function(){Bootstrap.Nav=Ember.Mixin.create({classNames:["nav"],classNameBindings:["navTypeClass"],tagName:"ul",navType:null,navTypeClass:function(){return null!=this.navType?"nav-"+this.navType:null}.property("navType").cacheable()})}.call(this),function(){Bootstrap.NavItem=Ember.Mixin.create(Bootstrap.SelectableView)}.call(this),function(){var a,b;a=function(a){var b,c;if(a&&(c=a.get("parentView")))return b=c instanceof Bootstrap.ItemsView,Ember.assert("The parent view must be an instance of Bootstrap.ItemsView or any inherited class",b),b?c:void 0},b=function(a,b,c){return"instance"===Ember.typeOf(a)||Ember.canInvoke(a,"get")?a.get(b):c},Bootstrap.ItemView=Ember.View.extend({isItem:!0,classNameBindings:["disabled"],title:function(){var c,d,e;if(e=a(this))return d=e.get("itemTitleKey")||"title",c=this.get("content"),b(c,d,c)}.property("content").cacheable(),disabled:function(){var c,d,e;if(e=a(this))return c=this.get("content"),d=!!b(c,"disabled",!1),d&&this.get("isActive")&&e.set("selected",null),d}.property("content","content.disabled").cacheable()})}.call(this),function(){Bootstrap.ItemsView=Ember.CollectionView.extend({didInsertElement:function(){var a,b,c,d,e,f;if(this.get("default")){for(a=this.get("default"),e=this._childViews,c=0,d=e.length;d>c;c++)b=e[c],(null!=(f=b.get("content"))?f.get("title"):void 0)===a&&this.set("selected",b.get("content"));return Ember.assert("Could not activate default tab "+a+" as it doesnt exist",a)}}})}.call(this),function(){Bootstrap.ItemPaneView=Ember.View.extend({template:Ember.Handlebars.compile(["{{#if view.content.template}}","{{bsItemPanePartial view.content.template}}","{{/if}}"].join("\n")),corrItem:function(){var a,b,c,d;if(null!=this.get("parentView").get("corrItemsView"))for(d=this.get("parentView").get("corrItemsView")._childViews,b=0,c=d.length;c>b;b++)if(a=d[b],a.content===this.get("content"))return a}.property("parentView.corrItemsView"),isVisible:function(){var a;return null!=(a=this.get("corrItem"))?a.get("isActive"):void 0}.property("corrItem.isActive"),controller:function(){var a,b;return a=this.get("parentView.controller"),this.get("content.controller")&&(b=this.get("container").lookup("controller:"+this.get("content.controller")),b&&(a=b)),a}.property("content")}),Ember.Handlebars.helper("bsItemPanePartial",function(a,b){var c,d;return d=b.data.view,c=d.templateForName(a),Ember.assert("Unable to find template with name '"+a+"'",c),c(this,{data:b.data})})}.call(this),function(){Bootstrap.ItemsPanesView=Ember.CollectionView.extend({viewsInserted:!1,corrItemsView:function(){var a;return a=Ember.View.views[this.get("items-id")]}.property("viewsInserted"),didInsertElement:function(){return this._super(),this.set("viewsInserted",!0)}})}.call(this);
|
@@ -0,0 +1,162 @@
|
|
1
|
+
/*
|
2
|
+
A Growl-like notifications component.
|
3
|
+
Originally written by Aaron Haurwitz (http://aaron.haurwitz.com/), licensed under MIT.
|
4
|
+
*/
|
5
|
+
|
6
|
+
|
7
|
+
(function() {
|
8
|
+
Bootstrap.GrowlNotifications = Ember.CollectionView.extend({
|
9
|
+
/*
|
10
|
+
@property {String[]} The array of concrete class names to put on this view's element
|
11
|
+
*/
|
12
|
+
|
13
|
+
classNames: ['growl-notifications'],
|
14
|
+
/*
|
15
|
+
Binding to the GrowlNotificationManager's notifications array
|
16
|
+
Each of the array element will be rendered as a notification view (see ItemViewClass)
|
17
|
+
*/
|
18
|
+
|
19
|
+
contentBinding: 'Bootstrap.GNM.notifications',
|
20
|
+
attributeBindings: ['style'],
|
21
|
+
showTime: 10000,
|
22
|
+
/*
|
23
|
+
@property {View} Notification view class
|
24
|
+
Determines what view class to render for each item in the content array.
|
25
|
+
*/
|
26
|
+
|
27
|
+
itemViewClass: Ember.View.extend({
|
28
|
+
classNames: ['growl-notification'],
|
29
|
+
template: Ember.Handlebars.compile('<span class="icon"><i class="fa {{unbound view.iconType}}"></i></span>\n<a class="close-notification" {{action "close" target="view"}}>\n <span style="font-size: 15px;"><i class="fa fa-times"></i></span>\n</a>\n<strong>\n {{view.content.title}}\n</strong>\n<p>\n {{view.content.sub}}\n</p>'),
|
30
|
+
classNameBindings: [":growl-notification", "content.closed", "isOpaque"],
|
31
|
+
attributeBindings: ['style'],
|
32
|
+
/*
|
33
|
+
@property {Number} Will be set by `didInsertElement`, used for clearing the auto-hide timeout.
|
34
|
+
*/
|
35
|
+
|
36
|
+
timeoutId: null,
|
37
|
+
/*
|
38
|
+
@property {Boolean} should the view be opaque now?
|
39
|
+
Used for fancy fading purposes.
|
40
|
+
*/
|
41
|
+
|
42
|
+
isOpaque: false,
|
43
|
+
/*
|
44
|
+
Lifecycle hook - called when view is created.
|
45
|
+
*/
|
46
|
+
|
47
|
+
init: function() {
|
48
|
+
var fn,
|
49
|
+
_this = this;
|
50
|
+
this._super();
|
51
|
+
fn = (function() {
|
52
|
+
return _this.notifyPropertyChange("style");
|
53
|
+
});
|
54
|
+
this.set("_recomputeStyle", fn);
|
55
|
+
return $(window).bind("resize", fn);
|
56
|
+
},
|
57
|
+
/*
|
58
|
+
View lifecycle hook - called when the view enters the DOM.
|
59
|
+
*/
|
60
|
+
|
61
|
+
didInsertElement: function() {
|
62
|
+
var _this = this;
|
63
|
+
this.set("timeoutId", setTimeout((function() {
|
64
|
+
return _this.send("close");
|
65
|
+
}), this.get("parentView.showTime")));
|
66
|
+
return Ember.run.later(this, (function() {
|
67
|
+
return this.set("isOpaque", true);
|
68
|
+
}), 1);
|
69
|
+
},
|
70
|
+
/*
|
71
|
+
Lifecycle hook - called right before view is destroyed
|
72
|
+
*/
|
73
|
+
|
74
|
+
willDestroyElement: function() {
|
75
|
+
return $(window).unbind('resize', this.get('_recomputeStyle'));
|
76
|
+
},
|
77
|
+
style: (function() {
|
78
|
+
var column, index, notifications, rightPx, row, topPx, unitHeight, unitWidth, unitsPerColumn, viewportHeight;
|
79
|
+
notifications = this.get('parentView.content').rejectProperty('closed', true);
|
80
|
+
index = notifications.indexOf(this.get('content'));
|
81
|
+
viewportHeight = $(window).height();
|
82
|
+
unitHeight = 80;
|
83
|
+
unitWidth = 320;
|
84
|
+
unitsPerColumn = Math.floor(viewportHeight / unitHeight);
|
85
|
+
column = Math.floor(index / unitsPerColumn);
|
86
|
+
row = index % unitsPerColumn;
|
87
|
+
if (index === -1) {
|
88
|
+
return '';
|
89
|
+
}
|
90
|
+
topPx = row * unitHeight;
|
91
|
+
rightPx = column * unitWidth;
|
92
|
+
return 'top: ' + topPx + 'px; right: ' + rightPx + 'px;';
|
93
|
+
}).property('parentView.content.@each.closed'),
|
94
|
+
/*
|
95
|
+
This is simply computed property for mapping a meaningful type name to a FontAwesome CSS class.
|
96
|
+
*/
|
97
|
+
|
98
|
+
iconType: (function() {
|
99
|
+
var hash, type;
|
100
|
+
type = this.get('content.type');
|
101
|
+
hash = {
|
102
|
+
'info': 'fa-bullhorn',
|
103
|
+
'success': 'fa-check',
|
104
|
+
'warning': 'fa-exclamation',
|
105
|
+
'danger': 'fa-times'
|
106
|
+
};
|
107
|
+
return hash[type] || '';
|
108
|
+
}).property('content.type'),
|
109
|
+
actions: {
|
110
|
+
close: function() {
|
111
|
+
var _this = this;
|
112
|
+
this.set('isOpaque', false);
|
113
|
+
return setTimeout((function() {
|
114
|
+
_this.get('parentView.content').removeObject(_this.get('content'));
|
115
|
+
return clearTimeout(_this.get("timeoutId"));
|
116
|
+
}), 300);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
})
|
120
|
+
});
|
121
|
+
|
122
|
+
Ember.Handlebars.helper('bs-growl-notifications', Bootstrap.GrowlNotifications);
|
123
|
+
|
124
|
+
/*
|
125
|
+
A manager that is responsible for getting told about new notifications and storing them within an array.
|
126
|
+
*/
|
127
|
+
|
128
|
+
|
129
|
+
Bootstrap.GNM = Bootstrap.GrowlNotificationManager = Ember.Object.create({
|
130
|
+
/*
|
131
|
+
@property {Array} A global array for storing notification objects.
|
132
|
+
*/
|
133
|
+
|
134
|
+
notifications: Ember.A(),
|
135
|
+
/*
|
136
|
+
An exposed method for pushing new notification.
|
137
|
+
@param title {String} leading text
|
138
|
+
@param sub {String} supporting text
|
139
|
+
@param type {String} classification; used for which icon to show
|
140
|
+
*/
|
141
|
+
|
142
|
+
push: function(title, sub, type) {
|
143
|
+
var notif;
|
144
|
+
type = type != null ? type : type = 'info';
|
145
|
+
notif = Bootstrap.Notification.create({
|
146
|
+
title: title,
|
147
|
+
sub: sub,
|
148
|
+
type: type,
|
149
|
+
closed: false
|
150
|
+
});
|
151
|
+
return this.get('notifications').pushObject(notif);
|
152
|
+
}
|
153
|
+
});
|
154
|
+
|
155
|
+
/*
|
156
|
+
An object that represents a notification to be displayed.
|
157
|
+
*/
|
158
|
+
|
159
|
+
|
160
|
+
Bootstrap.GrowlNotification = Ember.Object.extend();
|
161
|
+
|
162
|
+
}).call(this);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(){Bootstrap.GrowlNotifications=Ember.CollectionView.extend({classNames:["growl-notifications"],contentBinding:"Bootstrap.GNM.notifications",attributeBindings:["style"],showTime:1e4,itemViewClass:Ember.View.extend({classNames:["growl-notification"],template:Ember.Handlebars.compile('<span class="icon"><i class="fa {{unbound view.iconType}}"></i></span>\n<a class="close-notification" {{action "close" target="view"}}>\n <span style="font-size: 15px;"><i class="fa fa-times"></i></span>\n</a>\n<strong>\n {{view.content.title}}\n</strong>\n<p>\n {{view.content.sub}}\n</p>'),classNameBindings:[":growl-notification","content.closed","isOpaque"],attributeBindings:["style"],timeoutId:null,isOpaque:!1,init:function(){var a,b=this;return this._super(),a=function(){return b.notifyPropertyChange("style")},this.set("_recomputeStyle",a),$(window).bind("resize",a)},didInsertElement:function(){var a=this;return this.set("timeoutId",setTimeout(function(){return a.send("close")},this.get("parentView.showTime"))),Ember.run.later(this,function(){return this.set("isOpaque",!0)},1)},willDestroyElement:function(){return $(window).unbind("resize",this.get("_recomputeStyle"))},style:function(){var a,b,c,d,e,f,g,h,i,j;return c=this.get("parentView.content").rejectProperty("closed",!0),b=c.indexOf(this.get("content")),j=$(window).height(),g=80,h=320,i=Math.floor(j/g),a=Math.floor(b/i),e=b%i,-1===b?"":(f=e*g,d=a*h,"top: "+f+"px; right: "+d+"px;")}.property("parentView.content.@each.closed"),iconType:function(){var a,b;return b=this.get("content.type"),a={info:"fa-bullhorn",success:"fa-check",warning:"fa-exclamation",danger:"fa-times"},a[b]||""}.property("content.type"),actions:{close:function(){var a=this;return this.set("isOpaque",!1),setTimeout(function(){return a.get("parentView.content").removeObject(a.get("content")),clearTimeout(a.get("timeoutId"))},300)}}})}),Ember.Handlebars.helper("bs-growl-notifications",Bootstrap.GrowlNotifications),Bootstrap.GNM=Bootstrap.GrowlNotificationManager=Ember.Object.create({notifications:Ember.A(),push:function(a,b,c){var d;return c=null!=c?c:c="info",d=Bootstrap.Notification.create({title:a,sub:b,type:c,closed:!1}),this.get("notifications").pushObject(d)}}),Bootstrap.GrowlNotification=Ember.Object.extend()}.call(this);
|
@@ -0,0 +1,45 @@
|
|
1
|
+
(function() {
|
2
|
+
Bootstrap.ItemsActionBar = Ember.CollectionView.extend({
|
3
|
+
classNames: 'btn-toolbar',
|
4
|
+
classNameBindings: 'rtl:pull-right',
|
5
|
+
role: 'toolbar',
|
6
|
+
selectedItems: [],
|
7
|
+
rtl: false,
|
8
|
+
selection: (function() {
|
9
|
+
var items;
|
10
|
+
items = this.get('selectedItems');
|
11
|
+
if (items == null) {
|
12
|
+
return [];
|
13
|
+
}
|
14
|
+
if (Array.isArray(items)) {
|
15
|
+
return items;
|
16
|
+
} else {
|
17
|
+
return [items];
|
18
|
+
}
|
19
|
+
}).property('selectedItems'),
|
20
|
+
itemViewClass: Ember.CollectionView.extend({
|
21
|
+
tagName: ['div'],
|
22
|
+
classNames: ['btn-group'],
|
23
|
+
itemViewClass: Ember.View.extend({
|
24
|
+
tagName: 'button',
|
25
|
+
classNames: ['btn', 'btn-default'],
|
26
|
+
attributeBindings: ['disabled'],
|
27
|
+
template: Ember.Handlebars.compile(" {{#if view.content.transitionTo}} {{link-to view.content.title view.content.transitionTo tagName='div'}} {{else}} {{view.content.title}} {{/if}} "),
|
28
|
+
disabled: (function() {
|
29
|
+
var _base;
|
30
|
+
return typeof (_base = this.get('content.disabled')) === "function" ? _base(this.get('parentView.parentView.selection')) : void 0;
|
31
|
+
}).property('parentView.parentView.selection.@each', 'parentView.parentView.selection'),
|
32
|
+
click: function() {
|
33
|
+
if (this.get('content.clickActionName') != null) {
|
34
|
+
return this.get('controller').send(this.get('content.clickActionName'), this.get('parentView.parentView.selection'));
|
35
|
+
} else if (this.get('content.click')) {
|
36
|
+
return this.get('content.click')(this.get('parentView.parentView.selection'));
|
37
|
+
}
|
38
|
+
}
|
39
|
+
})
|
40
|
+
})
|
41
|
+
});
|
42
|
+
|
43
|
+
Ember.Handlebars.helper('bs-items-action-bar', Bootstrap.ItemsActionBar);
|
44
|
+
|
45
|
+
}).call(this);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(){Bootstrap.ItemsActionBar=Ember.CollectionView.extend({classNames:"btn-toolbar",classNameBindings:"rtl:pull-right",role:"toolbar",selectedItems:[],rtl:!1,selection:function(){var a;return a=this.get("selectedItems"),null==a?[]:Array.isArray(a)?a:[a]}.property("selectedItems"),itemViewClass:Ember.CollectionView.extend({tagName:["div"],classNames:["btn-group"],itemViewClass:Ember.View.extend({tagName:"button",classNames:["btn","btn-default"],attributeBindings:["disabled"],template:Ember.Handlebars.compile(" {{#if view.content.transitionTo}} {{link-to view.content.title view.content.transitionTo tagName='div'}} {{else}} {{view.content.title}} {{/if}} "),disabled:function(){var a;return"function"==typeof(a=this.get("content.disabled"))?a(this.get("parentView.parentView.selection")):void 0}.property("parentView.parentView.selection.@each","parentView.parentView.selection"),click:function(){return null!=this.get("content.clickActionName")?this.get("controller").send(this.get("content.clickActionName"),this.get("parentView.parentView.selection")):this.get("content.click")?this.get("content.click")(this.get("parentView.parentView.selection")):void 0}})})}),Ember.Handlebars.helper("bs-items-action-bar",Bootstrap.ItemsActionBar)}.call(this);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
(function() {
|
2
|
+
Bootstrap.BsLabelComponent = Ember.Component.extend(Bootstrap.TypeSupport, {
|
3
|
+
layoutName: 'components/bs-label',
|
4
|
+
tagName: 'span',
|
5
|
+
classNames: ['label'],
|
6
|
+
classTypePrefix: 'label'
|
7
|
+
});
|
8
|
+
|
9
|
+
Ember.Handlebars.helper('bs-label', Bootstrap.BsLabelComponent);
|
10
|
+
|
11
|
+
}).call(this);
|
12
|
+
|
13
|
+
this["Ember"] = this["Ember"] || {};
|
14
|
+
this["Ember"]["TEMPLATES"] = this["Ember"]["TEMPLATES"] || {};
|
15
|
+
|
16
|
+
this["Ember"]["TEMPLATES"]["components/bs-label"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
17
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
18
|
+
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
19
|
+
var hashTypes, hashContexts, escapeExpression=this.escapeExpression;
|
20
|
+
|
21
|
+
|
22
|
+
hashTypes = {};
|
23
|
+
hashContexts = {};
|
24
|
+
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "content", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
25
|
+
|
26
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(){Bootstrap.BsLabelComponent=Ember.Component.extend(Bootstrap.TypeSupport,{layoutName:"components/bs-label",tagName:"span",classNames:["label"],classTypePrefix:"label"}),Ember.Handlebars.helper("bs-label",Bootstrap.BsLabelComponent)}.call(this),this.Ember=this.Ember||{},this.Ember.TEMPLATES=this.Ember.TEMPLATES||{},this.Ember.TEMPLATES["components/bs-label"]=Ember.Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,Ember.Handlebars.helpers),e=e||{};var f,g,h=this.escapeExpression;f={},g={},e.buffer.push(h(c._triageMustache.call(b,"content",{hash:{},contexts:[b],types:["ID"],hashContexts:g,hashTypes:f,data:e})))});
|
@@ -0,0 +1,29 @@
|
|
1
|
+
(function() {
|
2
|
+
Bootstrap.BsListGroupComponent = Bootstrap.ItemsView.extend({
|
3
|
+
tagName: 'ul',
|
4
|
+
classNames: ['list-group'],
|
5
|
+
itemViewClass: Bootstrap.ItemView.extend(Bootstrap.ItemSelection, {
|
6
|
+
classNames: ['list-group-item'],
|
7
|
+
template: Ember.Handlebars.compile('{{#if view.badge}}\n {{bs-badge contentBinding="view.badge"}}\n{{/if}}\n{{#if view.sub}}\n <h4 class="list-group-item-heading">{{view.title}}</h4>\n <p class="list-group-item-text">{{view.sub}}</p>\n{{else}}\n {{view.title}}\n{{/if}}'),
|
8
|
+
badge: (function() {
|
9
|
+
var content;
|
10
|
+
content = this.get('content');
|
11
|
+
if (!(Ember.typeOf(content) === 'instance' || Ember.canInvoke(content, 'get'))) {
|
12
|
+
return null;
|
13
|
+
}
|
14
|
+
return content.get('badge');
|
15
|
+
}).property('content'),
|
16
|
+
sub: (function() {
|
17
|
+
var content;
|
18
|
+
content = this.get('content');
|
19
|
+
if (!(Ember.typeOf(content) === 'instance' || Ember.canInvoke(content, 'get'))) {
|
20
|
+
return null;
|
21
|
+
}
|
22
|
+
return content.get('sub');
|
23
|
+
}).property('content')
|
24
|
+
})
|
25
|
+
});
|
26
|
+
|
27
|
+
Ember.Handlebars.helper('bs-list-group', Bootstrap.BsListGroupComponent);
|
28
|
+
|
29
|
+
}).call(this);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(){Bootstrap.BsListGroupComponent=Bootstrap.ItemsView.extend({tagName:"ul",classNames:["list-group"],itemViewClass:Bootstrap.ItemView.extend(Bootstrap.ItemSelection,{classNames:["list-group-item"],template:Ember.Handlebars.compile('{{#if view.badge}}\n {{bs-badge contentBinding="view.badge"}}\n{{/if}}\n{{#if view.sub}}\n <h4 class="list-group-item-heading">{{view.title}}</h4>\n <p class="list-group-item-text">{{view.sub}}</p>\n{{else}}\n {{view.title}}\n{{/if}}'),badge:function(){var a;return a=this.get("content"),"instance"===Ember.typeOf(a)||Ember.canInvoke(a,"get")?a.get("badge"):null}.property("content"),sub:function(){var a;return a=this.get("content"),"instance"===Ember.typeOf(a)||Ember.canInvoke(a,"get")?a.get("sub"):null}.property("content")})}),Ember.Handlebars.helper("bs-list-group",Bootstrap.BsListGroupComponent)}.call(this);
|
@@ -0,0 +1,314 @@
|
|
1
|
+
/*
|
2
|
+
Modal component.
|
3
|
+
*/
|
4
|
+
|
5
|
+
|
6
|
+
(function() {
|
7
|
+
Bootstrap.BsModalComponent = Ember.Component.extend(Ember.Evented, {
|
8
|
+
layoutName: 'components/bs-modal',
|
9
|
+
classNames: ['modal'],
|
10
|
+
attributeBindings: ['role', 'aria-labelledby', 'isAriaHidden:aria-hidden', "ariaLabelledBy:aria-labelledby"],
|
11
|
+
isAriaHidden: (function() {
|
12
|
+
return "" + (this.get('isVisible'));
|
13
|
+
}).property('isVisible'),
|
14
|
+
modalBackdrop: '<div class="modal-backdrop fade in"></div>',
|
15
|
+
role: 'dialog',
|
16
|
+
footerViews: [],
|
17
|
+
backdrop: true,
|
18
|
+
title: null,
|
19
|
+
isVisible: false,
|
20
|
+
manual: false,
|
21
|
+
didInsertElement: function() {
|
22
|
+
var name;
|
23
|
+
this._super();
|
24
|
+
this.setupBinders();
|
25
|
+
name = this.get('name');
|
26
|
+
Ember.assert("Modal name is required for modal view " + (this.get('elementId')), this.get('name'));
|
27
|
+
if (name == null) {
|
28
|
+
name = this.get('elementId');
|
29
|
+
}
|
30
|
+
Bootstrap.ModalManager.add(name, this);
|
31
|
+
if (this.manual) {
|
32
|
+
return this.show();
|
33
|
+
}
|
34
|
+
},
|
35
|
+
becameVisible: function() {
|
36
|
+
if (this.get("backdrop")) {
|
37
|
+
return this.appendBackdrop();
|
38
|
+
}
|
39
|
+
},
|
40
|
+
becameHidden: function() {
|
41
|
+
if (this._backdrop) {
|
42
|
+
return this._backdrop.remove();
|
43
|
+
}
|
44
|
+
},
|
45
|
+
appendBackdrop: function() {
|
46
|
+
var parentElement;
|
47
|
+
parentElement = this.$().parent();
|
48
|
+
return this._backdrop = Em.$(this.modalBackdrop).appendTo(parentElement);
|
49
|
+
},
|
50
|
+
show: function() {
|
51
|
+
return this.set('isVisible', true);
|
52
|
+
},
|
53
|
+
hide: function() {
|
54
|
+
return this.set('isVisible', false);
|
55
|
+
},
|
56
|
+
toggle: function() {
|
57
|
+
return this.toggleProperty('isVisible');
|
58
|
+
},
|
59
|
+
click: function(event) {
|
60
|
+
var target, targetDismiss;
|
61
|
+
target = event.target;
|
62
|
+
targetDismiss = target.getAttribute("data-dismiss");
|
63
|
+
if (targetDismiss === 'modal') {
|
64
|
+
return this.close();
|
65
|
+
}
|
66
|
+
},
|
67
|
+
keyPressed: function(event) {
|
68
|
+
if (event.keyCode === 27) {
|
69
|
+
return this.close(event);
|
70
|
+
}
|
71
|
+
},
|
72
|
+
close: function(event) {
|
73
|
+
if (this.get('manual')) {
|
74
|
+
this.destroy();
|
75
|
+
} else {
|
76
|
+
this.hide();
|
77
|
+
}
|
78
|
+
return this.trigger('closed');
|
79
|
+
},
|
80
|
+
willDestroyElement: function() {
|
81
|
+
var name;
|
82
|
+
this.removeHandlers();
|
83
|
+
name = this.get('name');
|
84
|
+
if (name == null) {
|
85
|
+
name = this.get('elementId');
|
86
|
+
}
|
87
|
+
Bootstrap.ModalManager.remove(name, this);
|
88
|
+
if (this._backdrop) {
|
89
|
+
return this._backdrop.remove();
|
90
|
+
}
|
91
|
+
},
|
92
|
+
removeHandlers: function() {
|
93
|
+
return jQuery(window.document).unbind("keyup", this._keyUpHandler);
|
94
|
+
},
|
95
|
+
setupBinders: function() {
|
96
|
+
var handler,
|
97
|
+
_this = this;
|
98
|
+
handler = function(event) {
|
99
|
+
return _this.keyPressed(event);
|
100
|
+
};
|
101
|
+
jQuery(window.document).bind("keyup", handler);
|
102
|
+
return this._keyUpHandler = handler;
|
103
|
+
}
|
104
|
+
});
|
105
|
+
|
106
|
+
/*
|
107
|
+
Bootstrap.BsModalComponent = Bootstrap.BsModalComponent.reopenClass(
|
108
|
+
build: (options) ->
|
109
|
+
options = {} unless options
|
110
|
+
options.manual = true
|
111
|
+
modalPane = @create(options)
|
112
|
+
modalPane.append()
|
113
|
+
)
|
114
|
+
*/
|
115
|
+
|
116
|
+
|
117
|
+
Bootstrap.ModalManager = Ember.Object.create({
|
118
|
+
add: function(name, modalInstance) {
|
119
|
+
return this.set(name, modalInstance);
|
120
|
+
},
|
121
|
+
register: function(name, modalInstance) {
|
122
|
+
this.add(name, modalInstance);
|
123
|
+
return modalInstance.appendTo(modalInstance.get('targetObject').namespace.rootElement);
|
124
|
+
},
|
125
|
+
remove: function(name) {
|
126
|
+
return this.set(name, null);
|
127
|
+
},
|
128
|
+
close: function(name) {
|
129
|
+
return this.get(name).close();
|
130
|
+
},
|
131
|
+
hide: function(name) {
|
132
|
+
return this.get(name).hide();
|
133
|
+
},
|
134
|
+
show: function(name) {
|
135
|
+
return this.get(name).show();
|
136
|
+
},
|
137
|
+
toggle: function(name) {
|
138
|
+
return this.get(name).toggle();
|
139
|
+
},
|
140
|
+
confirm: function(controller, title, message, confirmButtonTitle, cancelButtonTitle) {
|
141
|
+
var body, buttons;
|
142
|
+
if (confirmButtonTitle == null) {
|
143
|
+
confirmButtonTitle = "Confirm";
|
144
|
+
}
|
145
|
+
if (cancelButtonTitle == null) {
|
146
|
+
cancelButtonTitle = "Cancel";
|
147
|
+
}
|
148
|
+
body = Ember.View.extend({
|
149
|
+
template: Ember.Handlebars.compile(message || "Are you sure you would like to perform this action?")
|
150
|
+
});
|
151
|
+
buttons = [
|
152
|
+
Ember.Object.create({
|
153
|
+
title: confirmButtonTitle,
|
154
|
+
clicked: "modalConfirmed",
|
155
|
+
dismiss: 'modal'
|
156
|
+
}), Ember.Object.create({
|
157
|
+
title: cancelButtonTitle,
|
158
|
+
clicked: "modalCanceled",
|
159
|
+
dismiss: 'modal'
|
160
|
+
})
|
161
|
+
];
|
162
|
+
return this.open('confirm-modal', title || 'Confirmation required!', body, buttons, controller);
|
163
|
+
},
|
164
|
+
openModal: function(modalView, options) {
|
165
|
+
var instance, rootElement;
|
166
|
+
if (options == null) {
|
167
|
+
options = {};
|
168
|
+
}
|
169
|
+
rootElement = options.rootElement || '.ember-application';
|
170
|
+
instance = modalView.create(options);
|
171
|
+
return instance.appendTo(rootElement);
|
172
|
+
},
|
173
|
+
open: function(name, title, view, footerButtons, controller) {
|
174
|
+
var cl, modalComponent, template;
|
175
|
+
cl = controller.container.lookup('component-lookup:main');
|
176
|
+
modalComponent = cl.lookupFactory('bs-modal', controller.get('container')).create();
|
177
|
+
modalComponent.setProperties({
|
178
|
+
name: name,
|
179
|
+
title: title,
|
180
|
+
manual: true,
|
181
|
+
footerButtons: footerButtons,
|
182
|
+
targetObject: controller
|
183
|
+
});
|
184
|
+
if (Ember.typeOf(view) === 'string') {
|
185
|
+
template = controller.container.lookup("template:" + view);
|
186
|
+
Ember.assert("Template " + view + " was specified for Modal but template could not be found.", template);
|
187
|
+
if (template) {
|
188
|
+
modalComponent.setProperties({
|
189
|
+
body: Ember.View.extend({
|
190
|
+
template: template,
|
191
|
+
controller: controller
|
192
|
+
})
|
193
|
+
});
|
194
|
+
}
|
195
|
+
} else if (Ember.typeOf(view) === 'class') {
|
196
|
+
modalComponent.setProperties({
|
197
|
+
body: view,
|
198
|
+
controller: controller
|
199
|
+
});
|
200
|
+
}
|
201
|
+
return modalComponent.appendTo(controller.namespace.rootElement);
|
202
|
+
}
|
203
|
+
});
|
204
|
+
|
205
|
+
Ember.Application.initializer({
|
206
|
+
name: 'bs-modal',
|
207
|
+
initialize: function(container, application) {
|
208
|
+
return container.register('component:bs-modal', Bootstrap.BsModalComponent);
|
209
|
+
}
|
210
|
+
});
|
211
|
+
|
212
|
+
}).call(this);
|
213
|
+
|
214
|
+
this["Ember"] = this["Ember"] || {};
|
215
|
+
this["Ember"]["TEMPLATES"] = this["Ember"]["TEMPLATES"] || {};
|
216
|
+
|
217
|
+
this["Ember"]["TEMPLATES"]["components/bs-modal"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
218
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
219
|
+
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
220
|
+
var buffer = '', stack1, hashTypes, hashContexts, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;
|
221
|
+
|
222
|
+
function program1(depth0,data) {
|
223
|
+
|
224
|
+
var buffer = '', stack1, hashContexts, hashTypes, options;
|
225
|
+
data.buffer.push("\n <i ");
|
226
|
+
hashContexts = {'class': depth0};
|
227
|
+
hashTypes = {'class': "STRING"};
|
228
|
+
options = {hash:{
|
229
|
+
'class': ("titleIconClasses")
|
230
|
+
},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};
|
231
|
+
data.buffer.push(escapeExpression(((stack1 = helpers['bind-attr'] || depth0['bind-attr']),stack1 ? stack1.call(depth0, options) : helperMissing.call(depth0, "bind-attr", options))));
|
232
|
+
data.buffer.push("></i>\n ");
|
233
|
+
return buffer;
|
234
|
+
}
|
235
|
+
|
236
|
+
function program3(depth0,data) {
|
237
|
+
|
238
|
+
var buffer = '', hashTypes, hashContexts;
|
239
|
+
data.buffer.push("\n ");
|
240
|
+
hashTypes = {};
|
241
|
+
hashContexts = {};
|
242
|
+
data.buffer.push(escapeExpression(helpers.view.call(depth0, "view.body", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
243
|
+
data.buffer.push("\n ");
|
244
|
+
return buffer;
|
245
|
+
}
|
246
|
+
|
247
|
+
function program5(depth0,data) {
|
248
|
+
|
249
|
+
var buffer = '', hashTypes, hashContexts;
|
250
|
+
data.buffer.push("\n ");
|
251
|
+
hashTypes = {};
|
252
|
+
hashContexts = {};
|
253
|
+
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
254
|
+
data.buffer.push("\n ");
|
255
|
+
return buffer;
|
256
|
+
}
|
257
|
+
|
258
|
+
function program7(depth0,data) {
|
259
|
+
|
260
|
+
var buffer = '', stack1, hashContexts, hashTypes, options;
|
261
|
+
data.buffer.push("\n ");
|
262
|
+
hashContexts = {'content': depth0,'targetObjectBinding': depth0};
|
263
|
+
hashTypes = {'content': "ID",'targetObjectBinding': "STRING"};
|
264
|
+
options = {hash:{
|
265
|
+
'content': (""),
|
266
|
+
'targetObjectBinding': ("view.targetObject")
|
267
|
+
},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};
|
268
|
+
data.buffer.push(escapeExpression(((stack1 = helpers['bs-button'] || depth0['bs-button']),stack1 ? stack1.call(depth0, options) : helperMissing.call(depth0, "bs-button", options))));
|
269
|
+
data.buffer.push("\n ");
|
270
|
+
return buffer;
|
271
|
+
}
|
272
|
+
|
273
|
+
function program9(depth0,data) {
|
274
|
+
|
275
|
+
var buffer = '', hashTypes, hashContexts;
|
276
|
+
data.buffer.push("\n ");
|
277
|
+
hashTypes = {};
|
278
|
+
hashContexts = {};
|
279
|
+
data.buffer.push(escapeExpression(helpers.view.call(depth0, "", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
280
|
+
data.buffer.push("\n ");
|
281
|
+
return buffer;
|
282
|
+
}
|
283
|
+
|
284
|
+
data.buffer.push("<div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h4 class=\"modal-title\">\n ");
|
285
|
+
hashTypes = {};
|
286
|
+
hashContexts = {};
|
287
|
+
stack1 = helpers['if'].call(depth0, "titleIconClasses", {hash:{},inverse:self.noop,fn:self.program(1, program1, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
288
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
289
|
+
data.buffer.push("\n ");
|
290
|
+
hashContexts = {'unescaped': depth0};
|
291
|
+
hashTypes = {'unescaped': "STRING"};
|
292
|
+
stack1 = helpers._triageMustache.call(depth0, "title", {hash:{
|
293
|
+
'unescaped': ("true")
|
294
|
+
},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
295
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
296
|
+
data.buffer.push("\n </h4>\n </div>\n <div class=\"modal-body\">\n ");
|
297
|
+
hashTypes = {};
|
298
|
+
hashContexts = {};
|
299
|
+
stack1 = helpers['if'].call(depth0, "body", {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
300
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
301
|
+
data.buffer.push("\n </div>\n <div class=\"modal-footer\">\n ");
|
302
|
+
hashTypes = {};
|
303
|
+
hashContexts = {};
|
304
|
+
stack1 = helpers.each.call(depth0, "footerButtons", {hash:{},inverse:self.noop,fn:self.program(7, program7, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
305
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
306
|
+
data.buffer.push("\n ");
|
307
|
+
hashTypes = {};
|
308
|
+
hashContexts = {};
|
309
|
+
stack1 = helpers.each.call(depth0, "footerViews", {hash:{},inverse:self.noop,fn:self.program(9, program9, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
310
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
311
|
+
data.buffer.push("\n </div>\n </div>\n</div>");
|
312
|
+
return buffer;
|
313
|
+
|
314
|
+
});
|