From 765a6d851a7b189c04acbc16f079025f3f2316f0 Mon Sep 17 00:00:00 2001 From: SengitU Date: Fri, 3 Feb 2017 11:30:03 +0300 Subject: [PATCH] =?UTF-8?q?Datepicker'in=20refresh=20methodunu=20=C3=A7a?= =?UTF-8?q?=C4=9F=C4=B1ran=20bir=20method=20eklendi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bower.json | 2 +- dist/uxrocket.calendar.js | 8 +++++++- dist/uxrocket.calendar.min.js | 6 +++--- lib/_uxrocket-calendar.scss | 2 +- lib/uxrocket.calendar.js | 8 +++++++- package.json | 2 +- uxrocket.json | 2 +- version.md | 3 +++ 8 files changed, 24 insertions(+), 9 deletions(-) diff --git a/bower.json b/bower.json index 56f9543..9e745cf 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "uxrocket.calendar", - "version": "0.10.2", + "version": "0.11.0", "homepage": "https://github.com/uxrocket/uxrocket.calendar", "authors": [ "Bilal Çınarlı " diff --git a/dist/uxrocket.calendar.js b/dist/uxrocket.calendar.js index d5c1239..36cbb28 100644 --- a/dist/uxrocket.calendar.js +++ b/dist/uxrocket.calendar.js @@ -211,6 +211,12 @@ }); }; + ux.refresh = function(el) { + var $el = el !== undefined ? $(el) : $("." + ns.ready); + + $el.datepicker('refresh'); + }; + ux.remove = function(el) { var $el = el !== undefined ? $(el) : $("." + ns.ready); @@ -253,7 +259,7 @@ }; // version - ux.version = "0.10.2"; + ux.version = "0.11.0"; // settings ux.settings = defaults; diff --git a/dist/uxrocket.calendar.min.js b/dist/uxrocket.calendar.min.js index e624571..ed5f6e2 100644 --- a/dist/uxrocket.calendar.min.js +++ b/dist/uxrocket.calendar.min.js @@ -1,7 +1,7 @@ /*! UX Rocket Select * UX Rocket Calendar: A jQueryUI Calendar plugin wrapper * @author Bilal Cinarli (http://bcinarli.com/) - * @version 0.10.2 - * @build Mon Dec 19 2016 13:49:03 GMT+0300 (MSK) + * @version 0.11.0 + * @build Fri Feb 03 2017 11:27:48 GMT+0300 (Russia TZ 2 Standard Time) */ -!function(e){var a,t={showOtherMonths:!0,selectOtherMonths:!0,changeMonth:!0,changeYear:!0,limitedDate:!1,setDateNow:!1,onReady:!1,onSelect:!1,onClose:!1,onRemove:!1,afterShow:!1},r={click:"click.uxCalendar",afterShow:"afterShow.uxCalendar"},n={rocket:"uxRocket",data:"uxCalendar",ready:"uxitd-calendar-ready",rocketWrap:"uxitd-plugin-wrap",wrap:"uxitd-calendar-wrap",icon:"icon-calendar"};e(function(){var a;e.datepicker._updateDatepicker_original=e.datepicker._updateDatepicker,e.datepicker._updateDatepicker=function(t){clearTimeout(a),e.datepicker._updateDatepicker_original(t);var r=this._get(t,"_afterShow");r&&(a=setTimeout(function(){r.apply(t.input?t.input[0]:null)},100))}});var i=function(a,r,i){var c=e(a),s=e.extend({},t,r,c.data(),{selector:i});c.data(n.data,s),o(c),p(s.onReady),d(c)},o=function(e){var a="",t=e.data(n.data);a=" "+e.context.className.replace(n.ready,""),"."==t.selector.charAt(0)&&(a=a.replace(" "+t.selector.substr(1),"")),e.parent().is("."+n.rocketWrap)?e.parent().addClass(n.wrap+a+" group"):e.wrap(''),e.after('')},c=function(e,a){e.each(function(){this.value>a&&(this.disabled=!0)})},d=function(a){var t,i,o=a.data(n.data),d=o.onClose;void 0!==o.calendarBefore&&(t=e(o.calendarBefore),o.onClose=function(e){t.datepicker("option","maxDate",e),"function"==typeof d&&d()}),o.limitedDate&&(o.beforeShowDay=function(e){var a=e.getDay();return[1!=a&&3!=a&&5!=a&&6!=a&&7!=a&&0!=a]}),void 0!==o.calendarAfter&&(i=e(o.calendarAfter),o.onClose=function(e){i.datepicker("option","minDate",e),i.focus(1),"function"==typeof d&&d()}),o._afterShow=function(){var t=a.data(n.data),i=new Date,o=e("#ui-datepicker-div"),d=o.find(".ui-datepicker-current-day a");a.trigger(r.afterShow),t&&t.timeLimit&&d&&d.html()==i.getDate()&&(c(o.find(".ui_tpicker_hour_slider option"),i.getHours()),c(o.find(".ui_tpicker_minute_slider option"),i.getMinutes())),"function"==typeof t.afterShow&&t.afterShow()},o.beforeShow=function(){return!a.attr("readonly")&&!a.attr("disabled")&&void(o.setDateNow&&""===a.val()&&a.datetimepicker("setDate",new Date))},a.next("."+n.icon).on(r.click,function(){a.focus()}),1==o.time?a.datetimepicker(o):o.timeOnly?a.timepicker(o):a.datepicker(o,e.datepicker.regional.tr)},p=function(e){if("function"==typeof e)e.apply(this);else if(e!==!1)return new Function("return "+e)};a=e.fn.calendar=e.uxcalendar=function(a){var t=this.selector;return this.each(function(){var r,o=e(this),c=o.data(n.rocket)||{};o.hasClass(n.ready)||o.hasClass(n.rocketWrap)||(o.addClass(n.ready),c[n.data]={hasWrapper:!0,wrapper:n.wrap,ready:n.ready,selector:t,options:a},o.data(n.rocket,c),r=new i(this,a,t))})},a.remove=function(a){var t=e(void 0!==a?a:"."+n.ready);t.filter("input").each(function(){var a=e(this),t=a.data(n.data),i=a.data(n.rocket);a.removeClass(n.ready),a.off(r.click),a.next("."+n.icon).remove(),i[n.data].hasWrapper&&(Object.keys&&1==Object.keys(i).length?a.unwrap():a.parent().removeClass(n.wrap)),a.removeData(n.data),delete i[n.data],a.data(n.rocket,i),a.datepicker("destroy"),p(t.onRemove)})},a.version="0.10.2",a.settings=t}(jQuery); \ No newline at end of file +!function(e){var a,t={showOtherMonths:!0,selectOtherMonths:!0,changeMonth:!0,changeYear:!0,limitedDate:!1,setDateNow:!1,onReady:!1,onSelect:!1,onClose:!1,onRemove:!1,afterShow:!1},r={click:"click.uxCalendar",afterShow:"afterShow.uxCalendar"},n={rocket:"uxRocket",data:"uxCalendar",ready:"uxitd-calendar-ready",rocketWrap:"uxitd-plugin-wrap",wrap:"uxitd-calendar-wrap",icon:"icon-calendar"};e(function(){var a;e.datepicker._updateDatepicker_original=e.datepicker._updateDatepicker,e.datepicker._updateDatepicker=function(t){clearTimeout(a),e.datepicker._updateDatepicker_original(t);var r=this._get(t,"_afterShow");r&&(a=setTimeout(function(){r.apply(t.input?t.input[0]:null)},100))}});var i=function(a,r,i){var c=e(a),p=e.extend({},t,r,c.data(),{selector:i});c.data(n.data,p),o(c),s(p.onReady),d(c)},o=function(e){var a="",t=e.data(n.data);a=" "+e.context.className.replace(n.ready,""),"."==t.selector.charAt(0)&&(a=a.replace(" "+t.selector.substr(1),"")),e.parent().is("."+n.rocketWrap)?e.parent().addClass(n.wrap+a+" group"):e.wrap(''),e.after('')},c=function(e,a){e.each(function(){this.value>a&&(this.disabled=!0)})},d=function(a){var t,i,o=a.data(n.data),d=o.onClose;void 0!==o.calendarBefore&&(t=e(o.calendarBefore),o.onClose=function(e){t.datepicker("option","maxDate",e),"function"==typeof d&&d()}),o.limitedDate&&(o.beforeShowDay=function(e){var a=e.getDay();return[1!=a&&3!=a&&5!=a&&6!=a&&7!=a&&0!=a]}),void 0!==o.calendarAfter&&(i=e(o.calendarAfter),o.onClose=function(e){i.datepicker("option","minDate",e),i.focus(1),"function"==typeof d&&d()}),o._afterShow=function(){var t=a.data(n.data),i=new Date,o=e("#ui-datepicker-div"),d=o.find(".ui-datepicker-current-day a");a.trigger(r.afterShow),t&&t.timeLimit&&d&&d.html()==i.getDate()&&(c(o.find(".ui_tpicker_hour_slider option"),i.getHours()),c(o.find(".ui_tpicker_minute_slider option"),i.getMinutes())),"function"==typeof t.afterShow&&t.afterShow()},o.beforeShow=function(){return!a.attr("readonly")&&!a.attr("disabled")&&void(o.setDateNow&&""===a.val()&&a.datetimepicker("setDate",new Date))},a.next("."+n.icon).on(r.click,function(){a.focus()}),1==o.time?a.datetimepicker(o):o.timeOnly?a.timepicker(o):a.datepicker(o,e.datepicker.regional.tr)},s=function(e){if("function"==typeof e)e.apply(this);else if(e!==!1)return new Function("return "+e)};a=e.fn.calendar=e.uxcalendar=function(a){var t=this.selector;return this.each(function(){var r,o=e(this),c=o.data(n.rocket)||{};o.hasClass(n.ready)||o.hasClass(n.rocketWrap)||(o.addClass(n.ready),c[n.data]={hasWrapper:!0,wrapper:n.wrap,ready:n.ready,selector:t,options:a},o.data(n.rocket,c),r=new i(this,a,t))})},a.refresh=function(a){var t=e(void 0!==a?a:"."+n.ready);t.datepicker("refresh")},a.remove=function(a){var t=e(void 0!==a?a:"."+n.ready);t.filter("input").each(function(){var a=e(this),t=a.data(n.data),i=a.data(n.rocket);a.removeClass(n.ready),a.off(r.click),a.next("."+n.icon).remove(),i[n.data].hasWrapper&&(Object.keys&&1==Object.keys(i).length?a.unwrap():a.parent().removeClass(n.wrap)),a.removeData(n.data),delete i[n.data],a.data(n.rocket,i),a.datepicker("destroy"),s(t.onRemove)})},a.version="0.11.0",a.settings=t}(jQuery); \ No newline at end of file diff --git a/lib/_uxrocket-calendar.scss b/lib/_uxrocket-calendar.scss index 150318c..abb6389 100644 --- a/lib/_uxrocket-calendar.scss +++ b/lib/_uxrocket-calendar.scss @@ -1,5 +1,5 @@ /* @author Bilal Cinarli */ -$calendar-version: "0.10.2"; +$calendar-version: "0.11.0"; /** ------------------------------------------- Calendar Styles diff --git a/lib/uxrocket.calendar.js b/lib/uxrocket.calendar.js index d5c1239..36cbb28 100644 --- a/lib/uxrocket.calendar.js +++ b/lib/uxrocket.calendar.js @@ -211,6 +211,12 @@ }); }; + ux.refresh = function(el) { + var $el = el !== undefined ? $(el) : $("." + ns.ready); + + $el.datepicker('refresh'); + }; + ux.remove = function(el) { var $el = el !== undefined ? $(el) : $("." + ns.ready); @@ -253,7 +259,7 @@ }; // version - ux.version = "0.10.2"; + ux.version = "0.11.0"; // settings ux.settings = defaults; diff --git a/package.json b/package.json index d219858..4be97fa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "uxrocket.calendar", - "version": "0.10.2", + "version": "0.11.0", "description": "UX Rocket Calendar: A jQueryUI Calendar plugin wrapper", "contributors": [], "repository": { diff --git a/uxrocket.json b/uxrocket.json index ad4ff0e..8d85ab3 100644 --- a/uxrocket.json +++ b/uxrocket.json @@ -1,7 +1,7 @@ { "name": "Select", "registry": "uxrocket.calendar", - "version": "0.10.2", + "version": "0.11.0", "paths": { "lib": "lib/", "dist": "dist/", diff --git a/version.md b/version.md index 966ac7c..a5d3ed2 100644 --- a/version.md +++ b/version.md @@ -1,3 +1,6 @@ +## Versiyon 0.11.0 +- YENI: Datepicker'in refresh methodunu çağıran bir method eklendi. + ## Versiyon 0.10.2 - FIX: Component açıldığında direkt olarak bugünü seçmesi `data-set-date-now` parametresi ile kontrol edildi.