--- { "title": "Favoricône", "language": "fr", "category": "Plugiciels", "categoryfile": "plugins", "description": "Offre la possibilité d'ajouter et de mettre à jour les favoricônes d'une page.", "altLangPrefix": "favicon", "dateModified": "2014-08-04" } ---
Needs translation
This plugin provides the ability to add and update a web page's favicon.
<link href="favion.ico" rel="icon" type="image/x-icon">
<link href="favion.ico" rel="icon" type="image/x-icon"
data-filename="my-mobile-favicon.ico"
data-path="/path/to/favicon/"
data-rel="apple-touch-icon-precomposed"
data-sizes="57x57">
var $favicon = $( "link[rel='icon']" );
icon.wb-favicon event on the favicon element:
$favicon.trigger( "icon.wb-favicon" );
Note: the update of the favicon's href attribute will be based on its data-path and data-filename attributes.
All configuration options of the plugin are controlled with data attributes:
| Option | Description | How to configure | Values |
|---|---|---|---|
data-filename |
Filename of the mobile favicon. It is appended to the favicon's path (specified by data-path). | Set to the filename of the mobile favicon. |
|
data-path |
Full path to the mobile favicon. | Set to the full path of the mobile favicon. |
|
data-rel |
Favicon rel attribute. | Set to the desired rel attribute value of the favicon. |
|
data-sizes |
Favicon sizes attribute. | Set to the desired sizes attribute value of the favicon. |
|
Document the public events that can be used by implementers or developers.
| Event | Trigger | What it does |
|---|---|---|
wb-init.wb-favicon |
Triggered manually (e.g., $( "link[rel='icon']" ).trigger( "wb-init.wb-favicon" );). |
Initializes the plugin and creates a mobile favicon if it doesn't already exist. Note: the favicon plugin will be initialized automatically unless the link element is added after the page has already loaded. |
wb-ready.wb-favicon (v4.0.5+) |
Triggered automatically after the Favicon plugin initializes. | Used to identify when the Favicon plugin has initialized
|
wb-updated.wb-favicon (v4.0.5+) |
Triggered automatically after the favicon update has completed. | Used to identify when the plugin has finished updating the favicon and to pass along what type of favicon was updated (mobile, icon).
|
mobile.wb-favicon |
Triggered manually and during plugin initialization (e.g., $( "link[rel='icon']" ).trigger( "mobile.wb-favicon" );). |
Adds or updates the mobile favicon on the web page. This will only update a mobile favicon that was added by the plugin. |
icon.wb-favicon |
Triggered manually (e.g., $( "link[rel='icon']" ).trigger( "icon.wb-favicon" );). |
Updates the favicon's href attribute based on its data-filename and data-path attributes. |
wb-ready.wb (v4.0.5+) |
Triggered automatically when WET has finished loading and executing. | Used to identify when all WET plugins and polyfills have finished loading and executing.
|