Skip to content

Commit

Permalink
Build 0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Fidelin committed Apr 14, 2016
1 parent c15c7f0 commit 58fc252
Show file tree
Hide file tree
Showing 12 changed files with 394 additions and 162 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Angular-xeditable changelog
=============================

Version 0.1.12 Apr 14, 2016
----------------------------
[enh #448] Add support for ui-select (ckosloski)
[enh #448] Current date as default max date on combodate (Jmenache)
[enh #443] Updated to use Angular 1.5.0, bootstrap 3.3.6, ui-bootstrap 1.2.4 (ckosloski)
[bug #435] Fix typeahed not working with ui-boostrap (ckosloski)
[bug #428] Fix datepicker doesn't popup (ckosloski)
[bug #415] Fix isDefaultPrevented check in editableForm prevents blur (mgerring)
[bug #317] Fix implementation for datepicker (ckosloski)


Version 0.1.11 Mar 24, 2016
----------------------------
[bug #424] Fix support for password fields (ckosloski)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-xeditable",
"version": "0.1.11",
"version": "0.1.12",
"description": "Edit in place for AngularJS",
"author": "https://github.com/vitalets",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions dist/css/xeditable.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

183 changes: 122 additions & 61 deletions dist/js/xeditable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
angular-xeditable - 0.1.11
angular-xeditable - 0.1.12
Edit-in-place for angular.js
Build date: 2016-03-24
Build date: 2016-04-14
*/
/**
* Angular-xeditable module
Expand Down Expand Up @@ -82,63 +82,76 @@ angular.module('xeditable', [])
});

/*
Angular-ui bootstrap datepicker
http://angular-ui.github.io/bootstrap/#/datepicker
*/
Angular-ui bootstrap datepicker
http://angular-ui.github.io/bootstrap/#/datepicker
*/
angular.module('xeditable').directive('editableBsdate', ['editableDirectiveFactory',
function(editableDirectiveFactory) {
return editableDirectiveFactory({
directiveName: 'editableBsdate',
inputTpl: '<div></div>',
render: function() {
/** This basically renders a datepicker as in the example shown in
** http://angular-ui.github.io/bootstrap/#/datepicker
** The attributes are all the same as in the bootstrap-ui datepicker with e- as prefix
**/
this.parent.render.call(this);

var inputDatePicker = angular.element('<input type="text" class="form-control" ng-model="$data"/>');
var buttonDatePicker = angular.element('<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>');
var buttonWrapper = angular.element('<span class="input-group-btn"></span>');

inputDatePicker.attr('datepicker-popup', this.attrs.eDatepickerPopupXEditable || 'yyyy/MM/dd' );
inputDatePicker.attr('is-open', this.attrs.eIsOpen);
inputDatePicker.attr('date-disabled', this.attrs.eDateDisabled);
inputDatePicker.attr('datepicker-popup', this.attrs.eDatepickerPopup);
inputDatePicker.attr('datepicker-mode', this.attrs.eDatepickerMode || 'day');
inputDatePicker.attr('min-date', this.attrs.eMinDate);
inputDatePicker.attr('max-date', this.attrs.eMaxDate);
inputDatePicker.attr('show-weeks', this.attrs.eShowWeeks || true);
inputDatePicker.attr('starting-day', this.attrs.eStartingDay || 0);
inputDatePicker.attr('init-date', this.attrs.eInitDate || new Date());
inputDatePicker.attr('min-mode', this.attrs.eMinMode || 'day');
inputDatePicker.attr('max-mode', this.attrs.eMaxMode || 'year');
inputDatePicker.attr('format-day', this.attrs.eFormatDay || 'dd');
inputDatePicker.attr('format-month', this.attrs.eFormatMonth || 'MMMM');
inputDatePicker.attr('format-year', this.attrs.eFormatYear || 'yyyy');
inputDatePicker.attr('format-day-header', this.attrs.eFormatDayHeader || 'EEE');
inputDatePicker.attr('format-day-title', this.attrs.eFormatDayTitle || 'MMMM yyyy');
inputDatePicker.attr('format-month-title', this.attrs.eFormatMonthTitle || 'yyyy');
inputDatePicker.attr('year-range', this.attrs.eYearRange || 20);
inputDatePicker.attr('show-button-bar', this.attrs.eShowButtonBar || true);
inputDatePicker.attr('current-text', this.attrs.eCurrentText || 'Today');
inputDatePicker.attr('clear-text', this.attrs.eClearText || 'Clear');
inputDatePicker.attr('close-text', this.attrs.eCloseText || 'Done');
inputDatePicker.attr('close-on-date-selection', this.attrs.eCloseOnDateSelection || true);
inputDatePicker.attr('date-picker-append-to-body', this.attrs.eDatePickerAppendToBody || false);
inputDatePicker.attr('date-disabled', this.attrs.eDateDisabled);

buttonDatePicker.attr('ng-click',this.attrs.eNgClick);

buttonWrapper.append(buttonDatePicker);
this.inputEl.prepend(inputDatePicker);
this.inputEl.append(buttonWrapper);

this.inputEl.removeAttr('class');
this.inputEl.attr('class','input-group');

}
});
function(editableDirectiveFactory) {
return editableDirectiveFactory({
directiveName: 'editableBsdate',
inputTpl: '<div></div>',
render: function() {
/** This basically renders a datepicker as in the example shown in
** http://angular-ui.github.io/bootstrap/#/datepicker
** The attributes are all the same as in the bootstrap-ui datepicker with e- as prefix
**/
this.parent.render.call(this);

var inputDatePicker = angular.element('<input type="text" class="form-control" ng-model="$data"/>');
var buttonDatePicker = angular.element('<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>');
var buttonWrapper = angular.element('<span class="input-group-btn"></span>');

inputDatePicker.attr('uib-datepicker-popup', this.attrs.eDatepickerPopupXEditable || 'yyyy/MM/dd' );
inputDatePicker.attr('is-open', this.attrs.eIsOpen);
inputDatePicker.attr('date-disabled', this.attrs.eDateDisabled);
inputDatePicker.attr('uib-datepicker-popup', this.attrs.eDatepickerPopup);
inputDatePicker.attr('min-date', this.attrs.eMinDate);
inputDatePicker.attr('max-date', this.attrs.eMaxDate);
inputDatePicker.attr('year-range', this.attrs.eYearRange || 20);
inputDatePicker.attr('show-button-bar', this.attrs.eShowButtonBar || true);
inputDatePicker.attr('current-text', this.attrs.eCurrentText || 'Today');
inputDatePicker.attr('clear-text', this.attrs.eClearText || 'Clear');
inputDatePicker.attr('close-text', this.attrs.eCloseText || 'Done');
inputDatePicker.attr('close-on-date-selection', this.attrs.eCloseOnDateSelection || true);
inputDatePicker.attr('datepicker-append-to-body', this.attrs.eDatePickerAppendToBody || false);
inputDatePicker.attr('date-disabled', this.attrs.eDateDisabled);
inputDatePicker.attr('name', this.attrs.eName);

this.scope.dateOptions = {
formatDay: this.attrs.eFormatDay || 'dd',
formatMonth: this.attrs.eFormatMonth || 'MMMM',
formatYear: this.attrs.eFormatYear || 'yyyy',
formatDayHeader: this.attrs.eFormatDayHeader || 'EEE',
formatDayTitle: this.attrs.eFormatDayTitle || 'MMMM yyyy',
formatMonthTitle: this.attrs.eFormatMonthTitle || 'yyyy',
showWeeks: this.attrs.eShowWeeks ? this.attrs.eShowWeeks.toLowerCase() === 'true' : true,
startingDay: this.attrs.eStartingDay || 0,
minMode: this.attrs.eMinMode || 'day',
maxMode: this.attrs.eMaxMode || 'year',
initDate: this.attrs.eInitDate || new Date(),
datepickerMode: this.attrs.eDatepickerMode || 'day'
};

inputDatePicker.attr('datepicker-options', "dateOptions");

buttonDatePicker.attr('ng-click',this.attrs.eNgClick);

buttonWrapper.append(buttonDatePicker);
this.inputEl.prepend(inputDatePicker);
this.inputEl.append(buttonWrapper);

this.inputEl.removeAttr('class');
this.inputEl.removeAttr('ng-click');
this.inputEl.removeAttr('is-open');
this.inputEl.removeAttr('init-date');
this.inputEl.removeAttr('datepicker-popup');
this.inputEl.removeAttr('required');
this.inputEl.removeAttr('ng-model');
this.inputEl.removeAttr('date-picker-append-to-body');
this.inputEl.removeAttr('name');
this.inputEl.attr('class','input-group');
}
});
}]);
/*
Angular-ui bootstrap editable timepicker
Expand All @@ -148,7 +161,7 @@ angular.module('xeditable').directive('editableBstime', ['editableDirectiveFacto
function(editableDirectiveFactory) {
return editableDirectiveFactory({
directiveName: 'editableBstime',
inputTpl: '<timepicker></timepicker>',
inputTpl: '<uib-timepicker></uib-timepicker>',
render: function() {
this.parent.render.call(this);

Expand Down Expand Up @@ -363,6 +376,53 @@ angular.module('xeditable').directive('editableTextarea', ['editableDirectiveFac
});
}]);

/*
AngularJS-native version of Select2 and Selectize
https://github.com/angular-ui/ui-select
*/
angular.module('xeditable').directive('editableUiSelect',['editableDirectiveFactory',
function(editableDirectiveFactory) {
var rename = function (tag, el) {
var newEl = angular.element('<' + tag + '/>');
newEl.html(el.html());
var attrs = el[0].attributes;
for (var i = 0; i < attrs.length; ++i) {
newEl.attr(attrs.item(i).nodeName, attrs.item(i).value);
}
return newEl;
};

var match = null;
var choices = null;
var dir = editableDirectiveFactory({
directiveName: 'editableUiSelect',
inputTpl: '<ui-select></ui-select>',
render: function () {
this.parent.render.call(this);
this.inputEl.append(rename('ui-select-match', match));
this.inputEl.append(rename('ui-select-choices', choices));
this.inputEl.removeAttr('ng-model');
this.inputEl.attr('ng-model', '$parent.$data');
}
});

var linkOrg = dir.link;

dir.link = function (scope, el, attrs, ctrl) {
var matchEl = el.find('editable-ui-select-match');
var choicesEl = el.find('editable-ui-select-choices');

match = matchEl.clone();
choices = choicesEl.clone();

matchEl.remove();
choicesEl.remove();

return linkOrg(scope, el, attrs, ctrl);
};

return dir;
}]);
/**
* EditableController class.
* Attached to element with `editable-xxx` directive.
Expand Down Expand Up @@ -1016,7 +1076,7 @@ angular.module('xeditable').factory('editableFormController',
// bind click to body: cancel|submit|ignore forms
$document.bind('click', function(e) {
// ignore right/middle button click
if ((e.which && e.which !== 1) || e.isDefaultPrevented()) {
if (e.which && e.which !== 1) {
return;
}

Expand Down Expand Up @@ -1676,6 +1736,7 @@ angular.module('xeditable').factory('editableCombodate', [function() {
throw 'Combodate should be applied to INPUT element';
}

var currentYear = new Date().getFullYear();
this.defaults = {
//in this format value stored in original input
format: 'YYYY-MM-DD HH:mm',
Expand All @@ -1684,7 +1745,7 @@ angular.module('xeditable').factory('editableCombodate', [function() {
//initial value, can be `new Date()`
value: null,
minYear: 1970,
maxYear: 2015,
maxYear: currentYear,
yearDescending: true,
minuteStep: 5,
secondStep: 1,
Expand Down
6 changes: 3 additions & 3 deletions dist/js/xeditable.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 58fc252

Please sign in to comment.