|
Donations |
|
|
|
|
|
If you found this site helpful, please donate to help keep it online
Don't want to use PayPal? Try our physical address
|
|
|
Survey |
|
|
|
|
|
|
|
|
Translate |
|
|
|
|
|
|
|
|
|
|
View previous topic :: View next topic |
Author |
Message |
theSurfer
Cadet
Joined: May 20, 2004
Posts: 5
Location: Denmark
|
Posted: Mon May 31, 2004 11:43 am Post subject: filter included javascript file |
|
|
There is an external JavaScript file, in which I wish to remove a comment.. this is done by removing the "/*" and "*/", or by replacing both with "/**/".
Here is my Proxomitron-code:
[Patterns]
Name = "eksperten.dk konto menu"
Active = TRUE
URL = "http://www.eksperten.dk/js/coolmenus/exp_menu.js"
Limit = 4096
Match = "/\* | \*/"
Replace = "/\*\*/"
or
[Patterns]
Name = "eksperten.dk konto menu"
Active = TRUE
URL = "http://www.eksperten.dk/js/coolmenus/exp_menu.js"
Limit = 4096
Match = "/\* | \*/"
Replace = ""
The section is:
// konto
oM.makeMenu('m5','','Konto','/konto.phtml','',50);
/*
oM.makeMenu('m5_0','m5','Konto','/konto.phtml');
oM.makeMenu('m5_1','m5','Personlige data','/konto.phtml?option=1');
oM.makeMenu('m5_2','m5','Kategori abonnering','/konto.phtml?option=3');
oM.makeMenu('m5_3','m5','Kategori opsætning','/konto.phtml?option=9');
oM.makeMenu('m5_4','m5','E-Mail abonnering','/konto.phtml?option=4');
oM.makeMenu('m5_5','m5','E-Mail robot','/konto.phtml?option=5');
oM.makeMenu('m5_6','m5','Generelle indstillinger','/konto.phtml?option=8');
oM.makeMenu('m5_7','m5','Minisite & Statement','/konto.phtml?option=6');
oM.makeMenu('m5_8','m5','CoAdmin','/konto.phtml?option=10');
oM.makeMenu('m5_9','m5','Box indstillinger','/konto.phtml?option=11');
oM.makeMenu('m5_10','m5','Reklamer','/konto.phtml?option=12');
oM.makeMenu('m5_11','m5','Spørgsmål indstillinger','/konto.phtml?option=13');
oM.makeMenu('m5_12','m5','Pro udløbsdato','/konto.phtml?option=14');
oM.makeMenu('m5_13','m5','Spørgsmål besvaret af dig','/konto.phtml?option=21');
oM.makeMenu('m5_14','m5','Spørgsmål oprettet af dig','/konto.phtml?option=22');
oM.makeMenu('m5_15','m5','Spørgsmål hvor du deltager','/konto.phtml?option=23');
oM.makeMenu('m5_16','m5','Point regnskab','/konto.phtml?option=24');
*/
switch ($section) {
I saved the position of the section to a HTML file, and it turned out to be about 3.5 kb into the .js file, hence the Limit = 4096. The test works fine.. even with a Limit = 2.
My questions:
1) It is not working.. What is wrong?
2) How does the "Limit" work? (I have read the Help, pressing F1 > clicking on "Byte limit", but didnt understand it)
I Hope You can help.
theSurfer. |
|
Back to top |
|
|
z12
Sergeant
Joined: Jul 17, 2002
Posts: 125
Location: USA
|
Posted: Tue Jun 01, 2004 11:54 am Post subject: |
|
|
Hi theSurfer,
The reason it doesn't work is the url match, don't include the protocol, enter it like so:
Code: |
www.eksperten.dk/js/coolmenus/exp_menu.js
|
The byte limit specifies the maximum number of bytes to check before giving up trying to match. Since your matching expression is only 2 bytes long, that is all you need for a byte limit.
If this script contained other comments that you didn't want to match, you would have to modify your matching expression to include some of the code (all of it or partial with wild card) within the comment to insure that only this comment is filtered. The code would also need to be captured so it could be included in the replacment text and the Byte Limit would have to raised since now your matching many characters.
HTH
Mike
PS the proxomitron general forum is a better place for questions like this.
|
|
Back to top |
|
|
theSurfer
Cadet
Joined: May 20, 2004
Posts: 5
Location: Denmark
|
Posted: Tue Jun 01, 2004 6:17 pm Post subject: |
|
|
Thank you! Thank you! Thank you! It works great!
I tried to make it more specific.. like trying to match:
/*
oM.makeMenu('m5_0'
..since it only appears once.. but I was unable to match "newline" ("\n" ?).. I also ran into trouble when I used the "('" part.. It even failed when I tried to escape them using "\"..
Any ideas on making it more specific?
The owner, of the site, could include some more comments, which my filter would interfere with..
Thanks for the help!
- theSurfer.
PS: Sorry for posting in the wrong forum.. my first post..
PPS: I'm from Denmark, Europe.. my English might be a little off |
|
Back to top |
|
|
z12
Sergeant
Joined: Jul 17, 2002
Posts: 125
Location: USA
|
Posted: Tue Jun 01, 2004 9:29 pm Post subject: |
|
|
Hi theSurfer,
Here, try this:
Code: |
Matching Expression:
(oM.makeMenu\('m5','','Konto','/konto.phtml','',50\);*[\n\r]+)\1
\/\*[^\n\r]+\2\*\/
Replacement Text:
\1\2
Byte Limit:
4096
|
HTH
Mike
PS: no problem about the post
PPS: your english is good!
|
|
Back to top |
|
|
theSurfer
Cadet
Joined: May 20, 2004
Posts: 5
Location: Denmark
|
Posted: Mon Jun 07, 2004 11:51 am Post subject: |
|
|
Hi Mike.
I apologize for the delay.
I have several ongoing projects, plus I help users with their IT-related problems, at www.eksperten.dk (Danish site for people seeking help with their IT-related problems.. the translation function is ineffective). Sometimes when I am checking HijackThis logs, I end up on computercops.biz, which I find funny .
Your RegExp code works great.
I have teamed up with a fellow helper to develop a better menu.
Therefore I am very pleased with Proxomitron, which can do what I have been looking for, since I first tried the filtering function in Mozilla FireFox (browser, http://www.mozilla.org/products/firefox/ ). It was able to filter out ads and so on using CSS3 code.
Using proxomitron, and Your RegExp code, I am able to implement a better menu, on my computer, without bothering others with it.
Thank You for Your help in improving my experience with www.eksperten.dk.
Regards,
theSurfer. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
|
Powered by phpBB 2.0.8a © 2001 phpBB Group
Version 2.0.6 of PHP-Nuke Port by Tom Nitzschner © 2002 www.toms-home.com
Version 2.2 by Paul Laudanski © 2003-2004 Computer Cops
|