User:V111P/js/WebRef: Difference between revisions

Content deleted Content added
Added expanded instructions for setting up the bookmarklet and troubleshooting suggestions.
m top: Replaced deprecated <source> tags with <syntaxhighlight>
 
(6 intermediate revisions by 2 users not shown)
Line 9:
The script can be used as a [[bookmarklet]] with the following address:
<div style="width:95%; overflow:auto; border: 2px solid #088">
<sourcesyntaxhighlight lang="javascript">javascript:(function(){var d=document,s=d.createElement('script');s.src='//en.wikipedia.org/w/index.php?title=User:V111P/js/webRef.js&action=raw&ctype=text/javascript&smaxage=43200&maxage=86400';d.body.appendChild(s);})();</sourcesyntaxhighlight>
</div>
 
Line 21:
* In Firefox click on any bookmark in the bookmark menu. (It will be more convenient if you turn on the Bookmarks toolbar from ''View/Toolbars/Bookmarks toolbar'' and create the bookmarklet there.) Select ''New Bookmark'', enter a name (for example ''WebRef'') in the Name field, enter the script given above in the address field (Location).
* In Internet Explorer you can create a bookmark of any page in the usual manner (Add to favorites), then right-click it in the favorites menu, choose Properties, enter the JavaScript given above in the URL field, change the name (in the General section) to ''WebRef''.
* In Google Chrome and Opera (Windows and Linux) - press Ctrl+D and then the button Edit (for Chrome) or Properties (for Opera), and change the name to ''WebRef'' and address as forto the otherscript browsersabove.
* In Google Chrome (Mac) – press Cmd-D then the button More, and change the name to ''WebRef'' and address as forto the otherscript browsersabove.
 
There is a second set of instructions further below if you have problems with these.
Line 45:
== How to create the bookmarklet -- super easy instructions! ==
 
[[File:WebRef citation tool.png|thumb|The bookmark (bookmarklet) doesn't take you to a different page, all it does is run the JavaScript saved in it: a text box with the Cite Web template pops up at the top of the page you are currently on, after clicking on the bookmark.]]This is actually super easy to set up. I do computer support for friends and family, so let's first ditch all the jargon.: Thisfor all intents and purposes a bookmarklet is whatnothing more than a bookmark with special instructions -- in this case a JavaScript put in the place where you needusually tohave do:the URL.
 
This is what you need to do:
* In your '''second favorite browser''', the one you don't use a lot for editing Wikipedia, go to https://en.wikipedia.org/wiki/User:V111P/js/WebRef
* In your '''favorite browser''' open any web page that you ''haven't'' bookmarked yet. Make a bookmark -- I put mine on the Bookmarks bar for easy access.
* Right-click the new bookmark and in FireFox go to Properties, in Chrome or Opera to Edit. You'll see that the first line is headed Name and contains the name of the webpage you just bookmarked. Replace the name of the webpage with whatever makes sense to you, I called my bookmark ''Wiki WebRef''.
* The second line is called Location or URL, depending on your browser. Delete the URL that is in it so that you have a blank line. Go to your other browser and copy '''copy the entire text in the green box'''. Then go back to your main browser and paste this into the Location or URL line of the bookmark. It will look like it won't fit, but it does.
* Hit Save and you are done!
 
Line 58 ⟶ 60:
Make sure to check the dates because WebRef doesn't always pick up the correct publication date, even when it is shown on the webpage.
 
Thank you '''V111P''' for giving us such an easy to use way for creating references! If anyoneyou still hashave problems setting this up -- and after reading the troubleshooting tips below, I'd be happy to help. If you installed WebRef after reading my guide, I'd love to hear from you.
 
-- [[User:Peter NYC|Peter NYC]] ([[User talk:Peter NYC|talk]]) 01:50, 25 May 2019 (UTC)
Line 64 ⟶ 66:
== Troubleshooting ==
 
[[File:WebRef citation tool.png|thumb|AThe bookmark (bookmarklet) doesn't take you to a different page, all it does is run the JavaScript saved in it: a text box with the Cite Web template ispops displayedup onat the top of the page you are currently on, after activatingclicking on the bookmarkletbookmark.]]If you have problems getting WebRef to work, first go to a site that is known to be easy to use with WebRef, the New York Times https://www.nytimes.com. Click on a news article on the main page, and then click on your WebRef bookmark.
 
If the textbox does not pop up: