SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Th hunt for javascripts

    Can any one help:
    Do you have or no where to find the following java scripts:

    1) Default Home - enables visitor to make the current page their default Home Page when they open up their browser.

    2) Print Version script - to print a prinatable version of the current page.

    3)I love the features attatched to the articles on this site (sitepoint). i.e. "send feedback", "email" and "print article", this would be fantastic for my site - anyone know where I can find these scripts.Or if the webmaster is listening in, can you help me

    4)Right Mouse Click script - I want to create my own drop down menu and options when you right click on a web page - NOT TO PRODUCE A WARNING MESSAGE, but just what I have said.

    I would thank you all for saving me hours and hours of work. Cheers

  2. #2
    SitePoint Guru
    Join Date
    Dec 2000
    Location
    Karachi, Pakistan
    Posts
    913
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For your request number 4, I have an answer. I remember saving the same script when I was a newbie but I never used it. I had found that script on www.dhtml***.com

    I can't recall the website at the moment. This is because I am so used to dhtmlgod's nick that I wrote dhtmlgod twice in the url. So you better start kicking D for keeping such a confusing nick. (j/k)

    When I would remember it, I would post it here.


    - Omair
    36Host.com - $36/year web hosting [affiliates earn 30%]
    * Affordable Small Business Web Hosting since 2003! *
    "500mb space, 10gb bandwith, 50 pop/ftp accounts, php,
    mysql, pre-installed php scripts, 24/7 support & more...."



  3. #3
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    1.
    Code:
    function setHomePage() {
        var agt=navigator.userAgent.toLowerCase();
        var is_major = parseInt(navigator.appVersion);
        var is_minor = parseFloat(navigator.appVersion);
        var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                    && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
        var is_nav4up = (is_nav && (is_major >= 4));
        var is_nav6up = (is_nav && (is_major >= 5));
        var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
        var is_ie3    = (is_ie && (is_major < 4));
        var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
        var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) && (agt.indexOf("msie 6")==-1));
        var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
        var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
        var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                        (agt.indexOf("windows 16-bit")!=-1));
        var is_mac    = (agt.indexOf("mac")!=-1);
    
    	if (is_win && is_ie4) {self.location.href = "browsers/pc.ie4.html";}
    	else if (is_mac && is_ie) {self.location.href = "browsers/mac.ie.html";}
    	else if (is_win && is_ie5up) {
    		oHomePage.style.behavior='url(#default#homepage)';
    		oHomePage.setHomePage('http://www.cnn.com/');
    		parent.close();
    		//location.href = 'dsw-browser.html';
    	}
    	else if (is_win && is_nav6up) {self.location.href = "browsers/ns6.html";}
            else if (is_win && is_nav4up) {self.location.href = "browsers/pc.ns.html";}
            else if (is_mac && is_nav4up) {self.location.href = "browsers/mac.ns.moz.html";}
    	else {self.location.href = "browsers/other.html";}
    	}
    2. Would need to interact with server-side script to rebuild the page for printing.

    3. THis is fairly simple, any ASP or PHP site has this

    4. Like: http://www.pip.co.za ?
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanxs

    Thanxs jeremy and Osmair for your reply.

    Jeremy I tried the default homepage script you posted.I assume you you call it using the following :
    onMouseClick="setdefaulthome()".
    I'm a bit new to javascript so be patient.I also need to make only one change to the script right? http://wwww.cnn.com changes obviously to my homepage?

    Yes!!
    The drop down right click menu at http://www.pip.co.za/ is exactly what I want, its a bit more sophisicated than I need, but brill!

    I'm going to be realy cheeky and ask you if you can recomend a server side print version script.If not thanks for your help

  5. #5
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right-Click script? look, this has always been debated. Is there a good reason for this? Look at any successful site you know of. I mean, really successful sites. Do they use this type of thing?

    Just thought I'd point out some moral / webmastering downsides of this.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    goob, noted, but LOOK @ the pip one!!

    pahayes, I don't know of any "canned" print-version ones, but essentially if the original page is db driven, the print version will just not use tables, images, funky fonts, etc.

    It's simply a matter of setting a differential and saying "these tags dont' get displayed in the print version".
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  7. #7
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's nice, but it's still going against my core values. You all know me, man of values and all..
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  8. #8
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    values? pfft
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  9. #9
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, me being british and all, i can't help it! sorry!
    I have looked at all the successful sites, of course! It's hard not to follow, but who really uses the right click except to copy an image or something else that one fancies. When people enter my site I want then to feel REAL virtual and have easy access to anything they want (of course in what I want them to have access to).

    Imagen : you scroll a hundred miles and suddenly you feel you want to access something or other you saw a few clicks ago on the site. I don't want them to click a 'hundred' times back.If they are interested in my site they wouldn't be there just to copy and manipulate with the RIGHT CLICK.

    In fact I like the idea alot of the right click, with options and so forth; and in the amidst of reading an article half way down the scroll bar, I would feel more comfortable in the fact that I could click out to another place on the site, just as easy.

    Tell me, am I crazy or am I speaking logical?

  10. #10
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by pahayes
    ...well, me being british and all, i can't help it! sorry!
    I have looked at all the successful sites, of course! It's hard not to follow, but who really uses the right click except to copy an image or something else that one fancies...
    I use right to find useful javascripts, certain CSS things, etc. It is perfectly alright to study and use a little bit of someone else's code. And as for the people that go too far, just sue them.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  11. #11
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can you be directed to any URL using the OnClick() function?


Bookmarks

Posting Permissions

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