Advertisement:

Author Topic: PM subject field  (Read 1074 times)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
PM subject field
« on: October 01, 2017, 06:04:17 PM »
A nitpicky thing, but just had to fix it again.  The default text in Subject field in pm editor - (No subject) - must be deleted before you can type a subject.  It's easily fixed by changing this -

Code: [Select]

<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="40" maxlength="50" />


 to this -

Code: [Select]

<input type="text" name="subject" placeholder="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="40" maxlength="50" />


 in PersonalMessage.template.php.  This clears the field when you click in the box.



Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #1 on: October 01, 2017, 06:05:38 PM »
Not happening in 2.0 because it would make the XHTML invalid.

In 2.1... GitHub is ---> that way.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #2 on: October 01, 2017, 06:11:13 PM »
Not happening in 2.0 because it would make the XHTML invalid.

What does it do?  I've used it in several forums and not seen any problems.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #3 on: October 01, 2017, 06:14:47 PM »
Break the page because it's invalid XML (because that's what XHTML means, XML+HTML)

It's also, incidentally, the reason why SMF uses ; in all the URLs, so it didn't have to deal with correctly encoding & in all the URLs which would break the page if any single instance were done wrong because a page then becomes an XML document rather than tag soup.

Browsers can decide to treat it not as XML but this can cause other things to break.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #4 on: October 01, 2017, 06:26:31 PM »
So it's valid HTML5, but invalid in XHTML 1.0 transitional?  I've seen this used on many websites in login fields, shopping carts.  Works differently in IE and FF, but doesn't seem to break anything.  Is there another way to do it?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #5 on: October 01, 2017, 06:34:44 PM »
Of course it's invalid XHTML, it didn't exist nearly 20 years ago when XHTML 1 was written...

Most sites these days use HTML5 where it's absolutely fine. Like 2.1 does.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #6 on: October 01, 2017, 06:35:48 PM »
This works -

Code: [Select]

<input type="text" name="subject" value="', $context['subject'], '" onfocus="value=\'\'" tabindex="', $context['tabindex']++, '" size="40" maxlength="50" />


I suppose it's rude to ask, but why is SMF using a 20 year old doctype in 2.0?
« Last Edit: October 01, 2017, 06:49:58 PM by Sir Osis of Liver »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #7 on: October 02, 2017, 02:37:09 AM »
Because in 2011 it was still the most modern.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #8 on: October 02, 2017, 01:31:02 PM »
Still don't see why this was never fixed.  It's an obvious, annoying glitch in a feature that's used regularly, and there seem to be many solutions available, at least one of which must be compatible with the 2.0 code.  I've seen devs argue interminably of much less significant minutae.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #9 on: October 02, 2017, 01:33:12 PM »
Because it's not possible TO fix in 2.0 without gutting the theme, sorry.

All of the other solutions require JavaScript, which no-one wanted to use for this because of cross browser compatibility.

Your solution also *requires* people to type a subject whereas the current one does not require the user to actually do anything.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 47,670
Re: PM subject field
« Reply #10 on: October 02, 2017, 01:41:04 PM »
since SMF 2.0 is not having features added to it, this will not be added to SMF 2.0.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #11 on: October 02, 2017, 01:43:45 PM »
Your solution also *requires* people to type a subject whereas the current one does not require the user to actually do anything.
Only if you click in the field, otherwise it still uses '(no subject)' as subject text.  Don't think that's a bad thing.

since SMF 2.0 is not having features added to it, this will not be added to SMF 2.0.
Didn't think it would be, but it's actually a fix, not a new feature.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #12 on: October 02, 2017, 01:45:29 PM »
Huh, didn't see you'd updated it with an edit, I was going off the original placeholder attribute which definitely wouldn't work.

And no, it's not a bug fix.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #13 on: October 02, 2017, 10:05:18 PM »
And no, it's not a bug fix.

Didn't say it was, it works badly because it's designed to work badly. 

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #14 on: October 03, 2017, 02:50:34 AM »
But that's why it's not being included, it isn't broken. You just dislike how it works.

I couldn't recommend the "fix" for it that would remove the title if I were to click back into it to, say, fix a typo.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,834
  • Too long in the wasteland
Re: PM subject field
« Reply #15 on: October 03, 2017, 04:30:32 PM »
But that's why it's not being included, it isn't broken. You just dislike how it works.
I can't remember ever seeing an input field that required manually deleting default text.  Spent an hour or so last night on 6 or 8 websites making a couple of purchases and renewing magazine subscriptions, all had input fileds with default text, and all cleared when I clicked in the box.

Quote
I couldn't recommend the "fix" for it that would remove the title if I were to click back into it to, say, fix a typo.

I don't see that as a bad thing, either.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 47,670
Re: PM subject field
« Reply #16 on: October 03, 2017, 04:31:23 PM »
i do see it as a bad thing. either way this is not being done in SMF 2.0.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,723
    • Arantor on GitHub
Re: PM subject field
« Reply #17 on: October 03, 2017, 04:36:15 PM »
Now we have placeholders, it's super easy to do. But this is only a recent phenomenon, unlike SMF which has done this consistently for the last 14 years, long before HTML5 was ever a thing, and back then it was done inconsistently and badly and invariably bad for accessibility.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.