diff --git a/www/js/filters.js b/www/js/filters.js index a040ac0a7647c442a5da29b22379184fc9f148f6..8179c87d64cb6177b6557ef9fe6962b7f0131cd0 100644 --- a/www/js/filters.js +++ b/www/js/filters.js @@ -389,6 +389,7 @@ angular.module('cesium.filters', ['cesium.config', 'cesium.platform', 'pascalpre return function(input, size) { size = size || 25; var startIndex = input.startsWith('http://') ? 7 : (input.startsWith('https://') ? 8 : 0); + startIndex = input.startsWith('www.', startIndex) ? startIndex + 4 : startIndex; // Remove sequence 'www.' return !input || (input.length-startIndex) <= size ? input.substr(startIndex) : (input.substr(startIndex, size) + '...'); }; }) diff --git a/www/plugins/es/js/services/http-services.js b/www/plugins/es/js/services/http-services.js index d26cf181d19c3c12497f61dbf44911004f9cfafe..f3ec90094d84db79fb2284c5129eae7ad42dfa40 100644 --- a/www/plugins/es/js/services/http-services.js +++ b/www/plugins/es/js/services/http-services.js @@ -343,10 +343,9 @@ angular.module('cesium.es.http.services', ['ngResource', 'ngApi', 'cesium.servic prefix = prefix || '#'; var reg = prefix === '@' ? regexp.USER_TAG : regexp.HASH_TAG; var matches = value && reg.exec(value); - var tags; + var tags = matches && []; while(matches) { var tag = matches[1]; - tags = tags || []; if (!_.contains(tags, tag)) { tags.push(tag); } @@ -358,10 +357,9 @@ angular.module('cesium.es.http.services', ['ngResource', 'ngApi', 'cesium.servic function parseUrlsFromText(value) { var matches = value && regexp.URL.exec(value); - var urls; + var urls = matches && []; while(matches) { var url = matches[0]; - urls = urls || []; if (!_.contains(urls, url)) { urls.push(url); } @@ -390,8 +388,9 @@ angular.module('cesium.es.http.services', ['ngResource', 'ngApi', 'cesium.servic // Replace URL in description var urls = parseUrlsFromText(content); _.forEach(urls, function(url){ + var href = (url.startsWith('http://') || url.startsWith('https://')) ? url : ('http://' + url); // Redirect URL to the function 'openLink', to open a new window if need (e.g. desktop app) - var link = '<a on-tap=\"openLink($event, \'{0}\')\" href=\"{1}\" target="_blank">{2}</a>'.format(url, url, truncUrlFilter(url)); + var link = '<a on-tap=\"openLink($event, \'{0}\')\" href=\"{1}\" target="_blank">{2}</a>'.format(href, href, truncUrlFilter(url)); content = content.replace(url, link); }); diff --git a/www/plugins/es/templates/message/lookup_lg.html b/www/plugins/es/templates/message/lookup_lg.html index 499b4e910672809df328c87f66435fb8522642a8..fcb8db9ad26da42e3d520fe60ae7001475b5faaf 100644 --- a/www/plugins/es/templates/message/lookup_lg.html +++ b/www/plugins/es/templates/message/lookup_lg.html @@ -86,11 +86,9 @@ <div class="pull-left" ng-if="!search.loading"> <ng-if ng-if="search.type=='last'"> <h4>{{ ('MESSAGE.LIST.LAST_' + type) | upper | translate}}</h4> - <!--<small class="gray no-padding" ng-if="search.total">{{'WOT.LOOKUP.NEWCOMERS_COUNT'|translate:{count: search.total} }}</small>--> </ng-if> <ng-if ng-if="search.type=='text'"> <h4 translate>COMMON.RESULTS_LIST</h4> - <!--<small class="gray no-padding" ng-if="search.total">{{'WOT.LOOKUP.PENDING_COUNT'|translate:{count: search.total} }}</small>--> </ng-if> </div>