• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

i'm look for feedback for the proper way to make a link function as a button

this javascript automatically fills in the web and topic fields when you click on the "link"

this should do nothing if javascript is not enabled, and it should not cause a page refresh

WN

Index: templates/moveattachment.pattern.tmpl
===================================================================
--- templates/moveattachment.pattern.tmpl       (revision 6313)
+++ templates/moveattachment.pattern.tmpl       (working copy)
@@ -23,7 +23,7 @@



-%TMPL:DEF{"movewebhelp"}%To delete an attachment move it to web *%TRASHWEB%*, topic *TrashAttachment*.%TMPL:END%
+%TMPL:DEF{"movewebhelp"}%To <a href="void:" title="Move attachment to the Trash" onclick="javascript:document.forms.rename.newweb.value='Trash'; document.forms.rename.newtopic.value='TrashAttachment'; return false;">delete</a> an attachment, mov
e it to web *%TRASHWEB%*, topic *TrashAttachment*.%TMPL:END%

I think the link should call a js function instead of putting the form.name.button.name.value in the link.

To hide the link if javascript is off, we could make use of the css and javascript functions from twisty (TWiki::Plugins/TwistyContrib). The link should have the class twikiTwistMakeVisible, and then something like:

function init () {
      
      makeVisibleElements = getElementsByClassName('twikiTwistMakeVisible');
      i = makeVisibleElements.length;
      while (i--)
      {
         removeClass(makeVisibleElements[i], 'twikiTwistMakeVisible');
      }
   
   }

-- AC


this implementation idea is superceeded by Item553 -- WN

ItemTemplate
Summary make moving an attachment to the Trash web easier
ReportedBy WillNorris
Codebase

AppliesTo Engine
Priority Enhancement
CurrentState No Action Required
WaitingFor

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2005-10-02 - WillNorris
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback