Skip to main content
Topic: RTL support (Read 10577 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: RTL support

Reply #30

Quote from: Antechinus – So why not just kill it, and save a lot of drama?

Maybe you don't use it , maybe it looks useless to you , I even read once that it causes a lot of queries and sql server load , I perfectly understand what you saying , I always disabled it in my forum in the past , but suddenly found that over 50% of my forum visitors are using mobile , so i have to put myself in their place , doing that i find it very difficult to navigate the forum on mobile without a jump-to menu , while on mobile , this menu increases the visits time on site, and that is something very important for site owners or admins . so if you guys provided some effective alternative , that would be great .

@Spuds for the record ,i just tested on another iOS device , iPhone 6 , and the result was the same , jump-to menu has the same issue as described before .

Re: RTL support

Reply #31

But it will only jump you to a board anyway, and you can access all of those from the board index. So it's only one more click without the jump to, and the linktree is in the same area of the page anyway. I have tried using the jump to, even when testing mobile resolutions, but personally I always find it easier to just go to the board index.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: RTL support

Reply #32

I will not argue with you about this , I just want to explain that on a narrow screen like my iPhone 5s with 320px width And with a forum consists of 29 parent boards and 32 child boards displayed as vertical listing as in my forum , the index page gets so tall and needs lot of scrolling up and down
So going to index page in my case is a bad idea  :D
IMG_1503.PNG

Re: RTL support

Reply #33

Quote from: sherif – here an update on this other "previously reported issue" from chrome console , using mobile emulator :
1:
[attach]4593[/attach]
2:
[attach]4591[/attach]
Code: [Select]
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
getXMLDocument @ script.js:67
grabJumpToContent @ script.js:1087
onfocus @ VM1470 index.php?topic=18983.0:321
This just means "you should use proper ajax and not a fake", but it has almost likely nothing to do with the issue (because it works on android and desktops).

Recap: the jump to shows only the current board in any browser under iOS.
Does that sound right?
Good.
Let's see where exactly the problem is.
Change in script.js the function:
Code: [Select]
function grabJumpToContent(elem)
{
var oXMLDoc = getXMLDocument(elk_prepareScriptUrl(elk_scripturl) + 'action=xmlhttp;sa=jumpto;xml'),
aBoardsAndCategories = [],
i = 0,
n = 0;

if (oXMLDoc.responseXML)
{
var items = oXMLDoc.responseXML.getElementsByTagName('elk')[0].getElementsByTagName('item');
for (i = 0, n = items.length; i < n; i++)
{
aBoardsAndCategories[aBoardsAndCategories.length] = {
id: parseInt(items[i].getAttribute('id')),
isCategory: items[i].getAttribute('type') === 'category',
name: items[i].firstChild.nodeValue.removeEntities(),
is_current: false,
childLevel: parseInt(items[i].getAttribute('childlevel'))
};
}
}

for (i = 0, n = aJumpTo.length; i < n; i++)
aJumpTo[i].fillSelect(aBoardsAndCategories);

// Internet Explorer needs this to keep the box dropped down.
elem.style.width = 'auto';
elem.focus();
}
to:
Code: [Select]
function grabJumpToContent(elem)
{
alert('click');
var oXMLDoc = getXMLDocument(elk_prepareScriptUrl(elk_scripturl) + 'action=xmlhttp;sa=jumpto;xml'),
aBoardsAndCategories = [],
i = 0,
n = 0;

if (oXMLDoc.responseXML)
{
alert('response');
var items = oXMLDoc.responseXML.getElementsByTagName('elk')[0].getElementsByTagName('item');
for (i = 0, n = items.length; i < n; i++)
{
aBoardsAndCategories[aBoardsAndCategories.length] = {
id: parseInt(items[i].getAttribute('id')),
isCategory: items[i].getAttribute('type') === 'category',
name: items[i].firstChild.nodeValue.removeEntities(),
is_current: false,
childLevel: parseInt(items[i].getAttribute('childlevel'))
};
}
alert(aBoardsAndCategories.length);
}

for (i = 0, n = aJumpTo.length; i < n; i++)
aJumpTo[i].fillSelect(aBoardsAndCategories);

// Internet Explorer needs this to keep the box dropped down.
elem.style.width = 'auto';
elem.focus();
}
to see if the function is actually called, if the response is valid XML and how many elements are found to be added.
The new function generates some message boxes any time you click the jump to, so you may want to keep it live only for the time to give it a try. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: RTL support

Reply #34

@emanuele , here is the test result
when touch > screen zoom in + menu size extend + page shifted > msg box1 :click
when close box1 > menu open with one option only > msg box2 :response
when close box2 > box3 : 71
when close box3 > page zoom out back to normal + menu closed, and operational now

Re: RTL support

Reply #35

So, the click is executed and the list is populated.
But it is now updated when displayed.

hmm...
Just to be sure, could you change:
Code: [Select]
JumpTo.prototype.fillSelect = function (aBoardsAndCategories)
{
this.removeAll();
to:
Code: [Select]
JumpTo.prototype.fillSelect = function (aBoardsAndCategories)
{
this.removeAll();
alert('yes');
always in the same file.
I was to be sure the things are added.
Bugs creator.
Features destroyer.
Template killer.

Re: RTL support

Reply #36

Now when close msg  box3 which displaying  71 , I get a new msg box displaying : yes

Re: RTL support

Reply #37

Good... well, not exactly.
Can't think right, now, tomorrow... :(
Bugs creator.
Features destroyer.
Template killer.

Re: RTL support

Reply #38

As another "experiment" on this issue.

I'd like to move the population of the select box from the onfocus event to an onload event.  I'm thinking that manipulating the select box post page load is just making iOS behave poorly.

So do to this, use this version of script.js and then edit MessageIndex.template.php as follows.
Code: (find) [Select]
					sGoButtonLabel: "', $txt['quick_mod_go'], '"
});
Code: (replace) [Select]
					sGoButtonLabel: "', $txt['quick_mod_go'], '"
});

grabJumpToContent();
so just adding that grabJumpToContent(); call after line 368 ... then lets see how iOS responds to that.

eta: removed async version of script to avoid confusion
Last Edit: March 20, 2017, 09:00:37 am by Spuds

Re: RTL support

Reply #39


Re: RTL support

Reply #40

Interesting reading.

If we feel that the first event is being canceled in iOS (like IE 8/9),  then adding a second event after the onfocus (used to populate) , lets try that instead.

Re: RTL support

Reply #41



@Spuds  OK this experiment fixed the issue  !!


Quote from: Spuds – As another "experiment" on this issue.

I'd like to move the population of the select box from the onfocus event to an onload event.  I'm thinking that manipulating the select box post page load is just making iOS behave poorly.

So do to this, use this version of script.js and then edit MessageIndex.template.php as follows.
Code: (find) [Select]
					sGoButtonLabel: "', $txt['quick_mod_go'], '"
});
Code: (replace) [Select]
					sGoButtonLabel: "', $txt['quick_mod_go'], '"
});

grabJumpToContent();
so just adding that grabJumpToContent(); call after line 368 ... then lets see how iOS responds to that.



Re: RTL support

Reply #42

Cool ... Looks like we found the issue.  I tried the second event as suggested in the above links but was not able to get that to work in ie8 or ie9 (yes I have old test beds just for that, and yes it caused me great trauma).

@emanuele‍ what, if anything, do we want to do about this for 1.0.10 ?? 

Re: RTL support

Reply #43

I'm just curious about what is the outcome of another little test.
@sherif could you add this line:
Code: [Select]
	alert(('implementation' in document ? 'implementation' : 'onmouseover') + ('onbeforeactivate' in document ? 'onbeforeactivate' : 'onfocus'));
for example after:
Code: [Select]
JumpTo.prototype.showSelect = function ()
{
var sChildLevelPrefix = '';
and report what the message box says with you click on the jump to?
Bugs creator.
Features destroyer.
Template killer.

Re: RTL support

Reply #44

Be sure to put back the original script.js as well !!!!!