Plugin Directory

Changeset 1027346


Ignore:
Timestamp:
11/17/2014 03:23:16 PM (11 years ago)
Author:
blocknot.es
Message:

New setting CSS editor; Small fix

Location:
polymer-components/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • polymer-components/trunk/conf.php

    r1026695 r1027346  
    66// Default options values
    77$polymer_options = array(
     8    'polymer-css-pages' => TRUE,
     9    'polymer-css-posts' => TRUE,
    810    'polymer-js-pages' => TRUE,
    911    'polymer-js-posts' => TRUE
  • polymer-components/trunk/polymer-admin.php

    r1026695 r1027346  
    5151        );
    5252        add_settings_section(
    53             'polymer-section-general', // ID
    54             'General settings', // Title
    55             array( $this, 'print_section_info' ), // Callback
    56             'polymer-settings' // Page
    57         );
    58         add_settings_field(
    59             'polymer-js-posts', // ID
    60             'JS in posts', // Title
    61             array( $this, 'field_js_posts' ), // Callback
    62             'polymer-settings', // Page
    63             'polymer-section-general' // Section           
    64         );
    65         add_settings_field(
    66             'polymer-js-pages', // ID
    67             'JS in pages', // Title
    68             array( $this, 'field_js_pages' ), // Callback
    69             'polymer-settings', // Page
    70             'polymer-section-general' // Section           
     53            'polymer-section-general',
     54            'General settings',
     55            array( $this, 'print_section_info' ),
     56            'polymer-settings'
     57        );
     58        add_settings_field(
     59            'polymer-css-posts',
     60            'CSS in posts',
     61            array( $this, 'field_css_posts' ),
     62            'polymer-settings',
     63            'polymer-section-general'
     64        );
     65        add_settings_field(
     66            'polymer-css-pages',
     67            'CSS in pages',
     68            array( $this, 'field_css_pages' ),
     69            'polymer-settings',
     70            'polymer-section-general'
     71        );
     72        add_settings_field(
     73            'polymer-js-posts',
     74            'JS in posts',
     75            array( $this, 'field_js_posts' ),
     76            'polymer-settings',
     77            'polymer-section-general'
     78        );
     79        add_settings_field(
     80            'polymer-js-pages',
     81            'JS in pages',
     82            array( $this, 'field_js_pages' ),
     83            'polymer-settings',
     84            'polymer-section-general'
    7185        );
    7286    }
     
    102116    }
    103117
     118    function field_css_pages()
     119    {
     120        echo '<input type="checkbox" id="polymer-css-pages" name="polymer-options[polymer-css-pages]"', !empty( $this->options['polymer-css-pages'] ) ? ' checked="checked"' : '', '/> <label for="polymer-css-pages">', __('Styles editor in pages'), '</label>';
     121    }
     122
     123    function field_css_posts()
     124    {
     125        echo '<input type="checkbox" id="polymer-css-posts" name="polymer-options[polymer-css-posts]"', !empty( $this->options['polymer-css-posts'] ) ? ' checked="checked"' : '', '/> <label for="polymer-css-posts">', __('Styles editor in posts'), '</label>';
     126    }
     127
    104128    function field_js_pages()
    105129    {
     
    173197        }
    174198    // --- CSS editor ---
    175         echo '<div style="border-bottom: 1px solid #aaa; padding-top: 10px; padding-bottom: 5px"><b>Styles</b>:</div>';
    176         $val = get_post_meta( $post->ID, 'poly_styles', TRUE );
    177         echo '<textarea name="poly_styles" id="poly_styles" style="width: 100%" cols="80" rows="6">', stripslashes( $val ), '</textarea>', "\n";
     199        if(      $post->post_type == 'post' ) $poly_styles = isset( $this->options['polymer-css-posts'] ) && !empty( $this->options['polymer-css-posts'] );
     200        else if( $post->post_type == 'page' ) $poly_styles = isset( $this->options['polymer-css-pages'] ) && !empty( $this->options['polymer-css-pages'] );
     201        else $poly_styles = FALSE;
     202        if( $poly_styles )
     203        {
     204            echo '<div style="border-bottom: 1px solid #aaa; padding-top: 10px; padding-bottom: 5px"><b>Styles</b>:</div>';
     205            $val = get_post_meta( $post->ID, 'poly_styles', TRUE );
     206            echo '<textarea name="poly_styles" id="poly_styles" style="width: 100%" cols="80" rows="6">', stripslashes( $val ), '</textarea>', "\n";
     207        }
    178208        echo "</div>\n";
    179209    }
  • polymer-components/trunk/polymer-components.php

    r1026695 r1027346  
    11<?php
    22/**
    3  * Plugin Name: Polymer Components
     3 * Plugin Name: Polymer for WordPress
    44 * Plugin URI: http://blocknot.es/
    55 * Description: Add Polymer elements to your website!
    6  * Version: 1.2.5
     6 * Version: 1.2.8
    77 * Author: Mattia Roccoberton
    88 * Author URI: http://blocknot.es
     
    1010 *
    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
     12 *
     13 * ToDo:
     14 * - Polymer 0.5.1
     15 * - area to manage custom elements
    1216 */
    1317require_once( plugin_dir_path( __FILE__ ) . 'conf.php' );
     
    106110        'social-icons'        => 'core-icons/social-icons.html',
    107111    );
     112    var $hide_keys = array( 'poly_autop', 'poly_iconsets', 'poly_javascript', 'poly_styles', 'poly_tags', 'poly_template' );
    108113    var $options;
    109114    var $import = array();
     
    132137    {   // filter
    133138        // hide some meta key from custom fields of the editor
    134         return ( $meta_key == 'poly_tags' || $meta_key == 'poly_iconsets' || $meta_key == 'poly_javascript' ) ? TRUE : $protected;
     139        return ( in_array( $meta_key, $this->hide_keys ) ? TRUE : $protected );
    135140    }
    136141
  • polymer-components/trunk/readme.txt

    r1026695 r1027346  
    1 === Polymer Components ===
     1=== Polymer for WordPress ===
    22Contributors: blocknot.es
    33Tags: plugin,google,shortcode,page,posts,Post
     
    55Requires at least: 3.5.0
    66Tested up to: 4.0
    7 Stable tag: 1.2.5
     7Stable tag: trunk
    88License: GPL3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    1414== Description ==
    1515
    16 This plugin allows to add Polymer elements in your posts and pages. The same components used in Android Lollypop. You can use the HTML editor with the Polymer tags or the shortcode *[poly]* for all the elements. The correct HTML libraries will be loaded automatically when you use a Polymer tag.
     16This plugin allows to add Polymer elements in your posts and pages, the same components used in Android Lollypop. You can use the HTML editor with the Polymer tags or the shortcode *[poly]* for all the elements. The correct HTML libraries will be loaded automatically.
    1717Polymer documentation page: http://www.polymer-project.org/
    1818
    19 Notice: Polymer is still in developer preview so some constructs may change in future and a modern browser is required to run Polymer apps.
     19Notice: Polymer is still in *developer* *preview* so some constructs may change in future. A modern browser is required to run Polymer apps.
    2020
    2121Features:
    2222
    23 * Polymer tags directly available (core & paper) in posts and pages with the HTML editor;
    24 * Polymer widget;
    25 * [poly] shortcode to access to the Polymer tags;
     23* Polymer tags directly available (core & paper) in posts / pages in the HTML editor;
     24* [poly] shortcode to access all tags;
     25* simple widget;
    2626* auto import the necessary HTML components;
    2727* Javascript editor in posts / pages admin;
     
    4646Notes:
    4747
    48 * autop option: the autop() Wordpress function adds p and br tags to the post content when a newline is found, but this can break the Polymer tags. That's why I have added this option that disable by default the autop function
     48* autop option: the autop() Wordpress function adds p and br tags to the contents when a newline is found, but this can break the Polymer tags. This option allows to enable/disable autop() in posts / pages (plugin default: no autop)
    4949* template override option: if this option is enabled this plugin will load a special template which provides only the required components to run a Polymer app. This is useful if you want a "fullscreen" Polymer app
    5050
     
    8181== Upgrade Notice ==
    8282
     83= 1.2.8 =
     84* New setting: CSS editor on/off
     85* Small fix
    8386= 1.2.5 =
    8487* New CSS editor for posts / pages
     
    8992* Auto-import improved
    9093* Small fix to JS editor
    91 = 1.1.2 =
    92 * Small fix and changes to settings
    93 = 1.1.0 =
    94 * New settings screen
    95 * New settings: JS in posts / pages
    96 * Improved Javascript editor
    97 * Added polymer-element tag
    9894
    9995== Changelog ==
    10096
     97= 1.2.8 =
     98* New setting: CSS editor on/off
     99* Small fix
    101100= 1.2.5 =
    102101* New CSS editor for posts / pages
Note: See TracChangeset for help on using the changeset viewer.