Changeset 589000
- Timestamp:
- 08/22/2012 08:48:25 PM (14 years ago)
- Location:
- back-end-instructions
- Files:
-
- 2 deleted
- 2 edited
-
tags/2.1 (deleted)
-
trunk/instructions.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (6 diffs)
-
trunk/style.css (deleted)
Legend:
- Unmodified
- Added
- Removed
-
back-end-instructions/trunk/instructions.php
r581112 r589000 5 5 Description: Plugin to provide nice little instructions for back-end WordPress users 6 6 Author: Shelly Cole 7 Version: 2. 17 Version: 2.2 8 8 Author URI: http://brassblogs.com 9 9 License: GPLv2 … … 154 154 155 155 156 add_action('admin_head', 'bei_enqueue_back_end_header'); // adds the script to the header157 function bei_enqueue_back_end_header() { // adding stuff to the header158 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 is161 // only added to pages it needs to be added to162 $css_file = WP_CONTENT_DIR . '/themes/' . get_template() . '/bei_style.css'; // if your styles are in a subdirectory, add it here163 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 box169 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 hidden190 // this one actually doesn't work because you can't clone this way. but I'm leaving it here for reference191 // 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 ID194 //var clone = $('#'+test).clone(true, true); // clones the previously active div195 //$('#'+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 <?php216 $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 needed221 }222 223 156 // meta information for the instructions posts (custom fields) 224 157 $bei_key = "instructions"; … … 515 448 516 449 517 518 450 /*----------------------------------------------------------------------------- 519 451 Now that we're all done with that, let's make 'em show up! 520 452 -----------------------------------------------------------------------------*/ 453 function 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 } 521 467 522 468 add_action('load-'.$pagenow, 'add_bei_instructions_button'); … … 525 471 526 472 $screen = get_current_screen(); 527 $this_screen = $screen->base; // get current screen's filename, sans extension528 if($pagenow == 'index.php') $pagenow = 'dashboard'; // test for dashboard529 473 $this_screen = $screen->base; 474 $help_tab_content = array(); // set up the help tab content 475 530 476 $address = array_reverse(explode('/', $address)); // reverse the current URL 531 477 $address = $address[0]; // grab the last URL bit (the page we're on) … … 558 504 $multi[] = $page; // add pages to the array to search against 559 505 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 561 509 562 510 if(current_user_can($level)) : -
back-end-instructions/trunk/readme.txt
r581112 r589000 4 4 Tags: developers, clients, instructions 5 5 Requires at least: 3.1 6 Tested up to: 3. 4.17 Stable tag: 2. 16 Tested up to: 3.5 7 Stable tag: 2.2 8 8 License: GPLv2 or later 9 9 … … 31 31 32 32 Note 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. 33 6. Tested (and found ot work) in Multi-Site. 33 34 34 35 … … 46 47 - archive-instructions.php (file) 47 48 - single-instructions.php (file) 48 - bei_style.css (file)49 49 - player.swf (file) 50 - readme.txt (file) 51 - style.css (file) 50 - readme.txt (file) 52 51 3. Upload the back-end-instructions folder (and all of its contents) to the "plugins" directory of your WordPress installation. 53 52 4. Activate the plugin through the "Plugins" menu in WordPress. … … 99 98 7. **Other Front End Viewing Options** 100 99 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. 102 101 103 102 … … 136 135 = Known Issues = 137 136 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. 140 138 141 139 … … 148 146 149 147 == 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 150 154 151 155 = 2.1 =
Note: See TracChangeset
for help on using the changeset viewer.