Plugin Directory

Changeset 1018331


Ignore:
Timestamp:
11/02/2014 12:38:56 PM (11 years ago)
Author:
blocknot.es
Message:

Minor fix to settings

Location:
polymer-components/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • polymer-components/trunk/polymer-admin.js

    r1017981 r1018331  
    2121        });
    2222    }
     23
     24    /* var editor_container = document.getElementById( 'wp-content-editor-container' );
     25    if( editor_container != null )
     26    {
     27        var textarea = editor_container.getElementsByTagName( 'textarea' );
     28        if( textarea.length > 0 )
     29        {
     30            CodeMirror.fromTextArea( textarea[0], {
     31                dragDrop: false,
     32                indentWithTabs: true,
     33                lineNumbers: true,
     34                smartIndent: false
     35            });
     36        }
     37    } */
    2338};
  • polymer-components/trunk/polymer-admin.php

    r1017981 r1018331  
    22if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    33
    4 define( 'PLUGIN_MAIN', 'polymer-components/polymer-components.php' );
     4require_once( plugin_dir_path( __FILE__ ) . 'conf.php' );
    55
    66class polymer_admin
     
    1616        add_action( 'save_post', array( &$this, 'save_post' ) );
    1717    // --- Filters ---
    18         add_filter( 'plugin_action_links_' . PLUGIN_MAIN, array( &$this, 'plugin_action_links' ), 10, 1 );
     18        add_filter( 'plugin_action_links_' . POLYMER_COMPONENTS_MAIN, array( &$this, 'plugin_action_links' ), 10, 1 );
    1919    }
    2020
    2121    function add_meta_boxes()
    2222    {   // action
    23         add_meta_box( 'polymer_meta', __( 'Polymer components', 'liquid-theme' ), array( &$this, 'polymer_meta' ), 'post', 'normal', 'high' );
    24         add_meta_box( 'polymer_meta', __( 'Polymer components', 'liquid-theme' ), array( &$this, 'polymer_meta' ), 'page', 'normal', 'high' );
     23        add_meta_box( 'polymer_meta', __( 'Polymer Components', 'liquid-theme' ), array( &$this, 'polymer_meta' ), 'post', 'normal', 'high' );
     24        add_meta_box( 'polymer_meta', __( 'Polymer Components', 'liquid-theme' ), array( &$this, 'polymer_meta' ), 'page', 'normal', 'high' );
    2525    }
    2626
     
    2828    {   // action
    2929        $this->options = get_option( 'polymer-options' );
     30        if( $this->options === FALSE )
     31        {   // default values
     32            $this->options = unserialize( POLYMER_OPTIONS );
     33        }
     34    // Styles and scripts
    3035        wp_enqueue_style( 'poly-admin-style', plugin_dir_url( __FILE__ ) . 'polymer-admin.css' );
    3136        wp_enqueue_style( 'poly-admin-codemirror-style', plugin_dir_url( __FILE__ ) . 'codemirror/codemirror.css' );
     
    6873        add_options_page(
    6974            'Settings Admin',
    70             'Polymer settings',
     75            'Polymer Components',
    7176            'manage_options',
    7277            'polymer-settings',
     
    8085    <div id="polymer-settings" class="wrap">
    8186        <?php screen_icon(); ?>
    82         <h2>Polymer settings</h2>
     87        <h2>Polymer Components</h2>
     88        <hr/>
    8389        <form method="post" action="options.php">
    8490        <?php
     
    94100    function field_js_pages()
    95101    {
    96         if( $this->options !== FALSE )
    97         {
    98             $checked = isset( $this->options['polymer-js-pages'] ) && !empty( $this->options['polymer-js-pages'] );
    99         }
    100         else $checked = TRUE;
    101         echo '<input type="checkbox" id="polymer-js-pages" name="polymer-options[polymer-js-pages]"', $checked ? ' checked="checked"' : '', '/> <label for="polymer-js-pages">', __('Javascript editor in pages'), '</label>';
     102        echo '<input type="checkbox" id="polymer-js-pages" name="polymer-options[polymer-js-pages]"', !empty( $this->options['polymer-js-pages'] ) ? ' checked="checked"' : '', '/> <label for="polymer-js-pages">', __('Javascript editor in pages'), '</label>';
    102103    }
    103104
    104105    function field_js_posts()
    105106    {
    106         if( $this->options !== FALSE )
    107         {
    108             $checked = isset( $this->options['polymer-js-posts'] ) && !empty( $this->options['polymer-js-posts'] );
    109         }
    110         else $checked = TRUE;
    111         echo '<input type="checkbox" id="polymer-js-posts" name="polymer-options[polymer-js-posts]"', $checked ? ' checked="checked"' : '', '/> <label for="polymer-js-posts">', __('Javascript editor in posts'), '</label>';
     107        echo '<input type="checkbox" id="polymer-js-posts" name="polymer-options[polymer-js-posts]"', !empty( $this->options['polymer-js-posts'] ) ? ' checked="checked"' : '', '/> <label for="polymer-js-posts">', __('Javascript editor in posts'), '</label>';
    112108    }
    113109
  • polymer-components/trunk/polymer-components.php

    r1017981 r1018331  
    44 * Plugin URI: http://blocknot.es/
    55 * Description: Add Polymer elements to your website!
    6  * Version: 1.1.0
     6 * Version: 1.1.2
    77 * Author: Mattia Roccoberton
    88 * Author URI: http://blocknot.es
     
    1111 * Note: polymer with bower; removed: core-scroll-header-panel/demos, google-code-prettify, polymer-test-tools, web-animations-js/test, web-animations-js/tools, web-animations-js/tutorial
    1212 */
     13require_once( plugin_dir_path( __FILE__ ) . 'conf.php' );
     14
    1315class polymer_components
    1416{
     
    109111    {
    110112        $this->options = get_option( 'polymer-options' );
     113        if( $this->options === FALSE )
     114        {   // default values
     115            $this->options = unserialize( POLYMER_OPTIONS );
     116        }
    111117        if( !is_admin() )
    112118        {
     
    170176$polycomponents = new polymer_components();
    171177
    172 require plugin_dir_path( __FILE__ ) . 'polymer-shortcodes.php';
     178require( plugin_dir_path( __FILE__ ) . 'polymer-shortcodes.php' );
    173179
    174 if( is_admin() ) require plugin_dir_path( __FILE__ ) . 'polymer-admin.php';
     180if( is_admin() ) require( plugin_dir_path( __FILE__ ) . 'polymer-admin.php' );
  • polymer-components/trunk/readme.txt

    r1017981 r1018331  
    55Requires at least: 3.5.0
    66Tested up to: 4.0
    7 Stable tag: 1.1.0
     7Stable tag: 1.1.2
    88License: GPL3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    7070== Upgrade Notice ==
    7171
     72= 1.1.2 =
     73* Small fix and changes to settings
     74= 1.1.0 =
     75* New settings screen
     76* New settings: JS in pages / posts
     77* Improved Javascript editor
     78* Added polymer-element tag
     79= 1.0.6 =
     80* Added Javascript textarea to posts and pages
     81
     82== Changelog ==
     83
     84= 1.1.2 =
     85* Small fix and changes to settings
    7286= 1.1.0 =
    7387* New settings screen
     
    8195= 1.0.0 =
    8296* First release
    83 
    84 == Changelog ==
    85 
    86 = 1.1.0 =
    87 * New settings screen
    88 * New settings: JS in pages / posts
    89 * Improved Javascript editor
    90 * Added polymer-element tag
    91 = 1.0.6 =
    92 * Added Javascript textarea to posts and pages
    93 = 1.0.2 =
    94 * Small fix for admin docs
    95 = 1.0.0 =
    96 * First release
Note: See TracChangeset for help on using the changeset viewer.