Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't bundle dist

  • Loading branch information...
commit f42ce7a824d4d60278551f88a09b39aca4991cf9 1 parent ce0a746
@josepjaume josepjaume authored
View
1  .gitignore
@@ -2,6 +2,7 @@ bin/
.bundle
tmp/
tests/source/
+dist/
.DS_Store
.project
View
1  dist/ember-forms-spade.js
0 additions, 1 deletion not shown
View
259 dist/ember-forms.js
@@ -1,259 +0,0 @@
-(function() {
-window.EF = Ember.Namespace.create({
- findFormRecursively: function(view){
- var currentView = view;
- do{
- if(currentView.get('isForm') === true){ return currentView; }
- }while(currentView = view.get('parentView'));
- },
-
- findFieldRecursively: function(view){
- var currentView = view;
- do{
- if(currentView.get('isField') === true){ return currentView; }
- }while(currentView = view.get('parentView'));
- },
-
- findField: function(name){
- name = name || 'text';
- var fieldName = Ember.String.camelize(name);
- fieldName = fieldName.replace(/^./, fieldName[0].toUpperCase());
- fieldName = fieldName + 'Field';
- var field = EF[fieldName];
- if(field){
- return field;
- }else{
- throw 'Field ' + name + ' cannot be found';
- }
- }
-});
-
-})();
-
-
-
-(function() {
-var findFieldRecursively = EF.findFieldRecursively;
-
-EF.Label = Ember.View.extend({
- tagName: 'label',
- field: Ember.computed(function(){
- return findFieldRecursively(this);
- }),
- attributeBindings: ['for'],
- formBinding: 'field.form',
- name: Ember.computed(function(){
- return this.getPath('field.label') || this.getPath('field.name');
- }),
- nameBinding: 'field.label',
- template: Ember.Handlebars.compile("{{view.name}}"),
- didInsertElement: function(){
- // We bind it here to avoid re-rendering before the element was inserted
- Ember.bind(this, 'for', 'component.inputView.elementId');
- }
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively;
-
-EF.BaseField = Ember.View.extend({
- name: null,
- formView: null,
- tagName: 'div',
- classNames: ['input'],
- LabelView: EF.Label.extend(),
- InputView: null,
- value: null,
- isField: true,
-
- template: Ember.Handlebars.compile(
- '{{view view.LabelView viewName="labelView"}}' +
- '{{view view.InputView viewName="inputView" fieldBinding="view" ' +
- ' valueBinding="view.value" nameBinding="view.name"}}'
- ),
-
- setFormView: function(){
- var parentView, formView;
-
- if(parentView = this.get('parentView')){
- formView = findFormRecursively(parentView);
- }
- if(formView){
- formView.get('fieldViews').pushObject(this);
- this.set('formView', formView);
- this.set('content', formView.get('content'));
- }
- },
-
- bindValue: function(){
- Ember.oneWay(this, 'value', 'content.' + this.get('name'));
- },
-
- data: Ember.computed(function(){
- var data = {};
- data[this.get('name')] = this.get('value');
- return data;
- }).property('value'),
-
- init: function(){
- this._super();
- this.setFormView();
- this.bindValue();
- }
-});
-
-})();
-
-
-
-(function() {
-EF.TextField = EF.BaseField.extend({
- InputView: Ember.TextField.extend({
- attributeBindings: ['name']
- })
-});
-
-})();
-
-
-
-(function() {
-EF.TextareaField = EF.BaseField.extend({
- InputView: Ember.TextArea.extend({
- template: Ember.Handlebars.compile("{{view.value}}")
- })
-});
-
-})();
-
-
-
-(function() {
-EF.SelectField = EF.BaseField.extend({
- optionLabelPath: 'content.name',
- optionValuePath: 'content.id',
- InputView: Ember.Select.extend({
- init: function(){
- this.set('optionLabelPath', this.getPath('parentView.optionLabelPath'));
- this.set('optionValuePath', this.getPath('parentView.optionValuePath'));
- this._super();
- },
- contentBinding: 'field.content'
- })
-});
-
-})();
-
-
-
-(function() {
-/*
- * Usage:
- */
-EF.Form = Ember.View.extend({
- tagName: 'form',
- attributeBindings: ['action'],
- fieldViews: Ember.A(),
- buttons: ['submit'],
- content: null,
- isForm: true,
-
- data: Ember.computed(function(){
- var data = {};
- this.get('fieldViews').forEach(function(field){
- var fieldData = field.get('data');
- for(var key in fieldData){
- data[key] = fieldData[key];
- }
- });
- return data;
- }).property('fieldViews.@each.value'),
-
- submit: function(){
- this.save(this.get('data'));
- return false;
- },
-
- save: function(data){ }
-});
-
-})();
-
-
-
-(function() {
-EF.SubmitButton = Ember.View.extend({
- tagName: 'button',
- attributeBindings: ['type'],
- type: 'submit',
- name: "Save",
- template: Ember.Handlebars.compile("{{view.name}}")
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively,
- findField = EF.findField;
-
-EF.ButtonHelper = Ember.Object.create({
- helper: function(view, options){
- var buttonView = EF.SubmitButton;
- var currentView = options.data.view;
- currentView.appendChild(buttonView, options.hash);
- }
-});
-
-Ember.Handlebars.registerHelper('form', function(name, options){
- if(name === 'buttons'){
- EF.ButtonHelper.helper(this, options);
- }else{
- throw "Unknown " + name + " in form helper";
- }
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively,
- findField = EF.findField;
-
-EF.FieldHelper = Ember.Object.create({
- helper: function(view, name, options){
- var optionsHash = options.hash,
- type = optionsHash.as,
- currentView = options.data.view,
- fieldView = findField(type);
-
- if(Ember.empty(optionsHash.name)){ optionsHash.name = name; }
- delete(optionsHash.as);
- currentView.appendChild(fieldView, optionsHash);
- }
-});
-
-Ember.Handlebars.registerHelper('field', function(name, options){
- EF.FieldHelper.helper(this, name, options);
-});
-
-})();
-
-
-
-(function() {
-
-})();
-
-
-
-(function() {
-
-})();
-
View
9 dist/ember-forms.min.js
@@ -1,9 +0,0 @@
-// ==========================================================================
-// Project: Ember Form
-// Copyright: ©2012 Josep Jaume Rey and Contributors
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-
-
-(function(){window.EF=Ember.Namespace.create({findFormRecursively:function(a){var b=a;do if(b.get("isForm")===!0)return b;while(b=a.get("parentView"))},findFieldRecursively:function(a){var b=a;do if(b.get("isField")===!0)return b;while(b=a.get("parentView"))},findField:function(a){a=a||"text";var b=Ember.String.camelize(a);b=b.replace(/^./,b[0].toUpperCase()),b+="Field";var c=EF[b];if(c)return c;throw"Field "+a+" cannot be found"}})})(),function(){var a=EF.findFieldRecursively;EF.Label=Ember.View.extend({tagName:"label",field:Ember.computed(function(){return a(this)}),attributeBindings:["for"],formBinding:"field.form",name:Ember.computed(function(){return this.getPath("field.label")||this.getPath("field.name")}),nameBinding:"field.label",template:Ember.Handlebars.compile("{{view.name}}"),didInsertElement:function(){Ember.bind(this,"for","component.inputView.elementId")}})}(),function(){var a=EF.findFormRecursively;EF.BaseField=Ember.View.extend({name:null,formView:null,tagName:"div",classNames:["input"],LabelView:EF.Label.extend(),InputView:null,value:null,isField:!0,template:Ember.Handlebars.compile('{{view view.LabelView viewName="labelView"}}{{view view.InputView viewName="inputView" fieldBinding="view" valueBinding="view.value" nameBinding="view.name"}}'),setFormView:function(){var b,c;if(b=this.get("parentView"))c=a(b);c&&(c.get("fieldViews").pushObject(this),this.set("formView",c),this.set("content",c.get("content")))},bindValue:function(){Ember.oneWay(this,"value","content."+this.get("name"))},data:Ember.computed(function(){var a={};return a[this.get("name")]=this.get("value"),a}).property("value"),init:function(){this._super(),this.setFormView(),this.bindValue()}})}(),function(){EF.TextField=EF.BaseField.extend({InputView:Ember.TextField.extend({attributeBindings:["name"]})})}(),function(){EF.TextareaField=EF.BaseField.extend({InputView:Ember.TextArea.extend({template:Ember.Handlebars.compile("{{view.value}}")})})}(),function(){EF.SelectField=EF.BaseField.extend({optionLabelPath:"content.name",optionValuePath:"content.id",InputView:Ember.Select.extend({init:function(){this.set("optionLabelPath",this.getPath("parentView.optionLabelPath")),this.set("optionValuePath",this.getPath("parentView.optionValuePath")),this._super()},contentBinding:"field.content"})})}(),function(){EF.Form=Ember.View.extend({tagName:"form",attributeBindings:["action"],fieldViews:Ember.A(),buttons:["submit"],content:null,isForm:!0,data:Ember.computed(function(){var a={};return this.get("fieldViews").forEach(function(b){var c=b.get("data");for(var d in c)a[d]=c[d]}),a}).property("fieldViews.@each.value"),submit:function(){return this.save(this.get("data")),!1},save:function(a){}})}(),function(){EF.SubmitButton=Ember.View.extend({tagName:"button",attributeBindings:["type"],type:"submit",name:"Save",template:Ember.Handlebars.compile("{{view.name}}")})}(),function(){var a=EF.findFormRecursively,b=EF.findField;EF.ButtonHelper=Ember.Object.create({helper:function(a,b){var c=EF.SubmitButton,d=b.data.view;d.appendChild(c,b.hash)}}),Ember.Handlebars.registerHelper("form",function(a,b){if(a==="buttons")EF.ButtonHelper.helper(this,b);else throw"Unknown "+a+" in form helper"})}(),function(){var a=EF.findFormRecursively,b=EF.findField;EF.FieldHelper=Ember.Object.create({helper:function(a,c,d){var e=d.hash,f=e.as,g=d.data.view,h=b(f);Ember.empty(e.name)&&(e.name=c),delete e.as,g.appendChild(h,e)}}),Ember.Handlebars.registerHelper("field",function(a,b){EF.FieldHelper.helper(this,a,b)})}(),function(){}(),function(){}()
View
259 dist/ember-forms.prod.js
@@ -1,259 +0,0 @@
-(function() {
-window.EF = Ember.Namespace.create({
- findFormRecursively: function(view){
- var currentView = view;
- do{
- if(currentView.get('isForm') === true){ return currentView; }
- }while(currentView = view.get('parentView'));
- },
-
- findFieldRecursively: function(view){
- var currentView = view;
- do{
- if(currentView.get('isField') === true){ return currentView; }
- }while(currentView = view.get('parentView'));
- },
-
- findField: function(name){
- name = name || 'text';
- var fieldName = Ember.String.camelize(name);
- fieldName = fieldName.replace(/^./, fieldName[0].toUpperCase());
- fieldName = fieldName + 'Field';
- var field = EF[fieldName];
- if(field){
- return field;
- }else{
- throw 'Field ' + name + ' cannot be found';
- }
- }
-});
-
-})();
-
-
-
-(function() {
-var findFieldRecursively = EF.findFieldRecursively;
-
-EF.Label = Ember.View.extend({
- tagName: 'label',
- field: Ember.computed(function(){
- return findFieldRecursively(this);
- }),
- attributeBindings: ['for'],
- formBinding: 'field.form',
- name: Ember.computed(function(){
- return this.getPath('field.label') || this.getPath('field.name');
- }),
- nameBinding: 'field.label',
- template: Ember.Handlebars.compile("{{view.name}}"),
- didInsertElement: function(){
- // We bind it here to avoid re-rendering before the element was inserted
- Ember.bind(this, 'for', 'component.inputView.elementId');
- }
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively;
-
-EF.BaseField = Ember.View.extend({
- name: null,
- formView: null,
- tagName: 'div',
- classNames: ['input'],
- LabelView: EF.Label.extend(),
- InputView: null,
- value: null,
- isField: true,
-
- template: Ember.Handlebars.compile(
- '{{view view.LabelView viewName="labelView"}}' +
- '{{view view.InputView viewName="inputView" fieldBinding="view" ' +
- ' valueBinding="view.value" nameBinding="view.name"}}'
- ),
-
- setFormView: function(){
- var parentView, formView;
-
- if(parentView = this.get('parentView')){
- formView = findFormRecursively(parentView);
- }
- if(formView){
- formView.get('fieldViews').pushObject(this);
- this.set('formView', formView);
- this.set('content', formView.get('content'));
- }
- },
-
- bindValue: function(){
- Ember.oneWay(this, 'value', 'content.' + this.get('name'));
- },
-
- data: Ember.computed(function(){
- var data = {};
- data[this.get('name')] = this.get('value');
- return data;
- }).property('value'),
-
- init: function(){
- this._super();
- this.setFormView();
- this.bindValue();
- }
-});
-
-})();
-
-
-
-(function() {
-EF.TextField = EF.BaseField.extend({
- InputView: Ember.TextField.extend({
- attributeBindings: ['name']
- })
-});
-
-})();
-
-
-
-(function() {
-EF.TextareaField = EF.BaseField.extend({
- InputView: Ember.TextArea.extend({
- template: Ember.Handlebars.compile("{{view.value}}")
- })
-});
-
-})();
-
-
-
-(function() {
-EF.SelectField = EF.BaseField.extend({
- optionLabelPath: 'content.name',
- optionValuePath: 'content.id',
- InputView: Ember.Select.extend({
- init: function(){
- this.set('optionLabelPath', this.getPath('parentView.optionLabelPath'));
- this.set('optionValuePath', this.getPath('parentView.optionValuePath'));
- this._super();
- },
- contentBinding: 'field.content'
- })
-});
-
-})();
-
-
-
-(function() {
-/*
- * Usage:
- */
-EF.Form = Ember.View.extend({
- tagName: 'form',
- attributeBindings: ['action'],
- fieldViews: Ember.A(),
- buttons: ['submit'],
- content: null,
- isForm: true,
-
- data: Ember.computed(function(){
- var data = {};
- this.get('fieldViews').forEach(function(field){
- var fieldData = field.get('data');
- for(var key in fieldData){
- data[key] = fieldData[key];
- }
- });
- return data;
- }).property('fieldViews.@each.value'),
-
- submit: function(){
- this.save(this.get('data'));
- return false;
- },
-
- save: function(data){ }
-});
-
-})();
-
-
-
-(function() {
-EF.SubmitButton = Ember.View.extend({
- tagName: 'button',
- attributeBindings: ['type'],
- type: 'submit',
- name: "Save",
- template: Ember.Handlebars.compile("{{view.name}}")
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively,
- findField = EF.findField;
-
-EF.ButtonHelper = Ember.Object.create({
- helper: function(view, options){
- var buttonView = EF.SubmitButton;
- var currentView = options.data.view;
- currentView.appendChild(buttonView, options.hash);
- }
-});
-
-Ember.Handlebars.registerHelper('form', function(name, options){
- if(name === 'buttons'){
- EF.ButtonHelper.helper(this, options);
- }else{
- throw "Unknown " + name + " in form helper";
- }
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively,
- findField = EF.findField;
-
-EF.FieldHelper = Ember.Object.create({
- helper: function(view, name, options){
- var optionsHash = options.hash,
- type = optionsHash.as,
- currentView = options.data.view,
- fieldView = findField(type);
-
- if(Ember.empty(optionsHash.name)){ optionsHash.name = name; }
- delete(optionsHash.as);
- currentView.appendChild(fieldView, optionsHash);
- }
-});
-
-Ember.Handlebars.registerHelper('field', function(name, options){
- EF.FieldHelper.helper(this, name, options);
-});
-
-})();
-
-
-
-(function() {
-
-})();
-
-
-
-(function() {
-
-})();
-
View
259 dist/modules/ember-forms.js
@@ -1,259 +0,0 @@
-(function() {
-window.EF = Ember.Namespace.create({
- findFormRecursively: function(view){
- var currentView = view;
- do{
- if(currentView.get('isForm') === true){ return currentView; }
- }while(currentView = view.get('parentView'));
- },
-
- findFieldRecursively: function(view){
- var currentView = view;
- do{
- if(currentView.get('isField') === true){ return currentView; }
- }while(currentView = view.get('parentView'));
- },
-
- findField: function(name){
- name = name || 'text';
- var fieldName = Ember.String.camelize(name);
- fieldName = fieldName.replace(/^./, fieldName[0].toUpperCase());
- fieldName = fieldName + 'Field';
- var field = EF[fieldName];
- if(field){
- return field;
- }else{
- throw 'Field ' + name + ' cannot be found';
- }
- }
-});
-
-})();
-
-
-
-(function() {
-var findFieldRecursively = EF.findFieldRecursively;
-
-EF.Label = Ember.View.extend({
- tagName: 'label',
- field: Ember.computed(function(){
- return findFieldRecursively(this);
- }),
- attributeBindings: ['for'],
- formBinding: 'field.form',
- name: Ember.computed(function(){
- return this.getPath('field.label') || this.getPath('field.name');
- }),
- nameBinding: 'field.label',
- template: Ember.Handlebars.compile("{{view.name}}"),
- didInsertElement: function(){
- // We bind it here to avoid re-rendering before the element was inserted
- Ember.bind(this, 'for', 'component.inputView.elementId');
- }
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively;
-
-EF.BaseField = Ember.View.extend({
- name: null,
- formView: null,
- tagName: 'div',
- classNames: ['input'],
- LabelView: EF.Label.extend(),
- InputView: null,
- value: null,
- isField: true,
-
- template: Ember.Handlebars.compile(
- '{{view view.LabelView viewName="labelView"}}' +
- '{{view view.InputView viewName="inputView" fieldBinding="view" ' +
- ' valueBinding="view.value" nameBinding="view.name"}}'
- ),
-
- setFormView: function(){
- var parentView, formView;
-
- if(parentView = this.get('parentView')){
- formView = findFormRecursively(parentView);
- }
- if(formView){
- formView.get('fieldViews').pushObject(this);
- this.set('formView', formView);
- this.set('content', formView.get('content'));
- }
- },
-
- bindValue: function(){
- Ember.oneWay(this, 'value', 'content.' + this.get('name'));
- },
-
- data: Ember.computed(function(){
- var data = {};
- data[this.get('name')] = this.get('value');
- return data;
- }).property('value'),
-
- init: function(){
- this._super();
- this.setFormView();
- this.bindValue();
- }
-});
-
-})();
-
-
-
-(function() {
-EF.TextField = EF.BaseField.extend({
- InputView: Ember.TextField.extend({
- attributeBindings: ['name']
- })
-});
-
-})();
-
-
-
-(function() {
-EF.TextareaField = EF.BaseField.extend({
- InputView: Ember.TextArea.extend({
- template: Ember.Handlebars.compile("{{view.value}}")
- })
-});
-
-})();
-
-
-
-(function() {
-EF.SelectField = EF.BaseField.extend({
- optionLabelPath: 'content.name',
- optionValuePath: 'content.id',
- InputView: Ember.Select.extend({
- init: function(){
- this.set('optionLabelPath', this.getPath('parentView.optionLabelPath'));
- this.set('optionValuePath', this.getPath('parentView.optionValuePath'));
- this._super();
- },
- contentBinding: 'field.content'
- })
-});
-
-})();
-
-
-
-(function() {
-/*
- * Usage:
- */
-EF.Form = Ember.View.extend({
- tagName: 'form',
- attributeBindings: ['action'],
- fieldViews: Ember.A(),
- buttons: ['submit'],
- content: null,
- isForm: true,
-
- data: Ember.computed(function(){
- var data = {};
- this.get('fieldViews').forEach(function(field){
- var fieldData = field.get('data');
- for(var key in fieldData){
- data[key] = fieldData[key];
- }
- });
- return data;
- }).property('fieldViews.@each.value'),
-
- submit: function(){
- this.save(this.get('data'));
- return false;
- },
-
- save: function(data){ }
-});
-
-})();
-
-
-
-(function() {
-EF.SubmitButton = Ember.View.extend({
- tagName: 'button',
- attributeBindings: ['type'],
- type: 'submit',
- name: "Save",
- template: Ember.Handlebars.compile("{{view.name}}")
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively,
- findField = EF.findField;
-
-EF.ButtonHelper = Ember.Object.create({
- helper: function(view, options){
- var buttonView = EF.SubmitButton;
- var currentView = options.data.view;
- currentView.appendChild(buttonView, options.hash);
- }
-});
-
-Ember.Handlebars.registerHelper('form', function(name, options){
- if(name === 'buttons'){
- EF.ButtonHelper.helper(this, options);
- }else{
- throw "Unknown " + name + " in form helper";
- }
-});
-
-})();
-
-
-
-(function() {
-var findFormRecursively = EF.findFormRecursively,
- findField = EF.findField;
-
-EF.FieldHelper = Ember.Object.create({
- helper: function(view, name, options){
- var optionsHash = options.hash,
- type = optionsHash.as,
- currentView = options.data.view,
- fieldView = findField(type);
-
- if(Ember.empty(optionsHash.name)){ optionsHash.name = name; }
- delete(optionsHash.as);
- currentView.appendChild(fieldView, optionsHash);
- }
-});
-
-Ember.Handlebars.registerHelper('field', function(name, options){
- EF.FieldHelper.helper(this, name, options);
-});
-
-})();
-
-
-
-(function() {
-
-})();
-
-
-
-(function() {
-
-})();
-
View
19,225 dist/modules/ember.js
0 additions, 19,225 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.