Wikibooks:Popup di navigazione: differenze tra le versioni

Wikibooks, manuali e libri di testo liberi.
Contenuto cancellato Contenuto aggiunto
Emc2 (discussione | contributi)
m en interwiki
Emc2 (discussione | contributi)
Nessun oggetto della modifica
Riga 1: Riga 1:
{{WIP|Emc2}}
{{WIP|Emc2}}


[[Immagine:anteprima-popup.png|thumb|400px|Un popup in azione]]
[[Immagine:anteprima-popup.png|350px|thumb|right|Un popup in azione]]
I '''Popup di navigazione''' offrono un accesso facile ed immediato a numerose funzioni di Wikipedia, attraverso un comodo popup che apparirà lasciando il mouse sopra ad un link.
I '''Popup di navigazione''' offrono un accesso facile ed immediato a numerose funzioni di Wikipedia, attraverso un comodo popup che apparirà lasciando il mouse sopra ad un link.



Versione delle 04:48, 26 ago 2006

Un popup in azione

I Popup di navigazione offrono un accesso facile ed immediato a numerose funzioni di Wikipedia, attraverso un comodo popup che apparirà lasciando il mouse sopra ad un link.

Installazione rapida: aggiungi {{subst:navpop}} al tuo monobook.js (o ad un file equivalente se utilizzi una skin diversa). Vedi sotto per le istruzioni complete per l'installazione.

Se riscontri dei problemi, prova a consultare le FAQ.

Funzionalità

Piccola anteprima di un'immagine per un articolo
Fai clic per ingrandire l'anteprima
Un rollback eseguito tramite un popup
  • Anteprima della prima parte del testo di un articolo (grazie a en:User:Pilaf per il suo script "Live Preview" che ha reso possibile tutto questo)
  • Anteprima delle immagini dai loro collegamenti
  • Anteprima della prima immagine di ogni articolo
  • Anteprima delle differenze negli osservati speciali, nella cronologia e nelle modifiche correlate.
  • Anteprima dei wikilink selezionati durante la modifica di una pagina (usa il mouse per selezionare un wikilink)
  • Rollback dei vandalismi con un click dalla cronologia (vedi immagine)
  • Tells you about redirects, stubs and disambiguation pages
  • Gives page information like size, number of links, number of images, number of categories and page age
  • Should work on all Wikimedia wikis
  • One-click access to
    • edit page
    • user contributions
    • Interiot's tool (edit count)
    • email user
    • history
    • watch and unwatch
    • view or edit talk page
    • what links here
    • related changes
    • for administrators, protect and unprotect, delete and block user
    • user log and block log
    • list subpages of user pages
    • Wikipedia search, global Wikipedia search and Google search
  • Shortcut keys (optional)
  • Automatically fix links to bypass redirects and disambiguation pages (optional)

Installation

You must have a user account in order to install and use the Navigation popups feature. If you do not have an account you will need to create one and log in.

The next step is to add {{subst:navpop}} to your monobook.js page. This will add the following code to your .js file:

// [[User:Lupin/popups.js]]

document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

Note: If you are using a skin other than MonoBook (the default), the relevant file you will need to edit is listed below.

After saving the page, clear your browser's cache (hold SHIFT key while reloading/refreshing page). Assuming that you have not disabled javascript in your browser, a popup should appear whenever you hover your mouse over an internal link in Wikipedia.

To install the script on the commons or wiktionary, repeat this procedure on those wikis. To uninstall the script, delete the above lines from the same page and clear your browser's cache.

Usage guide

This tool generates "popup hints" when you hover the mouse pointer over active links and images.

Many of the arguably most important features can be used from the watchlist.

  • hover over a diff link to show a summary of the difference that edit has made
  • hover over a link to an article version to show a short excerpt of the version

There should also be some "navigation links" which access many functions including one-click reversion, editing that page and so on. These may appear in the popup itself, or may be hidden in an "actions" menu depending on your browser and your settings.

In normal articles:

  • hold the mouse over links pulls up a short excerpt of the linked-to article, then hover over the actions link if necessary to see more commands
  • if you hold the shift key then you can drag the popup around

Configuration (optional)

Changing the appearance of your popups

By editing your user CSS file, you can change the appearance of the popups. Your user CSS file has exactly the same name as the javascript file, but with "css" instead of "js" at the end. So for most people, the file to edit is monobook.css.

Here is an example which gives an orange-flavoured popup with a border and changes the font used. This makes the popups looks pretty silly, but it shows the sort of thing you can do if you feel like it.

.navpopup { 
  background-color: #FFBE20  !important;
  font-family:      serif    !important;
  color:            #404     !important;
  font-size:        medium   !important;
}

Options

There are some options that you can set. To do so, edit your user javascript file (such as monobook.js) and add a line of the form

option = value;

where option and value are chosen from the table below. For example, to prevent all downloading and turn on admin links, you need something like this in your javascript file:

// [[User:Lupin/popups.js]] - please include this line 

document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

simplePopups=true;
popupAdminLinks=true;
Configuration options
Option Values* Description

Wikibooks:Popup di navigazione/General options Wikibooks:Popup di navigazione/Edit summary options Wikibooks:Popup di navigazione/Preview options Wikibooks:Popup di navigazione/Technical options Wikibooks:Popup di navigazione/Experimental options

*Default values are listed in bold

More options may be added, and requests for more configurability are welcome.

Advanced customization

You can define custom filters for articles. These are javascript functions which are run after the page statistics are generated, and their output is appended (as HTML) to that part of the popup. (Note that if simplePopups is true or popupSummaryData is false, then nothing will be displayed).

The way to set this up is to write a filter function which accepts a string (the wikitext of the article) as input, and returns a fragment of HTML. Repeat for as many filters as you want, and then create an array extraPopupFilters which contains all of the functions, in the order in which you want them to be run.

For example, let's say you want to be told whenever the wikitext of an article contains a table written using HTML tags rather than wiki markup. One way to do this is to add the following to your user javascript file:

// initialize the array - only do this once
extraPopupFilters=[];

// define the function
function popupFilterHtmlTable (wikiText) {
  if (/<table/i.test(wikiText)) return '&lt;table&gt;';
  else return '';
};

// add the function to the array (you can repeat this for lots of functions)
extraPopupFilters.push(popupFilterHtmlTable);

Then when a popup is generated for a page containing an HTML table, you should see <table> in the popup. (It may also appear for other pages, such as this page. Correcting this defect is left as an exercise for the reader).

Translations

Please see this page for translations of the script interface and of this page into other languages. You'll also find instructions for creating a translation yourself.

Browser problems

Safari

Some people have found that Safari crashes a lot when running this script. Lupin would be interested to hear if this is still the case or not, and would greatly welcome assistance from someone who knows some javascript in getting to the bottom of these problems.

Current versions of Safari have bugs which prevent the menus from functioning correctly. Using a Webkit nightly build should give correctly functioning menus.

Opera

Older versions of Opera have bugs which prevent the menus from functioning correctly. Using a current version (9.0 or higher) should give correctly functioning menus, but you may still experience problems sometimes, with popups not loading, or not disappearing after the mouse is moved away.

Feedback

Bugs, problems, suggestions and enhancements to Lupin, please.

I have set up a page where you can list pages with incorrect previews.

Development version

This tool remains under development. The very latest version is available at User:Lupin/popupsdev.js and it sees new features before the stable version. Be warned that it does break every so often, though. If you do want to install it, you can type

 {{subst:js|User:Lupin/popupsdev.js}}

into your user javascript file and delete your current popups installation from that file.

See also

Credits and external links

This tool depends on some other peoples' work:

Older versions of the tool used overlib by Erik Bosrup.

Wikipedians who have helped