CardDav categories support (tags)

This commit is contained in:
RainLoop Team 2014-05-15 00:45:52 +04:00
parent fe50a92f88
commit 74b09e93df
10 changed files with 28760 additions and 28760 deletions

View file

@ -621,8 +621,8 @@ ko.bindingHandlers.contactTags = {
'parseOnBlur': true, 'parseOnBlur': true,
'allowDragAndDrop': false, 'allowDragAndDrop': false,
'focusCallback': fFocusCallback, 'focusCallback': fFocusCallback,
'inputDelimiters': [';'], 'inputDelimiters': [',', ';'],
'outputDelimiter': ';', 'outputDelimiter': ',',
'autoCompleteSource': function (oData, fResponse) { 'autoCompleteSource': function (oData, fResponse) {
RL.getContactsTagsAutocomplete(oData.term, function (aData) { RL.getContactsTagsAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oTagItem) { fResponse(_.map(aData, function (oTagItem) {

View file

@ -73,7 +73,7 @@ ContactModel.prototype.parse = function (oItem)
if (Utils.isNonEmptyArray(oItem['Tags'])) if (Utils.isNonEmptyArray(oItem['Tags']))
{ {
this.tags = oItem['Tags'].join(';'); this.tags = oItem['Tags'].join(',');
} }
bResult = true; bResult = true;

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.6.6", "version": "1.6.6",
"release": "922", "release": "924",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "Gruntfile.js", "main": "Gruntfile.js",

View file

@ -5048,7 +5048,7 @@ class Actions
{ {
$sUid = \trim($this->GetActionParam('Uid', '')); $sUid = \trim($this->GetActionParam('Uid', ''));
$sTags = \trim($this->GetActionParam('Tags', '')); $sTags = \trim($this->GetActionParam('Tags', ''));
$aTags = \explode(';', $sTags); $aTags = \explode(',', $sTags);
$aTags = \array_map('trim', $aTags); $aTags = \array_map('trim', $aTags);
$aTags = \array_unique($aTags); $aTags = \array_unique($aTags);

View file

@ -211,7 +211,7 @@ class Contact
$oVCard->VERSION = '3.0'; $oVCard->VERSION = '3.0';
$oVCard->PRODID = '-//RainLoop//'.APP_VERSION.'//EN'; $oVCard->PRODID = '-//RainLoop//'.APP_VERSION.'//EN';
unset($oVCard->FN, $oVCard->EMAIL, $oVCard->TEL, $oVCard->URL, $oVCard->{'X-RL-TAGS'}); unset($oVCard->FN, $oVCard->EMAIL, $oVCard->TEL, $oVCard->URL, $oVCard->NICKNAME, $oVCard->CATEGORIES, $oVCard->{'X-RL-TAGS'});
$sFirstName = $sLastName = $sMiddleName = $sSuffix = $sPrefix = ''; $sFirstName = $sLastName = $sMiddleName = $sSuffix = $sPrefix = '';
foreach ($this->Properties as /* @var $oProperty \RainLoop\Providers\AddressBook\Classes\Property */ &$oProperty) foreach ($this->Properties as /* @var $oProperty \RainLoop\Providers\AddressBook\Classes\Property */ &$oProperty)
@ -274,7 +274,7 @@ class Contact
if (0 < \count($this->Tags)) if (0 < \count($this->Tags))
{ {
$oVCard->{'X-RL-TAGS'} = \implode(';', $this->Tags); $oVCard->CATEGORIES = $this->Tags;
} }
return (string) $oVCard->serialize(); return (string) $oVCard->serialize();
@ -590,9 +590,10 @@ class Contact
$this->Properties = $aProperties; $this->Properties = $aProperties;
if (isset($oVCard->{'X-RL-TAGS'}) && 0 < \strlen($oVCard->{'X-RL-TAGS'})) if (isset($oVCard->CATEGORIES))
{ {
$this->Tags = \explode(';', $oVCard->{'X-RL-TAGS'}); $this->Tags = (array) $oVCard->CATEGORIES->getParts();
$this->Tags = \is_array($this->Tags) ? $this->Tags : array();
$this->Tags = \array_map('trim', $this->Tags); $this->Tags = \array_map('trim', $this->Tags);
} }
} }

View file

@ -2470,6 +2470,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
return oItem.hasClass('open'); return oItem.hasClass('open');
})); }));
}, 50); }, 50);
// Base64 encode / decode // Base64 encode / decode
// http://www.webtoolkit.info/ // http://www.webtoolkit.info/
@ -3254,8 +3255,8 @@ ko.bindingHandlers.contactTags = {
'parseOnBlur': true, 'parseOnBlur': true,
'allowDragAndDrop': false, 'allowDragAndDrop': false,
'focusCallback': fFocusCallback, 'focusCallback': fFocusCallback,
'inputDelimiters': [';'], 'inputDelimiters': [',', ';'],
'outputDelimiter': ';', 'outputDelimiter': ',',
'autoCompleteSource': function (oData, fResponse) { 'autoCompleteSource': function (oData, fResponse) {
RL.getContactsTagsAutocomplete(oData.term, function (aData) { RL.getContactsTagsAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oTagItem) { fResponse(_.map(aData, function (oTagItem) {
@ -3460,7 +3461,6 @@ ko.observable.fn.validateFunc = function (fFunc)
return this; return this;
}; };
/** /**
* @constructor * @constructor
*/ */

File diff suppressed because one or more lines are too long

View file

@ -3259,8 +3259,8 @@ ko.bindingHandlers.contactTags = {
'parseOnBlur': true, 'parseOnBlur': true,
'allowDragAndDrop': false, 'allowDragAndDrop': false,
'focusCallback': fFocusCallback, 'focusCallback': fFocusCallback,
'inputDelimiters': [';'], 'inputDelimiters': [',', ';'],
'outputDelimiter': ';', 'outputDelimiter': ',',
'autoCompleteSource': function (oData, fResponse) { 'autoCompleteSource': function (oData, fResponse) {
RL.getContactsTagsAutocomplete(oData.term, function (aData) { RL.getContactsTagsAutocomplete(oData.term, function (aData) {
fResponse(_.map(aData, function (oTagItem) { fResponse(_.map(aData, function (oTagItem) {
@ -3465,7 +3465,6 @@ ko.observable.fn.validateFunc = function (fFunc)
return this; return this;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6008,7 +6007,7 @@ ContactModel.prototype.parse = function (oItem)
if (Utils.isNonEmptyArray(oItem['Tags'])) if (Utils.isNonEmptyArray(oItem['Tags']))
{ {
this.tags = oItem['Tags'].join(';'); this.tags = oItem['Tags'].join(',');
} }
bResult = true; bResult = true;

File diff suppressed because one or more lines are too long