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
2646f9aa
Commit
2646f9aa
authored
Jun 14, 2019
by
Alexandra Rogova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new gui, some other stuff
parent
feb459b4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
65 deletions
+78
-65
gadget_parser.js
gadget_parser.js
+2
-0
gadget_result.html
gadget_result.html
+2
-0
gadget_result.js
gadget_result.js
+46
-34
logo_google.png
logo_google.png
+0
-0
mynij.css
mynij.css
+2
-25
result.css
result.css
+26
-4
search.html
search.html
+0
-2
No files found.
gadget_parser.js
View file @
2646f9aa
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
})
})
.
declareMethod
(
"
remove_css
"
,
function
(
body
){
.
declareMethod
(
"
remove_css
"
,
function
(
body
){
/*var doc = new DOMParser().parseFromString(body, "text/html");
return doc.body.textContent || "";*/
var
regEx
=
new
RegExp
(
'
(style="(.*?)"|style="(.*?)")
'
,
'
gi
'
);
var
regEx
=
new
RegExp
(
'
(style="(.*?)"|style="(.*?)")
'
,
'
gi
'
);
return
body
.
replace
(
regEx
,
""
);
return
body
.
replace
(
regEx
,
""
);
});
});
...
...
gadget_result.html
View file @
2646f9aa
...
@@ -9,8 +9,10 @@
...
@@ -9,8 +9,10 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"result.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"result.css"
>
</head>
</head>
<body>
<body>
<div
id =
"mynij"
><img
src=
"./logo.png"
></div>
<ul
id=
"mynij-results"
>
<ul
id=
"mynij-results"
>
</ul>
</ul>
<div
id =
"google"
><img
src=
"./logo_google.png"
></div>
<ul
id=
"searx-results"
>
<ul
id=
"searx-results"
>
</ul>
</ul>
</body>
</body>
...
...
gadget_result.js
View file @
2646f9aa
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
title
,
title
,
link
,
link
,
link_par
,
link_par
,
body
;
body
,
gadget
=
this
;
list
=
document
.
getElementById
(
"
mynij-results
"
);
list
=
document
.
getElementById
(
"
mynij-results
"
);
list_item
=
document
.
createElement
(
"
LI
"
);
list_item
=
document
.
createElement
(
"
LI
"
);
...
@@ -21,33 +22,39 @@
...
@@ -21,33 +22,39 @@
title
.
href
=
item
.
link
;
title
.
href
=
item
.
link
;
list_item
.
appendChild
(
title
);
list_item
.
appendChild
(
title
);
link
=
document
.
createElement
(
"
a
"
);
return
this
.
cut_link
(
item
.
link
)
link
.
appendChild
(
document
.
createTextNode
(
item
.
link
));
.
push
(
function
(
cut_link
){
link
.
href
=
item
.
link
;
link
=
document
.
createElement
(
"
a
"
);
link
.
className
=
"
link
"
;
link
.
appendChild
(
document
.
createTextNode
(
cut_link
));
link_par
=
document
.
createElement
(
'
p
'
);
link
.
href
=
item
.
link
;
link_par
.
appendChild
(
link
);
link
.
className
=
"
link
"
;
list_item
.
appendChild
(
link_par
);
link_par
=
document
.
createElement
(
'
p
'
);
link_par
.
appendChild
(
link
);
body
=
document
.
createElement
(
'
p
'
);
list_item
.
appendChild
(
link_par
);
body
.
className
=
"
body
"
;
})
if
(
key
===
""
){
.
push
(
function
(){
body
.
innerHTML
=
""
;
body
=
document
.
createElement
(
'
p
'
);
list
.
appendChild
(
list_item
);
body
.
className
=
"
body
"
;
}
else
{
item
.
body
=
new
DOMParser
().
parseFromString
(
item
.
body
,
"
text/html
"
).
body
.
textContent
||
""
;
return
this
.
cut_description
(
item
.
body
,
key
)
if
(
key
===
""
||
item
.
body
===
""
){
.
push
(
function
(
result
){
body
.
innerHTML
=
""
;
var
array
=
[...
result
.
matchAll
(
key
)],
list
.
appendChild
(
list_item
);
i
;
}
else
{
for
(
i
=
0
;
i
<
array
.
length
;
i
+=
1
){
return
gadget
.
cut_description
(
item
.
body
,
key
)
result
=
result
.
slice
(
0
,
array
[
i
].
index
)
+
"
<b>
"
+
result
.
slice
(
array
[
i
].
index
,
array
[
i
].
index
+
array
[
i
][
0
].
length
+
1
)
+
"
</b>
"
+
result
.
slice
(
array
[
i
].
index
+
array
[
i
][
0
].
length
+
1
);
.
push
(
function
(
result
){
}
var
array
=
[...
result
.
matchAll
(
key
)],
body
.
innerHTML
=
result
;
i
;
list_item
.
appendChild
(
body
);
for
(
i
=
0
;
i
<
array
.
length
;
i
+=
1
){
list
.
appendChild
(
list_item
);
result
=
result
.
slice
(
0
,
array
[
i
].
index
)
+
"
<b>
"
+
result
.
slice
(
array
[
i
].
index
,
array
[
i
].
index
+
array
[
i
][
0
].
length
+
1
)
+
"
</b>
"
+
result
.
slice
(
array
[
i
].
index
+
array
[
i
][
0
].
length
+
1
);
}
body
.
innerHTML
=
result
;
list_item
.
appendChild
(
body
);
list
.
appendChild
(
list_item
);
});
}
});
});
}
})
})
.
declareMethod
(
"
show_searx_result
"
,
function
(
item
,
key
){
.
declareMethod
(
"
show_searx_result
"
,
function
(
item
,
key
){
...
@@ -77,7 +84,7 @@
...
@@ -77,7 +84,7 @@
body
=
document
.
createElement
(
"
p
"
);
body
=
document
.
createElement
(
"
p
"
);
body
.
className
=
"
body
"
;
body
.
className
=
"
body
"
;
if
(
item
.
querySelector
(
'
p.result-content
'
)
!==
null
)
body
.
innerHTML
=
item
.
querySelector
(
'
p.result-content
'
).
textContent
;
if
(
item
.
querySelector
(
'
p.result-content
'
)
!==
null
)
body
.
innerHTML
=
item
.
querySelector
(
'
p.result-content
'
).
outerHTML
;
else
body
.
innerHTML
=
""
;
else
body
.
innerHTML
=
""
;
list_item
.
appendChild
(
body
);
list_item
.
appendChild
(
body
);
...
@@ -96,14 +103,19 @@
...
@@ -96,14 +103,19 @@
})
})
.
declareMethod
(
"
cut_description
"
,
function
(
body
,
key
){
.
declareMethod
(
"
cut_description
"
,
function
(
body
,
key
){
var
regEx
,
var
result
=
new
RegExp
(
'
[^.?!]*
'
+
'
'
+
key
+
'
'
+
'
[^.?!]*[.?!]
'
,
'
gm
'
).
exec
(
body
);
result
;
regEx
=
new
RegExp
(
'
[^.?!]*
'
+
'
'
+
key
+
'
'
+
'
[^.?!]*[.?!]
'
,
'
gm
'
);
result
=
regEx
.
exec
(
body
);
if
(
result
===
null
)
{
if
(
result
===
null
)
{
return
new
RegExp
(
'
[^.?!]*[.?!]
'
).
exec
(
body
)[
0
];
result
=
new
RegExp
(
'
[^.?!]*[.?!]
'
).
exec
(
body
);
if
(
result
===
null
)
return
""
;
else
return
result
[
0
];
}
}
else
return
result
[
0
].
slice
(
1
);
else
return
result
[
0
];
})
.
declareMethod
(
"
cut_link
"
,
function
(
link
){
if
(
link
===
undefined
)
return
""
;
if
(
link
.
length
>
70
)
return
link
.
slice
(
0
,
70
)
+
"
...
"
;
else
return
link
;
});
});
}(
window
,
RSVP
,
rJS
,
jIO
));
}(
window
,
RSVP
,
rJS
,
jIO
));
\ No newline at end of file
logo_google.png
0 → 100644
View file @
2646f9aa
88.8 KB
mynij.css
View file @
2646f9aa
...
@@ -4,12 +4,13 @@ body {
...
@@ -4,12 +4,13 @@ body {
height
:
100vh
;
height
:
100vh
;
width
:
100%
;
width
:
100%
;
background
:
#fff
;
background
:
#fff
;
font-family
:
arial
,
sans-serif
;
}
}
form
{
form
{
position
:
relative
;
position
:
relative
;
top
:
3%
;
top
:
3%
;
left
:
10%
;
margin
:
auto
;
width
:
86%
;
width
:
86%
;
max-width
:
50em
;
max-width
:
50em
;
height
:
5%
;
height
:
5%
;
...
@@ -96,27 +97,3 @@ input{
...
@@ -96,27 +97,3 @@ input{
padding-bottom
:
0.2%
;
padding-bottom
:
0.2%
;
}
}
/*
#mynij{
position: fixed;
left: 1.5%;
top: 3.5%;
font-size: 250%;
font-family: "Roboto", Geneva, "Lucida Console", sans-serif;
font-weight: 500;
color: #485a67;
line-height: 38px;
letter-spacing: -1px;
}
*/
#mynij
{
position
:
fixed
;
left
:
1.5%
;
top
:
1.5%
;
}
#mynij
img
{
height
:
5em
;
}
result.css
View file @
2646f9aa
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
}
}
#mynij-results
,
#searx-results
{
#mynij-results
,
#searx-results
{
margin-top
:
4
%
;
margin-top
:
10
%
;
text-align
:
left
;
text-align
:
left
;
}
}
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
list-style-type
:
none
;
list-style-type
:
none
;
position
:
relative
;
position
:
relative
;
display
:
table
;
display
:
table
;
margin-left
:
1
0%
;
margin-left
:
5
0%
;
margin-top
:
1
%
;
margin-top
:
2
%
;
padding-top
:
1%
;
padding-top
:
1%
;
padding-bottom
:
1%
;
padding-bottom
:
1%
;
padding-left
:
1%
;
padding-left
:
1%
;
...
@@ -46,8 +46,12 @@
...
@@ -46,8 +46,12 @@
#mynij-results
>
a
,
#searx-results
>
a
{
#mynij-results
>
a
,
#searx-results
>
a
{
position
:
relative
;
position
:
relative
;
}
}
.highlight
{
font-weight
:
bold
;
}
#mynij-results
>
a
:after
,
#searx-results
>
a
:after
{
#mynij-results
>
a
:after
,
#searx-results
>
a
:after
{
content
:
''
;
content
:
''
;
position
:
absolute
;
position
:
absolute
;
...
@@ -73,4 +77,22 @@
...
@@ -73,4 +77,22 @@
opacity
:
.3
;
opacity
:
.3
;
font-weight
:
100
;
font-weight
:
100
;
font-size
:
.8em
;
font-size
:
.8em
;
}
#mynij
,
#google
{
margin-top
:
4%
;
margin-left
:
30%
;
position
:
absolute
;
}
#google
{
margin-left
:
65%
;
}
#mynij
img
{
height
:
5em
;
}
#google
img
{
height
:
5em
;
}
}
\ No newline at end of file
search.html
View file @
2646f9aa
...
@@ -13,8 +13,6 @@
...
@@ -13,8 +13,6 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"mynij.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"mynij.css"
>
</head>
</head>
<body>
<body>
<!-- <div id ="mynij">Mynij</div> -->
<div
id =
"mynij"
><img
src=
"./logo.png"
height=
"3em"
></div>
<form
id =
"search_bar"
>
<form
id =
"search_bar"
>
<input
type=
"search"
required
>
<input
type=
"search"
required
>
</form>
</form>
...
...
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