Skip to content

Commit

Permalink
Updated highlight.js and clipboard.js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
petenelson committed Jul 27, 2017
1 parent 24f15f6 commit 37cf6ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
19 changes: 9 additions & 10 deletions admin/class-wp-rest-api-log-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ static public function register_scripts() {
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';

// https://highlightjs.org/
$highlight_version = apply_filters( 'wp-rest-api-log-admin-highlight-js-version', '9.9.0' );
$highlight_version = apply_filters( 'wp-rest-api-log-admin-highlight-js-version', '9.12.0' );
$highlight_style = apply_filters( 'wp-rest-api-log-admin-highlight-js-style', 'github' );

// https://github.com/zenorocha/clipboard.js
$clipboard_version = apply_filters( 'wp-rest-api-log-admin-clipboard-js-version', '1.6.0' );
$clipboard_version = apply_filters( 'wp-rest-api-log-admin-clipboard-js-version', '1.7.0' );

wp_register_script( 'wp-rest-api-log-admin-highlight-js', 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/' . $highlight_version . '/highlight.min.js' );
wp_register_style( 'wp-rest-api-log-admin-highlight-js', 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/' . $highlight_version . '/styles/' . $highlight_style . '.min.css' );
wp_register_style( 'wp-rest-api-log-admin-highlight-js', 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/' . $highlight_version . '/styles/' . $highlight_style . '.min.css' );
wp_register_script( 'wp-rest-api-log-admin-clipboard-js', 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/' . $clipboard_version . '/clipboard.min.js' );

wp_register_script( 'wp-rest-api-log-admin', WP_REST_API_LOG_URL . 'admin/js/wp-rest-api-log-admin' . $min . '.js', 'jquery', WP_REST_API_Log_Common::VERSION );
wp_register_style( 'wp-rest-api-log-admin', WP_REST_API_LOG_URL . 'admin/css/wp-rest-api-log-admin' . $min . '.css', '', WP_REST_API_Log_Common::VERSION );
wp_register_style( 'wp-rest-api-log-admin', WP_REST_API_LOG_URL . 'admin/css/wp-rest-api-log-admin' . $min . '.css', '', WP_REST_API_Log_Common::VERSION );
}

/**
Expand All @@ -93,12 +93,12 @@ static public function localize_script_data() {
'nonce' => wp_create_nonce( 'wp_rest' ),
'endpoints' => array(
'purge_entries' => rest_url( WP_REST_API_Log_Common::PLUGIN_NAME . '/entries' ),
)
),
);

// Ensure admin URLs in SSL get pointed to SSL on the frontend.
if ( is_ssl() ) {
foreach( $data['endpoints'] as &$endpoint ) {
foreach ( $data['endpoints'] as &$endpoint ) {
$endpoint = set_url_scheme( $endpoint, 'https' );
}
}
Expand Down Expand Up @@ -145,19 +145,18 @@ private function plugin_name() {
/**
* Removes the wp-rest-api-log post type from the link query args
*
* @param array $query query args
* @param array $query Query args.
* @return array
*/
static public function wp_link_query_args( $query ) {

if ( isset( $query['post_type' ] ) && is_array( $query['post_type'] ) ) {
for ( $i = count( $query['post_type'] )-1; $i >= 0; $i-- ) {
if ( isset( $query['post_type'] ) && is_array( $query['post_type'] ) ) {
for ( $i = count( $query['post_type'] ) - 1; $i >= 0; $i-- ) {
if ( WP_REST_API_Log_DB::POST_TYPE === $query['post_type'][ $i ] ) {
unset( $query['post_type'][ $i ] );
break;
}
}

}

return $query;
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Roadmap

### v1.6.5 July 26, 2017 ###
* Fixed some escaping issues in admin and new-line characters when saving to database (props davidanderson)
* Updated highlight.js and clipboard.js versions

### v1.6.4 May 26, 2017 ###
* Fixed an issue with the URL in the settings tabs (props davidanderson)
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Roadmap

= v1.6.5 July 26, 2017 =
* Fixed some escaping issues in admin and new-line characters when saving to database (props davidanderson)
* Updated highlight.js and clipboard.js versions

= v1.6.4 May 26, 2017 =
* Fixed an issue with the URL in the settings tabs (props davidanderson)
Expand Down

0 comments on commit 37cf6ea

Please sign in to comment.