Post Reply 
Update: Remove - Specific Functions
Apr. 28, 2009, 04:01 PM
Post: #1
Update: Remove - Specific Functions
This update adds an "exact match only" modifier: $SET(sUserFnR==)

Code:
[Patterns]
Name = "Remove: Specific Functions on sel. Sites     9.04.28 [sd] (d.2)"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))$TST(sUserFn=*)"
Limit = 32766
Match = "function\s$TST(script=[1s]*)([^()"';]+{1,*})\4"
        "$TST(sUserFn=§(\5§$TST(\4=(($TST(\5)($TST(sUserFnR=*=*)|*))\6|*)))+)$TST(\6=*)"
        " $NEST(\(,\)) $NEST({,})"
        "$SET(1=function \4() { return prxVoidV)$SET(2=S-Spec Fn: $GET(sUserFnR))"
        "|"
        "if \( $TST(script=[1s]*)($INEST(\( ,\)))\4"
        "$TST(sUserFn=§(\5§$TST(\4=(($TST(\5)($TST(sUserFnR=*=*)|*))\6|*)))+)$TST(\6=*)"
        "\)( //[^\n]+| /\**\*/)+ ($NEST({,})|[^;]+;)"
        "$SET(7=$TST(sUserFnR=*!*)!)$SET(1=if (\70) {)$SET(2=S-Spec If: $GET(sUserFnR))$SET(3= - (\4))"
        ""
        "&($TST(volat=*.log:2*)$ADDLST(Log-Main,[$DTM(d T)]\tWEB SiteSpec_JS \2 \t\4 \t\u)|)"
        "($TYPE(htm)$SET(eAdJS=$GET(eAdJS)"
        "%3Cspan class=%22ProxFly-Span%22>$GET(mHead) \2%3C/span>"
        "$ESC(\4)%3Cbr class=%22ProxFly-Br%22 />"
        ")|)"
Replace = "\1 /* PROX: \2 Removed\3 */ }"


Changed description in the IncludeExclude lists:
Code:
## block ad functions                $SET(sUserFn=§MATCH1§MATCH2§)
##
## "MATCH" targets function names and IF conditions.  Each string must be
## surrounded by section signs (§).  You just need to match the beginning of
## the target, unless you append "$SET(sUserFnR==)".
##
## Example:
##   [^.]+.techtarget.com/    $SET(sUserFn=§HBX_§forMembersOnly§)
##
## Above entry would replace these code blocks on TechTarget sites:
##   function HBX_STRING() {code}
##   function HBX_ERROR() {code}
##   if (forMembersOnly && something) {code}
##
## If you append "$SET(sUserFnR=!)", replaced - hence empty - "if" blocks get
## executed instead of possible "else" blocks, which is the default.
##
## For above logic, plus exact string match only, append "$SET(sUserFnR=!=)".
## ----------------------------------------------------------------------------


By the way, does anyone have concerns, comments, thoughts about renaming the IncludeExcude Lists to "Exceptions"?
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Update: Remove - Specific Functions - sidki3003 - Apr. 28, 2009 04:01 PM

Forum Jump: