Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<head> TRIGGER breaks Screen which uses render_links #7

Closed
sebastfr opened this issue Jun 26, 2013 · 1 comment
Closed

<head> TRIGGER breaks Screen which uses render_links #7

sebastfr opened this issue Jun 26, 2013 · 1 comment
Assignees
Milestone

Comments

@sebastfr
Copy link
Contributor

@sebastfr sebastfr commented Jun 26, 2013

The trigger is using "utf8-head" and String format but it should use "head" and DOM.

# Trigger to load the Google Charts library from the template(s)
$c->add_trigger( EP_TRIGGER_DYNAMIC_TEMPLATE , sub
{
        my( %args ) = @_;

        my( $repo, $pins ) = @args{qw/ repository pins/};

        my $protocol = $repo->get_secure ? 'https':'http';

        if( !exists $pins->{head} )
        {
                $pins->{head} = $repo->make_doc_fragment;
        }

        $pins->{head}->appendChild( $repo->make_javascript( <
<script type="text/javascript" src="$protocol://www.google.com/jsapi">// </script>
<script type="text/javascript">google.load("visualization", "1", {packages:["corechart", "geochart"]});</script>

GCHARTS

    return EP_TRIGGER_OK;

} );

@ghost ghost assigned sebastfr Jun 26, 2013
@sebastfr
Copy link
Contributor Author

@sebastfr sebastfr commented Jun 26, 2013

In fact:

$c->add_trigger( EP_TRIGGER_DYNAMIC_TEMPLATE , sub
{
        my( %args ) = @_;
        my( $repo, $pins ) = @args{qw/ repository pins/};
        my $protocol = $repo->get_secure ? 'https':'http';
        if( !exists $pins->{head} )
        {
                $pins->{head} = $repo->make_doc_fragment;
        }
        $pins->{head}->appendChild( $repo->make_javascript( undef,
                src => "$protocol://www.google.com/jsapi"
        ) );
        $pins->{head}->appendChild( $repo->make_javascript( 'google.load("visualization", "1", {packages:["corechart", "geochart"]});' ) );
        return EP_TRIGGER_OK;
} );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant