mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-29 07:05:26 +00:00
@@ -78,7 +78,7 @@
|
||||
<md-menu-content width="4">
|
||||
<md-menu-item ng-hide="viewer.showFlags">
|
||||
<md-button label:aria-label="Add a tag"
|
||||
ng-click="viewer.addFlags()">
|
||||
ng-click="viewer.addFlags($event)">
|
||||
<var:string label:value="Add a tag"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
@@ -179,10 +179,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sg-padded hide-xs" ng-show="viewer.showFlags">
|
||||
<div class="sg-padded" ng-show="viewer.showFlags">
|
||||
<md-chips class="sg-readonly"
|
||||
sg-focus-on="flags"
|
||||
ng-model="viewer.message.flags">
|
||||
ng-model="viewer.message.flags"
|
||||
md-transform-chip="$chip.name">
|
||||
<md-chip-template>
|
||||
<span class="sg-chip-color">
|
||||
<span ng-style="{ 'background-color': viewer.service.$tags[$chip][1] }"><!-- color --></span>
|
||||
|
||||
@@ -321,10 +321,10 @@
|
||||
* @function $filter
|
||||
* @memberof Mailbox.prototype
|
||||
* @desc Fetch the messages metadata of the mailbox
|
||||
* @param {object} [sort] - sort preferences. Defaults to descendent by date.
|
||||
* @param {string} sort.match - either AND or OR
|
||||
* @param {string} sort.sort - either arrival, subject, from, to, date, or size
|
||||
* @param {boolean} sort.asc - sort is ascendant if true
|
||||
* @param {object} [sortsortingAttributes] - sort preferences. Defaults to descendent by date.
|
||||
* @param {string} sortingAttributes.match - either AND or OR
|
||||
* @param {string} sortingAttributes.sort - either arrival, subject, from, to, date, or size
|
||||
* @param {boolean} sortingAttributes.asc - sort is ascendant if true
|
||||
* @param {object[]} [filters] - list of filters for the query
|
||||
* @param {string} filters.searchBy - either subject, from, to, cc, or body
|
||||
* @param {string} filters.searchInput - the search string to match
|
||||
@@ -573,6 +573,7 @@
|
||||
// Update inbox quota
|
||||
if (data.quotas)
|
||||
_this.$account.updateQuota(data.quotas);
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -917,10 +918,11 @@
|
||||
// Instanciate Message objects
|
||||
_.reduce(_this.uids, function(msgs, msg, i) {
|
||||
var data, msgObject;
|
||||
if (_this.threaded)
|
||||
if (_this.threaded) {
|
||||
data = _.zipObject(uids, msg);
|
||||
else
|
||||
} else {
|
||||
data = {uid: msg.toString()};
|
||||
}
|
||||
|
||||
// Build map of UID <=> index
|
||||
_this.uidsMap[data.uid] = i;
|
||||
@@ -939,7 +941,7 @@
|
||||
_.forEach(_this.headers, function(data) {
|
||||
var msg = _.zipObject(headers, data),
|
||||
i = _this.uidsMap[msg.uid.toString()];
|
||||
_.extend(_this.$messages[i], msg);
|
||||
_this.$messages[i].init(msg);
|
||||
});
|
||||
}
|
||||
Mailbox.$log.debug('mailbox ' + _this.id + ' ready');
|
||||
@@ -976,7 +978,7 @@
|
||||
messageHeaders = _.zipObject(headers, messageHeaders);
|
||||
j = _this.uidsMap[messageHeaders.uid.toString()];
|
||||
if (angular.isDefined(j)) {
|
||||
_.extend(_this.$messages[j], messageHeaders);
|
||||
_this.$messages[j].init(messageHeaders);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
if (typeof futureMessageData.then !== 'function') {
|
||||
//console.debug(JSON.stringify(futureMessageData, undefined, 2));
|
||||
if (angular.isUndefined(lazy) || !lazy) {
|
||||
angular.extend(this, futureMessageData);
|
||||
this.$formatFullAddresses();
|
||||
this.init(futureMessageData);
|
||||
}
|
||||
this.uid = parseInt(futureMessageData.uid);
|
||||
}
|
||||
@@ -104,6 +103,24 @@
|
||||
return results;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function init
|
||||
* @memberof Message.prototype
|
||||
* @desc Extend instance with new data and massage some attributes.
|
||||
* @param {object} data - attributes of message
|
||||
*/
|
||||
Message.prototype.init = function(data) {
|
||||
var _this = this;
|
||||
angular.extend(this, data);
|
||||
this.$formatFullAddresses();
|
||||
this.$loadUnsafeContent = false;
|
||||
_.forEach(this.flags, function(flag, i) {
|
||||
if (flag.charAt(0) == '$') {
|
||||
_this.flags.splice(i, 1,'_' + flag);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $absolutePath
|
||||
* @memberof Message.prototype
|
||||
@@ -458,7 +475,7 @@
|
||||
var data = {
|
||||
operation: operation,
|
||||
msgUIDs: [this.uid],
|
||||
flags: tag
|
||||
flags: tag.replace(/^_\$/, '$')
|
||||
};
|
||||
|
||||
if (tag)
|
||||
@@ -746,10 +763,8 @@
|
||||
}
|
||||
return Message.$timeout(function() {
|
||||
delete _this.$parts;
|
||||
angular.extend(_this, data);
|
||||
_this.$formatFullAddresses();
|
||||
_this.$loadUnsafeContent = false;
|
||||
_this.$loaded = Message.STATUS.LOADED;
|
||||
_this.init(data);
|
||||
return _this;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -177,6 +177,8 @@
|
||||
}
|
||||
|
||||
this.addFlags = function($event) {
|
||||
$event.stopPropagation();
|
||||
$event.preventDefault();
|
||||
this.showFlags = true;
|
||||
focus("flags");
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
this.timeZonesList = $window.timeZonesList;
|
||||
this.timeZonesSearchText = '';
|
||||
this.sieveVariablesCapability = ($window.sieveCapabilities.indexOf('variables') >= 0);
|
||||
this.mailLabelKeyRE = new RegExp("^[^(){} %*\"\\\\]*$");
|
||||
this.mailLabelKeyRE = new RegExp(/^(?!^_\$)[^(){} %*\"\\\\]*?$/);
|
||||
|
||||
|
||||
if (sgSettings.activeUser('path').mail) {
|
||||
|
||||
Reference in New Issue
Block a user