ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Jorin on September 15, 2016, 10:53:53 am

Title: iOS 10 not showing editor buttons
Post by: Jorin on September 15, 2016, 10:53:53 am
A member wrote me. After the update to iOS 10 he can not see BBC buttons and smileys in his editor. He showed a screenshot, he is right.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on September 15, 2016, 11:00:56 am
Is that a mobile thingy or a computer?
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 15, 2016, 11:05:27 am
He says the name mentions are also not functioning any more. He uses an iPad.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on September 15, 2016, 11:59:45 am
From the screen shot, any javascript is completely broken.
Okay, IOs is the operating system, what version is Safari? (The browser.)
There are three things that could help (from the easiest to the most difficult):
1) take a screen shot of elkarte.net
2) try a different browser (chrome?)
3) open up web inspector (https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html) and see if there is any error message and report it.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 16, 2016, 07:03:55 am
I will test it for myself on the weekend and answer the questions.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 20, 2016, 07:46:01 am
I can't test it, no Apple device nearby.  :(  I will ask other members of my board if they could help and test.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on September 20, 2016, 01:28:42 pm
I have few ipads besides me. ;) I will take a look at it later.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 22, 2016, 07:04:13 am
Some users helped (at least a bit):

- User A is not seeing the editor buttons and smileys with iOS 10. He did see them before the iOS 10 upgrade.
- User B sees them with his iPhone 6s running iOS 10.0.1.
- User C with iPhone 5s running iOS 9 sees them. With his iPhone 6+ running iOS 10 he sees them not. He gets the error message: 516TypeError: undefined is not an object (evaluating '$editor_data['message'].css') with WebInspector.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on September 22, 2016, 11:19:20 am
Of the three members, which one of them is using the WYSIWYG editor? (You can check yourself in their profiles, in the "look and layout" area, looking for the option "Show WYSIWYG editor on post page by default".)
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 22, 2016, 11:30:13 am
No one is.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on September 22, 2016, 02:21:08 pm
Okay, apart from that, the only possible difference I see from the exact words you have written is: A and C use IOS 10, while B uses IOS 10.0.1.
Could it be a but somewhere in IOS fixed with the .0.1 update?
Of course unless all of them are actually using 10.0.1...
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 22, 2016, 02:31:36 pm
I will ask them for the exactly iOS version they use.
Title: Re: iOS 10 not showing editor buttons
Post by: badmonkey on September 22, 2016, 02:56:36 pm
Are you using minified JS/css?  We had some Android issues there as well. 
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 22, 2016, 03:23:15 pm
User A uses 10.0.1 also, but is NOT seeing the buttons.  :o

Are you using minified JS/css?  We had some Android issues there as well. 

I use ElkArte as it is. Changed only some colors of the theme. And I don't think the three users changed anything like that on their devices.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on September 22, 2016, 03:45:50 pm
Mine are still not upgraded, version iOS 9++. My kids are using them most of the time, so never got to update it so immediately. Hope the latest update as said by emanuele fixed them.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on September 22, 2016, 04:30:55 pm
As a shot in the dark ... I believe we only use $editor_data["message"].css in one place .. try removing just that to see if it fixes the issue.

In the default theme /themes/default open the file GenericControls.template.php ... (if you customized this, then edit the one in your custom theme)

Find the line, it should be 151
Code: (find) [Select]
				$editor_data["', $editor_id, '"].css("code {white-space: pre;}").createPermanentDropDown();', $editor_context['rich_active'] ? '' : '

Replace it with
Code: (replace) [Select]
				$editor_data["', $editor_id, '"].createPermanentDropDown();', $editor_context['rich_active'] ? '' : '

and let us know if it has any effect.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 26, 2016, 03:05:51 pm
Hm, don't have exactly this line. Here's the part from my file:

Code: [Select]
		// Create the tooltag rows to display the buttons in the editor
foreach ($context['bbc_toolbar'] as $i => $buttonRow)
echo implode('', $buttonRow), '||';

echo ',emoticon",';
}
else
echo ',
toolbar: "source,emoticon",';

echo '
});
$editor_data[\'', $editor_id, '\'] = $("#', $editor_id, '").data("sceditor");
$editor_container[\'', $editor_id, '\'] = $(".sceditor-container");
$editor_data[\'', $editor_id, '\'].css(\'code {white-space: pre;}\').createPermanentDropDown();
$editor_container[\'', $editor_id, '\'].width("100%").height("100%");', $editor_context['rich_active'] ? '' : '
$editor_data[\'' . $editor_id . '\'].setTextMode();', '
if (!(is_ie || is_ff || is_opera || is_safari || is_chrome))
$(".sceditor-button-source").hide();
', isset($context['post_error']['errors']['no_message']) || isset($context['post_error']['errors']['long_message']) ? '
$editor_container[\'' . $editor_id . '\'].find("textarea, iframe").addClass("border_error");' : '', '
}

$(document).ready(function(){
elk_editor();
});

// ]]></script>';
}
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on September 26, 2016, 05:09:33 pm
That might be one of 1.1.x and 1.0.x code differences. Wait for confirmation but following the advise, they could be the following line:
Code: [Select]
				$editor_data[\'', $editor_id, '\'].css(\'code {white-space: pre;}\').createPermanentDropDown();

To be change to:
Code: [Select]
				$editor_data[\'', $editor_id, '\'].createPermanentDropDown();

Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 27, 2016, 07:16:01 am
Thanks, made the edit and now my users have to test again.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 27, 2016, 08:47:07 am
Still the same result. No icons, no smileys.  :(
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on September 27, 2016, 09:43:48 am
I guess the only way to solve this is invest some 70 euro and get a 2nd hand iphone?
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 27, 2016, 09:57:41 am
No need to. I can ask my users to test anytime.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on September 27, 2016, 11:23:01 pm
Do they have Javascript enabled in their Safari settings ?  Had to ask.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 28, 2016, 05:52:42 am
Yes.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on September 28, 2016, 07:04:04 am
Out of topic a bit - I am curious since my ipad mini 3 still says the current version of 9++ is the latest. Could it be that version 10 is only for regular size (non-mini) ipad?
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on September 28, 2016, 08:58:11 am
Today I've received the same notice from a member of my forum, no bb buttons into editor and no smiley displayed
It was fine before updating to iOS 10
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on September 28, 2016, 09:42:15 am
Thanks for the info, radu!
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on October 05, 2016, 09:54:18 pm
Sorry for the bump, but please don't forget about this. Thank you
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 05, 2016, 10:52:38 pm
I didn't forget it, but the only way I have to debug it is have a device with iOS 10 in my hands (because I really have no idea what's going on and I'd need to try any thing that comes to my mind, and do it while looking directly at the output).
Unfortunately I don't have one and they are a little more expensive than I thought. :-\
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on October 05, 2016, 11:36:49 pm
I understand that is difficult or probably impossible to find the problem without an apple device. I know they are not cheap, I don't have one either, and to be honest I prefer the Android world, but that's another story.. 
After a quick search I found that iPhone 5 can be updated to ios 10, my wife has one, if there is something I can do just let me know. 
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on October 06, 2016, 08:26:08 am
Sorry, if we had an iPhone to spend, we would.  :-[
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on October 06, 2016, 09:48:08 am
I will try to when Malaysia has received ios 10. Until then  :-X
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 09, 2016, 06:29:36 pm
It appears this problem is fixed on version 1.1 beta 3 that is running here. BTW, this happens on Safari or Chrome.
This is an interesting new piece of information that gave me a little hint.
Would you mind trying to register at http://www.elkarte.it/elk1.1/index.php and see if it works or not?
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 09, 2016, 07:49:33 pm
Registered, just waiting approval so I can test. 
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 09, 2016, 08:10:11 pm
I forgot to send the email, but the account is now approved. :)
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 09, 2016, 09:02:37 pm
It is working fine with iOS 10 on the test site. 
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 10, 2016, 12:42:47 am
meh...
I hoped it was just the version of SCEditor, but it's not.

Can you have a look in the javascript console if you have any meaningful error that could give some hints?

Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on October 10, 2016, 08:37:18 am
From Ipad 3 mini, iOS 10.0.2. All is fine from here. BBC buttons and smileys are showing. ;)
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on October 10, 2016, 12:23:25 pm
@ahrasis‍ on 1.0.x version or 1.1?
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 10, 2016, 02:32:10 pm
meh...
I hoped it was just the version of SCEditor, but it's not.

Can you have a look in the javascript console if you have any meaningful error that could give some hints?
I would test this, but I have no idea in how to run the JavaScript console, especially on an iOS device.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on October 10, 2016, 02:44:47 pm
Sorry but I tested it on this site when I reported earlier. Now that I have tested on 1.0.9 site, both bbc buttons and smileys are not showing. How to debug this?

Edited: Ok. I enabled web inspector in safari advanced settings but it seems that I need to enable develop using my computer as well?

This may take some times since my lappy is win 10. I will download the necesary apple software(s) later and test this further.
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 10, 2016, 03:18:44 pm
Stupid iOS no longer has a JavaScript console, so you have to connect the iOS device to a Mac.  I tried that and here is what I got on a 1.0.9 site when replying to a post:

Code: [Select]
[Warning] Unexpected CSS token: : (hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css, line 4)
[Warning] Unexpected CSS token: : (hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css, line 8)
[Warning] Unexpected CSS token: : (hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css, line 8)
[Warning] Unexpected CSS token: : (hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css, line 8)
[Warning] Unexpected CSS token: : (hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css, line 8)
[Warning] Unexpected CSS token: : (hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css, line 8)

On this site and on the 1.1 test site I only get:

Code: [Select]
[Warning] Invalid CSS property declaration at: ; (jquery.sceditor.css, line 93)

No errors, just warnings.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on October 10, 2016, 05:12:28 pm
On the 1.0.9 site that is generating the errors, do you have admin access where you can turn off the JS/CSS minification?  If so do that and try again to see what errors you get.

ETA: the error you listed on this site has been fixed and PR made, thanks!
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 10, 2016, 06:02:12 pm
I disabled compressed output under server settings, and cleared the cache.  I still get the exact same warnings as before.  But here is where the warnings are getting generated:
index.php>Stylesheets>hive-aef237fc8b232d8e2100b111faf0b73d2dbccd81.css


Code: [Select]
line 7698: filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#222222', GradientType=0)
line 9825: filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=1);
line 9832: filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=2);
line 9839: filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=3);
line 9846: filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
line 9853: filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);


Each of those lines correspond to the hive warning I posted before, they are in order to match the warnings.  I am no developer, but is seems to be related to the DXImageTransform.  I am attaching the hive file from the cache folder.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on October 10, 2016, 07:18:47 pm
Thanks ... those warnings are caused by ie8 linear-gradient support in font-awesome and fancybox css files.  Unfortunately I don't believe they are the reason that the editor is not happy.  I'd really be expecting some form of JS error being thrown.

ETA: to clear those errors, edit your jquery.fancybox-buttons.css and delete the line
Code: (delete) [Select]
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );

Then replace your font-awesome.min.css file with the one attached.



Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 11, 2016, 02:49:20 am
Thanks Spuds.  I tried your suggestion and you were right, it did not fix the editor problem on iOS 10.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 16, 2016, 11:58:24 pm
While googling around for more details, I found this http://apple.stackexchange.com/questions/252904/ios-10-safari-javascript-setting-disabled
I don't think it's the case here, because the reports tell of js working on other sites, but maybe is worth a check, just in case.
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 17, 2016, 04:56:40 pm
While googling around for more details, I found this http://apple.stackexchange.com/questions/252904/ios-10-safari-javascript-setting-disabled
I don't think it's the case here, because the reports tell of js working on other sites, but maybe is worth a check, just in case.
I checked and Javascript is enabled on Safari.  Keep in mind this also happens on Chrome for iOS.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 17, 2016, 06:25:31 pm
Ohh... that is an interesting piece of information.
Now I'm even more confused.

Are you serving jquery for your domain or from a CDN?
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 17, 2016, 07:18:40 pm
Are you serving jquery for your domain or from a CDN?
Yes, I am using Cloudflare.  Auto Minify of Javascript is disabled.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 18, 2016, 12:16:54 am
I meant more: in the admin panel there is an option to use jquery CDN instead of using the one provided by Elk itself (in the themes directory), is that option enabled?
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on October 18, 2016, 12:50:57 am
If could be useful I use these settings:
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 18, 2016, 04:31:02 am
Here are my settings...
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 18, 2016, 10:44:45 am
I checked and Javascript is enabled on Safari.  Keep in mind this also happens on Chrome for iOS.
Does Chrome h ave any developer tool that can return javascript errors?
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 18, 2016, 02:36:59 pm
While trying to find developer tools on Chrome for iOS I found an option on the browser to display the full desktop site instead of the mobile site.  When doing that the post editor works perfectly fine, it is the mobile version that is broken.  So I went back to my Mac and opened my site with Safari, but emulating Safari on iOS 10.  I finally got an error in the javascript console:


Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 18, 2016, 09:32:06 pm
Could you check if in the other pages (without the editor) there is any error?
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 18, 2016, 11:16:41 pm
I navigated a whole bunch of other pages in iOS 10 emulation mode and none of them generated errors.  The error only comes up when the editor is used.  I tried the same thing on this site, and no errors are generated when the editor is opened.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 18, 2016, 11:28:43 pm
Do you have custom defined smiley?
Do you have smiley in the popup?
Do you have... and custom bbcode adding a button to the editor?

In GenericControls.template.php, try changing:
Code: [Select]
		$(document).ready(function(){
elk_editor();
});
to:
Code: [Select]
		$(function() {
elk_editor();
});
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on October 19, 2016, 12:27:16 am
One other question,

Do you have the full editor enabled in the quick reply area (check your user profile) ... if so do you get the same error on this page (the one with the Quick Reply at the bottom) as you do on the "Reply" page ?  
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 19, 2016, 01:41:48 am
Do you have custom defined smiley?
Do you have smiley in the popup?
Do you have... and custom bbcode adding a button to the editor?


In GenericControls.template.php, try changing:
Code: [Select]
		$(document).ready(function(){
elk_editor();
});
to:
Code: [Select]
		$(function() {
elk_editor();
});
I only have the default smileys.
Smileys do not show up in the editor.  I am using the full editor, not quick reply.
As far as I know, no custom BBC code.

I made the code change you suggested and it did not make a difference.  I will clone my site and create an admin account for you guys to mess with.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on October 19, 2016, 06:53:58 am
Thank you, txcas, for helping me out so much!  :)
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 19, 2016, 08:22:56 am
For me, don't waste time, I don't have any apple device to test the issue, that's why I'm here asking you to do the tests... :(

What is driving me nuts is that the code resembles this:
Code: [Select]
				$editor_data['message'] = $("#message").data("sceditor");
$editor_container['message'] = $(".sceditor-container");
$editor_data['message'].css('code {white-space: pre;}').createPermanentDropDown();
So, the only explanation I can give is that the "data" call (on line 1 here) fails to return a proper object for some reason... which one? I have no idea.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 19, 2016, 08:25:18 am
@Spuds do you by chance have a non-minified version of the 1.0.9 editor? (Or tell me which one I can pick and attach here.)
Maybe it's something there the issue.
If txcas can try and replace the file shipped with elk with a custom non-minified one we can exclude another source.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on October 19, 2016, 01:30:26 pm
This should be the file ....
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 19, 2016, 02:51:06 pm
One other question,

Do you have the full editor enabled in the quick reply area (check your user profile) ... if so do you get the same error on this page (the one with the Quick Reply at the bottom) as you do on the "Reply" page ?  
I did not have the full editor enabled on Quick Reply.  I enabled it and I do get the same error on the page.
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 19, 2016, 03:07:46 pm
This should be the file ....
I tried this file and it generates the following errors.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 19, 2016, 08:23:29 pm
Can you disable the js and css minification?
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 19, 2016, 10:38:05 pm
I disabled compressed output.  I got the same errors.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 19, 2016, 10:40:39 pm
The error is still referring to hives, so it's still either compressing the output or using an older, cached, version of the page...

At that point a test account may be worth.
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 21, 2016, 09:18:04 pm
The error is still referring to hives, so it's still either compressing the output or using an older, cached, version of the page...

At that point a test account may be worth.
Check your PMs, I created an admin account for you.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 22, 2016, 09:05:31 pm
From the tests I did at txcas site, I can say the code is broken for any browser I was able to test when minification is on. Turning off minification fixes the issue (at least here on linux, no idea on iOS 10).

Now, why that?
No idea.
What I've observed is that for some reason, an uncompressed version of sceditor is present in the hive that I got, with some notes:
Code: [Select]
// ==ClosureCompiler==
// @output_file_name jquery.sceditor.min.js
// @compilation_level SIMPLE_OPTIMIZATIONS
// ==/ClosureCompiler==

/*jshint smarttabs: true, scripturl: true, jquery: true, devel:true, eqnull:true, curly: false */
/*global Range: true, browser*/

But, AFAIK, it's been a while since we have added the unminified version of the editor, so I'm not sure where it comes from.
First thing I would suggest is to remove via ftp (or cli) all the files starting with "hive" present in the cache directory.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on October 22, 2016, 10:27:20 pm
We provided that unminimized version of the editor for testing (named .min), so even when it was added to the hive it was not compacted but added as is.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 22, 2016, 11:46:55 pm
Right. xD
/me is a bit up in the air... lol
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 23, 2016, 04:15:35 pm
This gets better...  Minification of JS and CSS is disabled on the site.  Minification of JS, CSS, and HTML is disabled on CloudFlare.  The editor is still broken for Safari or Chrome on iOS 10.  The editor is now broken on Chrome for Windows 10 as well, this was working before the changes.  The editor is still working fine on Edge and Internet Explorer on Windows 10.

ETA: Re-enabling minification of JS and CSS on the site fixes the editor on Chrome for Windows 10.  The uncompressed editor provided by Spuds made no difference.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 23, 2016, 04:47:34 pm
At the moment here works on Chrome and win10, maybe it's just a matter of an hard refresh to cleanup the rather persistent chrome cache.
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on October 23, 2016, 05:05:13 pm
At the moment here works on Chrome and win10, maybe it's just a matter of an hard refresh to cleanup the rather persistent chrome cache.
You are right.  Please ignore the false alarm on Chrome for Windows 10.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on October 23, 2016, 08:13:35 pm
No problem. :)
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 28, 2016, 12:21:07 am
sorry if I insist on this, but are there any news?
one of my moderators told me that is happening with all browsers in ios 10: safari, chrome and also firefox.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 28, 2016, 12:29:04 am
If not all is facing this, it could be just a caching issue.
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on November 28, 2016, 12:49:20 am
You are right to insist, but I really have no idea what is going on, neither means to investigate it.
Unless someone with an iOS10 device is able to debug the issue we are stuck...

Is the PM editor working?
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 28, 2016, 12:58:52 am
my wife has an iphone5 which probably is updated to ios10. I can make some tests but how do yoou debug from mobile? On chrome for desktop we have the inspector option but in mobile what should I do?

Is the PM editor working?
I just asked for the PM, probably tomorrow I'll get an answer. Thanks Emanuele

If not all is facing this, it could be just a caching issue.
do you refer to cache included into elkarte? I can try to disable it, thanks for the tip
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 28, 2016, 01:58:05 am
I was planning to help with my ipad mini 3 with iOS 10 but according to my research, to enable debugging mode , you'll need an apple computer. I don't have this. So, couldn't help debugging unless I can enable it.

About the caching, I don't mean for you to disable it, but rather, clear your cache and try again. May be from both browser and ElkArte sides.
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 28, 2016, 02:04:32 am
I was planning to help with my ipad mini 3 with iOS 10 but according to my research, to enable debugging mode , you'll need an apple computer. I don't have this. So, couldn't help debugging unless I can enable it.
me neither, I'm afraid I cannot help :(

About the caching, I don't mean for you to disable it, but rather, clear your cache and try again. May be from both browser and ElkArte sides.
I did cleaned the cache in elkarte ACP when it was reported on my board, but I'll try again
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on November 28, 2016, 03:58:19 am
I finally managed to get a 10.12 Sierra running inside a Virtual box on my windows machine.  I'm not sure its all that stable but it does seem to run.  I don't know if this is a mobile only issue or if it will show up on the desktop version as well, so if someone with the issue can give me a test account I'll try this vbox to see if I get the error.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 28, 2016, 05:51:12 am
I found this (http://stackoverflow.com/a/35714835) just now which I think can help debugging; but I am rushing to finish some jobs for the time being. I'll try to look into it later.
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 28, 2016, 10:26:26 am
so if someone with the issue can give me a test account I'll try this vbox to see if I get the error.
I sent you a PM ;) Thanks
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 28, 2016, 12:27:17 pm
I have a chance to swipe jquery.sceditor.bbcode.min.js file in 1.0.9 with the one in 1.1 Beta 3 just now and the editor surprisingly shows back all the icons and emoticons. I will try the suggested debugging technique mentioned above soon and report the errors in the current 1.0.9 file, if I managed to get the debugging mode working.
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on November 28, 2016, 03:25:07 pm
so if someone with the issue can give me a test account I'll try this vbox to see if I get the error.
I sent you a PM ;) Thanks
Got the credentials, and the buttons and all the smiles show up just fine on the desktop version of Sierra 10.12 using safari.  So perhaps this is just limited to mobile devices.
I have a chance to swipe jquery.sceditor.bbcode.min.js file in 1.0.9 with the one in 1.1 Beta 3 just now and the editor surprisingly shows back all the icons and emoticons. I will try the suggested debugging technique mentioned above soon and report the errors in the current 1.0.9 file, if I managed to get the debugging mode working.
Thats awesome, thank you for your help on this, keep us posted of what you find.
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 29, 2016, 12:12:10 am
Got the credentials, and the buttons and all the smiles show up just fine on the desktop version of Sierra 10.12 using safari.  So perhaps this is just limited to mobile devices.
I just tried with an iphone 5 and were not visible, so I think is only related to mobile devices

I found this (http://stackoverflow.com/a/35714835) just now which I think can help debugging; but I am rushing to finish some jobs for the time being. I'll try to look into it later.
I tried to install it in windows but without success. From the exe file I saw the name of the iphone, told me that I am connected but no device available from firefox when using Shift + F8.

I also discovered this https://github.com/google/ios-webkit-debug-proxy for linux. No success for now but I will retry in the next days
Code: [Select]
Listing devices on :9221
GnuTLS error: Error in the pull function.
Could not connect to lockdownd. Exiting.: Broken pipe
Unable to attach c52e7c50856e29d7dc80e1534a6ce44aa5c7a2c1 inspector

Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 12:48:41 am
I started to debug this this morning and when it all wired up, I noticed the ipad battery is now only 10%. Meh... I'll try again after it is duly charged.

Just to be sure, I should look into the missing bbccode icons and emoticons errors, right?

Some other questions, I noticed the code is quite old (1.4.5) and there could be a bug in it as reported in samclarke github. Currently is 1.5.1 and our our beta 3 is 1.5.0. Why not upgrade it for 1.0 branch as well? In any event, we are merely using it rather than making any custom changes to it, right? (or no?)
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 29, 2016, 12:58:31 am
Just to be sure, I should look into the missing bbccode icons and emoticons errors, right?
Yes, this is how I see it on my forum 
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on November 29, 2016, 01:12:04 am
1.5 was just recently released (after more than a year) but it has a bug where it strips bbc "code" indentation (tabs/spaces), I reported this when it was in beta but it was not fixed until the pending 2.0 branch. 

The 1.5 branch in our beta is "custom" as it does have the fix that I proposed for the code tag, so its good to go, I think we could include it in 1.0.10, although I should roll the 1.5.1 change back to it.

Still be nice to know what in the current branch broke with the latest ios on mobile so we could avoid it in the future.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 01:39:27 am
So we do customize it a bit and that's great. Just to note, in 1.5.1 there is a "serious bug fix" which I think its fix should be included into our file as well. https://github.com/samclarke/SCEditor/issues/542
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 05:06:51 am
I found this (http://stackoverflow.com/a/35714835) just now which I think can help debugging; but I am rushing to finish some jobs for the time being. I'll try to look into it later.
I tried to install it in windows but without success. From the exe file I saw the name of the iphone, told me that I am connected but no device available from firefox when using Shift + F8.
I get it working by clicking Chrome Desktop and selecting the relevant tab on the left. And I use x64 version to suit my OS.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 05:14:17 am
I posted a quick reply to find fault and I get this:
Quote
TypeError: undefined is not an object (evaluating '$['sceditor'].prototype')  jquery.sceditor.elkarte.js:183:30
TypeError: undefined is not an object (evaluating '$.sceditor.plugins')  splittag.plugin.js:24:12
TypeError: undefined is not an object (evaluating '$.sceditor.plugins')  drafts.plugin.js:293:12
TypeError: undefined is not an object (evaluating '$.sceditor.plugins')  mentioning.plugin.js:142:12
ReferenceError: Can't find variable: QuickReply  index.php:665:36
ReferenceError: Can't find variable: InTopicModeration  index.php:694:51
TypeError: undefined is not an object (evaluating '$.sceditor.locale')  index.php:4:13
TypeError: undefined is not an object (evaluating '$.sceditor.BBCodeParser')  index.php:589:28

Other warnings are the same:
Quote
Invalid CSS property declaration at: ;  jquery.sceditor.css:85:42
Unexpected CSS token: :  font-awesome.min.css:4:1924
Unexpected CSS token: :  font-awesome.min.css:4:2087
Unexpected CSS token: :  font-awesome.min.css:4:2253
Unexpected CSS token: :  font-awesome.min.css:4:2424
Unexpected CSS token: :  font-awesome.min.css:4:2597
Unexpected CSS token: $  index.php:84:15
Unexpected CSS token: $  index.php:85:16
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 06:06:14 am
I couldn't find anything really useful here actually. I attached here the picture of the only main error I can really confirm (which we already knew) which is:
Quote
TypeError: undefined is not an object (evaluating '$editor_data['message'].css')  index.php:638:28

Except for the minor css warning, others cannot be reproduced, so I don't think they are the problems.

The test is from my 1.0 site, please pm me if you want me to test on yours.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 10:36:54 am
Quote
17:35:04.626 ReferenceError: Can't find variable: elk_Toggle  index.php:193:44
17:35:04.633 TypeError: undefined is not an object (evaluating '$.sceditor.locale')  index.php:4:13
17:35:04.638 ReferenceError: Can't find variable: quickQuote  index.php:877:13
17:35:04.648 ReferenceError: Can't find variable: all_elk_mentions  index.php:51:45
17:35:06.222 Blocked a frame with origin "https://googleads.g.doubleclick.net" from accessing a frame with origin "http://www.skodaclub.it".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
 ads:1:54964

Quote
17:33:14.311 Unexpected CSS token: : hive-6d3fb9876cad879ca4a902a42b83e2081376745c.css:4:45464
17:33:14.325 Unexpected CSS token: : hive-6d3fb9876cad879ca4a902a42b83e2081376745c.css:8:2140
17:33:14.338 Unexpected CSS token: : hive-6d3fb9876cad879ca4a902a42b83e2081376745c.css:8:2303
17:33:14.348 Unexpected CSS token: : hive-6d3fb9876cad879ca4a902a42b83e2081376745c.css:8:2469
17:33:14.357 Unexpected CSS token: : hive-6d3fb9876cad879ca4a902a42b83e2081376745c.css:8:2640
17:33:14.365 Unexpected CSS token: : hive-6d3fb9876cad879ca4a902a42b83e2081376745c.css:8:2813
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on November 29, 2016, 10:59:19 am
@ahrasis since apparently you have both a debugger and an iOS that doesn't show the icons (right?), would you mind testing it on elkarte.it? So that I can put up code and we can see if we can find something? I can provide you with an account, just let me know (or register yourself and I'll take care of approving the account).

What you posted confirms more or less what was reported before. Now the problem is identify the cause.
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 29, 2016, 11:34:15 am
You can pm me the account for testing, I'll test it for you. And just post the code for testing in here. I'll help change it and see its outcome.

In the meantime, I think this is the only thing that should be look into as it reproduces, again and again:
Quote
18:29:39.526 TypeError: undefined is not an object (evaluating '$editor_data['message'].css')  index.php:474:28
18:29:39.533 TypeError: null is not an object (evaluating 'g[h].parentNode.parentNode.parentNode.previousElementSibling.querySelector')  hive-731ed43c2d14d764a2d4367069694cfa1c5eecb6.js:215:482
18:29:40.759 Blocked a frame with origin "https://googleads.g.doubleclick.net" from accessing a frame with origin "http://www.skodaclub.it".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
ads:1:54985
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on November 29, 2016, 05:12:14 pm
I think I found something .... well I know I did but lets see if it fixes the issue.   Use the attached file and let me know.
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 29, 2016, 06:52:18 pm
 Thank you Spuds, it's working! 8) 8)
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on November 29, 2016, 07:00:49 pm
awesome sauce !
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 30, 2016, 01:35:14 am
Great! So, no need further testing right?

One more question, what did you find @Spuds?
Title: Re: iOS 10 not showing editor buttons
Post by: Spuds on November 30, 2016, 02:44:47 am
Seems like its working now so no need to test further ... but thank you for your help as it made me dig a bit deeper.

The issue is
Code: [Select]
!/OS [5-9](_\d)+ like Mac OS X/i.test(userAgent);
is being used to determine editor support or not ... thats forward (and fragile) looking instead of min level looking ... so that was changed to
Code: [Select]
/OS [0-4](_\d)+ like Mac/i.test(userAgent)

That change was added for version 1.4.7 but the ElkArte 1.0 branch is on 1.4.5 since *at the time* of 1.0.9 that was the current release.  Also 1.4.7 was (and is) very broken in other areas.

ElkArte 1.1 is currently using a version of 1.4.7, which is really 1.4.5 with some  specific fixes (1.4.7) backported to it (including the above), specifically ones that fixed issues without creating others.  If you are wondering what 1.4.6 is, well its 1.4.5 but refactored into modules (also broken).

I intend to update the current version 1.5.1 with a needed fix and use that for 1.1 RC1.   The next editor release is going to be be 2.0, hopefully that one will be really stable, but I don't know if it will hit in time for 1.1 final.
Title: Re: iOS 10 not showing editor buttons
Post by: radu81 on November 30, 2016, 08:20:01 am
Great! So, no need further testing right?
no, it's ok now, tested with iphone 5, and also 4 users on my forum confirmed that is working fine now. Thanks ahrasis for your help and thanks to all that contributed in this topic
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on November 30, 2016, 08:59:51 am
A really big "THANK YOU" to all of you testing and fixing this issue!  :)

Will there be any fix I can install on my board? Or do I have to wait for newer ElkArte versions?
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on November 30, 2016, 09:16:05 am
Oook, so the usual problem "do not test for user agent, but for functionality" thingy, right? :P
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on November 30, 2016, 10:10:54 am
Its in reply #99 @Jorin.
Title: Re: iOS 10 not showing editor buttons
Post by: Jorin on November 30, 2016, 10:57:33 am
Ah, I missed that one. Thank you!
Title: Re: iOS 10 not showing editor buttons
Post by: ahrasis on December 02, 2016, 12:40:00 am
I have some noob questions with regards to the js file for the editor. In 1.0 branch we got three files: jquery.sceditor.bbcode.min.js, jquery.sceditor.elkarte.js and jquery.sceditor.min.js; and in 1.1 we got only jquery.sceditor.bbcode.min.js and jquery.sceditor.elkarte.js.

1. What are the differences between them and is jquery.sceditor.bbcode.min.js + jquery.sceditor.min.js in 1.0 branch equivalent to jquery.sceditor.bbcode.min.js in 1.1 branch?

2. Can't we use the same for both 1.0 and 1.1 branches for easier bug fixes in the future?

3. Can we like use the original js file from smclarke, but overwrite the broken part in that file with elkarte fixes, without having to fix the original file directly because I think it will be a lot easier to maintain?

If any of the above make sense, that is. :D
Title: Re: iOS 10 not showing editor buttons
Post by: txcas on December 02, 2016, 04:51:02 am
Thanks for the fix!
Title: Re: iOS 10 not showing editor buttons
Post by: emanuele on December 02, 2016, 01:32:31 pm
1. What are the differences between them and is jquery.sceditor.bbcode.min.js + jquery.sceditor.min.js in 1.0 branch equivalent to jquery.sceditor.bbcode.min.js in 1.1 branch?
As explained by Spuds earlier, in 1.0 we ship one version, in 1.1 another.
As for the equivalence between the 2 VS 1, I guess the two in 1.0 are equivalent to the single one in 1.1.

2. Can't we use the same for both 1.0 and 1.1 branches for easier bug fixes in the future?
Because for one the editor has a rather... strange version numbering where a micro increment may mean an almost complete rewrite and a major may just mean a bug fix (unless the versioning stabilized in the last period), then there is the problem that if the editor changes it may change so much that extensions like new buttons do not work any more, and another reason is that the editor relies on jQuery, in 1.0 I seem to remember we ship 1.8, in 1.1 we ship 3.0 (or something along the lines) and it's not always so straightforward what works with what when it comes to jQuery...
With that in mind, it was decided to ship a version of Elk with a certain version of the editor and stick with it to keep this side of the maintenance clean.

3. Can we like use the original js file from smclarke, but overwrite the broken part in that file with elkarte fixes, without having to fix the original file directly because I think it will be a lot easier to maintain?
That's what is already done as much as possible: jquery.sceditor.elkarte.js (along with other files) is meant to extend with custom functionalities the "core editor" as much as possible. In certain cases, this is just not feasible (see the current user agent check).

It does make sense, I hope the reasoning we applied do make sense as well. ;)