From 902525740d566eac08c7501f2b0340413b56dfe5 Mon Sep 17 00:00:00 2001
From: Mitch Thompson
Date: Tue, 2 Jun 2015 08:36:22 -0400
Subject: [PATCH] add e-single, add minified css, add MIT license, Fix
radiolist, new editables match the waiting state of the form, Allow passing
min/maxYear to combodate
---
.gitignore | 5 +
Gruntfile.js | 6 +-
bower.json | 2 +-
dist/css/xeditable.css | 121 +++++++++++++++++-
dist/css/xeditable.min.css | 7 +
dist/js/xeditable.js | 34 +++--
dist/js/xeditable.min.js | 6 +-
index.html | 63 ++++-----
package.json | 4 +-
src/js/editable-form/controller.js | 5 +
starter/angular-xeditable/css/xeditable.css | 121 +++++++++++++++++-
.../angular-xeditable/css/xeditable.min.css | 7 +
starter/angular-xeditable/js/xeditable.js | 26 +++-
starter/angular-xeditable/js/xeditable.min.js | 6 +-
zip/angular-xeditable-0.1.10.zip | Bin 0 -> 31574 bytes
zip/angular-xeditable-starter.zip | Bin 31281 -> 32623 bytes
16 files changed, 338 insertions(+), 75 deletions(-)
create mode 100644 dist/css/xeditable.min.css
create mode 100644 starter/angular-xeditable/css/xeditable.min.css
create mode 100644 zip/angular-xeditable-0.1.10.zip
diff --git a/.gitignore b/.gitignore
index 6fc4cc62..b5f2e467 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,8 @@
dev.html
jsdoc.json
/.idea
+node_modules
+.tmp
+.sass-cache
+bower_components
+npm-debug.log
\ No newline at end of file
diff --git a/Gruntfile.js b/Gruntfile.js
index d5dbceae..f604abcf 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -73,7 +73,7 @@ module.exports = function(grunt) {
grunt.config('uglify', {
options: {
banner: banner
- },
+ },
dist: {
src: ['<%= concat.dist.dest %>'],
dest: 'dist/js/xeditable.min.js'
@@ -128,14 +128,16 @@ module.exports = function(grunt) {
return text;
};
+
+
var jadeData = {
fs: require('fs'),
md: marked,
version: '<%= pkg.version %>',
- size: Math.floor(fs.statSync('dist/js/xeditable.min.js').size / 1024),
structure: require('./docs/js/structure.js'),
jsdoc: '<%= jsdocdata %>'
};
+
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.config('jade', {
docs: {
diff --git a/bower.json b/bower.json
index e1db722a..04ab4a60 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "angular-xeditable",
- "version": "0.1.9",
+ "version": "0.1.10",
"description": "Edit in place for AngularJS",
"author": "https://github.com/vitalets",
"license": "MIT",
diff --git a/dist/css/xeditable.css b/dist/css/xeditable.css
index 6e9b19f7..8919a903 100644
--- a/dist/css/xeditable.css
+++ b/dist/css/xeditable.css
@@ -1,7 +1,116 @@
-/*!
-angular-xeditable - 0.1.9
-Edit-in-place for angular.js
-Build date: 2015-03-26
-*/
-.editable-wrap{display:inline-block;white-space:nowrap;margin:0}.editable-wrap .editable-controls,.editable-wrap .editable-error{margin-bottom:0}.editable-wrap .editable-controls>input,.editable-wrap .editable-controls>select,.editable-wrap .editable-controls>textarea{margin-bottom:0}.editable-wrap .editable-input{display:inline-block}.editable-buttons{display:inline-block;vertical-align:top}.editable-buttons button{margin-left:5px}.editable-input.editable-has-buttons{width:auto}.editable-bstime .editable-input input[type=text]{width:46px}.editable-bstime .well-small{margin-bottom:0;padding:10px}.editable-range output{display:inline-block;min-width:30px;vertical-align:top;text-align:center}.editable-color input[type=color]{width:50px}.editable-checkbox label span,.editable-checklist label span,.editable-radiolist label span{margin-left:7px;margin-right:10px}.editable-hide{display:none!important}.editable-click,a.editable-click{text-decoration:none;color:#428bca;border-bottom:dashed 1px #428bca}.editable-click:hover,a.editable-click:hover{text-decoration:none;color:#2a6496;border-bottom-color:#2a6496}.editable-empty,.editable-empty:hover,.editable-empty:focus,a.editable-empty,a.editable-empty:hover,a.editable-empty:focus{font-style:italic;color:#D14;text-decoration:none}
\ No newline at end of file
+/* ==== editable-form ==== */
+
+/* class for single editable element */
+.editable-wrap {
+ display: inline-block;
+ white-space: nowrap;
+ margin: 0;
+}
+
+/* remove bottom-margin for bootstrap */
+.editable-wrap .editable-controls,
+.editable-wrap .editable-error {
+ margin-bottom: 0;
+}
+
+/* remove bottom-margin of inputs */
+.editable-wrap .editable-controls > input,
+.editable-wrap .editable-controls > select,
+.editable-wrap .editable-controls > textarea {
+ margin-bottom: 0;
+}
+
+/* keep buttons on the same line */
+.editable-wrap .editable-input {
+ display: inline-block;
+}
+
+.editable-buttons {
+ display: inline-block;
+ vertical-align: top;
+}
+
+.editable-buttons button {
+ margin-left: 5px;
+}
+
+/* in bootstrap width: 100% => buttons go outside the box */
+.editable-input.editable-has-buttons {
+ width: auto;
+}
+
+/* ==== editable-bstime ==== */
+
+/* workaround for bootstrap that sets width: 100% and inputs become too wide */
+.editable-bstime .editable-input input[type="text"] {
+ width: 46px;
+}
+
+/* less padding for .well */
+.editable-bstime .well-small {
+ margin-bottom: 0;
+ padding: 10px;
+}
+
+/* ==== editable-range ==== */
+
+.editable-range output {
+ display: inline-block;
+ min-width: 30px;
+ vertical-align: top;
+ text-align: center;
+}
+
+/* ==== editable-color ==== */
+
+.editable-color input[type="color"] {
+ width: 50px;
+}
+
+
+/* ==== editable-checkbox ==== */
+/* ==== editable-checklist ==== */
+/* ==== editable-radiolist ==== */
+
+.editable-checkbox label span,
+.editable-checklist label span,
+.editable-radiolist label span {
+ margin-left: 7px;
+ margin-right: 10px;
+}
+
+/* ==== element ==== */
+
+/* hiding element */
+.editable-hide {
+ display: none !important;
+}
+
+.editable-click,
+a.editable-click {
+ text-decoration: none;
+ color: #428bca;
+ border-bottom: dashed 1px #428bca;
+}
+
+.editable-click:hover,
+a.editable-click:hover {
+ text-decoration: none;
+ color: #2a6496;
+ border-bottom-color: #2a6496;
+}
+
+/* editable-empty */
+.editable-empty,
+.editable-empty:hover,
+.editable-empty:focus,
+a.editable-empty,
+a.editable-empty:hover,
+a.editable-empty:focus {
+ font-style: italic;
+ color: #DD1144;
+ text-decoration: none;
+}
+
+
diff --git a/dist/css/xeditable.min.css b/dist/css/xeditable.min.css
new file mode 100644
index 00000000..885e1de3
--- /dev/null
+++ b/dist/css/xeditable.min.css
@@ -0,0 +1,7 @@
+/*!
+angular-xeditable - 0.1.10
+Edit-in-place for angular.js
+Build date: 2016-02-16
+*/
+
+.editable-wrap{display:inline-block;white-space:nowrap;margin:0}.editable-wrap .editable-controls,.editable-wrap .editable-error{margin-bottom:0}.editable-wrap .editable-controls>input,.editable-wrap .editable-controls>select,.editable-wrap .editable-controls>textarea{margin-bottom:0}.editable-wrap .editable-input{display:inline-block}.editable-buttons{display:inline-block;vertical-align:top}.editable-buttons button{margin-left:5px}.editable-input.editable-has-buttons{width:auto}.editable-bstime .editable-input input[type=text]{width:46px}.editable-bstime .well-small{margin-bottom:0;padding:10px}.editable-range output{display:inline-block;min-width:30px;vertical-align:top;text-align:center}.editable-color input[type=color]{width:50px}.editable-checkbox label span,.editable-checklist label span,.editable-radiolist label span{margin-left:7px;margin-right:10px}.editable-hide{display:none!important}.editable-click,a.editable-click{text-decoration:none;color:#428bca;border-bottom:dashed 1px #428bca}.editable-click:hover,a.editable-click:hover{text-decoration:none;color:#2a6496;border-bottom-color:#2a6496}.editable-empty,.editable-empty:hover,.editable-empty:focus,a.editable-empty,a.editable-empty:hover,a.editable-empty:focus{font-style:italic;color:#D14;text-decoration:none}
\ No newline at end of file
diff --git a/dist/js/xeditable.js b/dist/js/xeditable.js
index cccf047b..c6e1378f 100644
--- a/dist/js/xeditable.js
+++ b/dist/js/xeditable.js
@@ -1,7 +1,7 @@
/*!
-angular-xeditable - 0.1.9
+angular-xeditable - 0.1.10
Edit-in-place for angular.js
-Build date: 2015-03-26
+Build date: 2016-02-16
*/
/**
* Angular-xeditable module
@@ -32,7 +32,7 @@ angular.module('xeditable', [])
*/
icon_set: 'default',
/**
- * Whether to show buttons for single editable element.
+ * Whether to show buttons for single editalbe element.
* Possible values `right` (default), `no`.
*
* @var {string} buttons
@@ -228,9 +228,20 @@ angular.module('xeditable').directive('editableCombodate', ['editableDirectiveFa
inputTpl: '',
render: function() {
this.parent.render.call(this);
- var combodate = editableCombodate.getInstance(this.inputEl, {value: new Date(this.scope.$data)});
+ var options = {
+ value: new Date(this.scope.$data)
+ };
var self = this;
+ angular.forEach(["format", "template", "minYear", "maxYear", "yearDescending", "minuteStep", "secondStep", "firstItem", "errorClass", "customClass", "roundTime", "smartDays"], function(name) {
+
+ var attrName = "e" + name.charAt(0).toUpperCase() + name.slice(1);
+ if (attrName in self.attrs) {
+ options[name] = self.attrs[attrName];
+ }
+ });
+
+ var combodate = editableCombodate.getInstance(this.inputEl, options);
combodate.$widget.find('select').bind('change', function(e) {
self.scope.$data = (new Date(combodate.getValue())).toISOString();
});
@@ -238,6 +249,7 @@ angular.module('xeditable').directive('editableCombodate', ['editableDirectiveFa
});
}
]);
+
/*
Input types: text|email|tel|number|url|search|color|date|datetime|time|month|week
*/
@@ -288,7 +300,7 @@ angular.module('xeditable').directive('editableRadiolist', [
this.parent.render.call(this);
var parsed = editableNgOptionsParser(this.attrs.eNgOptions);
var html = '';
this.inputEl.removeAttr('ng-model');
@@ -632,7 +644,7 @@ angular.module('xeditable').factory('editableController',
/*
Originally render() was inside init() method, but some directives polluting editorEl,
- so it is broken on second opening.
+ so it is broken on second openning.
Cloning is not a solution as jqLite can not clone with event handler's.
*/
self.render();
@@ -857,8 +869,8 @@ function($parse, $compile, editableThemes, $rootScope, $document, editableContro
// element wrapped by form
if(ctrl[1]) {
eFormCtrl = ctrl[1];
- hasForm = true;
- } else if(attrs.eForm) { // element not wrapped by