[Approval request] Shared command info screen troops

aromatt

Member
Reaction score
36
Approved on .net
Ticket t13871457



As unfortunately triggering mouseover events on mobile is pretty tricky, and more and more functionality is being added utilizing this mechanism without alternative for mobile, being a little frustrated I thought to try and write something quickly to "fix" that.



Script works from the command info page as long as sender shares commands.

Code:
javascript:if (window.location.href.indexOf('screen=info_command') < 0) {
UI.ErrorMessage ("This only works on command info page"); } else {
var a = document.createElement('span');
a.setAttribute("id","troop_counts");
$("#content_value").append(a);
var t = $('#quickedit-rename').attr('data-id');
Command.pending_details[t] = !0, TribalWars.get("info_command", { ajax: "details", id: t }, function(n) {
                Command.details_cache[t] = n, Command.pending_details[t] = !1, a.innerHTML =(Command.getDetailsHTML(Command.details_cache[t]))
            } );
};
Not the most beautiful but does the job.


Can this be okayed for .co.uk?

Kind regards
aromatt