[TxMt] Re: HTML output window: JavaScrip alert() and confirm()
Hans-Jörg Bibiko
bibiko at eva.mpg.de
Thu Sep 25 11:07:21 UTC 2008
On 25.09.2008, at 12:46, Alex Ross wrote:
>
> On Sep 25, 2008, at 12:29 PM, Hans-Jörg Bibiko wrote:
>
>>> <script type="text/javascript" charset="utf-8">
>>> try {
>>> if (TextMate.system("", function (task) { })) {
>>> var __TM_confirm_Status;
>>> alert = function(s){TextMate.system('"$DIALOG" -e -p
>>> \'{messageTitle="JavaScript";informativeText="'+s+'";}\'',null);};
>>> confirm = function(s){TextMate.system('"$DIALOG" -e -p
>>> \'{messageTitle="JavaScript";informativeText="'+s
>>> +'";buttonTitles=("OK","Cancel");}\'',null).onreadoutput=function(s)
>>> {if(s==1)
>>> {__TM_confirm_Status
>>> =false}else{__TM_confirm_Status=true}};return(__TM_confirm_Status)};
>>> }
>>> } catch(e) {}
>>> </script>
>>
>> I do not know if TM 2.0 supports this, but this could be sent by TM
>> automatically if an user will show up something as HTMLoutput (?)
>
> at the very least we can add it to the HTMLOutput.show command and
> web_preview. This would take care of 99% of the cases. For other
> commands, they can do without.
Well, I would say 97% because I use these functions rarely but it
would be a step into the right direction ;)
--Hans
More information about the textmate
mailing list