rename abstract to abstractinput fix

This commit is contained in:
vitalets
2012-12-10 13:22:04 +04:00
parent c674cdcfcb
commit 4543ecf404
7 changed files with 27 additions and 26 deletions

@ -3,7 +3,7 @@ Address editable input.
Internally value stored as {city: "Moscow", street: "Lenina", building: "15"} Internally value stored as {city: "Moscow", street: "Lenina", building: "15"}
@class address @class address
@extends abstract @extends abstractinput
@final @final
@example @example
<a href="#" id="address" data-type="address" data-pk="1">awesome</a> <a href="#" id="address" data-type="address" data-pk="1">awesome</a>
@ -27,7 +27,7 @@ $(function(){
}; };
//inherit from Abstract input //inherit from Abstract input
$.fn.editableutils.inherit(Address, $.fn.editabletypes.abstract); $.fn.editableutils.inherit(Address, $.fn.editabletypes.abstractinput);
$.extend(Address.prototype, { $.extend(Address.prototype, {
/** /**
@ -152,7 +152,7 @@ $(function(){
} }
}); });
Address.defaults = $.extend({}, $.fn.editabletypes.abstract.defaults, { Address.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
tpl: '<div><label><span>City: </span><input type="text" name="city" class="input-small"></label></div>'+ tpl: '<div><label><span>City: </span><input type="text" name="city" class="input-small"></label></div>'+
'<div><label><span>Street: </span><input type="text" name="street" class="input-small"></label></div>'+ '<div><label><span>Street: </span><input type="text" name="street" class="input-small"></label></div>'+
'<div><label><span>Building: </span><input type="text" name="building" class="input-mini"></label></div>', '<div><label><span>Building: </span><input type="text" name="building" class="input-mini"></label></div>',

@ -1,17 +1,18 @@
/** /**
Abstract editable input class. AbstractInput - base class for all editable inputs.
To create your own input you should inherit from this class. It defines interface to be implemented by any input type.
To create your own input you can inherit from this class.
@class abstract @class AbstractInput
**/ **/
(function ($) { (function ($) {
//types //types
$.fn.editabletypes = {}; $.fn.editabletypes = {};
var Abstract = function () { }; var AbstractInput = function () { };
Abstract.prototype = { AbstractInput.prototype = {
/** /**
Initializes input Initializes input
@ -150,7 +151,7 @@ To create your own input you should inherit from this class.
} }
}; };
Abstract.defaults = { AbstractInput.defaults = {
/** /**
HTML template of input. Normally you should not change it. HTML template of input. Normally you should not change it.
@ -177,6 +178,6 @@ To create your own input you should inherit from this class.
name: null name: null
}; };
$.extend($.fn.editabletypes, {abstract: Abstract}); $.extend($.fn.editabletypes, {abstractinput: AbstractInput});
}(window.jQuery)); }(window.jQuery));

@ -4,7 +4,7 @@ Description and examples: http://vitalets.github.com/bootstrap-datepicker.
For localization you can include js file from here: https://github.com/eternicode/bootstrap-datepicker/tree/master/js/locales For localization you can include js file from here: https://github.com/eternicode/bootstrap-datepicker/tree/master/js/locales
@class date @class date
@extends abstract @extends abstractinput
@final @final
@example @example
<a href="#" id="dob" data-type="date" data-pk="1" data-url="/post" data-original-title="Select date">15/05/1984</a> <a href="#" id="dob" data-type="date" data-pk="1" data-url="/post" data-original-title="Select date">15/05/1984</a>
@ -48,7 +48,7 @@ $(function(){
this.parsedViewFormat = this.dpg.parseFormat(this.options.viewformat); this.parsedViewFormat = this.dpg.parseFormat(this.options.viewformat);
}; };
$.fn.editableutils.inherit(Date, $.fn.editabletypes.abstract); $.fn.editableutils.inherit(Date, $.fn.editabletypes.abstractinput);
$.extend(Date.prototype, { $.extend(Date.prototype, {
render: function () { render: function () {
@ -112,7 +112,7 @@ $(function(){
}); });
Date.defaults = $.extend({}, $.fn.editabletypes.abstract.defaults, { Date.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/** /**
@property tpl @property tpl
@default <div></div> @default <div></div>

@ -4,7 +4,7 @@ Description and examples: http://jqueryui.com/datepicker.
This input is also accessible as **date** type. Do not use it together with __bootstrap-datepicker__ as both apply <code>$().datepicker()</code> method. This input is also accessible as **date** type. Do not use it together with __bootstrap-datepicker__ as both apply <code>$().datepicker()</code> method.
@class dateui @class dateui
@extends abstract @extends abstractinput
@final @final
@example @example
<a href="#" id="dob" data-type="date" data-pk="1" data-url="/post" data-original-title="Select date">15/05/1984</a> <a href="#" id="dob" data-type="date" data-pk="1" data-url="/post" data-original-title="Select date">15/05/1984</a>
@ -46,7 +46,7 @@ $(function(){
this.options.datepicker.dateFormat = this.options.datepicker.format; this.options.datepicker.dateFormat = this.options.datepicker.format;
}; };
$.fn.editableutils.inherit(DateUI, $.fn.editabletypes.abstract); $.fn.editableutils.inherit(DateUI, $.fn.editabletypes.abstractinput);
$.extend(DateUI.prototype, { $.extend(DateUI.prototype, {
render: function () { render: function () {
@ -129,7 +129,7 @@ $(function(){
}); });
DateUI.defaults = $.extend({}, $.fn.editabletypes.abstract.defaults, { DateUI.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/** /**
@property tpl @property tpl
@default <div></div> @default <div></div>

@ -2,7 +2,7 @@
List - abstract class for inputs that have source option loaded from js array or via ajax List - abstract class for inputs that have source option loaded from js array or via ajax
@class list @class list
@extends abstract @extends abstractinput
**/ **/
(function ($) { (function ($) {
@ -10,7 +10,7 @@ List - abstract class for inputs that have source option loaded from js array or
}; };
$.fn.editableutils.inherit(List, $.fn.editabletypes.abstract); $.fn.editableutils.inherit(List, $.fn.editabletypes.abstractinput);
$.extend(List.prototype, { $.extend(List.prototype, {
render: function () { render: function () {
@ -237,7 +237,7 @@ List - abstract class for inputs that have source option loaded from js array or
}); });
List.defaults = $.extend({}, $.fn.editabletypes.abstract.defaults, { List.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/** /**
Source data for list. If string - considered ajax url to load items. Otherwise should be an array. Source data for list. If string - considered ajax url to load items. Otherwise should be an array.
Array format is: <code>[{value: 1, text: "text"}, {...}]</code><br> Array format is: <code>[{value: 1, text: "text"}, {...}]</code><br>

@ -2,7 +2,7 @@
Text input Text input
@class text @class text
@extends abstract @extends abstractinput
@final @final
@example @example
<a href="#" id="username" data-type="text" data-pk="1">awesome</a> <a href="#" id="username" data-type="text" data-pk="1">awesome</a>
@ -20,7 +20,7 @@ $(function(){
this.init('text', options, Text.defaults); this.init('text', options, Text.defaults);
}; };
$.fn.editableutils.inherit(Text, $.fn.editabletypes.abstract); $.fn.editableutils.inherit(Text, $.fn.editabletypes.abstractinput);
$.extend(Text.prototype, { $.extend(Text.prototype, {
activate: function() { activate: function() {
@ -31,7 +31,7 @@ $(function(){
} }
}); });
Text.defaults = $.extend({}, $.fn.editabletypes.abstract.defaults, { Text.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/** /**
@property tpl @property tpl
@default <input type="text"> @default <input type="text">

@ -2,7 +2,7 @@
Textarea input Textarea input
@class textarea @class textarea
@extends abstract @extends abstractinput
@final @final
@example @example
<a href="#" id="comments" data-type="textarea" data-pk="1">awesome comment!</a> <a href="#" id="comments" data-type="textarea" data-pk="1">awesome comment!</a>
@ -21,7 +21,7 @@ $(function(){
this.init('textarea', options, Textarea.defaults); this.init('textarea', options, Textarea.defaults);
}; };
$.fn.editableutils.inherit(Textarea, $.fn.editabletypes.abstract); $.fn.editableutils.inherit(Textarea, $.fn.editabletypes.abstractinput);
$.extend(Textarea.prototype, { $.extend(Textarea.prototype, {
render: function () { render: function () {
@ -66,7 +66,7 @@ $(function(){
} }
}); });
Textarea.defaults = $.extend({}, $.fn.editabletypes.abstract.defaults, { Textarea.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/** /**
@property tpl @property tpl
@default <textarea></textarea> @default <textarea></textarea>