Plugin Directory

Changeset 2735012


Ignore:
Timestamp:
05/31/2022 05:36:15 PM (4 years ago)
Author:
jwz
Message:

Version 1.5

Location:
herp-derp
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • herp-derp/tags/1.5/herpderp.js

    r2361537 r2735012  
    11/* Herp all the derps.
    22
    3    Copyright © 2012-2019 Jamie Zawinski <jwz@jwz.org>
     3   Copyright © 2012-2022 Jamie Zawinski <jwz@jwz.org>
    44
    55   Permission to use, copy, modify, distribute, and sell this software and its
     
    2424   This version by jwz, created: 13-Dec-2012. Derp.
    2525 */
     26
     27(function() {
    2628
    2729function derp(p, herpa) {
     
    8991  }
    9092
    91   return (Derpfault && Derpfault.herp == 'herp');
     93  return (window.Derpfault && window.Derpfault.herp == 'herp');
    9294}
    9395
     
    104106  herpa (e.target.checked);
    105107  cderp (e.target.checked);
    106   return false;
     108  return true;
    107109}
    108110
     
    114116  if (derp) herpa (derp);
    115117  var p = document.createElement('div');
    116   var cb = '<INPUT TYPE=CHECKBOX ' +
    117            (derp ? 'CHECKED ' : '') +
    118            'ONCLICK="herpterg(event)">';
    119   cb = 'Herp Derp' + cb;
    120   p.innerHTML = cb;
    121118  p.className = 'herpderp';
     119
     120  var cb = document.createElement('input');
     121  cb.type = 'checkbox';
     122  if (derp) cb.checked = true;
     123  cb.onclick = herpterg;
     124
     125  p.appendChild (document.createTextNode('Herp Derp'));
     126  p.appendChild (cb);
     127
    122128  e.parentNode.insertBefore (p, e);
    123129}
    124130
    125 herpies();
     131if (document.readyState === 'loading') {
     132  document.addEventListener ("DOMContentLoaded", herpies);
     133} else {
     134  herpies();
     135}
     136
     137})();
  • herp-derp/tags/1.5/herpderp.php

    r2361537 r2735012  
    33Plugin Name: Herp Derp
    44Plugin URI: https://www.jwz.org/herpderp/
    5 Version: 1.4
     5Version: 1.5
    66Description: This plugin adds a checkbox to replace the text of your comments with "Herp Derp".
    77Author: Jamie Zawinski
     
    99*/
    1010
    11 /* Copyright © 2012-2017 Jamie Zawinski <jwz@jwz.org>
     11/* Copyright © 2012-2022 Jamie Zawinski <jwz@jwz.org>
    1212
    1313   Permission to use, copy, modify, distribute, and sell this software and its
     
    3939  global $herpderp_plugin_name;
    4040  global $herpderp_prefs_toggle_key;
    41   $options = get_option ($herpderp_plugin_name);
    42   $def = $options[$herpderp_prefs_toggle_key];
     41  $options = get_option ($herpderp_plugin_name) ?? null;
     42  $def = $options ? $options[$herpderp_prefs_toggle_key] : false;
    4343
    4444  wp_register_script ('herpderp',
     
    174174
    175175  $options = get_option ($herpderp_plugin_name);
    176   $def_toggle = $options[$herpderp_prefs_toggle_key];
     176  $def_toggle = $options ? $options[$herpderp_prefs_toggle_key] : false;
    177177
    178178  echo "<input id='$herpderp_prefs_toggle_id'
  • herp-derp/tags/1.5/readme.txt

    r2361535 r2735012  
    44Tags: herp, derp
    55Requires at least: 2.7
    6 Tested up to: 5.5
    7 Stable tag: 1.4
     6Tested up to: 6.0
     7Stable tag: 1.5
    88
    99This plugin herps all the derps.
     
    4242* Derpier herps.
    4343
     44= 1.5 =
     45* Made the JS be asyncable. Eliminated some PHP warnings.
     46
  • herp-derp/trunk/herpderp.js

    r2361537 r2735012  
    11/* Herp all the derps.
    22
    3    Copyright © 2012-2019 Jamie Zawinski <jwz@jwz.org>
     3   Copyright © 2012-2022 Jamie Zawinski <jwz@jwz.org>
    44
    55   Permission to use, copy, modify, distribute, and sell this software and its
     
    2424   This version by jwz, created: 13-Dec-2012. Derp.
    2525 */
     26
     27(function() {
    2628
    2729function derp(p, herpa) {
     
    8991  }
    9092
    91   return (Derpfault && Derpfault.herp == 'herp');
     93  return (window.Derpfault && window.Derpfault.herp == 'herp');
    9294}
    9395
     
    104106  herpa (e.target.checked);
    105107  cderp (e.target.checked);
    106   return false;
     108  return true;
    107109}
    108110
     
    114116  if (derp) herpa (derp);
    115117  var p = document.createElement('div');
    116   var cb = '<INPUT TYPE=CHECKBOX ' +
    117            (derp ? 'CHECKED ' : '') +
    118            'ONCLICK="herpterg(event)">';
    119   cb = 'Herp Derp' + cb;
    120   p.innerHTML = cb;
    121118  p.className = 'herpderp';
     119
     120  var cb = document.createElement('input');
     121  cb.type = 'checkbox';
     122  if (derp) cb.checked = true;
     123  cb.onclick = herpterg;
     124
     125  p.appendChild (document.createTextNode('Herp Derp'));
     126  p.appendChild (cb);
     127
    122128  e.parentNode.insertBefore (p, e);
    123129}
    124130
    125 herpies();
     131if (document.readyState === 'loading') {
     132  document.addEventListener ("DOMContentLoaded", herpies);
     133} else {
     134  herpies();
     135}
     136
     137})();
  • herp-derp/trunk/herpderp.php

    r2361537 r2735012  
    33Plugin Name: Herp Derp
    44Plugin URI: https://www.jwz.org/herpderp/
    5 Version: 1.4
     5Version: 1.5
    66Description: This plugin adds a checkbox to replace the text of your comments with "Herp Derp".
    77Author: Jamie Zawinski
     
    99*/
    1010
    11 /* Copyright © 2012-2017 Jamie Zawinski <jwz@jwz.org>
     11/* Copyright © 2012-2022 Jamie Zawinski <jwz@jwz.org>
    1212
    1313   Permission to use, copy, modify, distribute, and sell this software and its
     
    3939  global $herpderp_plugin_name;
    4040  global $herpderp_prefs_toggle_key;
    41   $options = get_option ($herpderp_plugin_name);
    42   $def = $options[$herpderp_prefs_toggle_key];
     41  $options = get_option ($herpderp_plugin_name) ?? null;
     42  $def = $options ? $options[$herpderp_prefs_toggle_key] : false;
    4343
    4444  wp_register_script ('herpderp',
     
    174174
    175175  $options = get_option ($herpderp_plugin_name);
    176   $def_toggle = $options[$herpderp_prefs_toggle_key];
     176  $def_toggle = $options ? $options[$herpderp_prefs_toggle_key] : false;
    177177
    178178  echo "<input id='$herpderp_prefs_toggle_id'
  • herp-derp/trunk/readme.txt

    r2361535 r2735012  
    44Tags: herp, derp
    55Requires at least: 2.7
    6 Tested up to: 5.5
    7 Stable tag: 1.4
     6Tested up to: 6.0
     7Stable tag: 1.5
    88
    99This plugin herps all the derps.
     
    4242* Derpier herps.
    4343
     44= 1.5 =
     45* Made the JS be asyncable. Eliminated some PHP warnings.
     46
Note: See TracChangeset for help on using the changeset viewer.