Hi all, Is it possible to use images instead of plain text for the "OK" and "Cancel" controls? Thanks, Best Regards, EJC _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
The image for the ok button was easy if I remember, but the cancel was a little trickier. Deco On Feb 8, 2006, at 2:31 PM, Ed C. wrote:> Hi all, > > Is it possible to use images instead of plain text for the "OK" and > "Cancel" controls? > > Thanks, > Best Regards, > EJC > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Can you be more specific? For example, when I tried: cancelText: "img tag here" It displayed the HTML Escaped text, and not the img ;) On 2/8/06, Deco Rior <decorior@tennissource.net> wrote:> The image for the ok button was easy if I remember, but the cancel > was a little trickier. > > Deco > On Feb 8, 2006, at 2:31 PM, Ed C. wrote: > > > Hi all, > > > > Is it possible to use images instead of plain text for the "OK" and > > "Cancel" controls? > > > > Thanks, > > Best Regards, > > EJC > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Yes that was the problem. So it required some more surgery further up where the cancel is defined. We did not complete it since it seemed like major surgery for such a small thing. :-( and we did not want to make such a big change to the library. But I can ask the guy who was doing this tomorrow what happened. Deco On Feb 8, 2006, at 4:26 PM, Ed C. wrote:> Can you be more specific? > > For example, when I tried: > > cancelText: "img tag here" > > It displayed the HTML Escaped text, and not the img ;) > > On 2/8/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: >> The image for the ok button was easy if I remember, but the cancel >> was a little trickier. >> >> Deco >> On Feb 8, 2006, at 2:31 PM, Ed C. wrote: >> >>> Hi all, >>> >>> Is it possible to use images instead of plain text for the "OK" and >>> "Cancel" controls? >>> >>> Thanks, >>> Best Regards, >>> EJC >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Do either of you have a sample (live site) using InPlaceEditor? I''ve never used it and I don''t see a demo on http://script.aculo.us/. Todd
On 2/8/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote:> Do either of you have a sample (live site) using InPlaceEditor? I''ve > never used it and I don''t see a demo on http://script.aculo.us/.Nevermind. I found that the documentation of InPlaceEditor had samples included. That site (script.aculo.us) is very inconsistant ... just like the InPlaceEditor! It''s using an input[type="submit"] button for OK but an a (anchor) for the Cancel? I can''t imagine any scenarios where that would be considered a "good interface". I was going to suggest that even if the InPlaceEditor didn''t support the use of images directly, that you could make it work with CSS, but it would be fugly considering that the "buttons" are created using different HTML elements. Just for grins, here''s a(n untested) patch to create a cancelButton (as opposed to the cancelLink) which can be styled to include an image. #<formId>-inplaceeditor .ipe_ok {} #<formId>-inplaceeditor .ipe_cancel {} Todd _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
It's on the Wiki ... http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor On 2/8/06, Todd Ross <rails-spinoffs@brainsick.com> wrote:> Do either of you have a sample (live site) using InPlaceEditor? I've > never used it and I don't see a demo on http://script.aculo.us/. > > Todd > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Yep weird isn''t it! I will try the patch On Feb 8, 2006, at 7:58 PM, Todd Ross wrote:> On 2/8/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote: >> Do either of you have a sample (live site) using InPlaceEditor? I''ve >> never used it and I don''t see a demo on http://script.aculo.us/. > > Nevermind. I found that the documentation of InPlaceEditor had > samples included. That site (script.aculo.us) is very inconsistant > ... just like the InPlaceEditor! > > It''s using an input[type="submit"] button for OK but an a (anchor) for > the Cancel? I can''t imagine any scenarios where that would be > considered a "good interface". > > I was going to suggest that even if the InPlaceEditor didn''t support > the use of images directly, that you could make it work with CSS, but > it would be fugly considering that the "buttons" are created using > different HTML elements. > > Just for grins, here''s a(n untested) patch to create a cancelButton > (as opposed to the cancelLink) which can be styled to include an > image. > > #<formId>-inplaceeditor .ipe_ok {} > > #<formId>-inplaceeditor .ipe_cancel {} > > Todd > <inPlaceEditor.patch> > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
How did you create that patch? I can''t get `diff` to make patches which include the preceeding and succeeding lines, like cvs diff does. -Rob Todd Ross wrote:>On 2/8/06, Todd Ross <rails-spinoffs-25kFIyuv2iRiLUuM0BA3LQ@public.gmane.org> wrote: > > >>Do either of you have a sample (live site) using InPlaceEditor? I''ve >>never used it and I don''t see a demo on http://script.aculo.us/. >> >> > >Nevermind. I found that the documentation of InPlaceEditor had >samples included. That site (script.aculo.us) is very inconsistant >... just like the InPlaceEditor! > >It''s using an input[type="submit"] button for OK but an a (anchor) for >the Cancel? I can''t imagine any scenarios where that would be >considered a "good interface". > >I was going to suggest that even if the InPlaceEditor didn''t support >the use of images directly, that you could make it work with CSS, but >it would be fugly considering that the "buttons" are created using >different HTML elements. > >Just for grins, here''s a(n untested) patch to create a cancelButton >(as opposed to the cancelLink) which can be styled to include an >image. > >#<formId>-inplaceeditor .ipe_ok {} > >#<formId>-inplaceeditor .ipe_cancel {} > >Todd > > >------------------------------------------------------------------------ > >Index: controls.js >==================================================================>--- controls.js (revision 3533) >+++ controls.js (working copy) >@@ -461,7 +461,7 @@ > this.options = Object.extend({ > okButton: true, > okText: "ok", >- cancelLink: true, >+ cancelButton: true, > cancelText: "cancel", > savingText: "Saving...", > clickToEditText: "Click to edit", >@@ -553,16 +553,18 @@ > if (this.options.okButton) { > okButton = document.createElement("input"); > okButton.type = "submit"; >+ okButton.className = "ipe_ok"; > okButton.value = this.options.okText; > this.form.appendChild(okButton); > } > >- if (this.options.cancelLink) { >- cancelLink = document.createElement("a"); >- cancelLink.href = "#"; >- cancelLink.appendChild(document.createTextNode(this.options.cancelText)); >- cancelLink.onclick = this.onclickCancel.bind(this); >- this.form.appendChild(cancelLink); >+ if (this.options.cancelButton) { >+ cancelButton = document.createElement("input"); >+ cancelButton.type = "button"; >+ cancelButton.className = "ipe_cancel"; >+ cancelButton.value = this.options.cancelText; >+ cancelButton.onclick = this.onclickCancel.bind(this); >+ this.form.appendChild(cancelButton); > } > }, > hasHTMLLineBreaks: function(string) { > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails-spinoffs mailing list >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >
On 2/9/06, Robin Haswell <rob-gyMb1R/nBgNh8AIihN9Rc9BPR1lH4CV8@public.gmane.org> wrote:> How did you create that patch? I can''t get `diff` to make patches which > include the preceeding and succeeding lines, like cvs diff does.I used svn diff, but if that''s not an option, you want a ''unified diff'' ... diff -u Some diff programs (Solaris) have a ''context'' flag as well. Todd