Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
jio
Commits
fe6aabc5
Commit
fe6aabc5
authored
Jun 05, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
query{,factory}.js: updated to manage no query
parent
0d528f2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
src/queries/query.js
src/queries/query.js
+10
-6
src/queries/queryfactory.js
src/queries/queryfactory.js
+8
-2
No files found.
src/queries/query.js
View file @
fe6aabc5
...
...
@@ -50,9 +50,7 @@ var Query = newClass(function (spec) {
item_list
.
splice
(
option
.
limit
[
1
]);
}
}
if
(
option
.
select_list
)
{
Query
.
filterListSelect
(
option
.
select_list
,
item_list
);
}
Query
.
filterListSelect
(
option
.
select_list
||
[],
item_list
);
};
/**
...
...
@@ -62,7 +60,9 @@ var Query = newClass(function (spec) {
* @param {Object} item The object to test
* @return {Boolean} true if match, false otherwise
*/
this
.
match
=
null
;
// function (item, wildcard_character) {};
this
.
match
=
function
(
item
,
wildcard_character
)
{
return
true
;
};
/**
...
...
@@ -71,7 +71,9 @@ var Query = newClass(function (spec) {
* @method toString
* @return {String} The string version of this query
*/
this
.
toString
=
null
;
// function () {};
this
.
toString
=
function
()
{
return
""
;
};
/**
* Convert this query to an jsonable object in order to be remake thanks to
...
...
@@ -80,7 +82,9 @@ var Query = newClass(function (spec) {
* @method serialized
* @return {Object} The jsonable object
*/
this
.
serialized
=
null
;
// function () {};
this
.
serialized
=
function
()
{
return
undefined
;
};
},
{
"
static_methods
"
:
{
...
...
src/queries/queryfactory.js
View file @
fe6aabc5
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global _export: true, ComplexQuery: true, SimpleQuery: true,
newClass: true */
newClass: true
, Query: true
*/
// XXX
var
query_class_dict
=
{},
QueryFactory
;
...
...
@@ -10,7 +10,13 @@ QueryFactory = newClass({
"
static_methods
"
:
{
// XXX
"
create
"
:
function
(
object
)
{
if
(
typeof
object
.
type
===
"
string
"
&&
if
(
object
===
""
)
{
return
new
Query
();
}
if
(
typeof
object
===
"
string
"
)
{
object
=
Query
.
parseStringToObject
(
object
);
}
if
(
typeof
(
object
||
{}).
type
===
"
string
"
&&
query_class_dict
[
object
.
type
])
{
return
new
query_class_dict
[
object
.
type
](
object
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment