WordPress.org

Plugin Directory

Changeset 585891


Ignore:
Timestamp:
08/15/12 16:37:05 (20 months ago)
Author:
andy
Message:

jetpack notes: update moved file URLs and stop using ..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/branches/notes/modules/notes.php

    r553117 r585891  
    2828    } 
    2929 
    30     function plugins_url($file) { 
     30    function wpcom_static_url($file) { 
     31        $i = hexdec( substr( md5( $file ), -1 ) ) % 2; 
    3132        $http = is_ssl() ? 'https' : 'http'; 
    32         $url = $http . '://s0.wordpress.com/wp-content/mu-plugins/notes/' . $file; 
    33         // Reduce .. in URLs 
    34         do { 
    35             $prev_url = $url; 
    36             $url = preg_replace( '#/[^/]+/\.\./#', '/', $url ); 
    37         } while ( $url != $prev_url ); 
     33        $url = $http . '://s' . $i . '.wordpress.com' . $file; 
    3834        return $url; 
    3935    } 
    4036 
    4137    function action_init() { 
    42         wp_enqueue_style( 'notes-admin-bar-rest', $this->plugins_url( 'admin-bar-rest.css' ), array(), '2012-05-18a' ); 
    43         wp_enqueue_script( 'spin', $this->plugins_url( '../../../wp-includes/js/spin.js' ), array( 'jquery' ) ); 
    44         wp_enqueue_script( 'jquery.spin', $this->plugins_url( '../../../wp-includes/js/jquery/jquery.spin.js' ), array( 'jquery', 'spin' ) ); 
    45         wp_enqueue_script( 'notes-postmessage', $this->plugins_url( '../../js/postmessage.js' ), array(), '20120525', true ); 
    46         wp_enqueue_script( 'mustache', $this->plugins_url( 'mustache.js' ), null, '2012-05-04', true ); 
    47         wp_enqueue_script( 'underscore', $this->plugins_url( 'underscore-min.js' ), null, '2012-05-04', true ); 
    48         wp_enqueue_script( 'backbone', $this->plugins_url( 'backbone-min.js' ), array( 'jquery', 'underscore' ), '2012-05-04', true ); 
    49         wp_enqueue_script( 'notes-rest-common', $this->plugins_url( 'notes-rest-common.js' ), array( 'backbone', 'mustache' ), '2012-05-24a', true ); 
    50         wp_enqueue_script( 'notes-admin-bar-rest', $this->plugins_url( 'admin-bar-rest.js' ), array( 'jquery', 'underscore', 'backbone' ), '20120525', true ); 
     38        wp_enqueue_style( 'notes-admin-bar-rest', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/admin-bar-rest.css' ), array(), '2012-05-18a' ); 
     39        wp_enqueue_script( 'spin', $this->wpcom_static_url( '/wp-includes/js/spin.js' ), array( 'jquery' ) ); 
     40        wp_enqueue_script( 'jquery.spin', $this->wpcom_static_url( '/wp-includes/js/jquery/jquery.spin.js' ), array( 'jquery', 'spin' ) ); 
     41        wp_enqueue_script( 'notes-postmessage', $this->wpcom_static_url( '/wp-content/js/postmessage.js' ), array(), '20120525', true ); 
     42        wp_enqueue_script( 'mustache', $this->wpcom_static_url( '/wp-content/js/mustache.js' ), null, '2012-05-04', true ); 
     43        wp_enqueue_script( 'underscore', $this->wpcom_static_url( '/wp-content/js/underscore.js' ), null, '2012-05-04', true ); 
     44        wp_enqueue_script( 'backbone', $this->wpcom_static_url( '/wp-content/js/backbone.js' ), array( 'jquery', 'underscore' ), '2012-05-04', true ); 
     45        wp_enqueue_script( 'notes-rest-common', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/notes-rest-common.js' ), array( 'backbone', 'mustache' ), '2012-05-24a', true ); 
     46        wp_enqueue_script( 'notes-admin-bar-rest', $this->wpcom_static_url( '/wp-content/mu-plugins/notes/admin-bar-rest.js' ), array( 'jquery', 'underscore', 'backbone' ), '20120525', true ); 
    5147        add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu'), 120 ); 
    5248    } 
Note: See TracChangeset for help on using the changeset viewer.