Make WordPress Core

Changeset 41313


Ignore:
Timestamp:
08/24/2017 05:54:22 PM (7 years ago)
Author:
wonderboymusic
Message:

Docs: improve JS docs for bookmarklet.js

Props andizer, ireneyoast.
Fixes #41547.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/bookmarklet.js

    r32828 r41313  
     1/**
     2 * @summary Creates a form with a URL, title, and content based on the current opened URL and the content of the associated web page.
     3 *
     4 * @since 4.2.0
     5 *
     6 * @param {window} window The window.
     7 * @param {document} document The document.
     8 * @param {string} href The current opened URL.
     9 * @param {string} pt_url The URL to post the content to.
     10 *
     11 * @returns {void}
     12 */
    113( function( window, document, href, pt_url ) {
    214    var encURI = window.encodeURIComponent,
     
    1426    if ( href.match( /^https?:/ ) ) {
    1527        pt_url += '&u=' + encURI( href );
     28        // Check whether the unencoded url and the encoded url use the same protocol.
    1629        if ( href.match( /^https:/ ) && pt_url.match( /^http:/ ) ) {
    1730            canPost = false;
     
    5366    }
    5467
     68    /**
     69     * @summary Creates a hidden input field and sets its name and value.
     70     *
     71     * @since 4.2.0
     72     *
     73     * @param name The input field name.
     74     * @param value The input field value.
     75     *
     76     * @returns {void}
     77     */
    5578    function add( name, value ) {
    5679        if ( typeof value === 'undefined' ) {
Note: See TracChangeset for help on using the changeset viewer.