The Un-Official Proxomitron Forum
Drag-and-Drop Resizable Flash... - Printable Version

+- The Un-Official Proxomitron Forum (https://www.prxbx.com/forums)
+-- Forum: Proxomitron Filters (/forumdisplay.php?fid=38)
+--- Forum: Website Customization (/forumdisplay.php?fid=9)
+--- Thread: Drag-and-Drop Resizable Flash... (/showthread.php?tid=1158)

Pages: 1 2 3 4 5 6 7 8


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Nov. 30, 2008 10:22 PM

looking forward to test driving (won't be 'til 'morrow or so)...
many thanks...


RE: Drag-and-Drop Resizable Flash... - z12 - Nov. 30, 2008 10:25 PM

ProxRocks Wrote:hope that helps, i'm not 100% sure if that's what you were asking for or not...

Wasn't quite what I was looking for (the acutal filter replace code) but no problem. Smile!

Code:
here's the match-replace with the resize div inside the textarea:
<div class="resizeMe" id="ResizeDiv">...</div>

The \1 seems to be missing on the class and id attributes.
That will break the script.
I would also put in the \2 on the closing div.

Code:
and here's the match-replace with the resize div within the span encasing the textarea:
<span class=\"resizeMe\" id=\"ResizeDiv\" style=\"display:none\">

It appears the class and id attribute values are reversed.
This would cause problems for the resize script.

I stuck this into the 2nd span and the toggle still worked.
Code:
class=\1ResizeDiv\1 id=\1resizeMe\1

BTW, when I clicked on the js link, ?prx-command=dbug.. got sent along as I don't uses sidki's config. Smile!
oops

Oddysey Wrote:Go here: NirSoft's Toggle Flash proggie, and see if that doesn't do exactly what you want

Not quite, but I appreciate the thought. Smile!
I prefer proxo to browser specific add-ons that don't quite do what I want.

lnminente Wrote:Ask whatever you want

Thanks for the code. Does it work here: http://www.beside.ca/

z12


RE: Drag-and-Drop Resizable Flash... - lnminente - Nov. 30, 2008 10:42 PM

Sadly no, my toggle will not work for objects writen by javascripts Sad


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Nov. 30, 2008 11:11 PM

(Nov. 30, 2008 10:25 PM)z12 Wrote:  Wasn't quite what I was looking for (the acutal filter replace code) but no problem. Smile!
oops... that answers my in-the-mind question, "how can i post the replacement code for an .swf that is failing, the match didn't match, so the replace isn't replacing... lol...

Quote:The \1 seems to be missing on the class and id attributes.
That will break the script.
I would also put in the \2 on the closing div.
Eureka! that seems to have done the trick!
what is your script-knowledge preference, btw - to run the class/id's within the textarea tag? or to run them within the span encasing the textarea tag?
edit: nevermind, i'm seeing that i "have to" run it within the textarea tag else some resizable's "vanish" when i resize the top or left borders...

Quote:I stuck this into the 2nd span and the toggle still worked.
Code:
class=\1ResizeDiv\1 id=\1resizeMe\1
that def. did NOT work for me, had to revert to pre-swap...

Quote:BTW, when I clicked on the js link, ?prx-command=dbug.. got sent along as I don't uses sidki's config. Smile!
oops
oops #2 - and after deleting all of the allow-script-if-block-by-default keywords in the links of the posted flash sites, lol...



many thanks again...
i'll run non-swapped \1|\2 class|id fixes for a few days (within the textarea tag) and see if i bump into anything else...

ps - where does this leave us with the document.onmouse(down|up|move) issue? i'm def. seeing some "odd behavior" here-and-there...
(ie, i drag the browser's scrollbar on the right of this-here forum and "everything" starts resizing, lol...)



again, many MANY thanks...


RE: Drag-and-Drop Resizable Flash... - z12 - Dec. 02, 2008 12:24 PM

ProxRocks Wrote:
z12 Wrote:I stuck this into the 2nd span and the toggle still worked.
Code:
class=\1ResizeDiv\1 id=\1resizeMe\1
that def. did NOT work for me, had to revert to pre-swap...

My bad. I wasn't seeing or thinking straight.

ProxRocks
many thanks again...
i'll run non-swapped | class|id fixes for a few days [color=green Wrote:
(within the textarea tag)[/color] and see if i bump into anything else...

Can you post the filter your using?
I'd like to run it so I can get a better idea of what your seeing.
Before I redo the script so it'll work with Firefox, I'd like to see what it's supposed to do.

ProxRocks Wrote:ps - where does this leave us with the document.onmouse(down|up|move) issue? i'm def. seeing some "odd behavior" here-and-there...
(ie, i drag the browser's scrollbar on the right of this-here forum and "everything" starts resizing, lol...)

I spent some time looking over the script, what your seeing doesn't surprise me.

I spent some time yesterday playing around to see if I could get Graycode's method to work, that is, put the className on the object so it could be resized directly without a using a wrapping span or div.

I had good results injecting the object back in with Firefox, but IE is doing some odd things.
When I initially toggle the object on with IE, it loads the flash twice. If I warp the object in a div it doesn't do this.

IE was also doing some odd things on USAToday on the snapshot page.
That page has two flash objects. One always toggled on/off as expected.
The other would toggle, download the flash but not display it.
It looked to be an issue with a reply the flash requested after loading.

If the filter was not enabled, the flash requested one page, but when toggled, it requested a different page.
That page would return a reply without a content-type header.
I'm not sure what to think of that. Firefox worked ok.

Anyway, before I dived deeper into script event handling I wanted to see what options we had as far as putting the object back in.
If I can't get IE to toggle on without downloading the flash twice, we may have no choice but to wrap it in a div or some other container.

z12


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Dec. 02, 2008 01:02 PM

(Dec. 02, 2008 12:24 PM)z12 Wrote:  Can you post the filter your using?

here is what i'm currently running:
Code:
Name = "Header Top Inject: User CSS - Resizable Div [add]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 16
Match = "(^(^<ProxHdrTop>))$STOP()"
Replace = "<style type="text/css">\n"
          "#ResizeDiv {\n"
          "  #overflow: auto;\n"
          "  width: 96%;\n"
          "  height: 96%;\n"
          "  #margin: auto;\n"
          "  border: 4px double lightblue;\n"
          "  #background: lightblue;\n"
          "  #color: black;\n"
          "  padding: 2px;\n"
          "  position: relative;\n"
          "  }\n"
          "</style>\n"

Name = "Header Top Add: User JS Code - z12 Toggle Objects [add]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 16
Match = "(^(^<ProxHdrTop>))$STOP()"
Replace = "\t<script type="text/javascript" src="http://local.ptron/My_HTML/z12_HTML/z12.js">\r\n\t</script>\r\n"

Name = "Header Top Add: User JS Code - Resizable Div [add]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 16
Match = "(^(^<ProxHdrTop>))$STOP()"
Replace = "\t<script type="text/javascript" src="http://local.ptron/My_HTML/ErikArvidsson_HTML/genresize.js">\r\n\t</script>\r\n"

Name = "Toggle: Object {4.d.3.2} 20081118 {z12} [add] [test]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Limit = 5120
Match = "("
        "("
        "$NEST(<object(\s|"),"+</object >)|"
        "<object(^[a-z])(*/ object >&&(^*<object)*)|"
        "<embed(^[a-z])*>(^ [=a-z0-9])( </embed >)+"
        ")\0(^ </object >)(^ </textarea>)"
        "&&"
        "(^*(type=$AV(image/*)))"
        "*)"
        "$SET(flash=$GET(flash)$DTM(t))"
        "(($TST(script=*))$SET(1=\\")$SET(2=\\)|$SET(1=")$SET(2=))"
Replace = "<span class=\1flash$GET(flash)\1 style=\1display:inline\1>"
          "<a title=\1Play Media\1 onclick=\1PrxObjToggle(this)\2;return false\2;\1 onmouseover=\1PrxTitleObj(this)\1>"
          "<img alt=\1Toggle Media\1 src=\1http://local.ptron/My_HTML/43unite_HTML/player_play.png\1 style=\1border-style:none\1 /><\2/a>"
          "<br />"
          "<\2/span>"
          "<span class=\1flash$GET(flash)\1 style=\1display:none\1>"
          "<textarea style=\1display:none\1><div class=\1resizeMe\1 id=\1ResizeDiv\1>\0<\2/div><\2/textarea>"
          "<\2/span>"

no changes to genresize.js, z12.js attached...
the ResizeDiv width/height is, i'm hoping, only "temporary"...
so far, i really do like Graycode's method the best, as for resizing...
i just can't do without the toggle though, lol...


i've been "trying" some other methods, but the "base" of those attempts is an old LWC filter which i can't get to work anymore...

maybe it will give you some added ideas, or perhaps you can see why it isn't matching anymore...

Code:
Name = "Object/Embed Killer {LWC} [add]"
Active = TRUE
Bounds = "<object*</object>|<embed*>( </embed>|)"
Limit = 2700
Match = "[^>]++(codebase|type|classid)=*"
        "&(*<param (* name=$AV(movie|src|url)|"
        " value=$AVQ((")\0(((*\?)\1*)|\1)\2$TST(\0)))+{2}|"
        "*src=$AVQ((")\0(((*\?)\1)*|\1)\2$TST(\0)))"
        "&(*(<param name=$AV(flashvars) value|flashvars)="
        "$AV(\3)$SET(4=?)$SET(5=\4\3)|)"
Replace = "<a href=\0\2\5\0>[\1\4]</a>"

which "used to" work for me in this form:
Code:
Name = "Block & Fetch: Object/Embed Killer {LWC} (modified) [add]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))"
Bounds = "<object*</object>|<embed*>( </embed>|)"
Limit = 2700
Match = "[^>]++(codebase|type|classid)=*"
        "&(*<param (* name=$AV(movie|src|url)|"
        " value=$AVQ((")\0(((*\?)\1*)|\1)\2$TST(\0)))+{2}|"
        "*src=$AVQ((")\0(((*\?)\1)*|\1)\2$TST(\0)))"
        "&(*(<param name=$AV(flashvars) value|flashvars)="
        "$AV(\3)$SET(4=?)$SET(5=\4\3)|)"
        "&*width=$AV(\6)*&*height=$AV(\7)*"
Replace = "<span class="ProxIframe ProxToggle" style="display:inline">"
          "<a class="ProxToggle&#x20;ProxTogO-A" href="javascript://""
          " onclick="prxO.oInt.inToggleA(this.parentNode);prxO.oInt.inToggleC(this.parentNode.nextSibling);""
          " target=_self>Fetch</a>"
          "<a class="ProxToggle&#x20;ProxTogO-A" href=\0\2\5\0 title="Entire&nbsp;Window" target="_top">Object/Embed</a>"
          "</span>"
          "<iframe class="ProxIframe" style="display:none;" width="\6" height="\7" src="about:blank" longdesc=\0\1\4\0></iframe>"



RE: Drag-and-Drop Resizable Flash... - z12 - Dec. 02, 2008 09:23 PM

ProxRocks Wrote:the ResizeDiv width/height is, i'm hoping, only "temporary"...

Yeah, that 100% right off the bat doesn't work so nice.
From what I've seen, it would be better to use the initial size until you decide to change it.

ProxRocks Wrote:i've been "trying" some other methods, but the "base" of those attempts is an old LWC filter which i can't get to work anymore...

maybe it will give you some added ideas, or perhaps you can see why it isn't matching anymore...
...snip code...

Ahh... the good old days before everybody started using js to put in flash.
Which is the root of the problem your having with this filter.

Take a look at the popular swfobject.js. Many of the sites on your "list" use it.
Here's some code snippets from one version:

Code:
<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")
+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>

Code:
<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"
"+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>

Good luck trying to match the file name or size attributes in that code. Smile!

In the replacement text there's some potential issues.
Most of the replacement text is not js friendly.
Characters that are js sensitive aren't escaped.

In other places, \0 which was captured in the match, is used for the replacement attribute quote.
It seems like a good idea and I've tried this method myself.
But when js is involved, it's just not reliable.

Now days, if I suspect a filter might match in js, I include a $TST for js.
That way, an escape variable or two can be preset accordingly.
In the Replacement Text, js sensitive characters are preceded by an escape variable.

I'm a bit leery of using character entity references in the replacement text.
The trailing semicolon is my main concern.

For the most part, I've had good luck variable escaping [";'] replacement characters.
No doubt I'll find some js that breaks because I didn't escape some other character.
I'm betting it's going to be one of these characters: [()<>].

As for the idea part, maybe adding some variation of match like this:
Code:
&*(swf|shockwave|flash|clsid:blah...blah)

We could stick it in there, if something doesn't match, we should see it. Smile!

z12


RE: Drag-and-Drop Resizable Flash... - z12 - Dec. 03, 2008 12:20 AM

I find it odd that the css is using #ResizeDiv instead of .resizeMe
As far as I can tell, the css only applies to elements with an id of ResizeDiv.
I would think you would want the css to apply to any element with the className of .resizeMe
Then any id could be used, which is good.
hmm...

z12


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Dec. 07, 2008 12:23 AM

i "think" i might have found a way around the onmouse(down|up|move)...
http://www.twinhelix.com/javascript/dragresize/
http://www.twinhelix.com/cgi-bin/forum.pl/dragresize

in-action here: http://timegadget.logicsmiths.co.uk/cpanel/gadget.php


edit: here's a better demo, from the author himself - http://www.twinhelix.com/javascript/dragresize/demo/


RE: Drag-and-Drop Resizable Flash... - z12 - Dec. 07, 2008 03:32 PM

Nice find, I'll check it out.
I've been working on the script, but it still has issues.
Maybe this will lead to a eureka moment for me. Smile!

z12


RE: Drag-and-Drop Resizable Flash... - z12 - Dec. 09, 2008 03:28 AM

I got a preliminary version the dragresize script working.
I'll try to get some code posted soon for testing.

z12


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Dec. 09, 2008 10:15 AM

Awesome! Can't wait!...
And many thanks in advance, looking forward to checking it out...


RE: Drag-and-Drop Resizable Flash... - z12 - Dec. 09, 2008 05:00 PM

I attached a zip file with the code.
Be sure to check out the readme.

Note to all:
If your looking for a filter you can use, move along.
This is not the code your looking for.
It's experimental, not ready for prime-time js for the most part.
Most likely, it will end up in the Recycle Bin.

z12


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Dec. 09, 2008 09:17 PM

testing... 1.. 2.. 3.. testing...

got the "toggle/resize pack" loaded and test-driving as we speak...
i've notice a bug here or there, give me a day or two with it and i'll report back on it...


RE: Drag-and-Drop Resizable Flash... - ProxRocks - Dec. 09, 2008 10:55 PM

i'm unable to drag on the borders until i define the left/top as in:
Code:
Name = "Toggle Flash Resize 1.3.r.1 {z12} (modified) [add]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Limit = 5120
Match = "("
        "("
        "$NEST(<object(\s|"),"+</object >)|"
        "<object(^[a-z])(*/ object >&&(^*<object)*)|"
        "<embed(^[a-z])*>(^ [=a-z0-9])( </embed >)+"
        ")\0(^ </object >)(^ </textarea>)"
        "&&*"
        "&(*(swf|shockwave|flash|clsid:D27CDB6E-))"
        ")"
        "$SET(tfr=$GET(tfr)1)"
        "(($TST(script=*))$SET(1=\\")$SET(2=\\)|$SET(1=")$SET(2=))"
Replace = "<span class=\1flash_$GET(tfr)\1 style=\1display:inline\1>"
          "<a title=\1Play Media\1 onclick=\1PrxObjToggle(this)\2;return false\2;\1 onmouseover=\1PrxTitleObj(this)\1>"
          "<img alt=\1Toggle Media\1 src=\1http://local.ptron/My_HTML/43unite_HTML/player_play.png\1 style=\1border-style:none\1 />"
          "<\2/a><br />"
          "<\2/span>"
          "<span class=\1flash_$GET(tfr)\1 style=\1display:none\1>"
          "<textarea style=\1display:none\1>"
          "<div class=\1drsElement\1 style=\1left: 0px; top: 0px; text-align: center\1>"
          "<div class=\1drsMoveHandle\1>Drag & Resize<\2/div>\0<\2/div>"
          "<\2/textarea>"
          "<\2/span>"

ie, this line: <div class=\1drsElement\1 style=\1left: 0px; top: 0px; text-align: center\1>
i also put the textarea within a span intead of a div...

still "fiddling on the hot tin roof"...