diff options
author | Zach Copley <zach@status.net> | 2009-10-05 10:05:43 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-10-05 10:05:43 -0700 |
commit | 2b7d8d0c29a9b28700828db5184ed6d1dc7b1922 (patch) | |
tree | 3dd0b4bdbbc421b155750fa77ddd38edd058d136 /lib | |
parent | ee207ffd8be4a7178d06ff7c6928dba3714146ec (diff) | |
parent | 7a33125a6c05a885a7e4c6d80be4e0fe26499565 (diff) |
Merge branch '0.9.x' into refactor-api
* 0.9.x: (23 commits)
Added hook to wrap the notice form data block
Unnecessary selector bit
Removed obsolete iphone theme (pre v0.7)
remove spurious readme from Orbited
need to show scripts at end of body in RealtimePlugin
Some changes required from Orbited debugging
Update OrbitedPlugin to work with RealtimePlugin framework
updated OrbitedPlugin to use RealtimePlugin
remove unused files for OrbitedPlugin
rename plugin
copy Comet plugin to Orbited
move scripts to just before </body>, add event for scripts that need to be in <head>
reformat Notice.php
added all them doxygens
Using CDATA for autofocus script
more doxygen
added doxygen
indent fix
better handling of y response in deleteuser.php
script to permanently delete a user
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 19 | ||||
-rw-r--r-- | lib/htmloutputter.php | 16 | ||||
-rw-r--r-- | lib/noticeform.php | 70 |
3 files changed, 54 insertions, 51 deletions
diff --git a/lib/action.php b/lib/action.php index 71ceffe20..1b2f73752 100644 --- a/lib/action.php +++ b/lib/action.php @@ -120,14 +120,16 @@ class Action extends HTMLOutputter // lawsuit { // XXX: attributes (profile?) $this->elementStart('head'); - $this->showTitle(); - $this->showShortcutIcon(); - $this->showStylesheets(); - $this->showScripts(); - $this->showOpenSearch(); - $this->showFeeds(); - $this->showDescription(); - $this->extraHead(); + if (Event::handle('StartShowHeadElements', array($this))) { + $this->showTitle(); + $this->showShortcutIcon(); + $this->showStylesheets(); + $this->showOpenSearch(); + $this->showFeeds(); + $this->showDescription(); + $this->extraHead(); + Event::handle('EndShowHeadElements', array($this)); + } $this->elementEnd('head'); } @@ -352,6 +354,7 @@ class Action extends HTMLOutputter // lawsuit Event::handle('EndShowFooter', array($this)); } $this->elementEnd('div'); + $this->showScripts(); $this->elementEnd('body'); } diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index c70f96537..ce83295fb 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -427,16 +427,12 @@ class HTMLOutputter extends XMLOutputter function autofocus($id) { $this->elementStart('script', array('type' => 'text/javascript')); - $this->raw(' - <!-- - $(document).ready(function() { - var el = $("#' . $id . '"); - if (el.length) { - el.focus(); - } - }); - --> - '); + $this->raw('/*<![CDATA[*/'. + ' $(document).ready(function() {'. + ' var el = $("#' . $id . '");'. + ' if (el.length) { el.focus(); }'. + ' });'. + ' /*]]>*/'); $this->elementEnd('script'); } } diff --git a/lib/noticeform.php b/lib/noticeform.php index 186330bf1..9864d15eb 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -142,40 +142,44 @@ class NoticeForm extends Form function formData() { - $this->out->element('label', array('for' => 'notice_data-text'), - sprintf(_('What\'s up, %s?'), $this->user->nickname)); - // XXX: vary by defined max size - $this->out->element('textarea', array('id' => 'notice_data-text', - 'cols' => 35, - 'rows' => 4, - 'name' => 'status_textarea'), - ($this->content) ? $this->content : ''); - - $contentLimit = Notice::maxContent(); - - $this->out->element('script', array('type' => 'text/javascript'), - 'maxLength = ' . $contentLimit . ';'); - - if ($contentLimit > 0) { - $this->out->elementStart('dl', 'form_note'); - $this->out->element('dt', null, _('Available characters')); - $this->out->element('dd', array('id' => 'notice_text-count'), - $contentLimit); - $this->out->elementEnd('dl'); + if (Event::handle('StartShowNoticeFormData', array($this))) { + $this->out->element('label', array('for' => 'notice_data-text'), + sprintf(_('What\'s up, %s?'), $this->user->nickname)); + // XXX: vary by defined max size + $this->out->element('textarea', array('id' => 'notice_data-text', + 'cols' => 35, + 'rows' => 4, + 'name' => 'status_textarea'), + ($this->content) ? $this->content : ''); + + $contentLimit = Notice::maxContent(); + + $this->out->element('script', array('type' => 'text/javascript'), + 'maxLength = ' . $contentLimit . ';'); + + if ($contentLimit > 0) { + $this->out->elementStart('dl', 'form_note'); + $this->out->element('dt', null, _('Available characters')); + $this->out->element('dd', array('id' => 'notice_text-count'), + $contentLimit); + $this->out->elementEnd('dl'); + } + + if (common_config('attachments', 'uploads')) { + $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); + $this->out->element('input', array('id' => 'notice_data-attach', + 'type' => 'file', + 'name' => 'attach', + 'title' => _('Attach a file'))); + $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); + } + if ($this->action) { + $this->out->hidden('notice_return-to', $this->action, 'returnto'); + } + $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto'); + + Event::handle('StartShowNoticeFormData', array($this)); } - - if (common_config('attachments', 'uploads')) { - $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); - $this->out->element('input', array('id' => 'notice_data-attach', - 'type' => 'file', - 'name' => 'attach', - 'title' => _('Attach a file'))); - $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); - } - if ($this->action) { - $this->out->hidden('notice_return-to', $this->action, 'returnto'); - } - $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto'); } /** |