CallBackery

 view release on metacpan or  search on metacpan

lib/CallBackery/Plugin/Doc.pm  view on Meta::CPAN

#          my $attrs = shift->attrs;
#          my $class = $attrs->{class};
#          $attrs->{class} =
#            defined $class ? "$class prettyprint lang-perl" : 'prettyprint lang-perl';
#        }
#      );

      # Rewrite headers
      my $url = $self->req->url->clone;
      $url =~ s/%2F/\//gi;
      my $toc = Mojo::URL->new->fragment('toc');

      my $sections = [];
        for my $e ($dom->find('h1, h2, h3')->each) {
            push @$sections, [] if $e->tag eq 'h1' || !@$sections;
            my $anchor = $e->{id};
            my $link   = Mojo::URL->new->fragment($anchor);
            push @{$sections->[-1]}, my $text = $e->all_text, $link;
            my $permalink = $self->link_to('#' => $link, class => 'permalink');
            $e->content($permalink . $self->link_to($text => $toc, id => $anchor));
        }


      # Try to find a title
      my $title = 'Perldoc';
      $dom->find('h1 + p')->first(sub { $title = shift->text });

lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/data/MHistoryRelaxedEncoding.js  view on Meta::CPAN

************************************************************************ */

/**
 * Make the History object use encodeURI instead of encodeURIComponent
 * in order to generate nicer urls
 **/
qx.Mixin.define("callbackery.data.MHistoryRelaxedEncoding", {
    members: {

        /**
         * Encodes the state value into a format suitable as fragment identifier.
         *
         * @param value {String} The string to encode
         * @return {String} The encoded string
         */
        _encode: function(value) {
            if (qx.lang.Type.isString(value)) {
                return encodeURI(value);
            }

            return "";
        },


        /**
         * Decodes a fragment identifier into a string
         *
         * @param value {String} The fragment identifier
         * @return {String} The decoded fragment identifier
         */
        _decode: function(value) {
            if (qx.lang.Type.isString(value)) {
                return decodeURI(value);
            }

            return "";
        }
    }
});



( run in 1.689 second using v1.01-cache-2.11-cpan-364913b4093 )