Plugin Directory

Changeset 643580


Ignore:
Timestamp:
12/23/2012 04:03:49 AM (13 years ago)
Author:
bmsterling
Message:

Remove quicktag-extender.js; Change url to use the Wordpress ajax url;

Location:
quicktag-extender/trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • quicktag-extender/trunk/quicktag-extender.php

    r377166 r643580  
    44Plugin URI: http://benjaminsterling.com/wordpress-plugins/wordpress-quicktag-extender/
    55Description: This plugin adds more buttons to the non-visual editor view for creating/editing posts/pages
    6 Version: 0.1.2
     6Version: 0.1.3
    77Author: Benjamin Sterling
    88Author URI: http://kenzomedia.com
     
    2626*/
    2727
     28
     29
    2830function gte_admin_print_scripts( $arg ){
    29     global $pagenow;
    30     if (is_admin() && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) ) {
    31         $js = plugins_url('/quicktag-extender.js', __FILE__ );
    32         wp_enqueue_script("qtescript", $js, array('quicktags') );
    33     }
     31    global $pagenow;
     32    if (is_admin() && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) ) {
     33        $js = admin_url( 'admin-ajax.php?action=gte_action', 'relative' );
     34        wp_enqueue_script("qtescript", $js, array('quicktags') );
     35    }
    3436}
     37add_action( 'admin_print_scripts', 'gte_admin_print_scripts' );
    3538
    36 add_action( 'admin_print_scripts', 'gte_admin_print_scripts' );
     39function gte_action_callback () {
     40    header("Content-type: text/javascript");
     41   
     42    $tags = array(
     43        'h1',
     44        'h2',
     45        'h3',
     46        'h4',
     47        'h5',
     48        'q',
     49        'cite',
     50        'sub',
     51        'sup',
     52        'dl',
     53        'dt',
     54        'dd'
     55    );
     56   
     57    for ($i=0; $i<count($tags); $i++) {
     58        $tag = $tags[$i];
    3759?>
     60edButtons[edButtons.length] =
     61new edButton('ed_<?php echo $tag;?>'
     62    ,'<?php echo $tag;?>'
     63    ,'<<?php echo $tag;?>>'
     64    ,'</<?php echo $tag;?>>'
     65    ,'<?php echo $i+1;?>'
     66);
     67<?php
     68    }
     69    die();
     70}
     71add_action('wp_ajax_gte_action', 'gte_action_callback');
     72?>
  • quicktag-extender/trunk/readme.txt

    r377166 r643580  
    44Tags: quicktags, visual editor, edit
    55Requires at least: 3.0
    6 Tested up to: 3.1.1
    7 Stable tag: 0.1.2
     6Tested up to: 3.5
     7Stable tag: 0.1.3
     8License: GPLv2 or later
     9License URI: http://www.gnu.org/licenses/gpl-2.0.html
    810
    911This plugin adds more buttons to the non-visual editor view for creating/editing posts/pages
     
    2729* dd
    2830
    29 Need this plugin customized or need a plugin created, contact me via my contact form at <a href=\"http://kenzomedia.com\">http://kenzomedia.com</a>
    30 
    31 Also available through twitter, @bmsterling
    32 
    3331== Installation ==
    3432
     
    4745== Credits ==
    4846
    49 Copyright 2011  Benjamin Sterling
     47Copyright 2012  Benjamin Sterling  (benjamin.sterling@kenzomedia.com)
    5048
    5149This program is free software; you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.