Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
6fc656d5
Commit
6fc656d5
authored
Feb 10, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
155b3b1b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
12 deletions
+5
-12
backend/web/plugins/jquery-tag-it/js/tag-it.js
backend/web/plugins/jquery-tag-it/js/tag-it.js
+2
-2
backend/web/plugins/jquery-tag-it/js/tag-it.min.js
backend/web/plugins/jquery-tag-it/js/tag-it.min.js
+1
-1
common/modules/blog/views/post-admin/_form.php
common/modules/blog/views/post-admin/_form.php
+2
-9
No files found.
backend/web/plugins/jquery-tag-it/js/tag-it.js
View file @
6fc656d5
...
@@ -236,12 +236,12 @@
...
@@ -236,12 +236,12 @@
that
.
_lastTag
().
removeClass
(
'
remove ui-state-highlight
'
);
that
.
_lastTag
().
removeClass
(
'
remove ui-state-highlight
'
);
}
}
//
Comma/
Space/Enter are all valid delimiters for new tags,
// Space/Enter are all valid delimiters for new tags,
// except when there is an open quote or if setting allowSpaces = true.
// except when there is an open quote or if setting allowSpaces = true.
// Tab will also create a tag, unless the tag input is empty,
// Tab will also create a tag, unless the tag input is empty,
// in which case it isn't caught.
// in which case it isn't caught.
if
(
if
(
(
event
.
which
===
$
.
ui
.
keyCode
.
COMMA
&&
event
.
shiftKey
===
false
)
||
/*(event.which === $.ui.keyCode.COMMA && event.shiftKey === false) || */
event
.
which
===
$
.
ui
.
keyCode
.
ENTER
||
event
.
which
===
$
.
ui
.
keyCode
.
ENTER
||
(
(
event
.
which
==
$
.
ui
.
keyCode
.
TAB
&&
event
.
which
==
$
.
ui
.
keyCode
.
TAB
&&
...
...
backend/web/plugins/jquery-tag-it/js/tag-it.min.js
View file @
6fc656d5
...
@@ -3,7 +3,7 @@ this;this.element.is("input")?(this.tagList=b("<ul></ul>").insertAfter(this.elem
...
@@ -3,7 +3,7 @@ this;this.element.is("input")?(this.tagList=b("<ul></ul>").insertAfter(this.elem
this
.
options
.
placeholderText
);
this
.
options
.
autocomplete
.
source
||
(
this
.
options
.
autocomplete
.
source
=
function
(
a
,
e
){
var
d
=
a
.
term
.
toLowerCase
(),
c
=
b
.
grep
(
this
.
options
.
availableTags
,
function
(
a
){
return
0
===
a
.
toLowerCase
().
indexOf
(
d
)});
this
.
options
.
allowDuplicates
||
(
c
=
this
.
_subtractArray
(
c
,
this
.
assignedTags
()));
e
(
c
)});
this
.
options
.
showAutocompleteOnFocus
&&
(
this
.
tagInput
.
focus
(
function
(
b
,
d
){
a
.
_showAutocomplete
()}),
"
undefined
"
===
typeof
this
.
options
.
autocomplete
.
minLength
&&
(
this
.
options
.
autocomplete
.
minLength
=
this
.
options
.
placeholderText
);
this
.
options
.
autocomplete
.
source
||
(
this
.
options
.
autocomplete
.
source
=
function
(
a
,
e
){
var
d
=
a
.
term
.
toLowerCase
(),
c
=
b
.
grep
(
this
.
options
.
availableTags
,
function
(
a
){
return
0
===
a
.
toLowerCase
().
indexOf
(
d
)});
this
.
options
.
allowDuplicates
||
(
c
=
this
.
_subtractArray
(
c
,
this
.
assignedTags
()));
e
(
c
)});
this
.
options
.
showAutocompleteOnFocus
&&
(
this
.
tagInput
.
focus
(
function
(
b
,
d
){
a
.
_showAutocomplete
()}),
"
undefined
"
===
typeof
this
.
options
.
autocomplete
.
minLength
&&
(
this
.
options
.
autocomplete
.
minLength
=
0
));
b
.
isFunction
(
this
.
options
.
autocomplete
.
source
)
&&
(
this
.
options
.
autocomplete
.
source
=
b
.
proxy
(
this
.
options
.
autocomplete
.
source
,
this
));
b
.
isFunction
(
this
.
options
.
tagSource
)
&&
(
this
.
options
.
tagSource
=
b
.
proxy
(
this
.
options
.
tagSource
,
this
));
this
.
tagList
.
addClass
(
"
tagit
"
).
addClass
(
"
ui-widget ui-widget-content ui-corner-all
"
).
append
(
b
(
'
<li class="tagit-new"></li>
'
).
append
(
this
.
tagInput
)).
click
(
function
(
d
){
var
c
=
b
(
d
.
target
);
c
.
hasClass
(
"
tagit-label
"
)?(
c
=
c
.
closest
(
"
.tagit-choice
"
),
c
.
hasClass
(
"
removed
"
)
||
a
.
_trigger
(
"
onTagClicked
"
,
0
));
b
.
isFunction
(
this
.
options
.
autocomplete
.
source
)
&&
(
this
.
options
.
autocomplete
.
source
=
b
.
proxy
(
this
.
options
.
autocomplete
.
source
,
this
));
b
.
isFunction
(
this
.
options
.
tagSource
)
&&
(
this
.
options
.
tagSource
=
b
.
proxy
(
this
.
options
.
tagSource
,
this
));
this
.
tagList
.
addClass
(
"
tagit
"
).
addClass
(
"
ui-widget ui-widget-content ui-corner-all
"
).
append
(
b
(
'
<li class="tagit-new"></li>
'
).
append
(
this
.
tagInput
)).
click
(
function
(
d
){
var
c
=
b
(
d
.
target
);
c
.
hasClass
(
"
tagit-label
"
)?(
c
=
c
.
closest
(
"
.tagit-choice
"
),
c
.
hasClass
(
"
removed
"
)
||
a
.
_trigger
(
"
onTagClicked
"
,
d
,{
tag
:
c
,
tagLabel
:
a
.
tagLabel
(
c
)})):
a
.
tagInput
.
focus
()});
var
c
=!
1
;
if
(
this
.
options
.
singleField
)
if
(
this
.
options
.
singleFieldNode
){
var
d
=
b
(
this
.
options
.
singleFieldNode
),
f
=
d
.
val
().
split
(
this
.
options
.
singleFieldDelimiter
);
d
.
val
(
""
);
b
.
each
(
f
,
function
(
b
,
d
){
a
.
createTag
(
d
,
null
,
!
0
);
c
=!
0
})}
else
this
.
options
.
singleFieldNode
=
b
(
'
<input type="hidden" style="display:none;" value="" name="
'
+
this
.
options
.
fieldName
+
'
" />
'
),
this
.
tagList
.
after
(
this
.
options
.
singleFieldNode
);
c
||
this
.
tagList
.
children
(
"
li
"
).
each
(
function
(){
b
(
this
).
hasClass
(
"
tagit-new
"
)
||
d
,{
tag
:
c
,
tagLabel
:
a
.
tagLabel
(
c
)})):
a
.
tagInput
.
focus
()});
var
c
=!
1
;
if
(
this
.
options
.
singleField
)
if
(
this
.
options
.
singleFieldNode
){
var
d
=
b
(
this
.
options
.
singleFieldNode
),
f
=
d
.
val
().
split
(
this
.
options
.
singleFieldDelimiter
);
d
.
val
(
""
);
b
.
each
(
f
,
function
(
b
,
d
){
a
.
createTag
(
d
,
null
,
!
0
);
c
=!
0
})}
else
this
.
options
.
singleFieldNode
=
b
(
'
<input type="hidden" style="display:none;" value="" name="
'
+
this
.
options
.
fieldName
+
'
" />
'
),
this
.
tagList
.
after
(
this
.
options
.
singleFieldNode
);
c
||
this
.
tagList
.
children
(
"
li
"
).
each
(
function
(){
b
(
this
).
hasClass
(
"
tagit-new
"
)
||
(
a
.
createTag
(
b
(
this
).
text
(),
b
(
this
).
attr
(
"
class
"
),
!
0
),
b
(
this
).
remove
())});
this
.
tagInput
.
keydown
(
function
(
c
){
if
(
c
.
which
==
b
.
ui
.
keyCode
.
BACKSPACE
&&
""
===
a
.
tagInput
.
val
()){
var
d
=
a
.
_lastTag
();
!
a
.
options
.
removeConfirmation
||
d
.
hasClass
(
"
remove
"
)?
a
.
removeTag
(
d
):
a
.
options
.
removeConfirmation
&&
d
.
addClass
(
"
remove ui-state-highlight
"
)}
else
a
.
options
.
removeConfirmation
&&
a
.
_lastTag
().
removeClass
(
"
remove ui-state-highlight
"
);
if
(
c
.
which
===
b
.
ui
.
keyCode
.
COMMA
&&!
1
===
c
.
shiftKey
||
c
.
which
===
b
.
ui
.
keyCode
.
ENTER
||
c
.
which
==
(
a
.
createTag
(
b
(
this
).
text
(),
b
(
this
).
attr
(
"
class
"
),
!
0
),
b
(
this
).
remove
())});
this
.
tagInput
.
keydown
(
function
(
c
){
if
(
c
.
which
==
b
.
ui
.
keyCode
.
BACKSPACE
&&
""
===
a
.
tagInput
.
val
()){
var
d
=
a
.
_lastTag
();
!
a
.
options
.
removeConfirmation
||
d
.
hasClass
(
"
remove
"
)?
a
.
removeTag
(
d
):
a
.
options
.
removeConfirmation
&&
d
.
addClass
(
"
remove ui-state-highlight
"
)}
else
a
.
options
.
removeConfirmation
&&
a
.
_lastTag
().
removeClass
(
"
remove ui-state-highlight
"
);
if
(
/*c.which===b.ui.keyCode.COMMA&&!1===c.shiftKey||*/
c
.
which
===
b
.
ui
.
keyCode
.
ENTER
||
c
.
which
==
b
.
ui
.
keyCode
.
TAB
&&
""
!==
a
.
tagInput
.
val
()
||
c
.
which
==
b
.
ui
.
keyCode
.
SPACE
&&!
0
!==
a
.
options
.
allowSpaces
&&
(
'
"
'
!=
b
.
trim
(
a
.
tagInput
.
val
()).
replace
(
/^s*/
,
""
).
charAt
(
0
)
||
'
"
'
==
b
.
trim
(
a
.
tagInput
.
val
()).
charAt
(
0
)
&&
'
"
'
==
b
.
trim
(
a
.
tagInput
.
val
()).
charAt
(
b
.
trim
(
a
.
tagInput
.
val
()).
length
-
1
)
&&
0
!==
b
.
trim
(
a
.
tagInput
.
val
()).
length
-
1
))
c
.
which
===
b
.
ui
.
keyCode
.
ENTER
&&
""
===
a
.
tagInput
.
val
()
||
c
.
preventDefault
(),
a
.
options
.
autocomplete
.
autoFocus
&&
a
.
tagInput
.
data
(
"
autocomplete-open
"
)
||
(
a
.
tagInput
.
autocomplete
(
"
close
"
),
a
.
createTag
(
a
.
_cleanedInput
()))}).
blur
(
function
(
b
){
a
.
tagInput
.
data
(
"
autocomplete-open
"
)
||
b
.
ui
.
keyCode
.
TAB
&&
""
!==
a
.
tagInput
.
val
()
||
c
.
which
==
b
.
ui
.
keyCode
.
SPACE
&&!
0
!==
a
.
options
.
allowSpaces
&&
(
'
"
'
!=
b
.
trim
(
a
.
tagInput
.
val
()).
replace
(
/^s*/
,
""
).
charAt
(
0
)
||
'
"
'
==
b
.
trim
(
a
.
tagInput
.
val
()).
charAt
(
0
)
&&
'
"
'
==
b
.
trim
(
a
.
tagInput
.
val
()).
charAt
(
b
.
trim
(
a
.
tagInput
.
val
()).
length
-
1
)
&&
0
!==
b
.
trim
(
a
.
tagInput
.
val
()).
length
-
1
))
c
.
which
===
b
.
ui
.
keyCode
.
ENTER
&&
""
===
a
.
tagInput
.
val
()
||
c
.
preventDefault
(),
a
.
options
.
autocomplete
.
autoFocus
&&
a
.
tagInput
.
data
(
"
autocomplete-open
"
)
||
(
a
.
tagInput
.
autocomplete
(
"
close
"
),
a
.
createTag
(
a
.
_cleanedInput
()))}).
blur
(
function
(
b
){
a
.
tagInput
.
data
(
"
autocomplete-open
"
)
||
a
.
createTag
(
a
.
_cleanedInput
())});
if
(
this
.
options
.
availableTags
||
this
.
options
.
tagSource
||
this
.
options
.
autocomplete
.
source
)
d
=
{
select
:
function
(
b
,
c
){
a
.
createTag
(
c
.
item
.
value
);
return
!
1
}},
b
.
extend
(
d
,
this
.
options
.
autocomplete
),
d
.
source
=
this
.
options
.
tagSource
||
d
.
source
,
this
.
tagInput
.
autocomplete
(
d
).
bind
(
"
autocompleteopen.tagit
"
,
function
(
b
,
c
){
a
.
tagInput
.
data
(
"
autocomplete-open
"
,
!
0
)}).
bind
(
"
autocompleteclose.tagit
"
,
function
(
b
,
c
){
a
.
tagInput
.
data
(
"
autocomplete-open
"
,
!
1
)}),
this
.
tagInput
.
autocomplete
(
"
widget
"
).
addClass
(
"
tagit-autocomplete
"
)},
a
.
createTag
(
a
.
_cleanedInput
())});
if
(
this
.
options
.
availableTags
||
this
.
options
.
tagSource
||
this
.
options
.
autocomplete
.
source
)
d
=
{
select
:
function
(
b
,
c
){
a
.
createTag
(
c
.
item
.
value
);
return
!
1
}},
b
.
extend
(
d
,
this
.
options
.
autocomplete
),
d
.
source
=
this
.
options
.
tagSource
||
d
.
source
,
this
.
tagInput
.
autocomplete
(
d
).
bind
(
"
autocompleteopen.tagit
"
,
function
(
b
,
c
){
a
.
tagInput
.
data
(
"
autocomplete-open
"
,
!
0
)}).
bind
(
"
autocompleteclose.tagit
"
,
function
(
b
,
c
){
a
.
tagInput
.
data
(
"
autocomplete-open
"
,
!
1
)}),
this
.
tagInput
.
autocomplete
(
"
widget
"
).
addClass
(
"
tagit-autocomplete
"
)},
destroy
:
function
(){
b
.
Widget
.
prototype
.
destroy
.
call
(
this
);
this
.
element
.
unbind
(
"
.tagit
"
);
this
.
tagList
.
unbind
(
"
.tagit
"
);
this
.
tagInput
.
removeData
(
"
autocomplete-open
"
);
this
.
tagList
.
removeClass
(
"
tagit ui-widget ui-widget-content ui-corner-all tagit-hidden-field
"
);
this
.
element
.
is
(
"
input
"
)?(
this
.
element
.
removeClass
(
"
tagit-hidden-field
"
),
this
.
tagList
.
remove
()):(
this
.
element
.
children
(
"
li
"
).
each
(
function
(){
b
(
this
).
hasClass
(
"
tagit-new
"
)?
b
(
this
).
remove
():(
b
(
this
).
removeClass
(
"
tagit-choice ui-widget-content ui-state-default ui-state-highlight ui-corner-all remove tagit-choice-editable tagit-choice-read-only
"
),
destroy
:
function
(){
b
.
Widget
.
prototype
.
destroy
.
call
(
this
);
this
.
element
.
unbind
(
"
.tagit
"
);
this
.
tagList
.
unbind
(
"
.tagit
"
);
this
.
tagInput
.
removeData
(
"
autocomplete-open
"
);
this
.
tagList
.
removeClass
(
"
tagit ui-widget ui-widget-content ui-corner-all tagit-hidden-field
"
);
this
.
element
.
is
(
"
input
"
)?(
this
.
element
.
removeClass
(
"
tagit-hidden-field
"
),
this
.
tagList
.
remove
()):(
this
.
element
.
children
(
"
li
"
).
each
(
function
(){
b
(
this
).
hasClass
(
"
tagit-new
"
)?
b
(
this
).
remove
():(
b
(
this
).
removeClass
(
"
tagit-choice ui-widget-content ui-state-default ui-state-highlight ui-corner-all remove tagit-choice-editable tagit-choice-read-only
"
),
...
...
common/modules/blog/views/post-admin/_form.php
View file @
6fc656d5
...
@@ -48,6 +48,7 @@ use common\modules\content\widgets\MetaTagsWidget;
...
@@ -48,6 +48,7 @@ use common\modules\content\widgets\MetaTagsWidget;
'delay'
=>
500
,
'delay'
=>
500
,
'minLength'
=>
1
,
'minLength'
=>
1
,
],
],
'triggerKeys'
=>
[
'enter'
,
'space'
,
'tab'
],
]
]
]);
?>
]);
?>
...
@@ -82,11 +83,3 @@ use common\modules\content\widgets\MetaTagsWidget;
...
@@ -82,11 +83,3 @@ use common\modules\content\widgets\MetaTagsWidget;
<?php
ActiveForm
::
end
();
?>
<?php
ActiveForm
::
end
();
?>
</div>
</div>
\ No newline at end of file
<script
type=
"text/javascript"
>
$
(
function
(){
$
(
'
#jquery-tagIt-tags
'
).
tagit
({
availableTags
:
[
"
c++
"
,
"
java
"
,
"
php
"
,
"
javascript
"
,
"
ruby
"
,
"
python
"
,
"
c
"
]
});
});
</script>
\ 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