AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Who can delete the JavaScript in a .htm or .html file?

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
akyahoo



Joined: 10 Nov 2009
Posts: 24
Location: Beijing, China

PostPosted: Sat May 22, 2010 9:56 pm    Post subject: Who can delete the JavaScript in a .htm or .html file? Reply with quote

The JavaScript inside a .htm file is quite awful, after saving a Webpage in my computer. I can delete the .js files in its folder. However, it is quite difficult to delete the JavaScript inside a .htm file, because its content is not fixed.

I can know that it always starts with:

<script

and ends with:

</script>


Akelpad can only replace fixed contents. Who can tell me how to use other tools to delete the JavaScript?

Rolling Eyes Rolling Eyes Rolling Eyes Rolling Eyes


Last edited by akyahoo on Mon Jun 14, 2010 1:01 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
ravenlaughs



Joined: 06 Sep 2008
Posts: 40

PostPosted: Sat May 22, 2010 10:33 pm    Post subject: Reply with quote

You can try something like Text Crawler, that uses regular expressions. One simpler tool that might work is Text Magician. Only use text Magician on copies! It can be a great help, though.
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2031
Location: Vinnitsa, Ukraine

PostPosted: Sun May 23, 2010 12:53 am    Post subject: Reply with quote

akyahoo
Try to use Scripts plugin, SearchReplace.js script(I forgot exact name).
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
cnnnc



Joined: 12 Jan 2008
Posts: 116
Location: Shantou, China

PostPosted: Tue May 25, 2010 12:57 am    Post subject: Delete the JavaScript in a .htm or .html file Reply with quote

Run SearchReplace.js and Try
Replace:
Code:
<script(.*\s)*?.*</script>

With: (Empty this field)
Code:


Uncheck all CheckBox. Then click OK.
OK?
Back to top
View user's profile Send private message Send e-mail
akyahoo



Joined: 10 Nov 2009
Posts: 24
Location: Beijing, China

PostPosted: Mon Jun 14, 2010 12:54 am    Post subject: Reply with quote

Thank you so much.

Cool Cool
Back to top
View user's profile Send private message Visit poster's website
HastaLuego



Joined: 14 Aug 2010
Posts: 5
Location: Saratov

PostPosted: Sat Aug 14, 2010 9:01 am    Post subject: Reply with quote

Hi everyone , sorry , but SearchReplace.js seems doesn't work properly. It always workin' in a "greedy" style . May be I have an old version of a script ? And this construction doesn't work too :<script(.*\s)*?.*</script>

Offtopic:
And, besides, I wrote a script in PowerShell for adding to favorites (AP version 4.0.2,thus I think I'll do that in PS scripting language.
Back to top
View user's profile Send private message Send e-mail
Xephon



Joined: 03 Jun 2008
Posts: 123

PostPosted: Sat Aug 14, 2010 10:44 am    Post subject: Reply with quote

SearchReplace.js works just fine, only the regexp was made lubberly. Use simpy
Code:
<script.+?</script>
Back to top
View user's profile Send private message
HastaLuego



Joined: 14 Aug 2010
Posts: 5
Location: Saratov

PostPosted: Sat Aug 14, 2010 5:01 pm    Post subject: Reply with quote

Just installed a newer version of AP and SearchReplace.js . All is working just fine . Thanks a lot !! Finally it's working!!!.


And where is a COM Object like AkelPad.document has gone? I used to use them in some of my PowerShell script, though they worked halfway, but nevertheless it allowed to adress to the system API functions.
Back to top
View user's profile Send private message Send e-mail
FeyFre



Joined: 07 Aug 2007
Posts: 2031
Location: Vinnitsa, Ukraine

PostPosted: Sat Aug 14, 2010 8:05 pm    Post subject: Reply with quote

HastaLuego
You not need that COM-object. It is implicity built-in now in every script as Akelpad object.
Outside Akelpads plugin this object was and is unusable.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
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


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group