First commit

This commit is contained in:
Theodotos Andreou 2018-01-14 13:10:16 +00:00
commit c6e2478c40
13918 changed files with 2303184 additions and 0 deletions

View file

@ -0,0 +1,43 @@
/* Date */
.bbf-date .bbf-date {
width: 4em
}
.bbf-date .bbf-month {
width: 9em;
}
.bbf-date .bbf-year {
width: 5em;
}
/* DateTime */
.bbf-datetime select {
width: 4em;
}
/* List */
.bbf-list .bbf-add {
margin-top: -10px
}
.bbf-list li {
margin-bottom: 5px
}
.bbf-list .bbf-del {
margin-left: 4px
}
/* List.Modal */
.bbf-list-modal {
cursor: pointer;
border: 1px solid #ccc;
width: 208px;
border-radius: 3px;
padding: 4px;
color: #555;
}

View file

@ -0,0 +1,95 @@
/**
* Include this file _after_ the main backbone-forms file to override the default templates.
* You only need to include templates you want to override.
*
* Requirements when customising templates:
* - Each template must have one 'parent' element tag.
* - "data-type" attributes are required.
* - The main placeholder tags such as the following are required: fieldsets, fields
*/
;(function() {
var Form = Backbone.Form;
//TWITTER BOOTSTRAP TEMPLATES
//Requires Bootstrap 2.x
Form.setTemplates({
//HTML
form: '\
<form class="form-horizontal">{{fieldsets}}</form>\
',
fieldset: '\
<fieldset>\
<legend>{{legend}}</legend>\
{{fields}}\
</fieldset>\
',
field: '\
<div class="control-group field-{{key}}">\
<label class="control-label" for="{{id}}">{{title}}</label>\
<div class="controls">\
{{editor}}\
<div class="help-inline">{{error}}</div>\
<div class="help-block">{{help}}</div>\
</div>\
</div>\
',
nestedField: '\
<div class="field-{{key}}">\
<div title="{{title}}" class="input-xlarge">{{editor}}\
<div class="help-inline">{{error}}</div>\
</div>\
<div class="help-block">{{help}}</div>\
</div>\
',
list: '\
<div class="bbf-list">\
<ul class="unstyled clearfix">{{items}}</ul>\
<button class="btn bbf-add" data-action="add">Add</button>\
</div>\
',
listItem: '\
<li class="clearfix">\
<div class="pull-left">{{editor}}</div>\
<button type="button" class="btn bbf-del" data-action="remove">&times;</button>\
</li>\
',
date: '\
<div class="bbf-date">\
<select data-type="date" class="bbf-date">{{dates}}</select>\
<select data-type="month" class="bbf-month">{{months}}</select>\
<select data-type="year" class="bbf-year">{{years}}</select>\
</div>\
',
dateTime: '\
<div class="bbf-datetime">\
<p>{{date}}</p>\
<p>\
<select data-type="hour" style="width: 4em">{{hours}}</select>\
:\
<select data-type="min" style="width: 4em">{{mins}}</select>\
</p>\
</div>\
',
'list.Modal': '\
<div class="bbf-list-modal">\
{{summary}}\
</div>\
'
}, {
//CLASSNAMES
error: 'error' //Set on the field tag when validation fails
});
})();

View file

@ -0,0 +1,140 @@
/* Form */
.bbf-form {
margin: 0;
padding: 0;
border: none;
}
/* Field */
.bbf-field {
margin: 1em 0;
list-style-type: none;
position: relative;
clear: both;
}
.bbf-field label {
float: left;
width: 25%;
}
.bbf-field .bbf-editor {
margin-left: 25%;
width: 74%;
}
.bbf-field input, .bbf-field textarea, .bbf-field select {
width: 100%;
}
.bbf-field .bbf-help {
margin-left: 25%;
width: 74%;
color: #999;
}
.bbf-field .bbf-error {
margin-left: 25%;
width: 74%;
color: red;
}
.bbf-field.bbf-error .bbf-editor {
outline: 1px solid red;
}
/* Radio */
.bbf-radio {
list-style-type: none;
}
.bbf-radio input {
width: auto;
}
.bbf-radio label {
float: none;
}
/* Checkboxes */
.bbf-checkboxes {
list-style-type: none;
}
.bbf-checkboxes input {
width: auto;
}
.bbf-checkboxes label {
float: none;
}
/* List */
.bbf-list ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.bbf-list .bbf-error {
border: 1px solid red;
}
.bbf-list li {
clear: both;
width: 100%;
}
.bbf-list li .bbf-editor-container {
margin-right: 2em;
}
.bbf-list li .bbf-remove {
float: right;
width: 2em;
}
.bbf-list .bbf-actions {
text-align: center;
clear: both;
}
/* List.Modal */
.bbf-list-modal {
cursor: pointer;
border: 1px solid #ccc;
width: 208px;
border-radius: 3px;
padding: 4px;
color: #555;
}
/* Date */
.bbf-date .bbf-date {
width: 4em;
}
.bbf-date .bbf-month {
width: 9em;
}
.bbf-date .bbf-year {
width: 6em;
}
/* DateTime */
.bbf-datetime .bbf-date-container {
float: left;
margin-right: 1em;
}
.bbf-datetime select {
width: 4em;
}

View file

@ -0,0 +1,91 @@
/**
* Include this file _after_ the main backbone-forms file to override the default templates.
* You only need to include templates you want to override.
*
* Requirements when customising templates:
* - Each template must have one 'parent' element tag.
* - "data-type" attributes are required.
* - The main placeholder tags such as the following are required: fieldsets, fields
*/
;(function() {
var Form = Backbone.Form;
//DEFAULT TEMPLATES
Form.setTemplates({
//HTML
form: '\
<form class="bbf-form">{{fieldsets}}</form>\
',
fieldset: '\
<fieldset>\
<legend>{{legend}}</legend>\
<ul>{{fields}}</ul>\
</fieldset>\
',
field: '\
<li class="bbf-field field-{{key}}">\
<label for="{{id}}">{{title}}</label>\
<div class="bbf-editor">{{editor}}</div>\
<div class="bbf-help">{{help}}</div>\
<div class="bbf-error">{{error}}</div>\
</li>\
',
nestedField: '\
<li class="bbf-field bbf-nested-field field-{{key}}" title="{{title}}">\
<label for="{{id}}">{{title}}</label>\
<div class="bbf-editor">{{editor}}</div>\
<div class="bbf-help">{{help}}</div>\
<div class="bbf-error">{{error}}</div>\
</li>\
',
list: '\
<div class="bbf-list">\
<ul>{{items}}</ul>\
<div class="bbf-actions"><button type="button" data-action="add">Add</div>\
</div>\
',
listItem: '\
<li>\
<button type="button" data-action="remove" class="bbf-remove">&times;</button>\
<div class="bbf-editor-container">{{editor}}</div>\
</li>\
',
date: '\
<div class="bbf-date">\
<select data-type="date" class="bbf-date">{{dates}}</select>\
<select data-type="month" class="bbf-month">{{months}}</select>\
<select data-type="year" class="bbf-year">{{years}}</select>\
</div>\
',
dateTime: '\
<div class="bbf-datetime">\
<div class="bbf-date-container">{{date}}</div>\
<select data-type="hour">{{hours}}</select>\
:\
<select data-type="min">{{mins}}</select>\
</div>\
',
'list.Modal': '\
<div class="bbf-list-modal">\
{{summary}}\
</div>\
'
}, {
//CLASSNAMES
error: 'bbf-error'
});
})();