Page view counter

Removing white space and cleaning up HTML

Last post 07-22-2004 2:02 PM by pspeth. 11 replies.

Sort Posts:

  • Removing white space and cleaning up HTML

    05-14-2004, 9:50 PM
    • Loading...
    • Rene B
    • Joined on 11-29-2003, 12:17 PM
    • Québec City, Canada
    • Posts 75
    • Points 375
    I been playing around with a function to remove the white spaces and also cleaning up the HTML before it goes out.

    The saving average 20% per page. It use a bit of processor time, on my server it take on average ,07 second for a 25k bytes page to process.

    It does not modify <pre> some text </pre> so you still render spaces if you want.

    You put the code in the basepage.vb, add two lines in the web.config recompile and you are ready to go.

    To see the result is put at the bottom of each page outside the </html> tag so you can see how it worked by viewing the source of the page.
    René Boulard
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 9:56 AM
    • Loading...
    • communitypc
    • Joined on 03-10-2003, 2:15 PM
    • Sydney
    • Posts 143
    • Points 715
    Hi Rene

    How do I get this?
    Cheers


    Ross
    ross at communitypc dot com dot au
    ----------------
    This page is best viewed by coming around to my computer and looking at it there.
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 10:39 AM
    • Loading...
    • xddg
    • Joined on 12-10-2002, 3:09 PM
    • Melbourne
    • Posts 1,874
    • Points 9,364
    • TrustedFriends-MVPs
    Hello Rene - that's a good idea as sometimes working on skins and copying and pasting, the whitespace itself can cause errors in the skins due to incorrectly formatted code.

    Is this going to be available to the community?


    Nina
    Nina Meiers


    Free Skins & Containers by Nina Meies
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 11:01 AM
    • Loading...
    • johnelaroche
    • Joined on 08-28-2003, 7:45 PM
    • Hollywood, FL
    • Posts 311
    • Points 1,565
    I could whip up something like this as a module or a skin object that could be applied on a per page basis without requiring core mods.

    When I get a few minutes after magicGadget 1.0 goes live and magicChat 1.3 is complete I'll toss this up on magicModules in the free stuff section.
    John Laroche

    ------------------------------------------

    magicModules Custom DNN Design and Programming

    http://magicModules.com
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 11:19 AM
    • Loading...
    • communitypc
    • Joined on 03-10-2003, 2:15 PM
    • Sydney
    • Posts 143
    • Points 715
    What's "magicGadget" John?
    Cheers


    Ross
    ross at communitypc dot com dot au
    ----------------
    This page is best viewed by coming around to my computer and looking at it there.
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 12:21 PM
    • Loading...
    • johnelaroche
    • Joined on 08-28-2003, 7:45 PM
    • Hollywood, FL
    • Posts 311
    • Points 1,565
    Oh my. How do you describe a module that has a 70 page manual in a couple of lines.... Hmm.

    OK. It's the Text/HTML module *done right*. It has staging and deployment features, versioning and rollback, it can read it's content from the database or directly off the server from text/html files, the editing interface is customizable, the CSS part of FTB actually works now giving you a full WYSIWYG experience....and more. Most of all it features the magicEngine. A scripting language of sorts that currently features 52 tags which turn the plain Text/HTML module into something amazing.

    With the magicEngine it becomes a personalized HTML module, a random content module, a customizable and personalized IFrame or Marquee module, an image of the day module, a scheduled content module, a 'server uptime module', a thumbnail gallery module, a feature rich image module, a text include module, an SQL reports module, a screen scraping module and a WHOLE LOT MORE or any combination of the above! All mixed in with your handwritten content!

    There's more, but that will give you an idea. It is due for release Monday.

    In prep for release I've posted the tag reference on our site http://www.magicmodules.com/
    John Laroche

    ------------------------------------------

    magicModules Custom DNN Design and Programming

    http://magicModules.com
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 2:33 PM
    • Loading...
    • PScarlett
    • Joined on 04-19-2004, 9:36 AM
    • Ontario, CANADA
    • Posts 331
    • Points 1,665
    I justed looked at the tag reference... WOW. Drooling as I write. I look forward to playing with is module.

    Many thanks for the effort.

    Paul.
    Paul Scarlett - Ontario, Canada
    www.tressleworks.ca
    www.tz3p9v.ca
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 8:08 PM
    • Loading...
    • Rene B
    • Joined on 11-29-2003, 12:17 PM
    • Québec City, Canada
    • Posts 75
    • Points 375
    I am still playing around with the codes.

    Since I not a programmer, I do not know if it is the best and fastest way to go.
    But I am sure that some of you will improve on the programming side of it.
    It would be a nice feature to have it packaged in a module, that could be set up
    without modifying the core.

    this link should take you to the latest version of my codes.

    http://www.reneboulard.qc.ca/admin/Portal/LinkClick.aspx?tabid=38&table=Documents&field=ItemID&id=13&link=whitespace.txt


    What I did was :

    1. Removed the whites spaces
    2. Removed the stuff not needed according to a html validator. (WDG HTML Validator)

    You can easely turn of portion of the codes, without recompiling, so you can use only some of the feature or all.
    René Boulard
  • Re: Removing white space and cleaning up HTML

    05-15-2004, 11:25 PM
    • Loading...
    • johnelaroche
    • Joined on 08-28-2003, 7:45 PM
    • Hollywood, FL
    • Posts 311
    • Points 1,565
    I certainly hope I didnt insult you... that certainly wasn't my intention.

    I had a look at your code and it certainly looks through. Maybe a bit too though... I'd have a cow if you took away my span and div ids... your mod would certainly kill magicChat as well as a few other modules I've seen recently. I'd rethink that one. The summary attribute is for handicapped folks. It informs screenreaders not to treat the tables as tabular data but as design elements.

    One suggestion that you might consider is to review the stringbuilder class. This has a great thing over plain old strings in that once the stringbuilder is initalized, it remains as an object until it grows too large for the memory allocated for it, then .net reallocates it, with double its memory requirements for growth. with a string, everything you do:
    dim s as string
    s= "boo"
    s+= "boo"
    s+= "boo"

    .net actually destroys the old string object and creates a new one. Not only does this consume extra cpu cycles, but extra time as well as memory.

    <quote>
    ' If we don't do this, JavaScript horks on the site
    </quote>

    "Hork" is most definately a true programmers term. I can't see how you say you arent one if you use that venerable term! Well done! ;) An excellent effort I'd say.
    John Laroche

    ------------------------------------------

    magicModules Custom DNN Design and Programming

    http://magicModules.com
  • Re: Removing white space and cleaning up HTML

    05-17-2004, 12:41 AM
    • Loading...
    • communitypc
    • Joined on 03-10-2003, 2:15 PM
    • Sydney
    • Posts 143
    • Points 715
    I'm so glad I asked John! What an amazing module!

    Question: for me (and my customers), the "ultimate" text/html module would be one that supported dragging and dropping text and images both within the module and from outside it (ie moving stuff in and out of the module).

    I know this involves client-side stuff like DHTML, but anyway ... can your module do anything truly "interactive" like this?

    In any case, I'm off to buy your module!
    Cheers


    Ross
    ross at communitypc dot com dot au
    ----------------
    This page is best viewed by coming around to my computer and looking at it there.
  • Re: Removing white space and cleaning up HTML

    05-17-2004, 1:16 PM
    • Loading...
    • johnelaroche
    • Joined on 08-28-2003, 7:45 PM
    • Hollywood, FL
    • Posts 311
    • Points 1,565
    This feature is best left to the Rich Editor component... FCK Editor does this and quite well. When the next DNN version comes out I intend to make freely availiable providers for FTB 2.0 HTMLArea and FCK. If the interest is high and the next version of DNN is delayed I can and will create an FCK version.

    Right now though, the module hasnt even been released and I'm getting requests for extensions of the magicEngine language as well as developers wanting an API heh.

    On a sad note, I discovered an issue with magicGadget this morning on a last minute deploy and have pulled release until the issue is solved. I'm thinking late tonight or tomorrow now.

    I am still adding demos, but there is quite a bit of information as well as the full PDF documentation at http://www.magicmodules.com/Default.aspx?tabid=137

    Thanks for your interest
    John Laroche

    ------------------------------------------

    magicModules Custom DNN Design and Programming

    http://magicModules.com
  • freely availiable providers for FTB 2.0 HTMLArea and FCK

    07-22-2004, 12:28 PM
    • Loading...
    • pspeth
    • Joined on 03-07-2003, 10:44 AM
    • Posts 221
    • Points 1,085
    Any Progress on this?
    These would be great additions to our Development Toolbox!!!!!!!!
Page 1 of 1 (12 items)