Use inlineScript() instead of element() to write inline javascript

This commit is contained in:
Craig Andrews 2009-12-04 20:33:41 -05:00
parent 675e32ac9a
commit d41a0a5ed0
2 changed files with 3 additions and 7 deletions

View File

@ -477,13 +477,10 @@ class HTMLOutputter extends XMLOutputter
*/
function autofocus($id)
{
$this->elementStart('script', array('type' => 'text/javascript'));
$this->raw('/*<![CDATA[*/'.
$this->inlineScript(
' $(document).ready(function() {'.
' var el = $("#' . $id . '");'.
' if (el.length) { el.focus(); }'.
' });'.
' /*]]>*/');
$this->elementEnd('script');
' });');
}
}

View File

@ -352,8 +352,7 @@ class MobileProfilePlugin extends WAP20Plugin
$contentLimit = Notice::maxContent();
$form->out->element('script', array('type' => 'text/javascript'),
'maxLength = ' . $contentLimit . ';');
$form->out->inlineScript('maxLength = ' . $contentLimit . ';');
if ($contentLimit > 0) {
$form->out->element('div', array('id' => 'notice_text-count'),