Hello.

I use this as a bookmark in Safari. I have used RCDefaults, so the txtmt 
protocol triggers TextWrangler.

javascript:(function(){var%20pgsrc;try{pgsrc=window.frames[0].location.toString();}catch(err){pgsrc=window.location.href.toString();}var%20file_loc=pgsrc.indexOf('file://');if(file_loc==0){var%20segm_loc=pgsrc.indexOf('#');if(segm_loc>0){var%20tmpS=pgsrc.substr(0,segm_loc);pgsrc=tmpS;}var%20twCmd="txmt://open/?url="+pgsrc;window.open(twCmd,"_self");}})();

The code looks like this, before it is "minified", and it is made to work 
with my personal system, where I have pages inside a frame, in index.html. 

Version 2: Checks if the file protocol is in use, and chops off any segment 
identifier

(function () {
        var pgsrc ;
        try {
                pgsrc= window.frames[0].location.toString();
        }
        catch( err ) {
                pgsrc = window.location.href ;
        }
        var file_loc = pgsrc.indexOf('file://') ;
        if ( file_loc == 0 ) {
                var segm_loc = pgsrc.indexOf('#');
                if (segm_loc > 0 ) {
                        // we have a segment identifier  on the end of the url.
                        var tmpS = pgsrc.substr(0,segm_loc) ;
                        pgsrc = tmpS ;
                }
                var twCmd = "txmt://open/?url="+pgsrc ;
                window.open(twCmd ,"_self");

        }
})();

 


torsdag 25. desember 2014 18.22.46 UTC+1 skrev Rich F følgende:
>
> It's interpreted, then just reflowed.  No replacements other than classes 
> and styles.  Those parameters sent to Tidy can be changed.  
>
> The point of this isn't to get my server code, but to grab the odd page 
> and open it up in BBEdit to peruse the DOM, etc.  
>
> On Tuesday, December 23, 2014 7:19:11 PM UTC-5, San wrote:
>>
>> I use a Firefox extension called "View Source With" to open the current 
>> Firefox URL into BBEdit. Unlike other "view source" approaches, this 
>> attempts to open the actual server source (assuming you have permission to 
>> get to it, such as with your own development server), rather than create a 
>> clone -- often of the browser's *interpretation* of the source -- as 
>> most "view source" methods do.
>>
>> I'm curious as to how your script compares to that. I don't know Ruby, 
>> but are you cloning the source, or are you attempting to access the actual 
>> server source file? I'm guessing it's the former, because it looks like 
>> you're doing some reformatting in your code, but I can't tell for sure.
>>
>>
>> 

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to