Post Reply 
flash to image
Aug. 01, 2006, 08:02 PM
Post: #16
RE: flash to image
I'm not positive, but I think it's this filter:

Mark: Inline Scripts 6.02.04 (fail) [srl sd jd] (d.r)

If so, use this test instead:

$TST(script=*)

Edit: fixed test

Mike
Add Thank You Quote this message in a reply
Aug. 01, 2006, 08:08 PM
Post: #17
RE: flash to image
FYI, here's the filter the filter I use to set/clear bScript:

Code:
[Patterns]
Name = "Mark: Script Tags {R}"
Active = TRUE
URL = "$TST(bHTM=1)"
Limit = 256
Match = "(<script(\s*|)>$SET(bScript=1)|"
        "</script > (^(^[^\)"';\+]))$SET(bScript=))"
        "&(^?)"

Note: bHTM=1 if $TYPE(htm) (for the most part)

Mike
Add Thank You Quote this message in a reply
Aug. 02, 2006, 10:51 AM
Post: #18
RE: flash to image
Couple more filter tweaks, modified bounds and dropped trying to match quotes.

Code:
[Patterns]
Name = "Flash to Img II 2 (js)"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))"
Bounds = "(<object*/object>|<embed(*/embed >|*> (^[a-z0-9])))"
Limit = 4096
Match = "\1((shockwave|clsid:D27CDB6E-AE6D-11cf-96B8-444553540000)*)\2"
        "&*(src|data|movie[^a-z]+value)=$AV(\6)"
        "&((^$TST(pfo=*))$SET(pfo=pfo)|)$SET(pfo=$GET(pfo)1)"
Replace = "<img id=\3$GET(pfo)\3 style=\3cursor:pointer\3 title=\3Run Flash: \6\3"
          " src=\3http://local.ptron/z12_htm/flash_rune.gif\3"
          " onclick=\3proxo.imgToFlash(this.id)\3"
          " /><!--\1\2-->"

The test for bScript has been removed.

I left \3 in the replacement text for right now, incase I can get the quote matching to work.

Anybody got a good way of matching quotes for replacement attributes, in particular, when matching in js?

Mike
Add Thank You Quote this message in a reply
Aug. 02, 2006, 06:07 PM
Post: #19
RE: flash to image
Mike;
Quote:hmm... so much for formating
Use the "Formated php code" tags. I know, it looks dorky, and unintuitive, but it leaves your code formatting intact, like this:

PHP Code:
if(typeof(proxo)=='undefined'){
  
proxo = {};
  
  
// proxo flashy object constructor
  
proxo.flashyObj = function(pfoId,flashSettings){
    
    
this.embed = (document.all&&!window.opera) ? true false// true for ie, moz & opera false
    
this.attribs = new Object();
    
this.params = new Object();
    
    
this.parseSettings = function(){
      var 
ioptionsnv_pairscur_nvnamevalue;
      
options = (this.embed) ? this.attribs this.params;
      
nv_pairs flashSettings.split("&prx=");
      while(
nv_pairs.length>1){
        
cur_nv nv_pairs.pop();
        
cur_nv.indexOf("=");
        
name cur_nv.substr(0,i).toLowerCase();
        
value cur_nv.substr(++i);
        if(
name.search(/^(type|quality|menu|play|loop|pluginspage|codebase|classid)/)==-1){
          if(
name.search(/^(src|movie|data)/)!=-1){
            if(
this.embed){
              
this.attribs.src value;
            }else{
              
this.attribs.data value;
              
this.params.movie value;
            }
          }else if(
name.search(/^(name|id)/)!=-1){
            if(
this.embed){
              
this.attribs.name value;
            }else{
              
this.attribs.id value;
            }
          }else if(
name.search(/^(height|width)/)!=-1){
            
this.attribs[name] = value;
          }else if(
name.search(/^[a-z]+$/)!=-1){
            
options[name] = value;
          }
        }
      }
      
// set default values
      
this.attribs.type "application/x-shockwave-flash";
      
options.quality "autolow";
      
options.menu "true";
      
options.play "true";
      
options.loop "false";
    }
    
    
this.insertFlash = function(pn){
      var 
inp;
      if (
typeof pn == 'string')pn document.getElementById(pn);
      
pn pn.parentNode;
      while(
pn.hasChildNodes()) {
        
pn.removeChild(pn.firstChild);
      }
      
document.createElement((this.embed) ? "embed" "object");
      for(
i in this.attribs){
        
n.setAttribute(i,this.attribs[i]);
      }
      if(!
this.embed){
        for (
i in this.params){
          
document.createElement("param");
          
p.setAttribute("value",this.params[i]);
          
p.setAttribute("name",i);
          
n.appendChild(p);
        }
      }
      
pn.appendChild(n);
      
// alert(pn.innerHTML);
    
}
    
    
this.parseSettings();
    
this.insertFlash(pfoId); 
  }



HTH!


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
Aug. 02, 2006, 06:32 PM
Post: #20
RE: flash to image
that works a little better...

aside from this
Code:
// alert(pn.innerHTML);
turning into
PHP Code:
// alert(pn.innerHTML); 


z12/Mike - a few coals hit the fire, I'll get back to the Flash filters tomorrow...
Add Thank You Quote this message in a reply
Aug. 03, 2006, 01:03 AM
Post: #21
RE: flash to image
Oddysey Wrote:Use the "Formated php code" tags.

Thanks for the tip, that looks much better.


ProxRocks Wrote:a few coals hit the fire,

Had a few myself today, seemed like a Monday for awhile.

Didn't get much done on the filter today. Did discover that removing the quotes in the replacement text causes the movie title to not display on most sites when hovering over the flash_rune image.

Overall, the filter in the flash_filter_3 attachment is working the best for me. I would like to simplify the quote matching logic though. Maybe a list could clean it up. That could be useful for other filters as well.

Mike
Add Thank You Quote this message in a reply
Aug. 03, 2006, 07:40 PM
Post: #22
RE: flash to image
Attached is the latest filter version, trying a $LST expression for matching quotes plus a few other tweaks.

I think the $LST expression could be removed and things would work, but I want those quotes in the replacement text.

BTW, I tried using the PHP tag but the code didn't display correctly. Perhaps I didn't do something correctly.

Mike


Attached File(s)
.txt  flash_filter_4.txt (Size: 1.53 KB / Downloads: 861)
Add Thank You Quote this message in a reply
Aug. 04, 2006, 12:46 PM
Post: #23
RE: flash to image
Since there are probably serveral sites that use adobe's AC_RunActiveContent.js to add flash via external js, I made a filter hack to make it compatible with the "Flash to Img" filter.

I'm attaching it as the php formating tag does bad things to it.

Mike


Attached File(s)
.txt  Adobe_Flash_JS_Hack.txt (Size: 942 bytes / Downloads: 836)
Add Thank You Quote this message in a reply
Aug. 06, 2006, 03:20 PM
Post: #24
RE: flash to image
Filter update, dropped the img id attribute which simplified things a bit.

Attachement contains all necessary filters ,js and $LST text.

Mike


Attached File(s)
.txt  flash_filter_5.txt (Size: 2.16 KB / Downloads: 829)
Add Thank You Quote this message in a reply
Aug. 09, 2006, 01:29 AM
Post: #25
RE: flash to image
Filter update, dropped the Adobe js hack web filter, switched to intercepting document.write(). Catches alot of flash that got by the Adobe filter.

Attachment contains all necessary filters ,js and $LST text.

Mike


Attached File(s)
.txt  flash_filter_6.txt (Size: 3.29 KB / Downloads: 857)
Add Thank You Quote this message in a reply
Oct. 02, 2006, 08:43 AM
Post: #26
RE: flash to image
Filter update, dropped the $LST, lots of other tweaks.

For the time being, I've dropped the flash check from the web filter.

As a result, the web filter now replaces all object/embed tags with an image.

Attachment contains the web filter and js.

Mike


Attached File(s)
.txt  flash_filter_7.txt (Size: 3.54 KB / Downloads: 849)
Add Thank You Quote this message in a reply
Oct. 03, 2006, 06:08 PM
Post: #27
RE: flash to image
I'm getting this to convert object/embed tags with the image, but isn't something supposed to happen when I hover over or click the image?
Add Thank You Quote this message in a reply
Oct. 03, 2006, 11:28 PM
Post: #28
RE: flash to image
ProxRocks Wrote:isn't something supposed to happen when I hover over or click the image?

Yep. You should see the title appear on mouseover. If you click the image, the object code should execute, replacing the image.

Are you injecting the javascript in the document head and is js enabled?

The js is what does the real work.

BTW, made a minor tweak to the matching exepression of the web filter:
PHP Code:
Match "\#"
        "&(*(" "|\\"
|= " \+|\()$SET(1=\\")|*\s(codebase|type|src)=(")\1)|$SET(1=")


Mike
Add Thank You Quote this message in a reply
Oct. 04, 2006, 11:10 AM
Post: #29
RE: flash to image
z12 Wrote:Are you injecting the javascript in the document head and is js enabled?

I'm inserting via:
Code:
Name = "Header Top Inject: Flash to Image JS {z12} [add]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 16
Match = "(^(^<ProxHdrTop>))$STOP()"
Replace = "<script type="text/javascript">"
          "--- your script here ---"
          "</script>\n"
and js is enabled...

js aside, I'm unable to get the mouseover title in IE, Firefox, or Opera...


I'm going to giver 'er another try and shall report back momentarily...


follow-up: confirmed, I cannot even get the title to show on hover... IE, Firefox, or Opera... Merging in with three different configs... the js IS being inserted and the flash_rune (the image I use) IS being displayed...
Add Thank You Quote this message in a reply
Oct. 04, 2006, 12:10 PM
Post: #30
RE: flash to image
Ok, couple of things.

First, there are some problems with the titleFlash function.

There needs to be a parenthesis around the file name attributes
like so:
PHP Code:
(movie|src|url

There is also a problem when there is a space in the filename or when the "name" "value" attributes are reversed in the param tag. I'm going to have to put my thinking cap on & have some more coffee to fix that.

It looks like a rewrite for that function. For now, either remove the mouseover attribute in the web filter or wait for my fix. The rest of the filter should still work.

Also, I'm injecting the code via a external js file. This might be required.
Give that a shot.

Mike
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: