Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question What is this code called?

    I would like to know how this person is able to switch between search forms by simply clicking the links "dictionary | site wide". What is this code called? I checked the source code, but it doesn't provide me with much information. Any opinions? Ideas? It's not so much important to know how the search form switches, I think just by knowing the code generally, I will be able to deduce how the form switches.

    >> http://www.biology-online.org/dictionary/Main_Page

    Thanks
    Last edited by shuban; 02-25-2011 at 08:07 AM.

  • #2
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts
    They are using JavaScript to control the style sheet properties of the elements on the page.
    Regards, Stooshie
    O

  • #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Stooshie View Post
    They are using JavaScript to control the style sheet properties of the elements on the page.
    Oh, do you know the name of the code? So that I can search it up on Google?

  • #4
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts
    I think they have probably written it themselves. View the source code, then look for a reference to a file called script.js then download that file.
    Regards, Stooshie
    O

  • #5
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Stooshie View Post
    I think they have probably written it themselves. View the source code, then look for a reference to a file called script.js then download that file.
    Thanks. It's a mediawiki so the scripts are all jumbled up. Probably would give an accurate representation of the code I'm looking for.

  • #6
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    It may be copyrighted so I would not download it.

  • #7
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by quartzy View Post
    It may be copyrighted so I would not download it.
    is free but have a creative commone licence:

    To grow the commons of free knowledge and free culture, all users contributing to Wikimedia projects are required to grant broad permissions to the general public to re-distribute and re-use their contributions freely, as long as the use is attributed and the same freedom to re-use and re-distribute applies to any derivative works. Therefore, for any text you hold the copyright to, by submitting it, you agree to license it under the Creative Commons Attribution/Share-Alike License 3.0 (Unported). For compatibility reasons, you are also required to license it under the GNU Free Documentation License (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Re-users can choose the license(s) they wish to comply with. Please note that these licenses do allow commercial uses of your contributions, as long as such uses are compliant with the terms.
    http://wikimediafoundation.org/wiki/Terms_of_Use

    http://www.mediawiki.org/wiki/MediaWiki

    best regards

  • #8
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    HI Oxes
    Good you found out that it was free, to me it sounded like the other person was telling the enquirer to download a script that a coder may have written themselves, ie copyrighted perhaps.

  • #9
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    380
    Thanks
    9
    Thanked 39 Times in 39 Posts
    Clicking on dictionary/site wide calls a function called switch_menu() which is about 10 lines of code (looks like a self-written script, with no copyright info) which sets display style on the search boxes to display the correct one.

    Googling getElementById will give you the code you need to change the display.

    Their google(sitewide) searchbox is the standard google search box that any site admin can get from google. Their own search box will be a custom search written into the wiki.

    In summary

    Changing the layer to display (switch_menu) is a very easy function to write (so easy that using it would be very unlikely to cause a problem). The div containing the google search is easy to obtain from google and their own custom search will be part of their wiki.
    Regards, Stooshie
    O


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •