forked from GNUsocial/gnu-social
Use inlineScript() instead of element() to write inline javascript
This commit is contained in:
parent
675e32ac9a
commit
d41a0a5ed0
@ -477,13 +477,10 @@ class HTMLOutputter extends XMLOutputter
|
|||||||
*/
|
*/
|
||||||
function autofocus($id)
|
function autofocus($id)
|
||||||
{
|
{
|
||||||
$this->elementStart('script', array('type' => 'text/javascript'));
|
$this->inlineScript(
|
||||||
$this->raw('/*<![CDATA[*/'.
|
|
||||||
' $(document).ready(function() {'.
|
' $(document).ready(function() {'.
|
||||||
' var el = $("#' . $id . '");'.
|
' var el = $("#' . $id . '");'.
|
||||||
' if (el.length) { el.focus(); }'.
|
' if (el.length) { el.focus(); }'.
|
||||||
' });'.
|
' });');
|
||||||
' /*]]>*/');
|
|
||||||
$this->elementEnd('script');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,8 +352,7 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
|
|
||||||
$contentLimit = Notice::maxContent();
|
$contentLimit = Notice::maxContent();
|
||||||
|
|
||||||
$form->out->element('script', array('type' => 'text/javascript'),
|
$form->out->inlineScript('maxLength = ' . $contentLimit . ';');
|
||||||
'maxLength = ' . $contentLimit . ';');
|
|
||||||
|
|
||||||
if ($contentLimit > 0) {
|
if ($contentLimit > 0) {
|
||||||
$form->out->element('div', array('id' => 'notice_text-count'),
|
$form->out->element('div', array('id' => 'notice_text-count'),
|
||||||
|
Loading…
Reference in New Issue
Block a user