Changeset 1548022
- Timestamp:
- 12/07/2016 07:31:08 PM (9 years ago)
- Location:
- hypothesis/trunk
- Files:
-
- 4 added
- 4 edited
-
Gruntfile.js (added)
-
README.md (modified) (1 diff)
-
hypothesis.php (modified) (20 diffs)
-
languages (added)
-
languages/hypothesis.pot (added)
-
license.txt (modified) (1 diff)
-
package.json (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hypothesis/trunk/README.md
r1431925 r1548022 11 11 4. Click Install Now. 12 12 5. Click Activate 13 6. Visit your WordPress Settings > Hypothesis page to configure how it works on your site 13 14 14 15 ## Publishing -
hypothesis/trunk/hypothesis.php
r1527063 r1548022 1 1 <?php 2 /** 3 * @package Hypothesis 4 * @version 0.4.8 2 /* 3 Plugin Name: Hypothesis 4 Plugin URI: http://hypothes.is/ 5 Description: Hypothesis is an open platform for the collaborative evaluation of knowledge. This plugin embeds the necessary scripts in your Wordpress site to enable any user to use Hypothesis without installing any extensions. 6 Author: The Hypothesis Project and contributors 7 Version: 0.4.9 8 Author URI: http://hypothes.is/ 9 Text Domain: hypothesis 10 Domain Path: /languages 11 12 @package Hypothesis 5 13 */ 6 7 /*8 Plugin Name: Hypothesis9 Plugin URI: http://hypothes.is/10 Description: Hypothesis is an open platform for the collaborative evaluation of knowledge. This plugin embeds the necessary scripts in your Wordpress site to enable any user to use Hypothesis without installing any extensions.11 Author: The Hypothesis Project and contributors12 Version: 0.4.813 Author URI: http://hypothes.is/14 */15 14 16 15 // Exit if called directly. … … 48 47 public function add_plugin_page() { 49 48 add_options_page( 50 'Hypothesis Settings',51 'Hypothesis',49 __( 'Hypothesis Settings', 'hypothesis' ), 50 __( 'Hypothesis', 'hypothesis' ), 52 51 'manage_options', 53 52 'hypothesis-setting-admin', … … 63 62 public static function get_posttypes() { 64 63 return apply_filters('hypothesis_supported_posttypes', array( 65 'post' => 'posts',66 'page' => 'pages',64 'post' => _x( 'posts', 'plural post type', 'hypothesis' ), 65 'page' => _x( 'pages', 'plural post type', 'hypothesis' ), 67 66 ) ); 68 67 } … … 102 101 add_settings_section( 103 102 'hypothesis_settings_section', // ID. 104 'Hypothesis Settings', // Title.103 __( 'Hypothesis Settings', 'hypothesis' ), // Title. 105 104 array( $this, 'settings_section_info' ), // Callback. 106 105 'hypothesis-setting-admin' // Page. … … 109 108 add_settings_field( 110 109 'highlights-on-by-default', 111 'Highlights on by default',110 __( 'Highlights on by default', 'hypothesis' ), 112 111 array( $this, 'highlights_on_by_default_callback' ), 113 112 'hypothesis-setting-admin', … … 117 116 add_settings_field( 118 117 'sidebar-open-by-default', 119 'Sidebar open by default',118 __( 'Sidebar open by default', 'hypothesis' ), 120 119 array( $this, 'sidebar_open_by_default_callback' ), 121 120 'hypothesis-setting-admin', … … 125 124 add_settings_field( 126 125 'serve-pdfs-with-via', 127 'Enable annotation for PDFs in Media Library',126 __( 'Enable annotation for PDFs in Media Library', 'hypothesis' ), 128 127 array( $this, 'serve_pdfs_with_via_default_callback' ), 129 128 'hypothesis-setting-admin', … … 137 136 add_settings_section( 138 137 'hypothesis_content_section', // ID. 139 'Content Settings', // Title.138 __( 'Content Settings', 'hypothesis' ), // Title. 140 139 array( $this, 'content_section_info' ), // Callback. 141 140 'hypothesis-setting-admin' // Page. … … 144 143 add_settings_field( 145 144 'allow-on-front-page', 146 'Allow on front page',145 __( 'Allow on front page', 'hypothesis' ), 147 146 array( $this, 'allow_on_front_page_callback' ), 148 147 'hypothesis-setting-admin', … … 152 151 add_settings_field( 153 152 'allow-on-blog-page', 154 'Allow on blog page',153 __( 'Allow on blog page', 'hypothesis' ), 155 154 array( $this, 'allow_on_blog_page_callback' ), 156 155 'hypothesis-setting-admin', … … 167 166 add_settings_field( 168 167 "allow-on-$slug", 169 "Allow on $name",168 sprintf( __( 'Allow on %s', 'hypothesis' ), $name ), 170 169 array( $this, 'allow_on_posttype_callback' ), 171 170 'hypothesis-setting-admin', … … 181 180 add_settings_field( 182 181 $slug . '_ids_show_h', // ID. 183 "Allow on specific $name (list of comma-separated $slug IDs, no spaces)", // Title. 182 sprintf( 183 __( 'Allow on specific %1$s (list of comma-separated %1$s IDs, no spaces)', 'hypothesis' ), 184 $name, 185 $slug 186 ), // Title. 184 187 array( $this, 'posttype_ids_show_h_callback' ), // Callback. 185 188 'hypothesis-setting-admin', // Page. … … 195 198 add_settings_field( 196 199 $slug . '_ids_override', // ID. 197 "Disallow on specific $name (list of comma-separated $slug IDs, no spaces)", // Title. 200 sprintf( 201 __( 'Disallow on specific %1$s (list of comma-separated %1$s IDs, no spaces)', 'hypothesis' ), 202 $name, 203 $slug 204 ), // Title. 198 205 array( $this, 'posttype_ids_override_callback' ), // Callback. 199 206 'hypothesis-setting-admin', // Page. … … 253 260 } 254 261 255 if ( isset( $input[ $slug . '_ids_show_h' ] ) ) {262 if ( isset( $input[ $slug . '_ids_show_h' ] ) && '' != $input[ $slug . '_ids_show_h' ] ) { 256 263 $new_input[ $slug . '_ids_show_h' ] = explode( ',', esc_attr( $input[ $slug . '_ids_show_h' ] ) ); 257 264 } 258 265 259 if ( isset( $input[ $slug . '_ids_override' ] ) ) {266 if ( isset( $input[ $slug . '_ids_override' ] ) && '' != $input[ $slug . '_ids_override' ] ) { 260 267 $new_input[ $slug . '_ids_override' ] = explode( ',', esc_attr( $input[ $slug . '_ids_override' ] ) ); 261 268 } … … 269 276 */ 270 277 public function settings_section_info() { 271 print 'Customize Hypothesis defaults and behavior.'; 272 } 278 ?> 279 <p><?php esc_attr_e( 'Customize Hypothesis defaults and behavior.', 'hypothesis' ); ?></p> 280 <?php } 273 281 274 282 /** … … 276 284 */ 277 285 public function content_section_info() { 278 print 'Control where Hypothesis is loaded.'; 279 } 286 ?> 287 <p><?php esc_attr_e( 'Control where Hypothesis is loaded.', 'hypothesis' ); ?></p> 288 <?php } 280 289 281 290 /** … … 398 407 */ 399 408 function enqueue_hypothesis() { 400 wp_enqueue_script( 'hypothesis', 'https://hypothes.is/embed.js', array(), false, true );409 wp_enqueue_script( 'hypothesis', 'https://hypothes.is/embed.js', [], false, true ); 401 410 } 402 411 … … 417 426 418 427 // Otherwise highlighting is on by default. 419 wp_enqueue_script( 'nohighlights', '/wp-content/plugins/hypothesis/js/nohighlights.js', '', false, true );428 wp_enqueue_script( 'nohighlights', plugins_url( 'js/nohighlights.js', __FILE__ ), [], false, true ); 420 429 421 430 // Embed options. 422 431 if ( isset( $options['highlights-on-by-default'] ) ) : 423 wp_enqueue_script( 'showhighlights', '/wp-content/plugins/hypothesis/js/showhighlights.js', '', false, true );432 wp_enqueue_script( 'showhighlights', plugins_url( 'js/showhighlights.js', __FILE__ ), [], false, true ); 424 433 endif; 425 434 426 435 if ( isset( $options['sidebar-open-by-default'] ) ) : 427 wp_enqueue_script( 'sidebaropen', '/wp-content/plugins/hypothesis/js/sidebaropen.js', '', false, true );436 wp_enqueue_script( 'sidebaropen', plugins_url( 'js/sidebaropen.js', __FILE__ ), [], false, true ); 428 437 endif; 429 438 430 439 if ( isset( $options['serve-pdfs-with-via'] ) ) : 431 wp_enqueue_script( 'pdfs-with-via', '/wp-content/plugins/hypothesis/js/via-pdf.js', '', false, true );440 wp_enqueue_script( 'pdfs-with-via', plugins_url( 'js/via-pdf.js', __FILE__ ), [], false, true ); 432 441 endif; 433 442 … … 450 459 if ( isset( $options[ $posttype . '_ids_override' ] ) && ! is_single( $options[ $posttype . '_ids_override' ] ) ) { // Make sure this post isn't in the override list if it exists. 451 460 enqueue_hypothesis(); 461 } elseif ( ! isset( $options[ $posttype . '_ids_override' ] ) ) { 462 enqueue_hypothesis(); 452 463 } 453 464 } elseif ( ! isset( $options[ "allow-on-$slug" ] ) && isset( $options[ $posttype . '_ids_show_h' ] ) && is_single( $options[ $posttype . '_ids_show_h' ] ) ) { // Check if Hypothesis is allowed on this specific post. … … 458 469 if ( isset( $options['page_ids_override'] ) && ! is_page( $options['page_ids_override'] ) ) { // Make sure this page isn't in the override list if it exists. 459 470 enqueue_hypothesis(); 471 } elseif ( ! isset( $options['page_ids_override'] ) ) { 472 enqueue_hypothesis(); 460 473 } 461 474 } elseif ( ! isset( $options['allow-on-pages'] ) && isset( $options['page_ids_show_h'] ) && is_page( $options['page_ids_show_h'] ) ) { // Check if Hypothesis is allowed on this specific page. -
hypothesis/trunk/license.txt
r1431925 r1548022 1 Copyright (c) 2013-201 5Hypothes.is Project and contributors1 Copyright (c) 2013-2016 Hypothes.is Project and contributors 2 2 3 3 Redistribution and use in source and binary forms, with or without -
hypothesis/trunk/readme.txt
r1535221 r1548022 3 3 Tags: hypothesis, annotation, comments 4 4 Requires at least: 3.0.1 5 Tested up to: 4. 6.16 Stable tag: 0.4. 85 Tested up to: 4.7 6 Stable tag: 0.4.9 7 7 License: BSD 8 8 License URI: http://opensource.org/licenses/BSD-2-Clause … … 21 21 22 22 == Changelog == 23 24 = 0.4.9 = 25 - Add localization support. 26 - Fix an error in options sanitization routine. 23 27 24 28 = 0.4.8 =
Note: See TracChangeset
for help on using the changeset viewer.