Automates the use of chat and message BB-Codes: [coords][url][player][alliance][b][i][s][u] - Contact list for whispering - Type /chelp <enter> in chat for help.
< C&C: Tiberium Alliances Chat Helper Enhanced Yiannis Mod 피드백
I found another glitch
Try to write in a message "...ggg" and return key
it is recognized as a "ext" and so tagged with URL
i modified the function to avoid the bug
inText = inText.replace(/(\[url\])*(https?:\/\/)?([\da-z\.-]+)(\.[a-z]{2,6})([\/\w\.\-\=\?\&:%#]*)*\/?(\[\/url\])*/gi, function(){
if (arguments[2] && arguments[3]) {
var result = new Array();
result.push('[url]');
result.push(arguments[2]); // http[s]://
result.push(arguments[3]); // domain
result.push(arguments[4]); // ext
result.push(arguments[5]); // query string
result.push('[/url]');
return result.join('');
} else { return arguments[0];}
});
URL AUTO TAG BUG
Hi URL that includes "%20" spaces or ":" break the tagging Ex.: https://greasyfork.org/scripts/1902-c-c-tiberium-alliances-chat-helper-enhanced-yiannis-mod/code/CC:%20Tiberium%20Alliances%20Chat%20Helper%20Enhanced%20Yiannis%20Mod.user.js
I modified the regex in this way /([url])(https?:\/\/)?([\da-z.-]+)(.[a-z]{2,6})([\/\w.-=\?&:%#])\/?([\/url])/gi
not sure it's the perfect one btw Bye