Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Mynij
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
Alexandra Rogova
Mynij
Commits
7576610c
Commit
7576610c
authored
May 28, 2019
by
Alexandra Rogova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
saving works, now working on queries
parent
a404e13f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
62 deletions
+49
-62
gadget_model.js
gadget_model.js
+6
-19
gadget_parser.js
gadget_parser.js
+32
-37
search.html
search.html
+1
-0
search.js
search.js
+10
-6
No files found.
gadget_model.js
View file @
7576610c
...
@@ -17,17 +17,6 @@
...
@@ -17,17 +17,6 @@
this
.
sub_storages
=
[];
this
.
sub_storages
=
[];
/*this.search_storage = jIO.createJIO({
type : "query",
sub_storage:{
type : "uuid",
sub_storage : {
type: "indexeddb",
database: "mynij-v1"
}
}
});*/
this
.
info
=
jIO
.
createJIO
({
this
.
info
=
jIO
.
createJIO
({
type
:
"
indexeddb
"
,
type
:
"
indexeddb
"
,
database
:
"
mynij-v1-info
"
database
:
"
mynij-v1-info
"
...
@@ -37,9 +26,10 @@
...
@@ -37,9 +26,10 @@
})
})
.
declareMethod
(
"
add_attachment
"
,
function
(
title
,
rss
){
.
declareMethod
(
"
add_attachment
"
,
function
(
title
,
rss
){
var
gadget
=
this
;
return
this
.
feeds
.
putAttachment
(
"
feeds_doc
"
,
title
,
new
Blob
([
rss
],
{
type
:
"
text/xml
"
}))
return
this
.
feeds
.
putAttachment
(
"
feeds_doc
"
,
title
,
new
Blob
([
rss
],
{
type
:
"
text/xml
"
}))
.
push
(
function
(){
.
push
(
function
(){
this
.
sub_storages
.
push
(
{
var
new_sub_storage
=
{
type
:
"
my_parser
"
,
type
:
"
my_parser
"
,
document_id
:
"
feeds_doc
"
,
document_id
:
"
feeds_doc
"
,
attachment_id
:
title
,
attachment_id
:
title
,
...
@@ -48,18 +38,15 @@
...
@@ -48,18 +38,15 @@
type
:
"
indexeddb
"
,
type
:
"
indexeddb
"
,
database
:
"
mynij-v1.2
"
database
:
"
mynij-v1.2
"
}
}
});
}
this
.
search_storage
=
jIO
.
createJIO
({
gadget
.
sub_storages
.
push
(
new_sub_storage
);
gadget
.
search_storage
=
jIO
.
createJIO
({
type
:
"
union
"
,
type
:
"
union
"
,
storage_list
:
this
.
sub_storages
storage_list
:
gadget
.
sub_storages
});
});
});
});
})
})
.
declareMethod
(
"
put
"
,
function
()
{
// deprecated
return
this
.
search_storage
.
post
.
apply
(
this
.
search_storage
,
arguments
);
})
.
declareMethod
(
"
get
"
,
function
()
{
.
declareMethod
(
"
get
"
,
function
()
{
return
this
.
search_storage
.
get
.
apply
(
this
.
search_storage
,
arguments
);
return
this
.
search_storage
.
get
.
apply
(
this
.
search_storage
,
arguments
);
})
})
...
...
gadget_parser.js
View file @
7576610c
...
@@ -6,43 +6,35 @@
...
@@ -6,43 +6,35 @@
.
declareAcquiredMethod
(
"
get_model
"
,
"
get_model
"
)
.
declareAcquiredMethod
(
"
get_model
"
,
"
get_model
"
)
.
setState
({
.
declareMethod
(
"
read_file_new
"
,
function
(
link
){
storage
:
null
var
gadget
=
this
,
})
storage
;
.
ready
(
function
(){
var
gadget
=
this
;
return
gadget
.
get_model
()
return
gadget
.
get_model
()
.
push
(
function
(
result
){
.
push
(
function
(
result
){
return
gadget
.
changeState
({
storage
=
result
;
storage
:
result
});
});
})
})
.
push
(
function
(){
.
declareMethod
(
"
read_file_new
"
,
function
(
link
){
var
xmlhttp
=
new
XMLHttpRequest
();
var
gadget
=
this
,
xmlhttp
=
new
XMLHttpRequest
();
xmlhttp
.
onreadystatechange
=
function
()
{
xmlhttp
.
onreadystatechange
=
function
()
{
if
(
xmlhttp
.
status
==
200
&&
xmlhttp
.
readyState
==
4
){
if
(
xmlhttp
.
status
==
200
&&
xmlhttp
.
readyState
==
4
){
var
rss
,
var
rss
,
title
;
title
;
rss
=
xmlhttp
.
responseText
;
rss
=
xmlhttp
.
responseText
;
title
=
rss
.
slice
(
rss
.
indexOf
(
"
<title>
"
)
+
7
,
rss
.
indexOf
(
"
</title>
"
));
title
=
rss
.
slice
(
rss
.
indexOf
(
"
<title>
"
)
+
7
,
rss
.
indexOf
(
"
</title>
"
));
return
gadget
.
is_already_pars
ed
(
title
)
return
gadget
.
is_already_load
ed
(
title
)
.
push
(
function
(
is_pars
ed
){
.
push
(
function
(
is_load
ed
){
if
(
!
is_pars
ed
){
if
(
!
is_load
ed
){
return
gadget
.
remove_css
(
rss
)
return
gadget
.
remove_css
(
rss
)
.
push
(
function
(
rss_without_css
){
.
push
(
function
(
rss_without_css
){
return
gadget
.
state
.
storage
.
add_attachment
(
title
,
rss_without_css
);
return
storage
.
add_attachment
(
title
,
rss_without_css
);
});
});
}
}
});
});
}
}
}
};
xmlhttp
.
open
(
"
GET
"
,
link
,
true
);
xmlhttp
.
open
(
"
GET
"
,
link
,
true
);
xmlhttp
.
send
();
xmlhttp
.
send
();
});
})
})
.
declareMethod
(
"
remove_css
"
,
function
(
body
){
.
declareMethod
(
"
remove_css
"
,
function
(
body
){
...
@@ -50,8 +42,11 @@
...
@@ -50,8 +42,11 @@
return
body
.
replace
(
regEx
,
""
);
return
body
.
replace
(
regEx
,
""
);
})
})
.
declareMethod
(
"
is_already_parsed
"
,
function
(
title
){
.
declareMethod
(
"
is_already_loaded
"
,
function
(
title
){
return
this
.
state
.
storage
.
all_loaded_docs
()
return
this
.
get_model
()
.
push
(
function
(
storage
){
return
storage
.
all_loaded_docs
();
})
.
push
(
function
(
result
){
.
push
(
function
(
result
){
var
i
;
var
i
;
for
(
i
=
0
;
i
<
result
.
data
.
rows
.
length
;
i
+=
1
){
for
(
i
=
0
;
i
<
result
.
data
.
rows
.
length
;
i
+=
1
){
...
...
search.html
View file @
7576610c
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<title>
Mynij
</title>
<title>
Mynij
</title>
<script
src=
"../jio/external/rsvp-2.0.4.js"
></script>
<script
src=
"../jio/external/rsvp-2.0.4.js"
></script>
<script
src=
"../jio/dist/jio-latest.js"
></script>
<script
src=
"../jio/dist/jio-latest.js"
></script>
<script
src=
"jio.my_parser_storage.js"
></script>
<script
src=
"../renderjs/dist/renderjs-latest.js"
></script>
<script
src=
"../renderjs/dist/renderjs-latest.js"
></script>
<script
src=
"search.js"
></script>
<script
src=
"search.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"mynij.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"mynij.css"
>
...
...
search.js
View file @
7576610c
...
@@ -23,10 +23,6 @@
...
@@ -23,10 +23,6 @@
]
]
})
})
.
allowPublicAcquisition
(
"
get_model
"
,
function
(){
return
this
.
getDeclaredGadget
(
"
model
"
);
})
.
ready
(
function
(){
.
ready
(
function
(){
var
model_gadget
,
var
model_gadget
,
result_gadget
;
result_gadget
;
...
@@ -65,8 +61,16 @@
...
@@ -65,8 +61,16 @@
RSVP
.
all
(
promise_list
);
RSVP
.
all
(
promise_list
);
})
})
.
allowPublicAcquisition
(
"
get_model
"
,
function
(){
return
this
.
getDeclaredGadget
(
"
model
"
);
})
.
declareMethod
(
"
search
"
,
function
(
key
){
.
declareMethod
(
"
search
"
,
function
(
key
){
var
gadget
=
this
,
return
this
.
state
.
model_gadget
.
search
()
.
push
(
function
(
result
){
console
.
log
(
result
);
})
/*var gadget = this,
options;
options;
options = {
options = {
...
@@ -102,7 +106,7 @@
...
@@ -102,7 +106,7 @@
promise_list.push(gadget.state.result_gadget.addItem(result_list[j], key));
promise_list.push(gadget.state.result_gadget.addItem(result_list[j], key));
}
}
return RSVP.all(promise_list);
return RSVP.all(promise_list);
});
});
*/
})
})
.
onEvent
(
"
submit
"
,
function
(
event
){
.
onEvent
(
"
submit
"
,
function
(
event
){
...
...
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