Javascript Variables - Gallery Theme

jerryrjerryr Registered Users Posts: 595 Major grins
Hi -
I reviewed the DOM using FF to see if there was a variable set which captured the theme applied to a specific gallery.
I did not see the information stand out.
Therefore, my questions are:
1. Is there JS variable containing the galleries theme name ?
2. If not, is there a way in capturing that information within a variable ?

thanks - jerryr

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited January 22, 2009
    As far as I know, the only ways to discern what theme is being used on any given page are:
    1. Using javascript, iterate over the link tags to find the one that references the theme CSS file and then parse out the theme number from that filename. For example, this line:

      <link type="text/css" rel="stylesheet" id="pickedTheme" href="http://cdn.smugmug.com/include/css/gecko/1.9/win/theme_1393-20081030212042-stretch.css" />

      is the theme from my homepage and 1393 is the theme number.
    2. If you are looking only for the presence of a particular theme, you could use javascript to detect the presence of certain key style rules (like a particular background or background image or certain text colors).
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • jerryrjerryr Registered Users Posts: 595 Major grins
    edited January 24, 2009
    Hi -
    Thank you for the recommendation.
    I am going to set and pass a specific variable via the footer area with the link (already doing it, just need to add a new variable).

    idk - maybe an enhancement for a future release to have the theme via a javascript variable.

    thanks again - jerryr
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited January 24, 2009
    jerryr wrote:
    Hi -
    Thank you for the recommendation.
    I am going to set and pass a specific variable via the footer area with the link (already doing it, just need to add a new variable).

    idk - maybe an enhancement for a future release to have the theme via a javascript variable.

    thanks again - jerryr

    May I ask why you need to know the theme in javascript? Perhaps there is a different way to solve your problem.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.