ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on October 29, 2013, 10:48:41 am

Title: Javascript & features
Post by: emanuele on October 29, 2013, 10:48:41 am
Context:
https://github.com/elkarte/Elkarte/issues/772#issuecomment-27180800
https://github.com/elkarte/Elkarte/pull/948#issuecomment-27227440
Quote from: emanueleI was wondering: and what if we do what github does? (i.e. just do the relative via javascript and nothing else?)
Quote from: TEmhh, the more I think about that .... I believe you're right in calculating it via javascript only.
Quote from: SpudsHumm ... there is a certain logic to that yes ... would prevent the email issue you described, only downside is those not using JS but I'm really not sure that is a valid concern these days?

So, all the features should work even with js disabled?

I'm one of those that browses with noscript and enables only the scripts I think should be enabled.

But I think that in the WWW of today, browse completely without js is impossible, so I'm fine with rely on js for "several" things.
As an example the mentioning recently introduced works only if js is enabled (and I'm not speaking about the droppy, I mean the real notification, the @emanuele is notified only and only if javascript is enabled and works as expected, because the code relies on a series of hidden input fields added for each @name in the body message, so that the only server-side processing is fetch the usernames (and this could actually avoided if we want POSTing the names too along with the id_member) and do the replace).

So, where do we draw the line?
Is relative time something that should always work or it is acceptable to have it working only for people with js enabled?
I was thinking that having it in js or not  would "affect" also how search engines see the site, because one thing is return the "just now" in the html and another one is return the actual date and time. No idea if it is relevant in some way.
Title: Re: Javascript & features
Post by: TE on October 29, 2013, 12:37:49 pm
Quote ... or it is acceptable to have it working only for people with js enabled?
Short answer is yes.

relative times is just a "cosmetic" aspect. There is no impairment regarding functionality while using the normal date format.
Title: Re: Javascript & features
Post by: forumsearch0r on November 03, 2013, 08:43:06 pm
Let me join here as I make my money with such things...

Quote from: emanuele – But I think that in the WWW of today, browse completely without js is impossible

A website which doesn't work without JavaScript has not much to say IMO. Forcing the users to allow JavaScript so they can see more shiny animations (mostly replacable by CSS3 transitions anyway) is ridiculous.

Also, ElkArte is not about the effects. Without JavaScript, all features of a board system should still work, minus the popups and fancy blinking stuff, of course. Why would anyone have to enable JavaScript just to write text into a database?
Title: Re: Javascript & features
Post by: emanuele on November 04, 2013, 04:51:23 am
Well... I didn't say anything about writing things into a database, neither I said I would make Elk similar to one of those websites you have to enable javascript just to see the text. :P

Auto-saved drafts are a feature, but without javascript they cannot work.
Preview works both ways.
The "jump to" works only if js is on.
The "more" droppy works without js too.
Any collapse/expand except the categories works only if javascript is on.
The editor obviously doesn't work without js.
Create a poll without js is quite painful (IIRC).
Part of the admin panel may not work properly without js.
Quick moderation and edit are completely useless without js.

So, where should we draw the line?
Is relative time something we can live without if js is disabled or it is a fundamental part of the features that has to work no matter what?
Title: Re: Javascript & features
Post by: forumsearch0r2 on November 04, 2013, 05:53:53 am
(Second account as I can't log in with my OpenID account on another machine, always taken to the registration form ... WTF?! - Feel free to take this as another serious bug report.)

The line should be drawn as wide as possible IMO. Creating polls is OK if it requires JS as it's not a common task. Common tasks should work without JS though.

(One more thing: The avatar pictures in the mobile interface are too small. Drop them or resize them; the way they are is pointless.)
Title: Re: Javascript & features
Post by: TE on November 04, 2013, 08:04:17 am

Quote from: forumsearch0r2 – (Second account as I can't log in with my OpenID account on another machine, always taken to the registration form ... WTF?! - Feel free to take this as another serious bug report.)
I thought you had registered your primary account without OpenID because of a timeout?
http://www.elkarte.net/index.php?topic=684.msg4778#msg4778
Title: Re: Javascript & features
Post by: forumsearch0r2 on November 04, 2013, 08:11:42 am
Yes, but as stated later I could still only log in with my OpenID regardless of the timeout, the password didn't work. Now (on a different machine), both don't work. WTH.
Title: Re: Javascript & features
Post by: emanuele on November 04, 2013, 09:05:12 am
Quote from: forumsearch0r2 – (One more thing: The avatar pictures in the mobile interface are too small. Drop them or resize them; the way they are is pointless.)
I don't have any mobile stuff, so...
What do you think of the attached?
Title: Re: Javascript & features
Post by: forumsearch0r on November 04, 2013, 09:49:26 am
I like that! :)

(Random note: The "up/down" slider on the right side is pretty much... too much on the mobile site. Maybe turn it off?)

(Yep, this is my other machine.)
Title: Re: Javascript & features
Post by: emanuele on November 04, 2013, 09:53:47 am
I was now playing a bit with that too, see attachments.
I'm facing a problem though in that configuration: the dropdowns on the right are pushed outside the screen... >:(

Of course I'm just playing with it, dunno exactly what I'm doing... LOL
Title: Re: Javascript & features
Post by: emanuele on November 04, 2013, 10:20:12 am
Okay, I found a sort of solution, but I think it doesn't work very well with small screens and three-level menus... lol
Title: Re: Javascript & features
Post by: TE on November 04, 2013, 10:50:59 am

Quote from: forumsearch0r – (Random note: The "up/down" slider on the right side is pretty much... too much on the mobile site. Maybe turn it off?)
IIRC I've  already turned it off via display: none; for smaller mobile screens. This site is using an older version of Elk.
Title: Re: Javascript & features
Post by: Spuds on November 04, 2013, 11:32:39 am

QuoteIIRC I've  already turned it off via display: none; for smaller mobile screens. This site is using an older version of Elk.
Hint Taken :P

Title: Re: Javascript & features
Post by: emanuele on November 04, 2013, 11:40:48 am
/me would suggest to wait until "someone" may want to change disregard to watch/unwatch... O:-)
Title: Re: Javascript & features
Post by: Spuds on November 04, 2013, 11:31:45 pm
All updated ... remember to clear yer cache :D
Title: Re: Javascript & features
Post by: TE on November 04, 2013, 11:50:31 pm

Quote from: Spuds – All updated ... remember to clear yer cache :D
yuppieeeee :D
Title: Re: Javascript & features
Post by: TE on November 05, 2013, 01:21:12 am
@Spuds: mention autosuggest doesn't seem to work.. Forgot to upload some files?
Title: Re: Javascript & features
Post by: emanuele on November 05, 2013, 02:10:40 am
/me waits for the bunch of fixes usually associated with a site upgrade! :P
Title: Re: Javascript & features
Post by: TE on November 05, 2013, 02:30:40 am
ups, old uploaded avatars seem to be broken, too.. I thought we had it fixed.. upgrade script broken?
Title: Re: Javascript & features
Post by: emanuele on November 05, 2013, 03:02:35 am
I can see them fine...at least mine.
Title: Re: Javascript & features
Post by: TE on November 05, 2013, 06:30:26 am

ah ok, probably an issue with frame security?
https://github.com/elkarte/Elkarte/pull/925
 I'm currently behind a restricted proxy. If I copy the Avatar URL in a new browser window I can download your avatar. However that pic isn't displayed inline.
Title: Re: Javascript & features
Post by: emanuele on November 05, 2013, 09:04:26 am
As far as I understood frame security is for (i)frames, not proxies.
Dunno...

ETA: what browser?
Title: Re: Javascript & features
Post by: Spuds on November 05, 2013, 09:55:35 am
Quote from: TE – ah ok, probably an issue with frame security?
Could be ... I turned off one of the added headers, lets see it that is the cause, and if so then we can determine what we can do

Quote@Spuds: mention autosuggest doesn't seem to work.. Forgot to upload some files?
Well there is always that possibility  O:-)  For some reason I could not get the upgrade script to run either CLI or from the browser.  The browser one would die on a JS error as the upcontext data was missing, that may be a session issue.  Don't know if its just this sites setup or the script be a bit buggered.

ETA: the mentions thing was a bug, and I can't blame Emanuele for this one :'(  should be working now, well active :D https://github.com/Spuds/Elkarte/commit/c6063809ae01c2f6d1a2ed1185cdb00f5d0ebe30
Title: Re: Javascript & features
Post by: TE on November 05, 2013, 11:11:53 am
QuoteCould be ... I turned off one of the added headers, lets see it that is the cause, and if so then we can determine what we can do
ok, I can't test right now.. (Currently @ home)  I'll report in a few hours.
Title: Re: Javascript & features
Post by: TE on November 05, 2013, 11:15:04 am
I'll test the frame security issue in a few hours, can't test it right now.

with notifications enabled I got an:
Code: [Select]
Unknown column 'notif_type' in 'where clause'
turned them off for now. It's the bug in the upgrade scripts:
https://github.com/elkarte/Elkarte/issues/980
Title: Re: Javascript & features
Post by: Spuds on November 05, 2013, 01:05:11 pm
LOL .. tripping over my own feet here ...

I knew about that and changed the upgrade script for the site, but when it would not run, well it was getting late so I did them the old fashioned  way, but copied the queries from the master and not the one I changed :P

Oh well .. should be moar fixed now

@emanuele  say the popup in wizzy is in the top right corner, looks great in standard mode
Title: Re: Javascript & features
Post by: emanuele on November 05, 2013, 02:00:03 pm
/me feels he didn't filter banned users... O:-)
Title: Re: Javascript & features
Post by: IchBin on November 05, 2013, 07:22:39 pm
@IchBin  testing mentions.
Title: Re: Javascript & features
Post by: emanuele on November 05, 2013, 07:27:39 pm
mmm...I think this should be considered a bug: IIRC you can't mention yourself @IchBin though the name is highlighted.
Also I'm pretty sure in matching the names I didn't consider punctuation, so I'll try an @Spuds.
Title: Re: Javascript & features
Post by: IchBin on November 05, 2013, 08:01:58 pm
What's the mention supposed to do? How does it alert me? I don't see options in the profile to change any settings for it. Did I miss anything?
Title: Re: Javascript & features
Post by: emanuele on November 06, 2013, 03:24:02 am
Oh, no I forgot it's disabled... lol
Title: Re: Javascript & features
Post by: Spuds on November 06, 2013, 09:19:13 am

Quote from: IchBin – What's the mention supposed to do? How does it alert me? I don't see options in the profile to change any settings for it. Did I miss anything?
Thats not done yet ... well the profile menu and the count notification, I don't think they are, ... coming soon !
Title: Re: Javascript & features
Post by: Spuds on November 07, 2013, 09:49:30 am
Quote from: TE –
QuoteCould be ... I turned off one of the added headers, lets see it that is the cause, and if so then we can determine what we can do
ok, I can't test right now.. (Currently @ home)  I'll report in a few hours.
@TE did you have a chance to see if the header I turned off helped with that?
Title: Re: Javascript & features
Post by: TE on November 07, 2013, 10:11:27 am
ups, yes. I think everything looked fine .. I'm now @ home again and can't test. O:-)
Title: Re: Javascript & features
Post by: Spuds on November 07, 2013, 10:14:47 am
Thanks ... just wanted to make sure which of the two headers might have caused it, sounds like we got the right one ... now what to do about it :P
Title: Re: Javascript & features
Post by: TE on November 08, 2013, 01:35:55 am

Quote from: Spuds – @TE did you have a chance to see if the header I turned off helped with that?
ok, definitely fixed. Tested behind the "bad" proxy  :D
Title: Re: Javascript & features
Post by: Bloc on November 27, 2013, 12:07:18 pm
The mentioning dropdown is quite nice, good call in collecting everything "liking" etc. in one page. (http://www.elkarte.net/themes/default/images/post/thumbup.png)

But while "likes" and "mentions" are logical..whats "unlikes"? Do you log if someone likes your post.and then unlike it again...? If so - whats the point in that?
Title: Re: Javascript & features
Post by: emanuele on November 27, 2013, 12:13:22 pm
Your avatar looks big...
/me wonders if we broke something while playing around. :P

Yep, "unlikes" are logged too, not sure if relevant or not, so since I was undecided I just added it... O:-)
Remove the thing is pretty easy, so up all of you if you like it or not. :D
Title: Re: Javascript & features
Post by: Bloc on November 27, 2013, 12:29:29 pm
"You may like my post, but don't you dare unlike it. Cuz I'll know!"  ;D  Seriously, feel a bit off that one..

The avatar? Its a gravatar..but doesn't the css limit its size on avatars in Elkarte?
Title: Re: Javascript & features
Post by: Xarcell on November 27, 2013, 12:59:06 pm
There should be a "like" and "dislike". Dislike covers not liking the post, and reversing a "like". Not unless you want to use "like", "unlike", and "dislike".
Title: Re: Javascript & features
Post by: emanuele on November 27, 2013, 01:05:06 pm
Quote from: Bloc – The avatar? Its a gravatar..but doesn't the css limit its size on avatars in Elkarte?
Yep, it was more a question to myself (or to someone that remembers if we did some mistake or if it is supposed to be like that lol).

If I understood correctly (not really into the like thing), at the moment is "like", then you can remove the like.
Title: Re: Javascript & features
Post by: Bloc on November 27, 2013, 01:08:10 pm
Xarcell, I am not arguing against dislike. But is the "dislike" a removal of a like(which is of course needed, but should that be logged for the user to check out?)..or a genuine "i am NOT liking this"?

The way I see it: liking a post is a positive thing. Removing it says" ok, I am not liking this so much anymore" but still positive in the sense that my "like" isn't simply not counted anymore. No hard feelings etc. So should I be "punished" for taking away a like, since it will actually show it as a "dislike"? Thats a negative vibe IMHO and not much different from Karma's positive/negative TBH.

Quote from: emanuele –
If I understood correctly (not really into the like thing), at the moment is "like", then you can remove the like.

But the "dislikes" in the menu..what do they show then?
Title: Re: Javascript & features
Post by: Xarcell on November 27, 2013, 01:51:47 pm
I was just speaking in terms of a better vocabulary.

If I had it my way, you wouldn't be able to undo your like, but you would still be able to "dislike", which is a positive/negative rating system for posts that allow user's to filter valuable/unvaluable content as seen by their peers. YouTube handles it nicely in my opinion, although StackOverflow is great too...

As far as mention being "punished" for having a like removed is something user's poptart about on a daily basis on StackOverflow. Their most common answer (paraphrased) is "We focus on quality of content, not the quality of the user". Which, anyone who's running a website should feel the same way.

You just can't please everybody...

The only solution I see to make more people happy with it would be to never remove the "likes" from the user's total count, but still remove them from the post. Although, is that worth the extra resources I wonder? Not in my opinion...

BTW, the karma system only effects the user, where the likes also effect the content. Huge difference. I much prefer to "like" something when I want to share it socially, and use a voting system for post quality rating.
Title: Re: Javascript & features
Post by: emanuele on November 27, 2013, 02:23:33 pm
Quote from: Bloc – The way I see it: liking a post is a positive thing. Removing it says" ok, I am not liking this so much anymore" but still positive in the sense that my "like" isn't simply not counted anymore. No hard feelings etc. So should I be "punished" for taking away a like, since it will actually show it as a "dislike"? Thats a negative vibe IMHO and not much different from Karma's positive/negative TBH.
As I said I'm not much into the like/unlike state of mind, so I'm completely open to suggestions.
I'm probably kind of naive, I just added it because I personally would like to know what is going on with my posts, if someone liked it there may be a reason, if they removed the like there may be another reason, so I was just curious to see this change in state of the post, nothing more, nothing less.
On the other hand, I tend to think that if someone "likes" something, the odds he is going to dislike it at any point in the future are low... Unless who is liking/unliking is mentally unstable. LOL

Quote from: Bloc –
Quote from: emanuele – If I understood correctly (not really into the like thing), at the moment is "like", then you can remove the like.
But the "dislikes" in the menu..what do they show then?
It's "unlike", that means "remove the like", yes.
As far as I remember there is no dislike.

You should be able to see it in your mentioning area: I just liked and unliked your previous post, so you should have two notifications around.

Again, up to you guys.
Title: Re: Javascript & features
Post by: Xarcell on November 27, 2013, 02:45:37 pm
Quote from: emanuele –
Quote from: Bloc – The way I see it: liking a post is a positive thing. Removing it says" ok, I am not liking this so much anymore" but still positive in the sense that my "like" isn't simply not counted anymore. No hard feelings etc. So should I be "punished" for taking away a like, since it will actually show it as a "dislike"? Thats a negative vibe IMHO and not much different from Karma's positive/negative TBH.
As I said I'm not much into the like/unlike state of mind, so I'm completely open to suggestions.
I'm probably kind of naive, I just added it because I personally would like to know what is going on with my posts, if someone liked it there may be a reason, if they removed the like there may be another reason, so I was just curious to see this change in state of the post, nothing more, nothing less.
On the other hand, I tend to think that if someone "likes" something, the odds he is going to dislike it at any point in the future are low... Unless who is liking/unliking is mentally unstable. LOL

Quote from: Bloc –
Quote from: emanuele – If I understood correctly (not really into the like thing), at the moment is "like", then you can remove the like.
But the "dislikes" in the menu..what do they show then?
It's "unlike", that means "remove the like", yes.
As far as I remember there is no dislike.

You should be able to see it in your mentioning area: I just liked and unliked your previous post, so you should have two notifications around.

Again, up to you guys.

I reckon you didn't do it to my post, because I didn't get anything, but that's ok because I've already seen how it works.

Personally, I don't see the reason to have a "mentions" area. There should be an "alerts" area, that show you all likes, dislikes, and messages. One area for everything. This would be great because maybe some plugins can utilize this area as well. Of course, in the alerts area one should be able to filter types of alerts.

It would even be nice to get announcements this way, but probably be too hard on resources to send everyone an alert, but wouldn't be so bad if you just targeted certain membergroups.
Title: Re: Javascript & features
Post by: Bloc on November 27, 2013, 04:29:09 pm
No, the mentions area is just fine. :) Its a great overview of it.

And true, I have now 2 likes and 2 unlikes. Its up to you guys of course, but for me getting a like is great, but if its removed I don't want to think twice about that, not wondering why etc. I would be tempted to simply show just the users that have liked, and remove any unlikes, or past likes. What you see is what you get, so to speak. I think Facebook works fine there, you only see whos liked, and if you remove it, it goes away, no hard feelings. AFAIK anyway, maybe its changed lol.
Title: Re: Javascript & features
Post by: TE on November 27, 2013, 10:56:11 pm
I think we should make it configurable via admin interface: "Add a mention when a post is unliked by a member"..
Title: Re: Javascript & features
Post by: Spuds on November 27, 2013, 11:21:11 pm
Quote from: TE – I think we should make it configurable via admin interface: "Add a mention when a post is unliked by a member"..

Was thinking the same thing, right after I fixed it :D ...
Title: Re: Javascript & features
Post by: emanuele on November 28, 2013, 05:23:36 pm
Quote from: Xarcell – Personally, I don't see the reason to have a "mentions" area. There should be an "alerts" area, that show you all likes, dislikes, and messages. One area for everything. This would be great because maybe some plugins can utilize this area as well. Of course, in the alerts area one should be able to filter types of alerts.
Actually the "mentioning" area is designed exactly like that: it can show anything you want (provided it is logged into the appropriate table and you instruct the class to know about the new "mentioning".
Yeah, maybe "alerts" would be a better name, though rename it again... dunno... O:-)
We can even do the lazy thing and just change the name of the button.
/me hides

Quote from: Xarcell – It would even be nice to get announcements this way, but probably be too hard on resources to send everyone an alert, but wouldn't be so bad if you just targeted certain membergroups.
mmm...dunno, though...I may have an idea for announcements...

/me foresee an addon coming
Title: Re: Javascript & features
Post by: Spuds on November 28, 2013, 06:25:00 pm
QuoteYeah, maybe "alerts" would be a better name, though rename it again... dunno... O:-)
Well I'm not going to change it (again) :P  And I don't like alert FWIW, sounds like a warning or something ... Hey we could put moderation actions in there :P
Title: Re: Javascript & features
Post by: emanuele on November 29, 2013, 04:24:10 am
Good point... :P
Oh well, there is a number, I'm pretty sure anyone that see a number will click on it. O:-)
Title: Re: Javascript & features
Post by: Xarcell on November 29, 2013, 10:11:39 am
If the "mentioning" area is actually the alert area, then wouldn't it be better for messages to go there too?

"Mentions" is one of the worse terms that could have been used for this.

Choice Of Terms That Should Have Been Used: Alerts, Prompts, Updates, and Notifications.
Alternative Terms Considered: tips, triggers, hints, and clues.
Title: Re: Javascript & features
Post by: emanuele on November 29, 2013, 11:09:52 am
It started as "notifications", but there are already other notifications, so it was confusing.
Dunno, I'm not that into English and social networks to know what's best to call it.
Title: Re: Javascript & features
Post by: Spuds on November 29, 2013, 11:33:16 am
Quote"Mentions" is one of the worse terms that could have been used for this.
Well it was until you posted your list, now its not even in the top 5 :P :D

QuoteIt started as "notifications", but there are already other notifications, so it was confusing.
Exactly this, especially in the code since notifications is a rather large feature of its own, having similar controllers, templates, subs etc was very confusing and that's with us actively working on the code, imagine how that would be if you had to go back in 6 months. 

If the issue is someone does not like the button being called Mentions, its easy to change it to something you like and if someone can come up with the "awesome sauce" name even better.  Granted not everything is directly a mention in that list, nor are they notifications, nor are they alerts .... The notify functions don't show up in that list at all.  I suppose at some point those areas could be unified, but not sure what you gain there either, soon you would just a another dropdown menu with personal messages, notifications, likes, mentions, buddies, etc etc   :-\
Title: Re: Javascript & features
Post by: emanuele on November 29, 2013, 11:58:33 am
Droppies FTW! :D

giggles