Solstice

 view release on metacpan or  search on metacpan

javascript/remote.js  view on Meta::CPAN

   
                // a bit of debugging information if we have an error in the xml returned from our ajax call
                if(xmldoc && xmldoc.parseError && xmldoc.parseError.errorCode && Solstice.development_mode){
                    var error = xmldoc.parseError;
                    alert("Error Code: "+error.errorCode+ " \nDescription: "+error.reason+'\n Line: ' +error.line+"\n Position: "+error.linepos+ "\n Source: "+error.srcText);
                }

                var actions = xmldoc.getElementsByTagName("action");
                for(var i = 0; i < actions.length; i ++){

                    //childnode[1] is the cdata block in mozilla, childnode[0] in IE
                    if(actions[i].childNodes[1]){
                        var content = actions[i].childNodes[1].nodeValue;
                    }else{
                        var content = actions[i].childNodes[0].nodeValue;
                    }

                    var type = actions[i].getAttribute('type');

                    if(type == 'action'){

lib/Solstice/StringLibrary.pm  view on Meta::CPAN

use warnings;
use HTML::Entities;
use HTML::TreeBuilder;
use HTML::FormatText;
use Solstice::StripScripts::Parser;
use Exporter;

our @ISA = qw(Exporter);
our ($VERSION) = ('$Revision: 2418 $' =~ /^\$Revision:\s*([\d.]*)/);

our @EXPORT = qw|htmltounicode truncstr truncemail fixstrlen encode decode unrender scrubhtml convertspaces strtoascii strtourl strtofilename strtojavascript trimstr htmltotext extracttext scrubcdata urlclean fixlinewidth|;
our %EXPORT_TAGS = ( all => [ qw|
    htmltounicode
    truncstr
    truncemail
    fixstrlen
    encode
    decode
    unrender
    scrubhtml
    convertspaces
    strtoascii
    strtourl
    strtofilename
    strtojavascript
    trimstr
    htmltotext
    extracttext
    scrubcdata
    urlclean
    fixlinewidth
| ] );

our @EXPORT_OK = ( @{ $EXPORT_TAGS{all} } );

=head2 Superclass

L<Exporter|Exporter>

lib/Solstice/StringLibrary.pm  view on Meta::CPAN

    my $string = shift;
    return undef unless defined $string;

    for ($string) {
        s/^(?:\s|&#09;|&#10;|&#13;|&#32;)+//;
        s/(?:\s|&#09;|&#10;|&#13;|&#32;)+$//;
    }
    return $string;
}

=item scrubcdata($string)

This will return a string with ]]> escaped, so it will be cdata safe.

=cut

sub scrubcdata {
    my $string = shift;
    return undef unless defined $string;

    $string =~ s/]]>/]]&gt;/g;
    return $string;
}


package Solstice::StringLibrary::ExtractText;



( run in 0.237 second using v1.01-cache-2.11-cpan-454fe037f31 )