Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
a85a4609
Commit
a85a4609
authored
Jan 15, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dropdown z index.
Autoupdate export data on tag add\remove. Format quiz title. Add product search result hint. DOM. add backref element insert ability
parent
9ef1dd74
Pipeline
#509
failed with stage
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
17 deletions
+65
-17
exportLogic.js
public/js/controller/exportLogic.js
+1
-1
quizGenerator.js
public/js/controller/quizGenerator.js
+1
-1
pcg-dom-util.js
public/js/pcg-dom-util.js
+12
-1
generate.js
public/js/view/page/generate.js
+4
-2
products.js
public/js/view/page/products.js
+15
-10
main.css
public/main.css
+32
-2
No files found.
public/js/controller/exportLogic.js
View file @
a85a4609
...
@@ -68,7 +68,7 @@ const formatters = {
...
@@ -68,7 +68,7 @@ const formatters = {
const exportLogic = function(exportEl) {
const exportLogic = function(exportEl) {
store.sub(['exportData', 'exportFormat'], function(exportData, exportFormat) {
store.sub(['exportData', 'exportFormat'
, 'lastUpdate'
], function(exportData, exportFormat) {
var arr = [];
var arr = [];
var fullData = dP[exportData];
var fullData = dP[exportData];
for(var k in fullData){
for(var k in fullData){
...
...
public/js/controller/quizGenerator.js
View file @
a85a4609
...
@@ -171,7 +171,7 @@ const shuffle = function (a) {
...
@@ -171,7 +171,7 @@ const shuffle = function (a) {
const
quizGenerator
=
function
(
type
,
photo
)
{
const
quizGenerator
=
function
(
type
,
photo
)
{
const
cfg
=
probabilityRand
(
quizTypes
[
type
+
(
photo
?
'Photo'
:
''
)]);
const
cfg
=
probabilityRand
(
quizTypes
[
type
+
(
photo
?
'Photo'
:
''
)]);
const
log
=
[
'Quiz generate '
+
type
+
(
photo
?
' with photo'
:
''
)
+
'
. '
+
(
cfg
?
cfg
.
type
:
'
FAIL'
)];
const
log
=
[
'Quiz generate '
+
type
+
(
photo
?
' with photo'
:
''
)
+
'
'
+
(
cfg
?
`„
${
cfg
.
type
}
“`
:
'.
FAIL'
)];
if
(
!
cfg
)
if
(
!
cfg
)
return
{
answers
:
[],
log
};
return
{
answers
:
[],
log
};
const
source
=
cfg
.
from
.
call
(
cfg
,
log
),
const
source
=
cfg
.
from
.
call
(
cfg
,
log
),
...
...
public/js/pcg-dom-util.js
View file @
a85a4609
...
@@ -134,8 +134,19 @@
...
@@ -134,8 +134,19 @@
D
.
appendChild
=
function
(
el
,
subEl
){
D
.
appendChild
=
function
(
el
,
subEl
){
var
type
=
typeof
subEl
;
var
type
=
typeof
subEl
;
if
(
subEl
===
null
){
return
;
}
if
(
type
!==
'object'
){
if
(
type
!==
'object'
){
if
(
subEl
!==
void
0
&&
subEl
!==
false
){
if
(
type
===
'function'
){
var
tmp
=
D
.
span
(
{}
);
el
.
appendChild
(
tmp
);
subEl
(
function
(){
D
.
removeChildren
(
tmp
);
D
.
appendChild
(
tmp
,
[].
slice
.
call
(
arguments
)
)
}
)
}
else
if
(
subEl
!==
void
0
&&
subEl
!==
false
&&
subEl
!==
null
){
el
.
appendChild
(
D
.
Text
(
subEl
)
);
el
.
appendChild
(
D
.
Text
(
subEl
)
);
}
}
}
else
if
(
'dom'
in
subEl
){
}
else
if
(
'dom'
in
subEl
){
...
...
public/js/view/page/generate.js
View file @
a85a4609
...
@@ -15,7 +15,7 @@ view.page.Generate = function() {
...
@@ -15,7 +15,7 @@ view.page.Generate = function() {
result
=
quizGenerator
(
type
,
photo
);
result
=
quizGenerator
(
type
,
photo
);
title
.
inner
Text
=
result
.
question
;
title
.
inner
HTML
=
textFormat
(
result
.
question
)
;
debug
.
value
=
result
.
log
.
join
(
'
\
n'
)
debug
.
value
=
result
.
log
.
join
(
'
\
n'
)
D
.
removeChildren
(
answers
);
D
.
removeChildren
(
answers
);
D
.
appendChild
(
answers
,
result
.
answers
.
map
((
a
)
=>
view
.
cmp
.
Answer
(
a
,
type
)));
D
.
appendChild
(
answers
,
result
.
answers
.
map
((
a
)
=>
view
.
cmp
.
Answer
(
a
,
type
)));
...
@@ -40,7 +40,7 @@ view.page.Generate = function() {
...
@@ -40,7 +40,7 @@ view.page.Generate = function() {
),
),
div
({
cls
:
'generate-controls'
},
div
({
cls
:
'generate-controls'
},
D
.
input
({
D
.
input
({
attr
:
{
type
:
'button'
,
value
:
'
Refresh
'
},
attr
:
{
type
:
'button'
,
value
:
'
F5
'
},
on
:
{
click
:
update
}})),
on
:
{
click
:
update
}})),
div
({
cls
:
'generate-example'
},
div
({
cls
:
'generate-example'
},
...
@@ -48,6 +48,8 @@ view.page.Generate = function() {
...
@@ -48,6 +48,8 @@ view.page.Generate = function() {
answers
=
div
({
cls
:
'generate-answers'
}),
answers
=
div
({
cls
:
'generate-answers'
}),
debug
=
D
.
textarea
({
cls
:
'generate-debug'
})
debug
=
D
.
textarea
({
cls
:
'generate-debug'
})
)
)
);
);
store
.
sub
([
'generateType'
,
'generatePhoto'
],
update
);
store
.
sub
([
'generateType'
,
'generatePhoto'
],
update
);
...
...
public/js/view/page/products.js
View file @
a85a4609
...
@@ -60,7 +60,7 @@ view.page.Products = function() {
...
@@ -60,7 +60,7 @@ view.page.Products = function() {
productTable
.
updateChildByData
(
item
);
productTable
.
updateChildByData
(
item
);
});
});
store
.
set
(
'lastUpdate'
,
+
new
Date
())
}
}
}}}),
}}}),
...
@@ -86,11 +86,16 @@ view.page.Products = function() {
...
@@ -86,11 +86,16 @@ view.page.Products = function() {
dP
.
Tag
.
connectToProduct
(
dP
.
Product
.
getByID
(
item
.
id
),
tag
);
dP
.
Tag
.
connectToProduct
(
dP
.
Product
.
getByID
(
item
.
id
),
tag
);
productTable
.
updateChildByData
(
item
);
productTable
.
updateChildByData
(
item
);
});
});
store
.
set
(
'lastUpdate'
,
+
new
Date
())
}
}
}
}
}),
}),
D
.
span
({
cls
:
'tag-manipulations-add-tag__comment'
},
_
=>
store
.
sub
(
'productFilteredCount'
,
count
=>
_
(
'Найдено: '
+
count
,
count
===
0
?
D
.
span
({},
'Надо больше результатов!'
)
:
(
count
>
30
?
D
.
span
({},
'Не цепляй тэг на всё сразу!'
)
:
null
)
)))
),
),
productTable
=
new
view
.
cmp
.
Table
({
productTable
=
new
view
.
cmp
.
Table
({
sorters
:
[{
id
:
'title'
,
type
:
String
}],
sorters
:
[{
id
:
'title'
,
type
:
String
}],
...
@@ -104,18 +109,18 @@ view.page.Products = function() {
...
@@ -104,18 +109,18 @@ view.page.Products = function() {
},
},
afterFilter
:
(
items
)
=>
store
.
set
(
'productFilteredCount'
,
items
.
length
),
afterFilter
:
(
items
)
=>
store
.
set
(
'productFilteredCount'
,
items
.
length
),
itemTpl
:
(
item
,
me
,
bonus
)
=>
{
itemTpl
:
(
item
,
me
,
bonus
)
=>
{
const
dom
=
div
({
const
dom
=
div
({
cls
:
'table-item table-item__product'
},
cls
:
'table-item table-item__product'
,
on
:
{
click
:
tableAction
},
attr
:{
'data-action'
:
'toggle:'
+
item
.
id
}
},
div
(
{
div
(
{
cls
:
'table-item-action table-item-collapse'
,
cls
:
'table-item-action table-item-collapse'
,
attr
:
{
title
:
'Скрыть'
,
'data-action'
:
'hide:'
+
item
.
id
},
attr
:
{
title
:
'Скрыть'
,
'data-action'
:
'hide:'
+
item
.
id
},
on
:
{
click
:
tableAction
}
on
:
{
click
:
tableAction
}
},
'←'
),
},
'←'
),
span
(
{
cls
:
'product-title'
},
me
.
highlight
(
item
.
title
)
),
span
(
{
cls
:
'product-title'
,
on
:
{
click
:
tableAction
},
attr
:{
'data-action'
:
'toggle:'
+
item
.
id
}
},
me
.
highlight
(
item
.
title
),
' ≡'
),
(
item
.
tags
||
[]
).
map
(
t
=>
me
.
highlight
(
dP
.
tagsHash
[
t
].
name
)
).
map
(
view
.
cmp
.
Tag
),
(
item
.
tags
||
[]
).
map
(
t
=>
me
.
highlight
(
dP
.
tagsHash
[
t
].
name
)
).
map
(
view
.
cmp
.
Tag
),
...
...
public/main.css
View file @
a85a4609
...
@@ -2,7 +2,7 @@ body {
...
@@ -2,7 +2,7 @@ body {
font-family
:
Verdana
,
Serif
;
font-family
:
Verdana
,
Serif
;
}
}
.main-menu
,
.export-sub-menu
{
.main-menu
,
.export-sub-menu
,
.generate-sub-menu
{
display
:
flex
;
display
:
flex
;
}
}
...
@@ -89,7 +89,9 @@ textarea.export-data {
...
@@ -89,7 +89,9 @@ textarea.export-data {
margin-right
:
10%
;
margin-right
:
10%
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.export-sub-menu
.main-menu-item
,
.product-filter__title
,
.product-filter
{
.export-sub-menu
.main-menu-item
,
.product-filter__title
,
.product-filter
,
.generate-sub-menu
.main-menu-item
{
color
:
#fff
;
color
:
#fff
;
}
}
.main-menu-item
{
.main-menu-item
{
...
@@ -165,6 +167,7 @@ body {margin: 0; padding: 0}
...
@@ -165,6 +167,7 @@ body {margin: 0; padding: 0}
border
:
1px
solid
#158b26
;
border
:
1px
solid
#158b26
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
margin-top
:
-1px
;
margin-top
:
-1px
;
z-index
:
1
;
}
}
.cmp-tag-dropdown-item
{
.cmp-tag-dropdown-item
{
margin
:
8px
;
margin
:
8px
;
...
@@ -197,3 +200,29 @@ textarea.generate-debug {
...
@@ -197,3 +200,29 @@ textarea.generate-debug {
margin
:
16px
0
5px
14px
;
margin
:
16px
0
5px
14px
;
height
:
300px
;
height
:
300px
;
}
}
.tag-manipulations-add-tag__comment
{
font-size
:
12px
}
.tag-manipulations-add-tag__comment
span
{
margin-left
:
16px
}
.product-title
{
cursor
:
pointer
;
}
.generate-title
{
font-size
:
18px
;
margin
:
16px
}
.quiz-answer-label
{
margin
:
16px
32px
16px
16px
;
}
.quiz-answer-label
input
{
margin-right
:
8px
}
.generate-controls
{
margin
:
16px
}
\ No newline at end of file
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