Commands Shared commands troops info on mobiles

DeletedUser124362

Guest
Author
aromatt
Contributors
N/A
Quickbar Entry
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]))
} );
};
Public?
Public
Approved
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.

Kind regards
aromatt
 
Last edited by a moderator:
Upvote 0

DeletedUser124362

Guest
This won't be a problem anymore with the updated android app that is rolling out btw.
Isn't new app the same as iPhone one?
Correct me if I'm wrong but I thought you couldn't do it on iPhone one either.
 

DeletedUser124362

Guest
Can I ask one of the mods to edit the thread subject to
Shared commands troops info on mobiles

And maybe add that nice "script approved" tag to it? :p

@JawJaw

Thanks in advance!!!
 
Top