Plugin Directory

Changeset 1548022


Ignore:
Timestamp:
12/07/2016 07:31:08 PM (9 years ago)
Author:
greatislander
Message:

Preparing release 0.4.9.

Location:
hypothesis/trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • hypothesis/trunk/README.md

    r1431925 r1548022  
    11114. Click Install Now.
    12125. Click Activate
     136. Visit your WordPress Settings > Hypothesis page to configure how it works on your site
    1314
    1415## Publishing
  • hypothesis/trunk/hypothesis.php

    r1527063 r1548022  
    11<?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
    513 */
    6 
    7 /*
    8 Plugin Name: Hypothesis
    9 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 contributors
    12 Version: 0.4.8
    13 Author URI: http://hypothes.is/
    14 */
    1514
    1615// Exit if called directly.
     
    4847    public function add_plugin_page() {
    4948        add_options_page(
    50             'Hypothesis Settings',
    51             'Hypothesis',
     49            __( 'Hypothesis Settings', 'hypothesis' ),
     50            __( 'Hypothesis', 'hypothesis' ),
    5251            'manage_options',
    5352            'hypothesis-setting-admin',
     
    6362    public static function get_posttypes() {
    6463        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' ),
    6766        ) );
    6867    }
     
    102101        add_settings_section(
    103102            'hypothesis_settings_section', // ID.
    104             'Hypothesis Settings', // Title.
     103            __( 'Hypothesis Settings', 'hypothesis' ), // Title.
    105104            array( $this, 'settings_section_info' ), // Callback.
    106105            'hypothesis-setting-admin' // Page.
     
    109108        add_settings_field(
    110109            'highlights-on-by-default',
    111             'Highlights on by default',
     110            __( 'Highlights on by default', 'hypothesis' ),
    112111            array( $this, 'highlights_on_by_default_callback' ),
    113112            'hypothesis-setting-admin',
     
    117116        add_settings_field(
    118117            'sidebar-open-by-default',
    119             'Sidebar open by default',
     118            __( 'Sidebar open by default', 'hypothesis' ),
    120119            array( $this, 'sidebar_open_by_default_callback' ),
    121120            'hypothesis-setting-admin',
     
    125124        add_settings_field(
    126125            'serve-pdfs-with-via',
    127             'Enable annotation for PDFs in Media Library',
     126            __( 'Enable annotation for PDFs in Media Library', 'hypothesis' ),
    128127            array( $this, 'serve_pdfs_with_via_default_callback' ),
    129128            'hypothesis-setting-admin',
     
    137136        add_settings_section(
    138137            'hypothesis_content_section', // ID.
    139             'Content Settings', // Title.
     138            __( 'Content Settings', 'hypothesis' ), // Title.
    140139            array( $this, 'content_section_info' ), // Callback.
    141140            'hypothesis-setting-admin' // Page.
     
    144143        add_settings_field(
    145144            'allow-on-front-page',
    146             'Allow on front page',
     145            __( 'Allow on front page', 'hypothesis' ),
    147146            array( $this, 'allow_on_front_page_callback' ),
    148147            'hypothesis-setting-admin',
     
    152151        add_settings_field(
    153152            'allow-on-blog-page',
    154             'Allow on blog page',
     153            __( 'Allow on blog page', 'hypothesis' ),
    155154            array( $this, 'allow_on_blog_page_callback' ),
    156155            'hypothesis-setting-admin',
     
    167166            add_settings_field(
    168167                "allow-on-$slug",
    169                 "Allow on $name",
     168                sprintf( __( 'Allow on %s', 'hypothesis' ), $name ),
    170169                array( $this, 'allow_on_posttype_callback' ),
    171170                'hypothesis-setting-admin',
     
    181180            add_settings_field(
    182181                $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.
    184187                array( $this, 'posttype_ids_show_h_callback' ), // Callback.
    185188                'hypothesis-setting-admin', // Page.
     
    195198            add_settings_field(
    196199                $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.
    198205                array( $this, 'posttype_ids_override_callback' ), // Callback.
    199206                'hypothesis-setting-admin', // Page.
     
    253260            }
    254261
    255             if ( isset( $input[ $slug . '_ids_show_h' ] ) ) {
     262            if ( isset( $input[ $slug . '_ids_show_h' ] ) && '' != $input[ $slug . '_ids_show_h' ] ) {
    256263                $new_input[ $slug . '_ids_show_h' ] = explode( ',', esc_attr( $input[ $slug . '_ids_show_h' ] ) );
    257264            }
    258265
    259             if ( isset( $input[ $slug . '_ids_override' ] ) ) {
     266            if ( isset( $input[ $slug . '_ids_override' ] ) && '' != $input[ $slug . '_ids_override' ] ) {
    260267                $new_input[ $slug . '_ids_override' ] = explode( ',', esc_attr( $input[ $slug . '_ids_override' ] ) );
    261268            }
     
    269276     */
    270277    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 }
    273281
    274282    /**
     
    276284     */
    277285    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 }
    280289
    281290    /**
     
    398407 */
    399408function 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 );
    401410}
    402411
     
    417426
    418427    // 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 );
    420429
    421430        // Embed options.
    422431    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 );
    424433    endif;
    425434
    426435    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 );
    428437    endif;
    429438
    430439    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 );
    432441    endif;
    433442
     
    450459                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.
    451460                    enqueue_hypothesis();
     461                } elseif ( ! isset( $options[ $posttype . '_ids_override' ] ) ) {
     462                    enqueue_hypothesis();
    452463                }
    453464            } 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.
     
    458469                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.
    459470                    enqueue_hypothesis();
     471                } elseif ( ! isset( $options['page_ids_override'] ) ) {
     472                    enqueue_hypothesis();
    460473                }
    461474            } 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-2015 Hypothes.is Project and contributors
     1Copyright (c) 2013-2016 Hypothes.is Project and contributors
    22
    33Redistribution and use in source and binary forms, with or without
  • hypothesis/trunk/readme.txt

    r1535221 r1548022  
    33Tags: hypothesis, annotation, comments
    44Requires at least: 3.0.1
    5 Tested up to: 4.6.1
    6 Stable tag: 0.4.8
     5Tested up to: 4.7
     6Stable tag: 0.4.9
    77License: BSD
    88License URI: http://opensource.org/licenses/BSD-2-Clause
     
    2121
    2222== Changelog ==
     23
     24= 0.4.9 =
     25- Add localization support.
     26- Fix an error in options sanitization routine.
    2327
    2428= 0.4.8 =
Note: See TracChangeset for help on using the changeset viewer.