Plugin Directory

Changeset 589000


Ignore:
Timestamp:
08/22/2012 08:48:25 PM (14 years ago)
Author:
doodlebee
Message:

Updating to 2.2

Location:
back-end-instructions
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • back-end-instructions/trunk/instructions.php

    r581112 r589000  
    55Description: Plugin to provide nice little instructions for back-end WordPress users
    66Author: Shelly Cole
    7 Version: 2.1
     7Version: 2.2
    88Author URI: http://brassblogs.com
    99License: GPLv2
     
    154154
    155155
    156 add_action('admin_head', 'bei_enqueue_back_end_header');                                    // adds the script to the header
    157 function bei_enqueue_back_end_header() {                                                    // adding stuff to the header
    158   global $pluginloc, $typenow;
    159   wp_enqueue_script('jquery');                                                              // scripts and styles to be added to the header -
    160   if($typenow == 'instructions') $activate = true;                                          // 'activate' will ensure this stuff is
    161                                                                                             // only added to pages it needs to be added to
    162   $css_file = WP_CONTENT_DIR . '/themes/' . get_template() . '/bei_style.css';              // if your styles are in a subdirectory, add it here
    163    
    164   $header  = "\n" . '<!-- back end instructions -->' . "\n"; ?>
    165    
    166   <script type="text/javascript">
    167             jQuery(document).ready(function($) {
    168                 // add dynamic fields for "Page Name" meta box
    169                 var scntDiv = $('.more_fields');
    170                 var i = $('.more_fields').size() + 1;
    171                
    172                 $('.add_field').live('click', function() {
    173                     $('<p><strong style="display:inline-block; width:26px; text-align:right; margin-right:8px;"><a href="#" class="add_field" style="text-decoration:none; color:#666; font-style:normal;">+</a></strong><input type="text" name="multi[]" value="" style="width:170px; margin-right:5px;" /><a href="#" class="remove" style="font-style:normal; text-decoration:none; font-size:0.8em; color:#666;">remove</a></p>').appendTo(scntDiv);
    174                     i++;
    175                     return false;
    176                 });
    177                
    178                 $('.remove').live('click', function() {
    179                     if( i > 2 ) {
    180                         $(this).parents('p').remove();
    181                         i--;
    182                     }
    183                 return false;
    184                 });
    185                
    186                 /* Still trying to get the "stop video playback when tab is swtiched" issue fixed.
    187                    These are my terrible, terrible attempts at solving this problem.
    188                    
    189                 // stop video playback when div is hidden
    190                 // this one actually doesn't work because you can't clone this way. but I'm leaving it here for reference
    191                 // because if you *could* clone this way, this would be a perfect solution.
    192                 //$('.contextual-help-tabs li').on('click', function(event) {
    193                     //var test = $('.contextual-help-tabs-wrap div.active').attr('id'); // gets previously active div ID
    194                     //var clone = $('#'+test).clone(true, true);                              // clones the previously active div
    195                     //$('#'+test).remove();
    196                     //$('#'+test).html(clone);
    197                 //});
    198                
    199                 // this one is actually the one I'm working on that's causing me to pull out my hair.
    200                 // for the record, I am now bald.  My eyebrows and eyelashes are now cowering in fear.
    201                 $('.contextual-help-tabs li').on('click', function() {
    202                     var previously_active = $('.contextual-help-tabs-wrap div.active').attr('id');
    203                     var video = $('#'+previously_active).find('*[video]');
    204                     //alert(video);   
    205                     if(video) {
    206                         $('html5-video').each(function(){
    207                             this.pause();
    208                         });
    209                     }
    210                 }); */
    211                
    212             });
    213         </script> 
    214        
    215 <?php
    216   $header .= '<link rel="stylesheet" href="' . $pluginloc . 'style.css" />' . "\n";
    217   if(file_exists($css_file)) $header .= '<link rel="stylesheet" href="' . $css . '" />' . "\n";
    218   $header .= '<!--/end back end instructions -->' . "\n\n";
    219  
    220   if($activate == true) echo $header; // don't insert the header junk if it's not needed
    221 }
    222 
    223156// meta information for the instructions posts (custom fields)
    224157$bei_key = "instructions";
     
    515448
    516449
    517 
    518450/*-----------------------------------------------------------------------------
    519451     Now that we're all done with that, let's make 'em show up!
    520452-----------------------------------------------------------------------------*/
     453function array_find($needle, $haystack) {                                                   // testing function
     454    if(strstr($needle, '?') !== false) {                                                    // check to see if the current page we're on has a "?"
     455        $test = explode('?', $needle);
     456        $test = $test[0];                                                                   // if it does, get the part before the "?"
     457    } else {
     458        $test = $needle;                                                                    // if it doesn't, just use the current page
     459    }
     460
     461    foreach ($haystack as $key=>$item) {
     462        if(($item == $test) || ($item == $needle)) return 'found';
     463    }
     464
     465    return false;
     466}
    521467
    522468add_action('load-'.$pagenow, 'add_bei_instructions_button');
     
    525471   
    526472    $screen = get_current_screen();
    527     $this_screen = $screen->base;                                                           // get current screen's filename, sans extension
    528     if($pagenow == 'index.php') $pagenow = 'dashboard';                                     // test for dashboard
    529    
     473    $this_screen = $screen->base;
     474    $help_tab_content = array();                                                            // set up the help tab content                                                     
     475
    530476    $address = array_reverse(explode('/', $address));                                       // reverse the current URL
    531477    $address = $address[0];                                                                 // grab the last URL bit (the page we're on)
     
    558504            $multi[] = $page;                                                               // add pages to the array to search against
    559505
    560             if(array_search($address, $multi, true) === FALSE) continue;                    // if the current page isn't in the array, skip it 
     506            $find = array_find($address, $multi);
     507
     508            if($find != 'found') continue;                                                  // if the current page isn't in the array, skip it 
    561509
    562510            if(current_user_can($level)) :
  • back-end-instructions/trunk/readme.txt

    r581112 r589000  
    44Tags: developers, clients, instructions
    55Requires at least: 3.1
    6 Tested up to: 3.4.1
    7 Stable tag: 2.1
     6Tested up to: 3.5
     7Stable tag: 2.2
    88License: GPLv2 or later
    99
     
    3131
    3232Note that upper levels will also see lower-level videos, so keep that in mind while preparing your instructions. I recommend making videos/content specific to the lowest level first, and then build onto that base as you go up the user-level chain of command.
     336. Tested (and found ot work) in Multi-Site.
    3334
    3435
     
    4647      - &nbsp; &nbsp; archive-instructions.php (file)   
    4748      - &nbsp; &nbsp; single-instructions.php (file)
    48       - &nbsp; &nbsp; bei_style.css (file)
    4949      - player.swf (file)
    50       - readme.txt (file)
    51       - style.css (file)   
     50      - readme.txt (file)   
    52513. Upload the back-end-instructions folder (and all of its contents) to the "plugins" directory of your WordPress installation.
    53524. Activate the plugin through the "Plugins" menu in WordPress.
     
    99987. **Other Front End Viewing Options**
    10099
    101     **Theme Files** You've had a CSS file available for you to use since version 0.8, but now you also have two theme files - archive-instructions.php and single-instructions.php - for you to use if you enable front-end viewing.  Simply copy these files and paste them into the theme folder youre using.  The files are basic Twenty Eleven copies, with a bit of necessary code stuck in there to take your settings into account.  You can edit them to match your theme as you please.  Just be sure you move these files to your current them, or any upgrade you make will overwrite whatever changes you've made.
     100    **Theme Files** There are two theme files available for you to use - archive-instructions.php and single-instructions.php - if you enable front-end viewing.  Simply copy these files and paste them into the theme folder youre using.  The files are basic Twenty Eleven copies, with a bit of necessary code stuck in there to take your settings into account.  You can edit them to match your theme as you please.  Just be sure you move these files to your current theme, or any upgrade you make will overwrite whatever changes you've made.
    102101
    103102
     
    136135= Known Issues =
    137136
    138 * Bug with swapping instructions that contain playing videos.  If you change tabs, the video of the previously-opened tab will continue to play in the background.  So you have to be sure to stop the video before you change tabs. If you're a guru at jQuery, and feel like you might know the solution, my sad attempts at solving this problem lie at (commented) lines 186-210 in the instructions.php file.  Have at it! In the meantime, I'll still be plugging away, trying to sort this out.
    139 * It's still not clear if this works with multi-site.  I have a few reports that say it doesn't - but I have many, many more that say it does.  That's on my to-do list for thenext release - to verify/make sure it works on multi-site.
     137* Bug with swapping instructions that contain playing videos.  If you change tabs, the video of the previously-opened tab will continue to play in the background.  So you have to be sure to stop the video before you change tabs. If you're a guru at jQuery, and feel like you might know the solution, have at it! In the meantime, I'll still be plugging away, trying to sort this out.
    140138
    141139
     
    148146
    149147== Changelog ==
     148
     149= 2.2 =
     150* tested in WordPress 3.5-alpha, minor bug fixes and code cleanup for the upcoming WordPress release.
     151* tested in a Multi-Site environment, seems to work fine.  (Please contact me if you find out otherwise, because my tests are only in a localhost environment.)
     152* created a now video explaining the plugin, since the old one is outdated.
     153* removed stylesheets because they actually aren't necessary anymore
    150154
    151155= 2.1 =
Note: See TracChangeset for help on using the changeset viewer.