Customizable site title

Development-related discussion, including bundled plugins
richbeales
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 15 Mar 2013, 18:04
Location: UK
Contact:

Customizable site title

Postby richbeales » 20 Mar 2013, 11:23

Hi,

I've created https://github.com/gothfox/Tiny-Tiny-RSS/pull/53 which allows you to change the page title from "Tiny Tiny RSS" to "TT-RSS" or anything you choose. It maintains the unread count, and if you have several browser tabs open, a shorter title allows you to still see the unread count.

Fox - Let me know if this needs more work before it can be merged?

richbeales
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 15 Mar 2013, 18:04
Location: UK
Contact:

Re: Customizable site title

Postby richbeales » 22 Mar 2013, 00:27

I've updated this to work with the unread count now appearing before the site title.
Also, it should work without forcing people to define it in their config.php

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Customizable site title

Postby fox » 22 Mar 2013, 08:43

OK I missed that. We're not adding a yet-another constant in config.php-dist, there's way to much stuff in there already; I'll take a look at this later today.

jdelamater99
Bear Rating Master
Bear Rating Master
Posts: 109
Joined: 11 Apr 2013, 17:45

Re: Customizable site title

Postby jdelamater99 » 12 Apr 2013, 05:29

Hey, I think I noticed a bug in the modified updateTitle function. I was getting an ever increasing string of (#) in the title bar.
ttrss_title.jpg
ttrss_title.jpg (20.48 KiB) Viewed 1698 times


never mind all the code that I just posted, if you saw it. It got rid of the increasing string, but it was only leaving the last number, which apparently was the oldest, so that's not correct either. But I think I know what needs to change.

Ok, here's the code, that appears to be working properly now.
in js/tt-rss.js
replace

Code: Select all

if (tmp.indexOf('(')>0)
    {
       tmp = tmp.substr(0,tmp.lastIndexOf('('));
    }


with

Code: Select all

if (tmp.indexOf("(") != -1){
      tmp = tmp.substr(tmp.lastIndexOf(") ")+2, tmp.length);
   }


Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests