Changeset 422967
- Timestamp:
- 08/13/2011 05:39:39 PM (15 years ago)
- Location:
- easy-spoiler/trunk
- Files:
-
- 4 edited
-
easy-spoiler-settings.php (modified) (2 diffs)
-
easy-spoiler.php (modified) (10 diffs)
-
js/easy-spoiler.js (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-spoiler/trunk/easy-spoiler-settings.php
r361506 r422967 38 38 'help' => 'Text for the hide button' ), 39 39 (object) array( 40 'title' => 'Select button Text', 41 'key' => 'GBL_SELECT', 42 'help' => 'Text for the select button' ), 43 (object) array( 40 44 'title' => 'Perform Animations', 41 45 'key' => 'GBL_ANIM', … … 55 59 'help' => 'If checked, a user will click on the title to open and close the spoiler.' ), 56 60 (object) array( 57 'title' => 'Refresh IFrames', 61 'title' => 'Show Select Content button', 62 'key' => 'GBL_SHOWSELECT', 63 'style' => 'max-width: 5em', 64 'text' => 'Provide the reader a select content button', 65 'help' => 'If checked, a user can click on a select button as a convenience to auto-select the content of a spoiler.' ), 66 (object) array( 67 'title' => 'Refresh IFrames (beta)', 58 68 'key' => 'GBL_REFRESHIFRAMES', 59 69 'style' => 'max-width: 5em', -
easy-spoiler/trunk/easy-spoiler.php
r361506 r422967 2 2 /* 3 3 Plugin Name: Easy Spoiler 4 Version: 1. 04 Version: 1.1 5 5 Plugin URI: http://www.dyerware.com/main/products/easy-spoiler 6 6 Description: Creates an attractive container to hide a spoiler within a post or page. Works in comments and widgets as well. Also supports clustering spoilers into groups. … … 49 49 var $GBL_SHOW = 'Show'; 50 50 var $GBL_HIDE = 'Hide'; 51 var $GBL_SELECT = 'Select'; 51 52 var $GBL_ANIM = true; 52 53 var $GBL_EDITORBUTTONS = true; … … 69 70 var $GBL_REFRESHIFRAMES = false; 70 71 var $GBL_ANIMATIONSPEED = 'fast'; 72 var $GBL_SHOWSELECT = true; 71 73 72 74 … … 76 78 { 77 79 $jsDir = get_option('siteurl') . '/wp-content/plugins/easy-spoiler/js/'; 78 wp_register_script('wpEasySpoilerJS', "{$jsDir}easy-spoiler.js", false, ' 0.7');80 wp_register_script('wpEasySpoilerJS', "{$jsDir}easy-spoiler.js", false, '1.0'); 79 81 80 82 $this->init_options_map(); … … 161 163 'GBL_BUTTONSTYLE', 'GBL_OPENBTNIMAGE', 'GBL_CLOSEBTNIMAGE', 'GBL_CUSTOMCOLORS', 'GBL_LINECOLOR', 162 164 'GBL_TITLECOLOR', 'GBL_OUTERBKGCOLOR', 'GBL_INNERBKGCOLOR', 'GBL_BUTTONCOLOR', 'GBL_BUTTONTEXT', 163 'GBL_INNERTEXTCOLOR', 'GBL_BUTTONLINE', 'GBL_REFRESHIFRAMES', 'GBL_ANIMATIONSPEED', 'GBL_TITLEBARBUTTON', 165 'GBL_INNERTEXTCOLOR', 'GBL_BUTTONLINE', 'GBL_REFRESHIFRAMES', 'GBL_ANIMATIONSPEED', 'GBL_TITLEBARBUTTON', 166 'GBL_SHOWSELECT', 'GBL_SELECT', 164 167 ); 165 168 $this->op = (object) array(); … … 358 361 359 362 return <<<ecbCode 360 <div style='display:none '>363 <div style='display:none; white-space:wrap; overflow:auto;'> 361 364 {$scontent} 362 365 </div> … … 475 478 $doAnim = 'true'; 476 479 477 $doButtons = ""; 480 $doShowButtons = ""; 481 $doSelButtons = ""; 478 482 $titleAction = ""; 479 $buttonAction = "onclick='wpSpoilerToggle(" . $rowDiv2 . "," .$doAnim. "," .$show. "," .$hide. "," .$speed. "," .$iframe. "); '";483 $buttonAction = "onclick='wpSpoilerToggle(" . $rowDiv2 . "," .$doAnim. "," .$show. "," .$hide. "," .$speed. "," .$iframe. "); return false;'"; 480 484 481 485 if ($this->GBL_TITLEBARBUTTON) 482 486 { 483 $do Buttons = "display:none;";487 $doShowButtons = "display:none;"; 484 488 $titleAction = $buttonAction . " onselectstart='return false;'"; 485 489 $buttonAction = ""; 490 $spoilertitle = "<a href='' " . $titleAction . ">" . $spoilertitle . "</a>"; 486 491 } 487 492 … … 513 518 { 514 519 array_push($this->spoilerArray, $rowDiv); 515 $buttonAction = "onclick='wpSpoilerGroupToggle_" . $this->currentGroup . "(". $rowDiv2 ."); '";520 $buttonAction = "onclick='wpSpoilerGroupToggle_" . $this->currentGroup . "(". $rowDiv2 ."); return false;'"; 516 521 if ($this->GBL_TITLEBARBUTTON) 517 522 { 518 $do Buttons = "display:none;";523 $doShowButtons = "display:none;"; 519 524 $titleAction = $buttonAction . " onselectstart='return false;'"; 520 525 $buttonAction = ""; 526 $spoilertitle = "<a href='' " . $titleAction . ">" . $spoilertitle . "</a>"; 521 527 } 522 528 … … 548 554 } 549 555 550 // <div class={$tableCSS}> 551 552 return <<<ecbCode 556 // <div class={$tableCSS}> <xnput type='button' value='Select' {$selAction} align='right'/> 557 //<input type='button' id={$spoilerbutton} class={$buttonCSS} value={$show} {$buttonAction} align='right' style='{$gblButtonTextColor}{$gblButtonBkg}{$gblButtonLine}${doShowButtons}'/></th> 558 $selAction = "onclick='wpSpoilerSelect(\"" . $rowDiv . "\"); return false;'"; 559 if ($this->GBL_SHOWSELECT == false) 560 { 561 $selAction = ""; 562 $doSelButtons = "display:none;"; 563 } 564 565 $doBorder = ""; 566 if ($this->GBL_CUSTOMCOLORS == true) 567 { 568 $doBorder = "border: 1px inset;"; 569 } 570 571 return <<<ecbCode 553 572 {$begin} 554 573 <div class={$tableCSS} style='{$gblLineColor}'> … … 556 575 <table class='easySpoilerTable' border='0' style='text-align:center;' align='center' bgcolor='FFFFFF' > 557 576 558 <tr><th class={$titlea} style='text-align:left;vertical-align:middle;font-size:120%;{$gblOuterBkg}{$gblLineColor}{$gblTitleColor}' {$titleAction}>{$spoilertitle}</th> 559 <th class={$titleb} style='text-align:right;vertical-align:middle;font-size:100%;{$gblOuterBkg}{$gblLineColor}' {$titleAction}><input type='button' id={$spoilerbutton} class={$buttonCSS} value={$show} {$buttonAction} align='right' style='{$gblButtonTextColor}{$gblButtonBkg}{$gblButtonLine}${doButtons}'/></th> 577 <tr><th class={$titlea} style='text-align:left;vertical-align:middle;font-size:120%;{$gblOuterBkg}{$gblLineColor}{$gblTitleColor}'>{$spoilertitle}</th> 578 <th class={$titleb} style='text-align:right;vertical-align:middle;font-size:100%;{$gblOuterBkg}{$gblLineColor} white-space:nowrap;'> 579 <a href='' {$selAction} style='{$gblButtonTextColor}{$gblButtonBkg}{$gblButtonLine} ${doSelButtons} margin: 0px 0px; padding: 1px; ${doBorder}' align='right'>{$this->GBL_SELECT}</a><a href='' {$buttonAction} id={$spoilerbutton} class={$buttonCSS} value={$show} align='right' style='{$gblButtonTextColor}{$gblButtonBkg}{$gblButtonLine}${doShowButtons} margin: 0px 0px 0px 5px; padding: 1px; ${doBorder}"'>{$this->GBL_SHOW}</></th> 560 580 </tr> 561 562 <tr><td class='easySpoilerRow' colspan='2' style='{$gblLineColor}'><div><div id='{$rowDiv}' class='easySpoilerSpoils' style='display:none; white-space:wrap; vertical-align:middle;{$gblInnerBkg}${gblInnerTextColor}{$gblLineColor}'> 581 <tr><td class='easySpoilerRow' colspan='2' style='{$gblLineColor}'><div id='{$rowDiv}' class='easySpoilerSpoils' style='display:none; white-space:wrap; overflow:auto; vertical-align:middle;{$gblInnerBkg}${gblInnerTextColor}{$gblLineColor}'> 563 582 {$scontent} 564 </div></ div></td></tr>583 </div></td></tr> 565 584 </table> 566 585 {$conclude} -
easy-spoiler/trunk/js/easy-spoiler.js
r361506 r422967 1 1 /** 2 2 * Handle: easySpoiler 3 * Version: 0.73 * Version: 1.0 4 4 * Enqueue: true 5 5 * … … 10 10 */ 11 11 12 ///////////////////////////////////////////////////////////////////////////// 12 13 function wpSpoilerToggle(id, doAnim, showName, hideName, speed, doIframes) 13 14 { … … 23 24 {e.style.display = 'none';} 24 25 me.value=showName; 26 me.innerText=showName; 25 27 } 26 28 else … … 30 32 e.style.display = 'block'; 31 33 me.value=hideName; 34 me.innerText=hideName; 32 35 33 36 if (doIframes) 34 {jQuery("#" + id).find('iframe').each(function (i) {this.src = this.src;});} 37 { 38 jQuery("#" + id).find('iframe').each(function(i) {autoResize(this);}); 39 //jQuery("#" + id).find('iframe').each(function(i) {this.src = this.src;}); 40 } 35 41 } 42 43 return false; 36 44 } 37 45 46 ///////////////////////////////////////////////////////////////////////////// 47 function autoResize(iframe) 48 { 49 iframe.height = iframe.contentWindow.document.body.scrollHeight; 50 iframe.width = iframe.contentWindow.document.body.scrollWidth; 51 } 52 53 ///////////////////////////////////////////////////////////////////////////// 38 54 function wpSpoilerHide(id, doAnim, showName, speed) 39 55 { … … 48 64 e.style.display = 'none'; 49 65 me.value=showName; 66 me.innerText=showName; 50 67 } 51 68 } 69 70 ///////////////////////////////////////////////////////////////////////////// 71 function wpSpoilerSelect(objId) 72 { 73 if (document.selection) 74 { 75 document.selection.empty(); 76 } 77 else 78 { 79 if (window.getSelection) 80 { 81 window.getSelection().removeAllRanges(); 82 } 83 } 84 85 if (document.selection) 86 { 87 var range = document.body.createTextRange(); 88 range.moveToElementText(document.getElementById(objId)); 89 range.select(); 90 } 91 else if (window.getSelection) 92 { 93 var range = document.createRange(); 94 range.selectNode(document.getElementById(objId)); 95 window.getSelection().addRange(range); 96 } 97 } 98 -
easy-spoiler/trunk/readme.txt
r361506 r422967 5 5 Tags: spoiler,hint,tip,answer,hidden,hide,mobile,shortcode,dyerware 6 6 Requires at least: 2.8 7 Tested up to: 3. 18 Stable tag: 1. 07 Tested up to: 3.2.1 8 Stable tag: 1.1 9 9 10 10 This plugin allows you to create a container for spoilers within pages, posts, comments, and widgets. Also supports spoiler groups. … … 69 69 == Upgrade Notice == 70 70 71 = 1.1 = 72 * Flat, more subtle buttons 73 * Option for using title as the show/hide toggle now changes mouse pointer to indicate it is an actionable area 74 * Improved iframe support 75 * new select button option which will provide a 'select' button on the title bar for auto-selecting the 76 spoiler content. 77 * Admin option to enable/disable select button feature and to configure the text of the select button 78 71 79 = 1.0 = 72 80 * You can now configure the titlebar to be the open/close button. … … 106 114 == Changelog == 107 115 116 = 1.1 = 117 * Flat, more subtle buttons 118 * Option for using title as the show/hide toggle now changes mouse pointer to indicate it is an actionable area 119 * Improved iframe support 120 * new select button option which will provide a 'select' button on the title bar for auto-selecting the 121 spoiler content. 122 * Admin option to enable/disable select button feature and to configure the text of the select button 123 108 124 = 1.0 = 109 125 * You can now configure the titlebar to be the open/close button.
Note: See TracChangeset
for help on using the changeset viewer.