Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Mynij-test
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
Mynij
Mynij-test
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
Show 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,21 +22,25 @@
...
@@ -21,21 +22,25 @@
title
.
href
=
item
.
link
;
title
.
href
=
item
.
link
;
list_item
.
appendChild
(
title
);
list_item
.
appendChild
(
title
);
return
this
.
cut_link
(
item
.
link
)
.
push
(
function
(
cut_link
){
link
=
document
.
createElement
(
"
a
"
);
link
=
document
.
createElement
(
"
a
"
);
link
.
appendChild
(
document
.
createTextNode
(
item
.
link
));
link
.
appendChild
(
document
.
createTextNode
(
cut_
link
));
link
.
href
=
item
.
link
;
link
.
href
=
item
.
link
;
link
.
className
=
"
link
"
;
link
.
className
=
"
link
"
;
link_par
=
document
.
createElement
(
'
p
'
);
link_par
=
document
.
createElement
(
'
p
'
);
link_par
.
appendChild
(
link
);
link_par
.
appendChild
(
link
);
list_item
.
appendChild
(
link_par
);
list_item
.
appendChild
(
link_par
);
})
.
push
(
function
(){
body
=
document
.
createElement
(
'
p
'
);
body
=
document
.
createElement
(
'
p
'
);
body
.
className
=
"
body
"
;
body
.
className
=
"
body
"
;
if
(
key
===
""
){
item
.
body
=
new
DOMParser
().
parseFromString
(
item
.
body
,
"
text/html
"
).
body
.
textContent
||
""
;
if
(
key
===
""
||
item
.
body
===
""
){
body
.
innerHTML
=
""
;
body
.
innerHTML
=
""
;
list
.
appendChild
(
list_item
);
list
.
appendChild
(
list_item
);
}
else
{
}
else
{
return
this
.
cut_description
(
item
.
body
,
key
)
return
gadget
.
cut_description
(
item
.
body
,
key
)
.
push
(
function
(
result
){
.
push
(
function
(
result
){
var
array
=
[...
result
.
matchAll
(
key
)],
var
array
=
[...
result
.
matchAll
(
key
)],
i
;
i
;
...
@@ -46,8 +51,10 @@
...
@@ -46,8 +51,10 @@
list_item
.
appendChild
(
body
);
list_item
.
appendChild
(
body
);
list
.
appendChild
(
list_item
);
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
;
...
@@ -74,3 +78,21 @@
...
@@ -74,3 +78,21 @@
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