collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 137
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Jade Elizabeth: It's GREAT to see you too Sinan!! :D
    July 06, 2016, 02:33:26 am
  • [SiNaN]: Hey Jade! It's great to see you around! Jade!
    July 03, 2016, 06:51:31 am
  • Jade Elizabeth: Oops, sorry I mean HEY SINAN! ;)
    July 01, 2016, 11:07:13 am
  • Jade Elizabeth: Hey Sinan!! :D
    July 01, 2016, 11:06:59 am
  • [SiNaN]: But you shouldn't wait for a security issue and drop by more often. :D
    June 27, 2016, 04:32:18 pm
  • [SiNaN]: Hey ディン1031! It's great to see you around!
    June 27, 2016, 04:31:56 pm
  • ディン1031: Uh to long ago that i was last time here xD
    June 27, 2016, 02:03:08 pm
  • Schnuffeltier: :D
    June 24, 2016, 05:22:34 am
  • Jade Elizabeth: SHOUTBOX IS FOR SHOUTING AAAAAAHHHHHHHHHHH!!
    June 24, 2016, 12:57:05 am
  • [DFg]DJF-1975: Thank you, SP!
    June 21, 2016, 01:35:09 pm
  • Skhilled: phpBB is a good product but has a steeper learning curve.
    June 21, 2016, 08:19:04 am
  • ♦ Ninja ZX-10RR ♦: Hmm, not so sure about it, Eliana: [link]
    May 05, 2016, 02:03:02 am
  • Eliana Tamerin: That may have faded away now, or gotten better. I hope so. I see a lot of happy phpBB users, so I have to imagine someone is having success.
    April 25, 2016, 12:48:06 am
  • Eliana Tamerin: @andy, the phpBB folks had (at one point, not sure how it is now) a specific set of rules you had to follow to get support. Anyone not found doing so would have their topic ignored.
    April 25, 2016, 12:47:40 am
  • andy: SP team is a breath of fresh air...
    April 24, 2016, 11:24:32 pm
  • andy: Yes they are difficult to deal with at SMF. I never experienced anybody like that at phpbb several years ago.
    April 24, 2016, 11:24:03 pm
  • D.Va: Their team is very antagonistic and I prefer this forum and this staff far more. So kudos to SP for doing it right.
    April 24, 2016, 09:18:21 pm
  • andy: When SMF went gold there was a lot of optimism about progress and talk of 3.0.  Five years on and that soulds like SF.
    April 24, 2016, 08:37:31 pm
  • andy: Just my frustration at the slow pace of SMF. I suppose we have an alternative now.
    April 24, 2016, 08:34:38 pm
  • Burke Knight: Andy, as long as the SMF team keeps like they are doing, there's always going to be bugs, mainly due to SMF issues, because the team can't get their stuff straight.
    April 24, 2016, 08:25:41 pm

* Recent Posts

Re: Deleted block still showing!!! by ♦ Ninja ZX-10RR ♦
[July 21, 2016, 10:43:54 am]


Re: Deleted block still showing!!! by habeycole
[July 20, 2016, 04:52:22 am]


Re: Colocar Temas Fijos en portal. by Sapinho®
[July 19, 2016, 04:43:03 pm]


Re: Pregunta y duda de rendimiento con Simpleportal by Sapinho®
[July 19, 2016, 04:37:30 pm]


Re: Paginas del Boards News by Sapinho®
[July 19, 2016, 04:34:09 pm]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Changing forum title if there is new shout  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

Offline phantomm

  • Translator
  • *
  • Posts: 395
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • SP Version: 2.4 (Elkarte)
  • Elkarte Version: 1.0.5
Changing forum title if there is new shout
« on: February 28, 2013, 10:18:03 am »
Hi, so I've been trying to make something like this:

If there is new shout in SP Shoutbox forum title would be changed to "New shout!", but when you visit tab/window with this shourbox it should be changed to default forum title.

I know how and where* use document.title = 'New shout!';. Problem is how to reset forum title to default after visiting page, without need to refresh whole page?

* - you need to add document.title before this code in portal.js
Code: [Select]
}

setInnerHTML(document.getElementById('shouts_' + shoutbox_id), new_body);
« Last Edit: February 28, 2013, 10:20:31 am by phantomm »

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1216
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Changing forum title if there is new shout
« Reply #1 on: February 28, 2013, 11:32:27 am »
phantomm,

  Imo use DOM or javascript.

Here it is using javascript:
Code: [Select]
echo '<script type="text/javascript">
    document.title = "New Page Title";
  </script>';


Offline phantomm

  • Translator
  • *
  • Posts: 395
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: None
  • SP Version: 2.4 (Elkarte)
  • Elkarte Version: 1.0.5
Re: Changing forum title if there is new shout
« Reply #2 on: February 28, 2013, 01:01:50 pm »
Thanks for repy, but this code will change title right after page will be loaded.
What I need to have here is JS to set specified forum title when user will go to already open tab.

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1216
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Changing forum title if there is new shout
« Reply #3 on: March 04, 2013, 02:49:42 am »
Thanks for repy, but this code will change title right after page will be loaded.
What I need to have here is JS to set specified forum title when user will go to already open tab.

phantomm,

  My apologies for the late reply as I am working on a project as of late.
I have not tested it but you put what I posted in a js function & have it execute the function when the shout button or ie. onkeydown keycode 13 (return/enter) is executed if I understand you correctly.

Code: [Select]
echo '<script type="text/javascript">
onLoad = function changeTitle() {
    document.title = "New Page Title";
}
  </script>';
.. then in the js for what I mentioned prior you execute changeTitle()