Plugin Directory

Changeset 366041


Ignore:
Timestamp:
03/28/2011 10:48:27 PM (15 years ago)
Author:
doolin
Message:

Massive jslint script cleanups.

Location:
hrecipe/trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • hrecipe/trunk

    • Property svn:ignore deleted
  • hrecipe/trunk/hrecipe.class.php

    r361092 r366041  
    4949        //wp_enqueue_script('hrecipe-jquery-min');
    5050        //wp_enqueue_script('hrecipe-reciply');
    51         wp_register_script('hrecipe-format',plugins_url('hrecipe/js/hrecipe_format.js',dirname(__FILE__)));
    52         wp_register_script('hrecipescript',plugins_url('hrecipe/js/hrecipescript.js',dirname(__FILE__)));
     51        wp_register_script('hrecipeformat',plugins_url('hrecipe/js/hrecipe_format.js', dirname(__FILE__)),'','',true);
     52        wp_register_script('hrecipescript',plugins_url('hrecipe/js/hrecipescript.js', dirname(__FILE__)));
    5353        wp_localize_script('hrecipescript','hrecipe_handle',hrecipe_localize_vars());
    5454
    5555        // TODO: Move the enqueue to where it's needed.
    5656        wp_enqueue_script('hrecipescript');
    57         //wp_enqueue_script('hrecipe-format');
    58        
    59        
     57        wp_enqueue_script('hrecipeformat');
    6058    }
    6159   
     
    136134        // should go away, and it should be renamed to hrecipe_format.js       
    137135        // See if wp_enqueue_script will work here.
    138         //wp_enqueue_script('hrecipe-format');
    139         include ('hrecipe_format.php');
     136        wp_register_script('hrecipeformat',plugins_url('hrecipe/js/hrecipe_format.js', dirname(__FILE__)),'','',true);
     137        wp_enqueue_script('hrecipeformat');
     138        //include ('hrecipe_format.php');
    140139    }
    141140
  • hrecipe/trunk/hrecipe.php

    r361294 r366041  
    11<?php
    22/*
    3 Plugin Name: hRecipe
    4 Plugin URI: http://hrecipe.com/
    5 Description: Fast and easy recipe formatting. Allows the correct microformat content to be easily added for recipes.
    6 Version: 0.5.4.4
    7 Author: Dave Doolin
    8 Author URI: http://website-in-a-weekend.net/
    9 */
     3 * Plugin Name: hRecipe
     4 * Plugin URI: http://hrecipe.com/
     5 * Description: Fast and easy recipe formatting. Allows the correct microformat content to be easily added for recipes.
     6 * Version: 0.5.4.5
     7 * Author: Dave Doolin
     8 * Author URI: http://website-in-a-weekend.net/
     9 */
    1010
    1111/*  Copyright 2009 David M. Doolin
     
    7171
    7272
    73     add_action('admin_footer', array ($recipe, 'hrecipe_plugin_footer'));
     73    //add_action('admin_footer', array ($recipe, 'hrecipe_plugin_footer'));
     74    //add_action('admin_print_scripts', array ($recipe, 'hrecipe_plugin_footer'));
    7475
    7576    //add_action('wp_head', array ($recipe, 'hrecipe_plugin_head'));
     
    8384
    8485    add_action('init', array ($recipe, 'hrecipe_plugin_init'));
     86    // Not yet ready to move to internal options handling.
    8587    //add_action('init', array ($recipe, 'register_mysettings'));
    8688    add_action('admin_menu', array ($recipe, 'hrecipe_plugin_menu'));
  • hrecipe/trunk/hrecipe_format.php

    r361079 r366041  
    148148
    149149/**
    150  * Thanks for Michael Allen Smith for help 
     150 * Thanks for Michael Allen Smith for help
    151151 * with bringing duration into spec so that
    152152 * hrecipes will be properly displayed as
  • hrecipe/trunk/tinymceplugin/editor_plugin.js

    r359006 r366041  
    1 /* TinyMCE plugin for WordPress hRecipe plug-in.
    2    Details on creating TinyMCE plugins at
    3      http://wiki.moxiecode.com/index.php/TinyMCE:Create_plugin/3.x
    4 */
    5 (function() {
    6 // Grab the text strings to be used by hrecipe TinyMCE button
    7 tinymce.PluginManager.requireLangPack('hrecipe_plugin');
     1/*
     2 * TinyMCE plugin for WordPress hRecipe plug-in.
     3 * Details on creating TinyMCE plugins at
     4 * http://tinymce.moxiecode.com/wiki.php/Creating_a_plugin
     5 */
     6/*global tinymce, edInsertHRecipe */
    87
    9 tinymce.create('tinymce.plugins.hrecipe_plugin', {
    10     getInfo : function() {
    11         return {
    12             longname : 'hRecipe Support for Editor',
    13             author : 'Dave Doolin',
    14             authorurl : 'http://website-in-a-weekend.net/',
    15             infourl : 'http://website-in-a-weekend.net/',
    16             version : "0.1"
    17         };
    18     },
     8(function () {
    199
    20     init : function(ed, url) {
    21         ed.addButton('hrecipe_button', {
    22             title : 'hrecipe_plugin.insertbutton',
    23             image : url + '/../hrecipe_icon_20x20.png',
    24             onclick : function () {
    25                 edInsertHRecipe();
    26             }
    27         });
    28     },
     10  // Grab the text strings to be used by hrecipe TinyMCE button
     11  tinymce.PluginManager.requireLangPack('hrecipe_plugin');
    2912
    30     createControl : function (n, cm) {
    31         return null;
    32     }
     13  tinymce.create('tinymce.plugins.hrecipe_plugin', {
     14      getInfo : function () {
     15          return {
     16              longname : 'hRecipe Support for Editor',
     17              author : 'Dave Doolin',
     18              authorurl : 'http://website-in-a-weekend.net/',
     19              infourl : 'http://website-in-a-weekend.net/',
     20              version : "0.1"
     21          };
     22      },
    3323
    34 });
     24      init : function (ed, url) {
     25          ed.addButton('hrecipe_button', {
     26              title : 'hrecipe_plugin.insertbutton',
     27        image : url + '/../hrecipe_icon_20x20.png',
     28        onclick : function () {
     29          edInsertHRecipe();
     30        }
     31          });
     32      },
    3533
    36 // Adds the plugin class to the list of available TinyMCE plugins
    37 tinymce.PluginManager.add('hrecipe_plugin', tinymce.plugins.hrecipe_plugin);
     34      createControl : function (n, cm) {
     35          return null;
     36      }
     37
     38  });
     39
     40  tinymce.PluginManager.add('hrecipe_plugin', tinymce.plugins.hrecipe_plugin);
    3841})();
  • hrecipe/trunk/view/lightbox.php

    r361027 r366041  
    131131}
    132132
     133
     134
    133135function getSelectValue(fieldId) {
    134136   
    135137  var selectItem = document.getElementById(fieldId);
    136138  var selectValue = selectItem.value;
    137   if ("" != selectValue)
    138   {
     139
     140  if ("" != selectValue) {
    139141    return selectValue;
    140142  }
     143 
    141144  // avoid bug in old browsers where they never give any value directly
    142145  var selectIdx = selectItem.selectedIndex;
    143146  selectValue = selectItem.options[selectIdx].value;
    144   if ("" != selectValue)
    145   {
     147
     148  if ("" != selectValue) {
    146149    return selectValue;
    147150  }
     151 
    148152  // and cope with IE
    149153  selectValue = (selectItem.options[selectIdx]).text;
    150154  return selectValue;
    151155}
     156
    152157
    153158// Process the checkboxes here.
Note: See TracChangeset for help on using the changeset viewer.