Post Reply 
[help] Google Preview...
Oct. 19, 2008, 01:39 AM
Post: #1
[help] Google Preview...
i'm trying to get the "preview function" that Grypen used to have to work with sidki-1.2.08...

for some reason, the .js doesn't seem to pass the URL ???


three filters, the first is placed directly beneath "Header Top Add: Initial JS Code 7.11.29 (ccw! !mos) [...] (d.r)" and is:
Code:
Name = "Header Top Add: User JS Code - Google Preview [add]"
Active = TRUE
URL = "(^TYPE(oth))www.google."
Limit = 16
Match = "(^(^<ProxHdrTop>))$STOP()"
Replace = "\t<script type="text/javascript">//<![CDATA[\r\n"
      "\t function GooglePrv(Gid,Gsrc,Glid,Gplid) {\r\n"
      "\t \r\n"
      "\t prxO.oInt.inToggleB(Gplid,'id','a',1);\r\n"
      "\t prxO.oInt.inToggleB(Glid,'id','a',1);\r\n"
      "\t prxO.oInt.inToggleB(Gid,'id','div',1);\r\n"
      "\t \r\n"
      "\t var Giframe = document.createElement("iframe");\r\n"
      "\t Giframe.setAttribute("src", Gsrc );\r\n"
      "\t Giframe.setAttribute("width", "95%" );\r\n"
      "\t Giframe.setAttribute("height", "300px" );\r\n"
      "\t \r\n"
      "\t document.getElementById(Gid).appendChild(Giframe);\r\n"
      "\t }\r\n"
      "\t \r\n"
      "\t function GooglePrvC(Gid,Glid,Gplid) {\r\n"
      "\t \r\n"
      "\t prxO.oInt.inToggleB(Gplid,'id','a',1);\r\n"
      "\t prxO.oInt.inToggleB(Glid,'id','a',1);\r\n"
      "\t prxO.oInt.inToggleB(Gid,'id','div',1);\r\n"
      "\t \r\n\t }\r\n\t//]]></script>\r\n"

the next two "replace" two of sidki's:
Code:
Name = ". + Google Light Blue Theme     7.06.08 (!nn) [jd sd] (o.s) [un-082208] PFR"
Active = TRUE
URL = "$TYPE(htm)www.google.(^$TST(hOrigUA=mozilla/4.[1-9](^*opera)*))[^:/]+/(intl/[^/]+/(^?)|search\?(^q\=cache:)|webhp|(^?))"
Limit = 4900
Match = "<style( id=\"themed\"*>$INEST(<style,//-->|-->|</style))\2(*</style >)\3"
Replace = "<style\2\r\n"
          "/* Proxomitron light blue Google theme */\r\n"
          ".g {line-height:16px;margin-top:0px;margin-bottom:0px;border-top:2px solid #dddddd;clear:both;padding:0px 7px 2px;}\r\n"
          "div.g, p.g {line-height:16px;padding:2px 5px 4px 5px;}\r\n"
          ".odd {background:#EFF6FF;margin:0px -16px 0px 0px;}\r\n"
          ".even {background:#DFEFFF;margin:0px -16px 0px 0px;}\r\n"
          "div#topspace {padding-top:0px;line-height:0;}\r\n"
          "br.mainspace {line-height:0px;}\r\n"
          "a {text-decoration:none;font-size:12px;}\r\n"
          "a:link, .q a:link, a.toplink:visited {color:#0000cc;}\r\n"
          "a:visited {color: #990066;}\r\n"
          "a:hover {text-decoration: underline;}\r\n"
          "a:hover,.q a:hover, a.fl:hover {color: #1689FF;}\r\n"
          "a#topthumb, a.mainlink {font-size: 15px;}\r\n"
          "a.mainlink:hover, a.toplink:hover {color:#1689FF;text-decoration:none;border-bottom:1px solid #1689FF;}\r\n"
          "a.ProXPref:hover {color:#379CCD;}\r\n"
          "a.ProXPrefJs:hover {color:#968AFF;}\r\n"
          "a.ProXPref.mainlink {padding-right:20px;background:url(http://local.ptron/sidki_h_$GET(cfg)/Google/google-bug.png) no-repeat right center;}\r\n"
          "a.ProXPrefJs {padding-right:0;background:none;}\r\n"
          ".j {width: 100%;}\r\n"
          ".gbh, .gbd {border-top:none;}\r\n"
          ".s{max-width:none;font-size:11px;}\r\n"
          "a.tool{background:none transparent scroll repeat 0% 0%;border-bottom:0;border-left:0;border-right:0;border-top:0;color:#999999;text-decoration:none;font-size:12px;padding:0px 3px 0px 3px;}\r\n"
      "a.tool:hover{background:#ffff66; transparent scroll repeat 0% 0%;color:#0000cc;padding:0px 3px 0px 3px;}\r\n"
          "\3"

and:
Code:
Name = "Google Search: Alternate Display     7.10.30 (multi) [sd] (d.s) [un-101808] PFR"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)www.google.[^:/]+/(intl/[^/]+/(^?)|search\?(^q\=cache:)|webhp|(^?))$SET(keyword=$TST(keyword=\1.(i_layout:[#*:0].)+\2)\1.i_layout:2.\2)"
Limit = 2048
Match = "</body$SET(a=)$SET(b=)PrxFail$TST()"
        "|"
        "<br>((\r|)\n$SET(1= )| <br>( <table)\2$SET(1=</p><br class=mainspace>\2))"
        "|"
        "<("
        "/b> of (about )+<b>[0-9,]+</b> ((from|over the) $NEST(<b>,</b >) )+for <b>( <b>)+[^<]+"
        "&&((<*>|?)+{95})\2???$SET(1=<\2...\3\4\5)*|$SET(1=<\2\3\4\5)\2"
        ")(*</table > )\3(<div(^ id=)$INEST(<div,>)$SET(5=<div)|)$SET(4=<div id="topspace">&nbsp;</div>\r\n)"
        "|"
        "<style(^$TST(b=s))$SET(b=s)$SET(1="
        "<script>"
        "var prxSpics=["http://local.ptron/sidki_h_$GET(cfg)/Google/google-","
        "new Image(),new Image(),new Image()];"
        "prxSpics[1].src=prxSpics[0]+"bug.png";prxSpics[2].src=prxSpics[0]+"top.png";"
        "prxSpics[3].src=prxSpics[0]+"new.png";"
        "</script>"
        "<style id="themed""
        ")"
        "|"
        "<div ("
        "id=("
        "$AV(ie6tb)>$INEST(<div,</div)</div >( $NEST(<script,</script >))+"
        "|$AV(exp_msgs)$INEST(<div,</div)</div >"
        ")"
        "|style=$AV(margin : -5px 0 5px)$INEST(<div,</div)</div >"
        ")"
        "|"
        "<(div|p|li)\2 class="
        "$AV(g)("
        "((^ style=$AV(margin-(left|right)*))($TST(c=odd)$SET(a=even)|$SET(a=odd))|)$SET(c=$GET(a))"
        ")(*<a)\#"
        "((*href=$AV(/interstitial\?url\=h\9|([^/]+//[^/]+/)\9?*|*)*)\5>*</a >)\4\6( <br>|( <table)\7)"
        "($TST(\9=t$SET(0="
        "<a href="h\9"><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-bug.png""
        " width=16 height=10 border=0 title="Malware warning!"></a>&nbsp;&nbsp;"
        ")*|$SET(0="
        "<a href="\9"><img src="http://local.ptron/sidki_h_$GET(cfg)/Google/google-top.png""
        " width=10 height=10 border=0 title="Go to top domain"></a>&nbsp;&nbsp;"
        ")*)|)"
    "$SET(google=$GET(google)1)"
        "$SET(iframe=<div id="google$GET(google)" style="display:none"></div>)"
        "$SET(1="
        "<\2 class=g&#x20;$GET(c);\#\4&nbsp;&nbsp;\0"
        "<a class="tool"\5 target=_blank><img src="http://local.ptron/Grypen_HTML/imgs/google/new.png" width=14 height=10 border=0 align="middle">&nbsp;New&nbsp;Window</a>&nbsp;&nbsp;"
        "<a id="plink$GET(google)" class="tool" style="display:inline" href="javascript:GooglePrv('google$GET(google)','\h','link$GET(google)','plink$GET(google)')"><img src="http://local.ptron/My_HTML/storm119_HTML/preview.png" width=15 height=15 border=0 align="middle">&nbsp;Preview</a>"
        "<a id="link$GET(google)" class="tool" style="display:none" href="javascript:GooglePrvC('google$GET(google)','link$GET(google)','vlink$GET(google)')"><img src="http://local.ptron/My_HTML/storm119_HTML/close.png" width=15 height=15 border=0 align="middle">&nbsp;Close&nbsp;Preview</a>"
        "<a id="vlink$GET(google)" class="tool" style="display:none" href="javascript:GooglePrvC('google$GET(google)','link$GET(google)','vlink$GET(google)')"><img src="http://local.ptron/My_HTML/storm119_HTML/reload.png" width=15 height=15 border=0 align="middle">&nbsp;Show&nbsp;Preview</a>"
        "$GET(iframe)\6<br class=mainspace><br class=mainspace>\7"
        ")"
Replace = "\1"
which is SUPPOSED TO pass the host, http://www.google.com...
but ultimately will pass the search result...


any suggestions?
Add Thank You Quote this message in a reply
Oct. 19, 2008, 01:28 PM
Post: #2
RE: [help] Google Preview...
i found "a" fix, not sure if it's "the" fix...

basically,
Code:
href="javascript:GooglePrv('google$GET(google)','\h','link$GET(google)','plink$GET(google)')"
will NOT work...

but
Code:
href="javascript:GooglePrv('google$GET(google)','//\h','link$GET(google)','plink$GET(google)')"
DOES...


the below seems to be a work-around as well:
Code:
href="javascript:GooglePrv('google$GET(google)','& # 104;ttp://\h','link$GET(google)','plink$GET(google)')">"
(spaces added before and after # to keep the forum from borking it...)

still "in-process"...
Add Thank You Quote this message in a reply
Oct. 20, 2008, 02:10 PM
Post: #3
RE: [help] Google Preview...
He got it, the link is here:
http://prxbx.com/forums/showthread.php?tid=1134
Add Thank You Quote this message in a reply
Oct. 20, 2008, 02:22 PM
Post: #4
RE: [help] Google Preview...
lol... "thanks"...
oh wait, i'm supposed to hit the new 'thanks button', aren't i, lol...
Add Thank You Quote this message in a reply
Oct. 20, 2008, 02:38 PM
Post: #5
RE: [help] Google Preview...
ProxRocks Wrote:i found "a" fix, not sure if it's "the" fix...

Code:
,'//\h',

That looks like a valid relative url to me.

See here: http://www.ietf.org/rfc/rfc1808.txt

Quote:2.3. Specific Schemes and their Syntactic Categories

Each URL scheme has its own rules regarding the presence or absence
of the syntactic components described in Sections 2.1 and 2.2. In
addition, some schemes are never appropriate for use with relative
URLs. However, since relative URLs will only be used within contexts
in which they are useful, these scheme-specific differences can be
ignored by the resolution process.

...snip...

2.4.3. Parsing the Network Location/Login

If the parse string begins with a double-slash "//", then the
substring of characters after the double-slash and up to, but not
including, the next slash "/" character is the network location/login
(<net_loc>) of the URL. If no trailing slash "/" is present, the
entire remaining parse string is assigned to <net_loc>. The double-
slash and <net_loc> are removed from the parse string before continuing.

All in all, it seems like a clever way to avoid the "scheme" issue of http: or https:.
Let the browser figure it out.
Nice. I'll have to remember that.

z12
Add Thank You Quote this message in a reply
Oct. 20, 2008, 02:54 PM
Post: #6
RE: [help] Google Preview...
To Proxrocks: :P!!!!! hehehe

BTW I'm looking for a filter to convert relative adresses to absolute. Has someone already done it?
Add Thank You Quote this message in a reply
Oct. 20, 2008, 04:10 PM
Post: #7
RE: [help] Google Preview...
(Oct. 20, 2008 02:38 PM)z12 Wrote:  All in all, it seems like a clever way to avoid the "scheme" issue of http: or https:.
Let the browser figure it out.
Nice. I'll have to remember that.

so, you're saying i should use //\8 instead of '& # 104;ttp://\8' (spaces for forum-posting only) ??? my "working edition" of the filter i was working on used the latter of the two...
Add Thank You Quote this message in a reply
Oct. 20, 2008, 04:48 PM
Post: #8
RE: [help] Google Preview...
ProxRocks:
I guess it doesn't really matter if the filter is working.
But // would have been my first choice.
According to the rfc, the // syntax is perfectly valid for a relative url.
It's also seems a bit easier to understand vs. the entity, at least for me.

My only disclaimer is, as with any filter, it should be tested.

lnminente:
I sent you a PM in regards to the filter you requested.

z12
Add Thank You Quote this message in a reply
Oct. 20, 2008, 06:58 PM
Post: #9
RE: [help] Google Preview...
(Oct. 20, 2008 04:48 PM)z12 Wrote:  lnminente:
I sent you a PM in regards to the filter you requested.

hey! what about any of us following that is "curious" about absolute versus relative? Sad



ps: E = mc^2... it's *all* "relative", lol...
Add Thank You Quote this message in a reply
Oct. 20, 2008, 07:06 PM
Post: #10
RE: [help] Google Preview...
ProxRocks

Well, it's not like it's some secret stuff.
I just didn't think it was "relative" to this thread. Smile!

BTW, what is \8 in your previous post.
I looked over the code and I must have missed it.

z12
Add Thank You Quote this message in a reply
Oct. 20, 2008, 08:51 PM
Post: #11
RE: [help] Google Preview...
i was using \h for my "test filter"...
in the final "Google Preview", \8 is the actual Google Test Result that is being "passed on" to the 'iframe toggler'...

said "final" is posted at http://prxbx.com/forums/showthread.php?tid=1134
Add Thank You Quote this message in a reply
Oct. 20, 2008, 11:35 PM
Post: #12
RE: [help] Google Preview...
I see now, \8 is not a relative url.
So never mind, // won't work. Smile!

I guess I misunderstood your second post with \h.
Some days, I shouldn't turn on my computer. D'oh!

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


Forum Jump: