diff --git a/plugins/kolab_notes/composer.json b/plugins/kolab_notes/composer.json index 2ebb4ef5..fd8005cd 100644 --- a/plugins/kolab_notes/composer.json +++ b/plugins/kolab_notes/composer.json @@ -21,6 +21,7 @@ "require": { "php": ">=5.3.0", "roundcube/plugin-installer": ">=0.1.3", - "kolab/libkolab": ">=1.1.0" + "kolab/libkolab": ">=1.1.0", + "roundcube/jqueryui": ">=1.10.4" } } diff --git a/plugins/kolab_notes/jquery.tagedit.js b/plugins/kolab_notes/jquery.tagedit.js deleted file mode 120000 index 6bb782c4..00000000 --- a/plugins/kolab_notes/jquery.tagedit.js +++ /dev/null @@ -1 +0,0 @@ -../tasklist/jquery.tagedit.js \ No newline at end of file diff --git a/plugins/kolab_notes/kolab_notes_ui.php b/plugins/kolab_notes/kolab_notes_ui.php index c03ea2db..6cec3b99 100644 --- a/plugins/kolab_notes/kolab_notes_ui.php +++ b/plugins/kolab_notes/kolab_notes_ui.php @@ -55,15 +55,14 @@ class kolab_notes_ui $this->rc->output->include_script('list.js'); $this->rc->output->include_script('treelist.js'); $this->plugin->include_script('notes.js'); - $this->plugin->include_script('jquery.tagedit.js'); + + jqueryui::tagedit(); // include kolab folderlist widget if available if (in_array('libkolab', $this->plugin->api->loaded_plugins())) { $this->plugin->api->include_script('libkolab/js/folderlist.js'); } - $this->plugin->include_stylesheet($this->plugin->local_skin_path() . '/tagedit.css'); - // load config options and user prefs relevant for the UI $settings = array( 'sort_col' => $this->rc->config->get('kolab_notes_sort_col', 'changed'), diff --git a/plugins/kolab_notes/skins/larry/tagedit.css b/plugins/kolab_notes/skins/larry/tagedit.css deleted file mode 120000 index f25378ff..00000000 --- a/plugins/kolab_notes/skins/larry/tagedit.css +++ /dev/null @@ -1 +0,0 @@ -../../../tasklist/skins/larry/tagedit.css \ No newline at end of file diff --git a/plugins/tasklist/composer.json b/plugins/tasklist/composer.json index 210490b2..4673e64c 100644 --- a/plugins/tasklist/composer.json +++ b/plugins/tasklist/composer.json @@ -21,6 +21,7 @@ "require": { "php": ">=5.3.0", "roundcube/plugin-installer": ">=0.1.3", - "kolab/libcalendaring": ">=1.1.0" + "kolab/libcalendaring": ">=1.1.0", + "roundcube/jqueryui": ">=1.10.4" } } diff --git a/plugins/tasklist/jquery.tagedit.js b/plugins/tasklist/jquery.tagedit.js deleted file mode 100644 index baab701c..00000000 --- a/plugins/tasklist/jquery.tagedit.js +++ /dev/null @@ -1,683 +0,0 @@ -/* -* Tagedit - jQuery Plugin -* The Plugin can be used to edit tags from a database the easy way -* -* Examples and documentation at: tagedit.webwork-albrecht.de -* -* License: -* This work is licensed under a MIT License -* -* @licstart The following is the entire license notice for the -* JavaScript code in this file. -* -* Copyright (c) 2010 Oliver Albrecht -* Copyright (c) 2014 Thomas Brüderli -* -* Licensed under the MIT licenses -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to deal in the Software without restriction, including -* without limitation the rights to use, copy, modify, merge, publish, -* distribute, sublicense, and/or sell copies of the Software, and to -* permit persons to whom the Software is furnished to do so, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -* -* @licend The above is the entire license notice -* for the JavaScript code in this file. -* -* @author Oliver Albrecht Mial: info@webwork-albrecht.de Twitter: @webworka -* @version 1.5.2 (06/2014) -* Requires: jQuery v1.4+, jQueryUI v1.8+, jQuerry.autoGrowInput -* -* Example of usage: -* -* $( "input.tag" ).tagedit(); -* -* Possible options: -* -* autocompleteURL: '', // url for a autocompletion -* deleteEmptyItems: true, // Deletes items with empty value -* deletedPostfix: '-d', // will be put to the Items that are marked as delete -* addedPostfix: '-a', // will be put to the Items that are choosem from the database -* additionalListClass: '', // put a classname here if the wrapper ul shoud receive a special class -* allowEdit: true, // Switch on/off edit entries -* allowDelete: true, // Switch on/off deletion of entries. Will be ignored if allowEdit = false -* allowAdd: true, // switch on/off the creation of new entries -* direction: 'ltr' // Sets the writing direction for Outputs and Inputs -* animSpeed: 500 // Sets the animation speed for effects -* autocompleteOptions: {}, // Setting Options for the jquery UI Autocomplete (http://jqueryui.com/demos/autocomplete/) -* breakKeyCodes: [ 13, 44 ], // Sets the characters to break on to parse the tags (defaults: return, comma) -* checkNewEntriesCaseSensitive: false, // If there is a new Entry, it is checked against the autocompletion list. This Flag controlls if the check is (in-)casesensitive -* texts: { // some texts -* removeLinkTitle: 'Remove from list.', -* saveEditLinkTitle: 'Save changes.', -* deleteLinkTitle: 'Delete this tag from database.', -* deleteConfirmation: 'Are you sure to delete this entry?', -* deletedElementTitle: 'This Element will be deleted.', -* breakEditLinkTitle: 'Cancel' -* } -*/ - -(function($) { - - $.fn.tagedit = function(options) { - /** - * Merge Options with defaults - */ - options = $.extend(true, { - // default options here - autocompleteURL: null, - checkToDeleteURL: null, - deletedPostfix: '-d', - addedPostfix: '-a', - additionalListClass: '', - allowEdit: true, - allowDelete: true, - allowAdd: true, - direction: 'ltr', - animSpeed: 500, - autocompleteOptions: { - select: function( event, ui ) { - $(this).val(ui.item.value).trigger('transformToTag', [ui.item.id]); - return false; - } - }, - breakKeyCodes: [ 13, 44 ], - checkNewEntriesCaseSensitive: false, - texts: { - removeLinkTitle: 'Remove from list.', - saveEditLinkTitle: 'Save changes.', - deleteLinkTitle: 'Delete this tag from database.', - deleteConfirmation: 'Are you sure to delete this entry?', - deletedElementTitle: 'This Element will be deleted.', - breakEditLinkTitle: 'Cancel', - forceDeleteConfirmation: 'There are more records using this tag, are you sure do you want to remove it?' - }, - tabindex: false - }, options || {}); - - // no action if there are no elements - if(this.length == 0) { - return; - } - - // set the autocompleteOptions source - if(options.autocompleteURL) { - options.autocompleteOptions.source = options.autocompleteURL; - } - - // Set the direction of the inputs - var direction= this.attr('dir'); - if(direction && direction.length > 0) { - options.direction = this.attr('dir'); - } - - var elements = this; - var focusItem = null; - - var baseNameRegexp = new RegExp("^(.*)\\[([0-9]*?("+options.deletedPostfix+"|"+options.addedPostfix+")?)?\]$", "i"); - - var baseName = elements.eq(0).attr('name').match(baseNameRegexp); - if(baseName && baseName.length == 4) { - baseName = baseName[1]; - } - else { - // Elementname does not match the expected format, exit - alert('elementname dows not match the expected format (regexp: '+baseNameRegexp+')') - return; - } - - // read tabindex from source element - var ti; - if (!options.tabindex && (ti = elements.eq(0).attr('tabindex'))) - options.tabindex = ti; - - // init elements - inputsToList(); - - /** - * Creates the tageditinput from a list of textinputs - * - */ - function inputsToList() { - var html = ''; - - elements - .append(html) - .attr('tabindex', options.tabindex) // set tabindex to