PmWikiDevelopment.PmToggleEdit History

Hide minor edits - Show changes to output - Cancel

 
 
June 30, 2014, at 04:08 PM by MichaelPaulukonis -
Changed line 8 from:
Maintainer: [[~OtherMichael]]
to:
Maintainer: [[~MichaelPaulukonis]]
 
 
June 26, 2014, at 12:52 PM by MichaelPaulukonis -
Changed line 45 from:
Download Attach:pm-toggle-edit.zip (3kb)
to:
Download Attach:Programming/pm-toggle-edit.zip (3kb)
 
 
June 26, 2014, at 12:51 PM by MichaelPaulukonis - fixed image link
Changed line 27 from:
->Attach:pmToggleEdit-button-in-situ.png
to:
->Attach:Programming/pmToggleEdit-button-in-situ.png
 
 
May 29, 2013, at 04:16 PM by OtherMichael -
Added line 76:
[[#buttontemplate]]
Changed lines 79-80 from:
It's included in [[Attach:pm-toggle-edit.zip|pm-toggle-edit.zip]], but looks like http://www.xradiograph.com/wrottings/wiki/pub/guiedit/button-template-22x22.gif
to:
It's included in [[Attach:pm-toggle-edit.zip|pm-toggle-edit.zip]], but looks like http://www.xradiograph.com/projects/xradiograph.com/wiki/pub/guiedit/button-template-22x22.gif
Changed lines 83-86 from:
See more buttons and ideas at Cookbook:GuiEdit


!! [[#SeeAlso
]] See Also
to:
See more buttons and ideas at [[Cookbook:GuiEdit]]


[[#SeeAlso]]
!!
See Also
Changed lines 92-93 from:
!! [[#Categories]] Category tags
to:
[[#Categories]]
!!
Category tags
 
 
September 27, 2010, at 09:21 PM by OtherMichael -
Changed lines 46-49 from:

*copy [@toggle.gif@] to [@pub\guiedit\@]
*copy [@pm-toggle-edit.js@] to [@pub\@]
*add the following to your [@config.php@]:
to:
# Install [[Cookbook:Toggle|Toggle]]
# copy [@toggle.gif@] to [@pub\guiedit\@]
#copy [@pm-toggle-edit.js@] to [@pub\@]
#add the following to your [@local\
config.php@]:
 
 
September 14, 2009, at 04:06 PM by OtherMichael -
Added lines 66-67:

At least putting the default style into a more-readily-edited config variable, instead of the less-accessible javascript-file.
 
 
September 14, 2009, at 09:13 AM by OtherMichael -
Changed line 5 from:
Version: 0.1.20090913
to:
Version: 0.1.20090914
Changed line 34 from:
(:div1252880238887 id="tog1252880238887" style="border:1px solid #999; padding;5px;":)
to:
(:div1252880238887 id="tog1252880238887" style="border:1px solid #999; padding:5px;":)
 
 
September 14, 2009, at 09:06 AM by OtherMichael -
Changed line 6 from:
Prerequisites: [[http://www.pmwiki.org/|PmWiki 2.2.0-beta67]], Cookbook:Toggle
to:
Prerequisites: [[http://www.pmwiki.org/|PmWiki 2.2.0]], Cookbook:Toggle
 
 
September 14, 2009, at 08:48 AM by OtherMichael - corrected onclick capitalization, moved script-inclusion to config.php instead of template
Changed line 49 from:
*add to your skin (eg, [@pub/skins/pmwiki/pmwiki.tmpl@] or [@pub/skins/triad/skin-triad.tmpl@]) within the [@<head>...</head>@] section:
to:
*add the following to your [@config.php@]:
Changed lines 51-52 from:
<script type="text/javascript" src="$FarmPubDirUrl/pm-toggle-edit.js"></script>
to:
$GUIButtons['toggle'] = array(90, '', '', '',
  '<a href
=\"#\" onclick=\"pmAddToggle();\"><img src=\'$GUIButtonDirUrlFmt/toggle.gif\' title=\'$[toggle]\' /></a>');
Deleted line 54:
*add to your [@config.php@]:
Changed lines 56-57 from:
$GUIButtons['toggle'] = array(90, '', '', '',
  '<a href=\"#\" onclick=\"pmAddtoggle();\"><img src=\'$GUIButtonDirUrlFmt/toggle.gif\' title=\'$[toggle]\' /></a>');
to:
$HTMLFooterFmt['toggle'] = '<script type="text/javascript"
  src="$FarmPubDirUrl/pm-toggle-edit.js"></script>';
Deleted line 60:
* Default template file is [@pub/skins/pmwiki/pmwiki.tmpl@] but you can make a copy of the pmwiki skin avoiding it to be overwritten during the next pmwiki upgrade, see http://www.pmwiki.org/wiki/PmWiki/SkinTemplates)
 
 
September 13, 2009, at 10:21 PM by OtherMichael -
Added lines 71-72:

see also: Cookbook:UnToggle which deals with this issue (but is a less robust toggle implementation?)
 
 
September 13, 2009, at 07:11 PM by OtherMichael - category change
Changed line 9 from:
Categories: [[!Editing]] [[!Layout]]
to:
Categories: [[!Editing]] [[!Markup]]
 
 
September 13, 2009, at 07:11 PM by OtherMichael - additional notes, image
Changed lines 5-6 from:
Version: 1.0 September 13, 2009
Prerequisites
: PmWiki 2, Cookbook:Toggle
to:
Version: 0.1.20090913
Prerequisites: [[http
://www.pmwiki.org/|PmWiki 2.2.0-beta67]], Cookbook:Toggle
Changed lines 27-29 from:
to:
->Attach:pmToggleEdit-button-in-situ.png

Changed lines 45-48 from:
Attach:pm-toggle-edit.zip

add to
[@config.php@]:
to:
Download Attach:pm-toggle-edit.zip (3kb)

*copy
[@toggle.gif@] to [@pub\guiedit\@]
*copy [@pm-toggle-edit.js@] to [@pub\@]
*add to your skin (eg, [@pub/skins/pmwiki/pmwiki.tmpl@] or [@pub/skins/triad/skin-triad.tmpl@]) within the [@<head>...</head>@] section
:
Changed lines 51-52 from:
$GUIButtons['toggle'] = array(90, '', '', '',
  '<a href
=\"#\" onclick=\"pmAddtoggle();\"><img src=\'$GUIButtonDirUrlFmt/toggle.gif\' title=\'$[toggle]\' /></a>');
to:
<script type="text/javascript" src="$FarmPubDirUrl/pm-toggle-edit.js"></script>
Changed lines 54-59 from:

copy [@toggle.gif@] to [@pub\guiedit\@]

copy [@pm-toggle-edit.js@] to [@pub\@]

add to your skin (eg, [@pub/skins/triad/skin-triad.tmpl@]) within the [@<head>...</head>@] section
:
to:
*add to your [@config.php@]:
Changed lines 56-57 from:
<script type="text/javascript" src="$FarmPubDirUrl/pm-toggle-edit.js"></script>
to:
$GUIButtons['toggle'] = array(90, '', '', '',
  '<a href
=\"#\" onclick=\"pmAddtoggle();\"><img src=\'$GUIButtonDirUrlFmt/toggle.gif\' title=\'$[toggle]\' /></a>');
Added lines 61-64:
* Default template file is [@pub/skins/pmwiki/pmwiki.tmpl@] but you can make a copy of the pmwiki skin avoiding it to be overwritten during the next pmwiki upgrade, see http://www.pmwiki.org/wiki/PmWiki/SkinTemplates)
* Don't forget to enable javascript in your browser! 

Changed lines 70-73 from:
NOTE: as [[http://www.pmwiki.org/wiki/Cookbook/Toggle|toggle.php]] is currently implemented, does not degrade gracefully when JS is disabled. see notes and patch @  Cookbook:Toggle-Talk


to:
NOTE: as [[http://www.pmwiki.org/wiki/Cookbook/Toggle|toggle.php]] is currently implemented, it does not degrade gracefully when JS is disabled (eg, hidden text remains hidden with no easy way to view, outside of page-source). See notes and proposed patch @ Cookbook:Toggle-Talk

Changed lines 84-85 from:

to:
Cookbook:GuiEdit

Changed line 88 from:
[[!Programming]] [[!javascript]] [[!php]] [[!pmwiki]] [[!cookbook]]
to:
[[!Programming]] [[!javascript]] [[!php]] [[!pmwiki]] [[!cookbook]] [[!editing]]
 
 
September 13, 2009, at 06:57 PM by OtherMichael - add a button to easily add toggle-markup to your pmwiki pages (page creation)
Added lines 1-86:
(:description homepage for pmToggleEdit recipe for PmWiki:)
(:title pmToggleEdit:)
>>recipeinfo<<
Summary: easier addition of toggle-markup.
Version: 1.0 September 13, 2009
Prerequisites: PmWiki 2, Cookbook:Toggle
Status: beta
Maintainer: [[~OtherMichael]]
Categories: [[!Editing]] [[!Layout]]
(:if exists [[{$Name}-Talk]]:)Discussion: [[{$Name}-Talk]](:if:)
>><<
!! Questions answered by this recipe
How can I easily add toggle markup when editing pages?
How can I add a toggle-button to the edit-gui-buttons?

pmToggleEdit adds a button to the edit-bar for easier addition of toggle-markup.

Requires the [=PmWiki Cookbook=] recipe [[Cookbook:Toggle|Toggle]] to be enabled.


!!Basic usage

# edit page
# highlight region
# click the button that looks like a window-shade: http://www.xradiograph.com/wrottings/wiki/pub/guiedit/toggle.gif


Output will look something like:

(:markup:)
(:toggle id="tog1252880238887" show="Show message" init=hide button=1:)
(:div1252880238887 id="tog1252880238887" style="border:1px solid #999; padding;5px;":)
toggle this text
(:div1252880238887end:)
(:markupend:)


By default, the text is hidden, and the show message is simply "Show message". A simple border-style has also been included. To ensure that divs can be safely toggled, the [@(:div@]''[@n@]''[@:)...(:div@]''[@n@]''[@end:)@] markup has been used. A unique id and div-number is assigned using on the JavaScript [@Date.getTime()@] function.


!!Installation

Attach:pm-toggle-edit.zip

add to [@config.php@]:

(:source lang=php:)
$GUIButtons['toggle'] = array(90, '', '', '',
  '<a href=\"#\" onclick=\"pmAddtoggle();\"><img src=\'$GUIButtonDirUrlFmt/toggle.gif\' title=\'$[toggle]\' /></a>');
(:sourceend:)


copy [@toggle.gif@] to [@pub\guiedit\@]

copy [@pm-toggle-edit.js@] to [@pub\@]

add to your skin (eg, [@pub/skins/triad/skin-triad.tmpl@]) within the [@<head>...</head>@] section:
(:source lang=php:)
<script type="text/javascript" src="$FarmPubDirUrl/pm-toggle-edit.js"></script>
(:sourceend:)


!! TODO - further development
The use of css for styling would be preferable to the hard-coded style currently included.


!! [=Unobtrusive JavaScript toggle=]
NOTE: as [[http://www.pmwiki.org/wiki/Cookbook/Toggle|toggle.php]] is currently implemented, does not degrade gracefully when JS is disabled. see notes and patch @  Cookbook:Toggle-Talk



!! Button template
I've found it useful to keep a blank 22x22 button template lying around for adding new entries.
It's included in [[Attach:pm-toggle-edit.zip|pm-toggle-edit.zip]], but looks like http://www.xradiograph.com/wrottings/wiki/pub/guiedit/button-template-22x22.gif

Hrm. Pretty boring, yeah? Use your imagination, and start filling it up.

See more buttons and ideas at Cookbook:GuiEdit


!! [[#SeeAlso]] See Also
Cookbook:Toggle


!! [[#Categories]] Category tags
[[!Programming]] [[!javascript]] [[!php]] [[!pmwiki]] [[!cookbook]]