$contentLimit = Message::maxContent();
- $this->out->element('script', array('type' => 'text/javascript'),
- 'maxLength = ' . $contentLimit . ';');
+ $this->out->inlineScript('maxLength = ' . $contentLimit . ';');
if ($contentLimit > 0) {
$this->out->elementStart('dl', 'form_note');
$contentLimit = Notice::maxContent();
- $this->out->element('script', array('type' => 'text/javascript'),
- 'maxLength = ' . $contentLimit . ';');
+ $this->out->inlineScript('maxLength = ' . $contentLimit . ';');
if ($contentLimit > 0) {
$this->out->elementStart('dl', 'form_note');
// XXX: Facebook says we don't need this FB_RequireFeatures(),
// but we actually do, for IE and Safari. Gar.
- $js = '<script type="text/javascript">';
$js .= ' $(document).ready(function () {';
$js .= ' FB_RequireFeatures(';
$js .= ' ["XFBML"], function() {';
$js .= ' }';
$js .= ' );';
$js .= ' });';
- $js .= '</script>';
$js = sprintf($js, $apikey, $login_url, $logout_url);
$js = str_replace(' ', '', $js);
- $action->raw(" $js"); // leading two spaces to make it line up
+ $action->inlineScript($js);
}
}
'pageTracker._trackPageview();'.
'} catch(err) {}',
$this->code);
- $action->elementStart('script', array('type' => 'text/javascript'));
- $action->raw($js1);
- $action->elementEnd('script');
- $action->elementStart('script', array('type' => 'text/javascript'));
- $action->raw($js2);
- $action->elementEnd('script');
+ $action->inlineScript($js1);
+ $action->inlineScript($js2);
}
}
function onEndShowScripts($action)
{
- $piwikCode = <<<ENDOFPIWIK
-
-<!-- Piwik -->
-<script type="text/javascript">
+ $piwikCode1 = <<<ENDOFPIWIK
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$this->piwikroot}" : "http://{$this->piwikroot}");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
+ENDOFPIWIK;
+ $piwikCode2 = <<<ENDOFPIWIK
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$this->piwikId});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
-</script>
-<!-- End Piwik Tag -->
-
ENDOFPIWIK;
- $action->raw($piwikCode);
+ $action->inlineScript($piwikCode1);
+ $action->inlineScript($piwikCode2);
return true;
}
}
$realtimeUI = ' RealtimeUpdate.initActions("'.$url.'", "'.$timeline.'", "'. $pluginPath .'");';
}
- $action->elementStart('script', array('type' => 'text/javascript'));
-
$script = ' $(document).ready(function() { '.
$realtimeUI.
$this->_updateInitialize($timeline, $user_id).
'}); ';
- $action->raw($script);
-
- $action->elementEnd('script');
+ $action->inlineScript($script);
return true;
}
function onEndShowScripts($action)
{
- $action->elementStart('script', array('type' => 'text/javascript'));
- $action->raw('/*<![CDATA[*/ if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); } /*]]>*/');
- $action->elementEnd('script');
+ $action->inlineScript('if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); }');
return true;
}
}