Improved tag handling
This commit is contained in:
parent
1bc595306a
commit
a1fe0f2d8c
@ -1257,8 +1257,8 @@ Clipperz.PM.DataModel.Record.regExpForSearch = function (aSearch) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Slightly more readable: http://rubular.com/r/4O8xGEsLgw
|
||||||
Clipperz.PM.DataModel.Record.tagRegExp = new RegExp('\\' + Clipperz.PM.DataModel.Record.tagChar + '(' + Clipperz.PM.DataModel.Record.specialTagChar + '?\\w+)', 'g');
|
Clipperz.PM.DataModel.Record.tagRegExp = new RegExp('\\' + Clipperz.PM.DataModel.Record.tagChar + '(' + Clipperz.PM.DataModel.Record.specialTagChar + '?[^'+Clipperz.PM.DataModel.Record.tagChar+']+?)\\s*(?='+Clipperz.PM.DataModel.Record.tagChar+'|$)', 'g');
|
||||||
Clipperz.PM.DataModel.Record.trimSpacesRegExp = new RegExp('^\\s+|\\s+$', 'g');
|
Clipperz.PM.DataModel.Record.trimSpacesRegExp = new RegExp('^\\s+|\\s+$', 'g');
|
||||||
|
|
||||||
Clipperz.PM.DataModel.Record.extractLabelFromFullLabel = function (aValue) {
|
Clipperz.PM.DataModel.Record.extractLabelFromFullLabel = function (aValue) {
|
||||||
|
@ -1550,10 +1550,14 @@ deferredResult.addCallback(function (aValue) { console.log("FIELDS", aValue); re
|
|||||||
deferredResult.addMethod(user, 'getRecord', recordID);
|
deferredResult.addMethod(user, 'getRecord', recordID);
|
||||||
//deferredResult.addCallback(function (aValue) { console.log("VALUE", aValue); return aValue; });
|
//deferredResult.addCallback(function (aValue) { console.log("VALUE", aValue); return aValue; });
|
||||||
deferredResult.addMethodcaller('addTag', "TagX");
|
deferredResult.addMethodcaller('addTag', "TagX");
|
||||||
|
deferredResult.addMethod(user, 'getRecord', recordID);
|
||||||
|
deferredResult.addMethodcaller('addTag', "A tag with spaces");
|
||||||
|
deferredResult.addMethod(user, 'getRecord', recordID);
|
||||||
|
deferredResult.addMethodcaller('addTag', "ετικέτα");
|
||||||
|
|
||||||
deferredResult.addMethod(user, 'getRecord', recordID);
|
deferredResult.addMethod(user, 'getRecord', recordID);
|
||||||
deferredResult.addMethodcaller('tags');
|
deferredResult.addMethodcaller('tags');
|
||||||
deferredResult.addCallback(SimpleTest.eq, ['Tag1', 'Tag2', 'TagX']);
|
deferredResult.addCallback(SimpleTest.eq, ['Tag1', 'Tag2', 'TagX', 'A tag with spaces', 'ετικέτα']);
|
||||||
|
|
||||||
deferredResult.addMethod(user, 'getRecord', recordID);
|
deferredResult.addMethod(user, 'getRecord', recordID);
|
||||||
deferredResult.addMethodcaller('setLabel', "Card 1 - edited");
|
deferredResult.addMethodcaller('setLabel', "Card 1 - edited");
|
||||||
@ -1565,7 +1569,7 @@ deferredResult.addCallback(function (aValue) { console.log("FIELDS", aValue); re
|
|||||||
deferredResult.addMethod(user_2, 'login');
|
deferredResult.addMethod(user_2, 'login');
|
||||||
deferredResult.addMethod(user_2, 'getRecord', recordID);
|
deferredResult.addMethod(user_2, 'getRecord', recordID);
|
||||||
deferredResult.addMethodcaller('tags');
|
deferredResult.addMethodcaller('tags');
|
||||||
deferredResult.addCallback(SimpleTest.eq, ['Tag1', 'Tag2', 'TagX']);
|
deferredResult.addCallback(SimpleTest.eq, ['Tag1', 'Tag2', 'TagX', 'A tag with spaces', 'ετικέτα']);
|
||||||
|
|
||||||
deferredResult.callback();
|
deferredResult.callback();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user