').append(color_input)))
+ .show();
name_input.focus();
- color_input.miniColors({colorValues: rcmail.env.mscolors});
+ color_input.minicolors(rcmail.env.minicolors_config || {});
}
// save tags form (create/update/delete tags)
@@ -407,6 +420,7 @@ function update_tags(response)
rcmail.env.tags[i] = tag;
});
+ rcmail.triggerEvent('kolab-tags-update', {});
rcmail.enable_command('reset-tags', tagsfilter.length && list);
// update Mark menu in case some messages are already selected
@@ -645,7 +659,7 @@ function message_list_update_tags(e)
// add tags to message subject in message preview
function message_tags(tags, merge)
{
- var boxes = [], subject_tag = $('#messageheader .subject');
+ var boxes = [], subject_tag = $('#messageheader .subject,#message-header h2.subject'); // Larry and Elastic
$.each(tags || [], function (i, tag) {
if (merge) {
@@ -697,6 +711,10 @@ function tag_box_element(tag, del_btn)
function tag_set_color(obj, tag)
{
if (obj && tag.color) {
+ if (rcmail.triggerEvent('kolab-tag-color', {obj: obj, tag: tag}) === false) {
+ return;
+ }
+
var style = 'background-color: ' + tag.color + ' !important';
// choose black text color when background is bright, white otherwise
@@ -726,7 +744,6 @@ function tag_selector(event, callback, remove_mode)
span = document.createElement('span');
link.href = '#';
- link.className = 'active';
container = $('')
.keydown(function(e) {
var focused = $('*:focus', container).parent();
@@ -756,7 +773,7 @@ function tag_selector(event, callback, remove_mode)
// add tag name element
tmp = span.cloneNode(false);
$(tmp).text(tag.name);
- $(a).data('uid', tag.uid);
+ $(a).data('uid', tag.uid).attr('class', 'tag active ' + tag_class_name(tag));
a.appendChild(tmp);
row.appendChild(a);
@@ -810,7 +827,7 @@ function tag_selector(event, callback, remove_mode)
// we also hide the search input, if there's not many tags left
if ($('a:visible', container).length < max_items) {
- $('input', container).parent().hide();
+ $('input', container).parents('li')[0].hide();
}
}
}
@@ -825,35 +842,40 @@ function tag_selector_reset()
function tag_selector_search_element(container)
{
var title = rcmail.gettext('kolab_tags.tagsearchnew'),
- placeholder = rcmail.gettext('kolab_tags.newtag');
-
- var input = $('
').attr({'type': 'text', title: title, placeholder: placeholder})
- .keyup(function(e) {
- if (this.value) {
- // execute action on Enter
- if (e.which == 13) {
- container.data('callback')({name: this.value});
- rcmail.hide_menu('tag-selector', e);
- if ($('#markmessagemenu').is(':visible')) {
- rcmail.hide_menu('markmessagemenu', e);
+ placeholder = rcmail.gettext('kolab_tags.newtag'),
+ form = $('
'),
+ input = $('
').attr({'type': 'text', title: title, placeholder: placeholder, 'class': 'form-control'})
+ .keyup(function(e) {
+ if (this.value) {
+ // execute action on Enter
+ if (e.which == 13) {
+ container.data('callback')({name: this.value});
+ rcmail.hide_menu('tag-selector', e);
+ if ($('#markmessagemenu').is(':visible')) {
+ rcmail.hide_menu('markmessagemenu', e);
+ }
+ }
+ // search tags
+ else {
+ var search = this.value.toUpperCase();
+ $('li:not(.search)', container).each(function() {
+ var tag_name = $(this).text().toUpperCase();
+ $(this)[tag_name.indexOf(search) >= 0 ? 'show' : 'hide']();
+ });
}
}
- // search tags
else {
- var search = this.value.toUpperCase();
- $('li:not(.search)', container).each(function() {
- var tag_name = $(this).text().toUpperCase();
- $(this)[tag_name.indexOf(search) >= 0 ? 'show' : 'hide']();
- });
+ // reset search
+ $('li', container).show();
}
- }
- else {
- // reset search
- $('li', container).show();
- }
- });
+ });
- return $('
').append(input)
+ return $('').append(form.append(input))
// prevents from closing the menu on click in the input/row
- .mouseup(function(e) { return false; });
+ .on('mouseup click', function(e) { e.stopPropagation(); return false; });
+}
+
+function tag_class_name(tag)
+{
+ return 'kolab-tag-' + tag.uid.replace(/[^a-z0-9]/ig, '');
}
diff --git a/plugins/kolab_tags/skins/elastic/templates/ui.html b/plugins/kolab_tags/skins/elastic/templates/ui.html
new file mode 100644
index 00000000..9eee997d
--- /dev/null
+++ b/plugins/kolab_tags/skins/elastic/templates/ui.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/kolab_tags/skins/larry/style.css b/plugins/kolab_tags/skins/larry/style.css
index eabfea82..175cef0a 100644
--- a/plugins/kolab_tags/skins/larry/style.css
+++ b/plugins/kolab_tags/skins/larry/style.css
@@ -87,9 +87,10 @@ ul.toolbarmenu li span.icon.tagremoveall {
margin-left: 10px;
}
-#tagsform div.buttons input {
+#tagsform div.buttons button {
display: block;
width: 80px;
+ margin-bottom: 5px;
}
#tagsform select {
@@ -97,6 +98,10 @@ ul.toolbarmenu li span.icon.tagremoveall {
float: left;
}
+#tageditform div.col-sm-10 {
+ display: inline-block;
+}
+
#tageditform input {
margin-bottom: 5px;
}
diff --git a/plugins/libkolab/skins/elastic/libkolab.less b/plugins/libkolab/skins/elastic/libkolab.less
index 78d1836c..9362506f 100644
--- a/plugins/libkolab/skins/elastic/libkolab.less
+++ b/plugins/libkolab/skins/elastic/libkolab.less
@@ -210,6 +210,108 @@ html.touch .listing {
}
}
+.toolbarmenu.listing li {
+ a.tags:before {
+ content: @fa-var-tags;
+ }
+
+ a.tag:before,
+ a.tag.remove:before,
+ a.tag.remove.all:before {
+ content: @fa-var-tag;
+ }
+
+ &.search {
+ padding: .25rem .5rem;
+ .input-group {
+
+ i.icon {
+ font-size: 80%;
+ padding: .5rem;
+ }
+
+ input {
+ font-size: 100%;
+ }
+ }
+ }
+}
+
+#taglist {
+ li {
+ padding: 0 .5rem;
+ &:before {
+ &:extend(.font-icon-class);
+ content: @fa-var-tag;
+ }
+ }
+}
+
+#taglist li:before,
+#tag-selector li a:before {
+ color: darken(@color-main, 15%); // default tag color
+}
+
+#tag-selector li:hover a:before {
+ color: #fff;
+}
+
+#tagsform {
+ min-height: 15rem;
+
+ select {
+ padding: 0;
+ margin-bottom: .5rem;
+
+ &:focus {
+ box-shadow: none !important;
+ border: 1px solid @color-layout-border;
+ }
+ }
+
+ option {
+ color: @color-font; // fix Firefox issue caused by text-shadow below
+ text-shadow: none;
+ padding: .5rem;
+ outline: 0;
+ border: 0;
+
+ &:before {
+ &:extend(.font-icon-class);
+ content: @fa-var-tag;
+ line-height: 1;
+ }
+ }
+
+ .buttons {
+ text-align: center;
+
+ button {
+ margin: 0 .25rem;
+ }
+ }
+}
+
+.tagbox {
+ color: #fff;
+ background-color: @color-main;
+ border-radius: .25rem;
+ max-width: 4em;
+ padding: .1rem .4rem;
+ margin-right: .2rem;
+ font-weight: bold;
+
+ a {
+ color: inherit;
+ padding-left: .5rem;
+ text-decoration: none;
+ }
+
+ h2 > & {
+ font-size: 1.2rem;
+ }
+}
+
#calendarcategories {
.input-group:not(:last-child) {
margin-bottom: .25rem;