forked from 0x2620/oxjs
splitpanel rewrite
This commit is contained in:
parent
62e6c0d84c
commit
1b68e49a2a
3 changed files with 322 additions and 14 deletions
|
|
@ -1,8 +1,29 @@
|
|||
// todo: check http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
|
||||
|
||||
var Ox = {
|
||||
version: '0.1.2'
|
||||
};
|
||||
/*
|
||||
(function() {
|
||||
var methods = {
|
||||
'array': ['pop', 'push', 'shift', 'unshift'],
|
||||
'string': [
|
||||
'charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf',
|
||||
'match', 'replace', 'search', 'slice', 'split',
|
||||
'substr', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase',
|
||||
'toString', 'toUpperCase', 'trim', 'trimLeft, 'trimRight',
|
||||
'valueOf'
|
||||
]
|
||||
},
|
||||
global = this;
|
||||
return function Ox(val) {
|
||||
var ret,
|
||||
type = Ox.typeof(val);
|
||||
if (type == 'array') {
|
||||
|
||||
}
|
||||
}
|
||||
})();
|
||||
*/
|
||||
|
||||
Ox = {};
|
||||
|
||||
/*
|
||||
================================================================================
|
||||
|
|
@ -74,6 +95,7 @@ Ox.TYPES = [
|
|||
'Arguments', 'Array', 'Boolean', 'Date', 'Element', 'Function', 'Infinity',
|
||||
'NaN', 'Null', 'Number', 'Object', 'RegExp', 'String', 'Undefined'
|
||||
];
|
||||
Ox.VERSION = '0.1.2';
|
||||
Ox.WEEKDAYS = [
|
||||
'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'
|
||||
];
|
||||
|
|
@ -99,7 +121,7 @@ Ox.getset = function(obj, args, callback, context) {
|
|||
Ox.getset(obj, [key, val], callback, context)
|
||||
Ox.getset(obj, [{key: val, ...}], callback, context) sets obj.key to val,
|
||||
calls callback(key, val)
|
||||
for any changed value,
|
||||
for each changed value,
|
||||
returns context
|
||||
(for chaining)
|
||||
|
||||
|
|
@ -2310,7 +2332,7 @@ Ox.endsWith = function(str, sub) {
|
|||
>>> Ox.endsWith("foobar", "bar")
|
||||
true
|
||||
*/
|
||||
return str.substr(-sub.length) === sub;
|
||||
return str.toString().substr(-sub.length) === sub;
|
||||
};
|
||||
|
||||
Ox.highlight = function(txt, str) {
|
||||
|
|
@ -2371,7 +2393,7 @@ Ox.reverse = function(str) {
|
|||
Ox.reverse("foo")
|
||||
oof
|
||||
*/
|
||||
return str.split('').reverse().join('');
|
||||
return str.toString().split('').reverse().join('');
|
||||
};
|
||||
|
||||
Ox.startsWith = function(str, sub) {
|
||||
|
|
@ -2379,7 +2401,7 @@ Ox.startsWith = function(str, sub) {
|
|||
>>> Ox.startsWith("foobar", "foo")
|
||||
true
|
||||
*/
|
||||
return str.substr(0, sub.length) === sub;
|
||||
return str.toString().substr(0, sub.length) === sub;
|
||||
};
|
||||
|
||||
Ox.stripTags = function(str) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue