isocial-svn Mailing List for isocial (Page 11)
Status: Pre-Alpha
Brought to you by:
aguidrevitch
You can subscribe to this list here.
2008 |
Jan
|
Feb
(11) |
Mar
(80) |
Apr
(22) |
May
(90) |
Jun
(28) |
Jul
(33) |
Aug
(12) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|
From: <agu...@us...> - 2008-03-09 17:38:29
|
Revision: 54 http://isocial.svn.sourceforge.net/isocial/?rev=54&view=rev Author: aguidrevitch Date: 2008-03-09 10:38:17 -0700 (Sun, 09 Mar 2008) Log Message: ----------- link to events application added Modified Paths: -------------- app/locales/layout/en.php app/locales/layout/ru.php app/views/shared/loggedin/compiled/sidebar.tpl.php app/views/shared/loggedin/sidebar.tpl public/stylesheets/Application.css Added Paths: ----------- public/images/calendar.png Modified: app/locales/layout/en.php =================================================================== --- app/locales/layout/en.php 2008-03-09 16:40:08 UTC (rev 53) +++ app/locales/layout/en.php 2008-03-09 17:38:17 UTC (rev 54) @@ -19,5 +19,6 @@ $dictionary['PhotoApp'] = 'Photos'; $dictionary['GroupApp'] = 'Groups'; +$dictionary['EventApp'] = 'Events'; ?> Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-03-09 16:40:08 UTC (rev 53) +++ app/locales/layout/ru.php 2008-03-09 17:38:17 UTC (rev 54) @@ -26,5 +26,6 @@ $dictionary['PhotoApp'] = 'Фото'; $dictionary['GroupApp'] = 'Группы'; +$dictionary['EventApp'] = 'События'; ?> Modified: app/views/shared/loggedin/compiled/sidebar.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/sidebar.tpl.php 2008-03-09 16:40:08 UTC (rev 53) +++ app/views/shared/loggedin/compiled/sidebar.tpl.php 2008-03-09 17:38:17 UTC (rev 54) @@ -13,5 +13,6 @@ </div> <div id="applications"> <a href="/photo" class="photoapp"><?php echo $text_helper->translate('PhotoApp', array()); ?></a> - <a href="/groups" class="groupsapp"><?php echo $text_helper->translate('GroupApp', array()); ?></a> + <a href="/group" class="groupapp"><?php echo $text_helper->translate('GroupApp', array()); ?></a> + <a href="/event" class="eventapp"><?php echo $text_helper->translate('EventApp', array()); ?></a> </div> \ No newline at end of file Modified: app/views/shared/loggedin/sidebar.tpl =================================================================== --- app/views/shared/loggedin/sidebar.tpl 2008-03-09 16:40:08 UTC (rev 53) +++ app/views/shared/loggedin/sidebar.tpl 2008-03-09 17:38:17 UTC (rev 54) @@ -13,5 +13,6 @@ </div> <div id="applications"> <a href="/photo" class="photoapp">_{PhotoApp}</a> - <a href="/groups" class="groupsapp">_{GroupApp}</a> + <a href="/group" class="groupapp">_{GroupApp}</a> + <a href="/event" class="eventapp">_{EventApp}</a> </div> \ No newline at end of file Added: public/images/calendar.png =================================================================== (Binary files differ) Property changes on: public/images/calendar.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-09 16:40:08 UTC (rev 53) +++ public/stylesheets/Application.css 2008-03-09 17:38:17 UTC (rev 54) @@ -273,10 +273,14 @@ background: url('/images/photo.png') no-repeat 0px; } -.groupsapp { +.groupapp { background: url('/images/group.png') no-repeat 0px; } +.eventapp { + background: url('/images/calendar.png') no-repeat 0px; +} + .linksarea a { padding: 2px 5px 2px 5px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-09 16:40:04
|
Revision: 53 http://isocial.svn.sourceforge.net/isocial/?rev=53&view=rev Author: aguidrevitch Date: 2008-03-09 09:40:08 -0700 (Sun, 09 Mar 2008) Log Message: ----------- various city/common autocompletion improvements Modified Paths: -------------- app/application_controller.php app/helpers/city_helper.php app/views/layouts/application.tpl app/views/profile/basic.tpl app/views/shared/loggedin/pageheader.tpl public/javascripts/autocomplete.js public/stylesheets/autocomplete.css Added Paths: ----------- app/helpers/auto_complete_helper.php public/images/spinner-faded.gif public/images/spinner.gif Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-09 14:40:12 UTC (rev 52) +++ app/application_controller.php 2008-03-09 16:40:08 UTC (rev 53) @@ -20,7 +20,7 @@ var $_errors = array(); var $models = array('User'); - var $app_helpers = array('City'); + var $app_helpers = array('AutoComplete', 'City'); var $current_user; function beforeAction ( $method = '' ) { Added: app/helpers/auto_complete_helper.php =================================================================== --- app/helpers/auto_complete_helper.php (rev 0) +++ app/helpers/auto_complete_helper.php 2008-03-09 16:40:08 UTC (rev 53) @@ -0,0 +1,57 @@ +<?php + +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'javascript_helper.php'); +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'tag_helper.php'); +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'form_helper.php'); + +class AutoCompleteHelper extends JavascriptMacrosHelper { + + function auto_complete_field($field_id, $options = array()) + { + $function = "var {$field_id}_auto_completer = new Ajax.IAutocompleter("; + $function .= "'{$field_id}', "; + $function .= !empty($options['update']) ? "'{$options['update']}', " : "'{$field_id}_auto_complete', "; + $function .= "'".UrlHelper::url_for($options['url'])."'"; + + $js_options = array(); + foreach (array('paramName', + 'tokens', + 'frequency', + 'minChars', + 'indicator', + 'updateElement', + 'afterUpdateElement', + 'callback', + 'parameters') as $key) { + if (!empty($options[$key])) { + $js_options[$key] = $options[$key]; + } + } + + $function .= ', '.JavaScriptHelper::_options_for_javascript($js_options).')'; + return JavaScriptHelper::javascript_tag($function); + } + + function auto_complete_result($entries, $phrase = null) + { + if (empty($entres)) { + return ''; + } + foreach ($entries as $entry) { + $name = !empty($phrase) + ? TextHelper::highlight( TextHelper::h($entry->name), $phrase) + : TextHelper::h($entry->name); + $item = TagHelper::content_tag('div', $name); + $items[] = TagHelper::content_tag('li', $item); + } + return TagHelper::content_tag('ul', join('', array_unique($items))); + } + + function text_field_with_auto_complete($object, $method, $tag_options = array(), $completion_options = array()) + { + $completion_options['indicator'] = "'{$object}_{$method}'"; + return parent::text_field_with_auto_complete($object, $method, $tag_options, $completion_options); + } +} + +?> \ No newline at end of file Modified: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php 2008-03-09 14:40:12 UTC (rev 52) +++ app/helpers/city_helper.php 2008-03-09 16:40:08 UTC (rev 53) @@ -1,38 +1,11 @@ <?php -require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'javascript_helper.php'); require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'tag_helper.php'); require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'form_helper.php'); -class CityHelper extends AkActionViewHelper +class CityHelper extends AutoCompleteHelper { - function auto_complete_field($field_id, $options = array()) - { - $function = "var {$field_id}_auto_completer = new Ajax.Autocompleter("; - $function .= "'{$field_id}', "; - $function .= !empty($options['update']) ? "'{$options['update']}', " : "'{$field_id}_auto_complete', "; - $function .= "'".UrlHelper::url_for($options['url'])."'"; - - $js_options = array(); - foreach (array('paramName', - 'tokens', - 'frequency', - 'minChars', - 'indicator', - 'updateElement', - 'afterUpdateElement', - 'callback', - 'parameters') as $key) { - if (!empty($options[$key])) { - $js_options[$key] = $options[$key]; - } - } - - $function .= ', '.JavaScriptHelper::_options_for_javascript($js_options).')'; - return JavaScriptHelper::javascript_tag($function); - } - function auto_complete_result($cities, $phrase = null) { if (empty($cities)) { @@ -61,7 +34,8 @@ 'skip_style' => true, 'url' => array('action' => 'auto_complete_for_city'), 'frequency' => 0.4, - 'afterUpdateElement' => "function (text, li) { $('{$object}_{$method}').value = li.id; $('{$object}_{$method}_prev').value = text.value; }" + 'indicator' => "'auto_{$object}_{$method}'", + 'afterUpdateElement' => "function (text, li) { \$('{$object}_{$method}').value = li.id; \$('{$object}_{$method}_prev').value = text.value; }" ), $completion_options); $hidden = $this->_controller->form_helper->hidden_field($object, $method); @@ -72,6 +46,7 @@ return $hidden . $hidden_prev . $text_field . $div . $javascript; } + } ?> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-09 14:40:12 UTC (rev 52) +++ app/views/layouts/application.tpl 2008-03-09 16:40:08 UTC (rev 53) @@ -7,8 +7,22 @@ <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/<?= $controller->getControllerName() ?>.css" rel="stylesheet" type="text/css"> <script src="/javascripts/prototype.js" type="text/javascript"></script> -<script src="/javascripts/scriptaculous.js" type="text/javascript"></script> +<script src="/javascripts/scriptaculous.js?load=effects,controls,autocomplete" type="text/javascript"></script> <script src="/javascripts/autocomplete.js" type="text/javascript"></script> +<script type="text/javascript"> + function push_onload_handler (func) { + if (!window._onload) window._onload = []; + window._onload.push(func); + } + + window.onload = function (event) { + if (window._onload) { + for (var i = 0; i < window._onload.length; i++) { + window._onload[i](event); + } + } + } +</script> </head> <body id="application"> <div id="main"> Modified: app/views/profile/basic.tpl =================================================================== --- app/views/profile/basic.tpl 2008-03-09 14:40:12 UTC (rev 52) +++ app/views/profile/basic.tpl 2008-03-09 16:40:08 UTC (rev 53) @@ -15,7 +15,7 @@ </div> <div class="formrow"> <label>_{Hometown}:</label> - <?= $city_helper->city_field('basic', 'city', array('class' => 'shorttextinput')); ?> + <?= $city_helper->city_field('basic', 'city', array('class' => 'autocomplete')); ?> </div> <div id="basic_country_div" class="formrow" style="display:none"> <label>_{Country}:</label> @@ -27,7 +27,7 @@ </div> <div class="formrow"> <label>_{Religious views}:</label> - <?= $javascript_macros_helper->text_field_with_auto_complete('basic', 'religious_view', array('autocomplete' => 'on', 'class' => 'shorttextinput'), array('skip_style' => true) )?> + <?= $auto_complete_helper->text_field_with_auto_complete('basic', 'religious_view', array('autocomplete' => 'on', 'class' => 'autocomplete'), array('skip_style' => true) )?> </div> <div class="formrow"> <label></label> @@ -37,30 +37,3 @@ </div> </div> </form> - -<script type="text/javascript"> - - - function city_changed () { - if (!$F('basic_city')) { - $('basic_country_div').hide(); - } - } - - function city_blurred () { - // check city existence - if ($F('basic_city')) { - // order is important !!! - $('basic_country_id').focus(); - $('basic_country_div').show(); - } - } - - /* - window.onload = function () { - $('basic_city').observe("keyup", city_changed); - $('auto_basic_city').observe("change", city_blurred); - } - */ - -</script> Modified: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl 2008-03-09 14:40:12 UTC (rev 52) +++ app/views/shared/loggedin/pageheader.tpl 2008-03-09 16:40:08 UTC (rev 53) @@ -8,9 +8,11 @@ </ul> <script> -window.onload = function () { - new Ajax.PeriodicalUpdater('messages_count', '/message/inbox_count', { - method: 'get', frequency: 3, decay: 0 - }); -} + push_onload_handler( + function (event) { + new Ajax.PeriodicalUpdater('messages_count', '/message/inbox_count', { + method: 'get', frequency: 3, decay: 0 + }); + } + ); </script> Added: public/images/spinner-faded.gif =================================================================== (Binary files differ) Property changes on: public/images/spinner-faded.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/spinner.gif =================================================================== (Binary files differ) Property changes on: public/images/spinner.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: public/javascripts/autocomplete.js =================================================================== --- public/javascripts/autocomplete.js 2008-03-09 14:40:12 UTC (rev 52) +++ public/javascripts/autocomplete.js 2008-03-09 16:40:08 UTC (rev 53) @@ -1,3 +1,13 @@ +Ajax.IAutocompleter = Class.create(Ajax.Autocompleter, { + startIndicator: function() { + if(this.options.indicator) Element.addClassName(this.options.indicator, 'loading'); + }, + + stopIndicator: function() { + if(this.options.indicator) Element.removeClassName(this.options.indicator, 'loading'); + }, +}); + function city_updated (input, prev, hidden) { if ($F(input)) { if ($F(input) != $F(prev)) { @@ -3,9 +13,10 @@ $(input).value = ''; $(hidden).value = ''; - $(prev).value = ''; - new Effect.Highlight(input, { startcolor: '#ff0000'}); + $(prev).value = ''; + new Effect.Highlight(input, { keepBackgroundImage: true, startcolor: '#ff0000', afterFinish: function (obj) { obj.element.setStyle('') } }); } } else { $(hidden).value = ''; } } + Modified: public/stylesheets/autocomplete.css =================================================================== --- public/stylesheets/autocomplete.css 2008-03-09 14:40:12 UTC (rev 52) +++ public/stylesheets/autocomplete.css 2008-03-09 16:40:08 UTC (rev 53) @@ -3,6 +3,15 @@ margin-left: 4px; } +input.autocomplete { + padding-right: 18px; + background: url('/images/spinner-faded.gif') no-repeat right; +} + +input.autocomplete.loading { + background-image: url('/images/spinner.gif'); +} + span.indicator img { vertical-align: middle; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-09 14:40:07
|
Revision: 52 http://isocial.svn.sourceforge.net/isocial/?rev=52&view=rev Author: dim0s77 Date: 2008-03-09 07:40:12 -0700 (Sun, 09 Mar 2008) Log Message: ----------- minor fix Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 14:16:35 UTC (rev 51) +++ app/controllers/message_controller.php 2008-03-09 14:40:12 UTC (rev 52) @@ -130,11 +130,11 @@ function _mark_messages ($is_read) { if (!empty($this->params['check_messages'])) { $messages = $this->Message->find('all', - array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); + array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")"))); if ($messages) { foreach ($messages as $message_loop_key => $message) { - if ($message->sender_id = $this->current_user->getId() || - $message->recipient_id = $this->current_user->getId()) { + if ($message->sender_id == $this->current_user->getId() || + $message->recipient_id == $this->current_user->getId()) { $message->is_read = $is_read; $message->save(); } @@ -152,15 +152,15 @@ array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); if ($threads) { foreach ($threads as $thread_loop_key => $thread) { - if ($thread->sender_id = $this->current_user->getId() || - $thread->recipient_id = $this->current_user->getId()) { + if ($thread->sender_id == $this->current_user->getId() || + $thread->recipient_id == $this->current_user->getId()) { $this->Message->destroyAll("thread_id = $thread->thread_id"); } } } } return $this->render(array('partial' => 'rows', - 'locals' => array('messages' => $this->_getInboxMessages(), + 'locals' => array('messages' => $this->_getBoxMessages('inbox_message'), 'target' => 'sender'))); } } Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-09 14:16:35 UTC (rev 51) +++ app/views/message/_rows.tpl 2008-03-09 14:40:12 UTC (rev 52) @@ -20,7 +20,7 @@ <td class="checkbox"><input onclick="oncheck(this, {?message.is_read}{message.is_read}{else}0{end})" type="checkbox" class="check{?message.is_read}read{else}unread{end}" id="{message.id}" name="check_messages[]" value="{message.id}"></td> <td class="profile_photo"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> <td class="info"> - <span class="name"><a href=""><? if ($target == 'recipient') { ?>_{To}: <? } ?>{sender.name?}</a></span> + <span class="name"><? if ($target == 'recipient') { ?>_{To}: <? } ?><a href="">{sender.name?}</a></span> <span class="datetime">{message.created_at?}</span> </td> <td class="msg"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-09 14:16:30
|
Revision: 51 http://isocial.svn.sourceforge.net/isocial/?rev=51&view=rev Author: dim0s77 Date: 2008-03-09 07:16:35 -0700 (Sun, 09 Mar 2008) Log Message: ----------- fix message_threads calculation Modified Paths: -------------- app/controllers/message_controller.php Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 13:53:21 UTC (rev 50) +++ app/controllers/message_controller.php 2008-03-09 14:16:35 UTC (rev 51) @@ -10,14 +10,10 @@ function inbox () { $this->inbox_messages = $this->_getBoxMessages('inbox_message'); - $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', - 'conditions' => "sender_id = " . $this->current_user->getId())); } function outbox () { $this->outbox_messages = $this->_getBoxMessages('outbox_message'); - $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', - 'conditions' => "recipient_id = " . $this->current_user->getId())); } function _getBoxMessages ($box_message) { @@ -30,6 +26,9 @@ } } } + $user_id = $box_message == 'inbox_message' ? 'sender_id' : 'recipient_id'; + $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', + 'conditions' => "$user_id = " . $this->current_user->getId())); return $box_messages; } @@ -143,7 +142,7 @@ } } return $this->render(array('partial' => 'rows', - 'locals' => array('messages' => $this->_getInboxMessages(), + 'locals' => array('messages' => $this->_getBoxMessages('inbox_message'), 'target' => 'sender'))); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-09 13:53:18
|
Revision: 50 http://isocial.svn.sourceforge.net/isocial/?rev=50&view=rev Author: dim0s77 Date: 2008-03-09 06:53:21 -0700 (Sun, 09 Mar 2008) Log Message: ----------- added reading message after his opening by recipient Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 13:06:23 UTC (rev 49) +++ app/controllers/message_controller.php 2008-03-09 13:53:21 UTC (rev 50) @@ -9,45 +9,30 @@ } function inbox () { - $this->inbox_messages = $this->_getInboxMessages(); + $this->inbox_messages = $this->_getBoxMessages('inbox_message'); $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', 'conditions' => "sender_id = " . $this->current_user->getId())); } - - function _getInboxMessages () { - $messages = $this->current_user->inbox_message->load(); - $inbox_messages = array(); - if(!empty($messages)) { - foreach ($messages as $message_loop_key => $message) { - if (isset($inbox_messages[$message->thread_id])) { - if ($inbox_messages[$message->thread_id]->id < $message->id) { - $inbox_messages[$message->thread_id] = $message; - } - } else { - $inbox_messages[$message->thread_id] = $message; - } - } - } - return $inbox_messages; + + function outbox () { + $this->outbox_messages = $this->_getBoxMessages('outbox_message'); + $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', + 'conditions' => "recipient_id = " . $this->current_user->getId())); } - function outbox () { - $messages = $this->current_user->outbox_message->load(); - $outbox_messages = array(); + function _getBoxMessages ($box_message) { + $messages = $this->current_user->$box_message->load(); + $box_messages = array(); if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { - if (isset($outbox_messages[$message->thread_id])) { - if ($outbox_messages[$message->thread_id]->id < $message->id) { - $outbox_messages[$message->thread_id] = $message; - } - } else { - $outbox_messages[$message->thread_id] = $message; + if (!isset($inbox_messages[$message->thread_id])) { + $box_messages[$message->thread_id] = $message; } } } - $this->outbox_messages = $outbox_messages; + return $box_messages; } - + function send () { if (!empty($this->params['message']) && !empty($this->params['message']['recipient']) && @@ -57,10 +42,9 @@ $message = $this->current_user->outbox_message->build(); $message->setAttributes($this->params['message']); $message->recipient->assign($recipient); - if (empty($message->subject)) { - $message->subject = $this->t('(no subject)'); - } - + if (empty($message->subject)) { + $message->subject = $this->t('(no subject)'); + } if ($message->save()) { if (!$message->thread_id) { $message->thread_id = $message->getId(); @@ -96,7 +80,7 @@ 'include' => array('sender', 'recipient'))); return $this->render(array('partial' =>'thread', 'locals' => array('interlocutor' => $interlocutor, - 'messages' => $messages))); + 'messages' => $messages))); } } } @@ -113,9 +97,18 @@ if ($thread->sender_id == $user_id || $thread->recipient_id == $user_id ) { $recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; $this->interlocutor = $this->User->findFirst(array( 'id' => $recipient_id)); - $this->messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), - 'order' => 'created_at', - 'include' => array('sender', 'recipient'))); + $messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), + 'order' => 'created_at', + 'include' => array('sender', 'recipient'))); + if(!empty($messages)) { + foreach ($messages as $message_loop_key => $message) { + if ($message->recipient_id == $this->current_user->getId()) { + $message->is_read = 1; + $message->save(); + } + } + } + $this->messages = $messages; return; } } Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-09 13:06:23 UTC (rev 49) +++ app/views/message/_rows.tpl 2008-03-09 13:53:21 UTC (rev 50) @@ -7,9 +7,9 @@ <? if ($target == 'sender') { echo '<a href="">'; if (!$message->is_read) { - echo '<img src="/images/email.png" alt="_{New message}" class="">'; + echo '<img src="/images/email.png" alt="' . $text_helper->translate("New message", array()) . '">'; } else { - echo '<img src="/images/email_open.png" alt="_{Message is readed}" class="">'; + echo '<img src="/images/email_open.png" alt="' . $text_helper->translate("Message is read", array()) . '">'; } echo '</a>'; } else { @@ -20,7 +20,7 @@ <td class="checkbox"><input onclick="oncheck(this, {?message.is_read}{message.is_read}{else}0{end})" type="checkbox" class="check{?message.is_read}read{else}unread{end}" id="{message.id}" name="check_messages[]" value="{message.id}"></td> <td class="profile_photo"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> <td class="info"> - <span class="name"><a href="">{sender.name?}</a></span> + <span class="name"><a href=""><? if ($target == 'recipient') { ?>_{To}: <? } ?>{sender.name?}</a></span> <span class="datetime">{message.created_at?}</span> </td> <td class="msg"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-09 13:06:18
|
Revision: 49 http://isocial.svn.sourceforge.net/isocial/?rev=49&view=rev Author: aguidrevitch Date: 2008-03-09 06:06:23 -0700 (Sun, 09 Mar 2008) Log Message: ----------- recipient is required field for message Modified Paths: -------------- app/controllers/message_controller.php Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 12:53:18 UTC (rev 48) +++ app/controllers/message_controller.php 2008-03-09 13:06:23 UTC (rev 49) @@ -49,12 +49,18 @@ } function send () { - if (!empty($this->params['message'])){ + if (!empty($this->params['message']) && + !empty($this->params['message']['recipient']) && + !empty($this->params['message']['body'])) { $recipient = $this->User->findFirst(array( 'id' => $this->params['message']['recipient'] )); if ($recipient) { $message = $this->current_user->outbox_message->build(); + $message->setAttributes($this->params['message']); $message->recipient->assign($recipient); - $message->setAttributes($this->params['message']); + if (empty($message->subject)) { + $message->subject = $this->t('(no subject)'); + } + if ($message->save()) { if (!$message->thread_id) { $message->thread_id = $message->getId(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-09 12:53:12
|
Revision: 48 http://isocial.svn.sourceforge.net/isocial/?rev=48&view=rev Author: aguidrevitch Date: 2008-03-09 05:53:18 -0700 (Sun, 09 Mar 2008) Log Message: ----------- unread message count updated Modified Paths: -------------- app/controllers/message_controller.php Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 12:49:47 UTC (rev 47) +++ app/controllers/message_controller.php 2008-03-09 12:53:18 UTC (rev 48) @@ -117,9 +117,8 @@ } function inbox_count () { - $messages = $this->Message->find('all', array('conditions' => array('is_read' => '0'))); - return $this->render(array('partial' =>'count', - 'locals' => array('count' => count($messages)))); + $this->count = $this->Message->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0", $this->current_user->getId()))); + return $this->render(array('partial' =>'count')); } function mark_unread () { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-09 12:49:42
|
Revision: 47 http://isocial.svn.sourceforge.net/isocial/?rev=47&view=rev Author: aguidrevitch Date: 2008-03-09 05:49:47 -0700 (Sun, 09 Mar 2008) Log Message: ----------- more patches to akelos : AkActiveRecord::count fixed Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-03-09 12:04:55 UTC (rev 46) +++ akelos.diff 2008-03-09 12:49:47 UTC (rev 47) @@ -1,8 +1,8 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 500) +--- lib/Ak.php (revision 505) +++ lib/Ak.php (working copy) -@@ -186,6 +186,11 @@ +@@ -183,6 +183,11 @@ return @$string[$try_whith_lang]; } @@ -14,7 +14,7 @@ if(isset($controller) && !isset($framework_dictionary[$controller.'_dictionary']) && is_file(AK_APP_DIR.DS.'locales'.DS.$controller.DS.$lang.'.php')){ require(AK_APP_DIR.DS.'locales'.DS.$controller.DS.$lang.'.php'); $framework_dictionary[$controller.'_dictionary'] = (array)$dictionary; -@@ -193,6 +198,8 @@ +@@ -190,6 +195,8 @@ if(isset($controller) && isset($framework_dictionary[$controller.'_dictionary'][$string])){ $string = $framework_dictionary[$controller.'_dictionary'][$string]; @@ -25,7 +25,7 @@ } Index: lib/AkActiveRecord.php =================================================================== ---- lib/AkActiveRecord.php (revision 500) +--- lib/AkActiveRecord.php (revision 505) +++ lib/AkActiveRecord.php (working copy) @@ -4721,7 +4721,7 @@ $resulting_array = array(); @@ -36,3 +36,43 @@ } } return $resulting_array; +@@ -5003,8 +5003,27 @@ + + $sql .= empty($options['joins']) ? '' : " {$options['joins']} "; + ++ //$this->santizeSql(conditions); ++ if(!empty($options['conditions']) && is_array($options['conditions'])){ ++ if (isset($options['conditions'][0]) && strstr($options['conditions'][0], '?') && count($options['conditions']) > 1){ ++ //array('conditions' => array("name=?",$name)) ++ $pattern = array_shift($options['conditions']); ++ $options['bind'] = array_values($options['conditions']); ++ $options['conditions'] = $pattern; ++ }elseif (isset($options['conditions'][0])){ ++ //array('conditions' => array("user_name = :user_name", ':user_name' => 'hilario') ++ $pattern = array_shift($options['conditions']); ++ $options['conditions'] = str_replace(array_keys($options['conditions']), array_values($this->getSanitizedConditionsArray($options['conditions'])),$pattern); ++ }else{ ++ //array('conditions' => array('user_name'=>'Hilario')) ++ $options['conditions'] = join(' AND ',(array)$this->getAttributesQuoted($options['conditions'])); ++ } ++ } ++ ++ + empty($options['conditions']) ? null : $this->addConditions($sql, $options['conditions']); + ++ + if (!empty($options['group'])){ + $sql .= " GROUP BY {$options['group_field']} "; + $sql .= empty($options['having']) ? '' : " HAVING {$options['having']} "; +@@ -5013,6 +5032,11 @@ + $sql .= empty($options['order']) ? '' : " ORDER BY {$options['order']} "; + $this->_db->addLimitAndOffset($sql, $options); + $sql .= $use_workaround ? ')' : ''; ++ ++ if(!empty($options['bind']) && is_array($options['bind']) && strstr($sql,'?')){ ++ $sql = array_merge(array($sql),$options['bind']); ++ } ++ + return $sql; + } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-09 12:04:49
|
Revision: 46 http://isocial.svn.sourceforge.net/isocial/?rev=46&view=rev Author: dim0s77 Date: 2008-03-09 05:04:55 -0700 (Sun, 09 Mar 2008) Log Message: ----------- messaging updated Modified Paths: -------------- app/controllers/message_controller.php app/locales/message/ru.php app/shared_model.php app/views/message/_rows.tpl app/views/message/inbox.tpl app/views/message/show.tpl app/views/shared/loggedin/pageheader.tpl config/routes.php public/stylesheets/Message.css Added Paths: ----------- app/views/message/_count.tpl app/views/message/_thread.tpl public/images/email.png public/images/email_open.png Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 12:04:52 UTC (rev 45) +++ app/controllers/message_controller.php 2008-03-09 12:04:55 UTC (rev 46) @@ -9,6 +9,12 @@ } function inbox () { + $this->inbox_messages = $this->_getInboxMessages(); + $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', + 'conditions' => "sender_id = " . $this->current_user->getId())); + } + + function _getInboxMessages () { $messages = $this->current_user->inbox_message->load(); $inbox_messages = array(); if(!empty($messages)) { @@ -22,7 +28,7 @@ } } } - $this->inbox_messages = $inbox_messages; + return $inbox_messages; } function outbox () { @@ -64,25 +70,101 @@ $this->addError('_common', 'Sending message error', 'please, try again'); } } + + function reply () { + if (!empty($this->params['message'])) { + $recipient = $this->User->findFirst(array( 'id' => $this->params['message']['recipient'] )); + if ($recipient) { + $message = $this->current_user->outbox_message->build(); + $message->recipient->assign($recipient); + $message->setAttributes($this->params['message']); + if ($message->save()) { + $thread_id = $this->params['message']['thread_id']; + $thread = $this->Message->findFirst(array('thread_id' => $thread_id )); + $user_id = $this->current_user->getId(); + if ($thread->sender_id == $user_id || $thread->recipient_id == $user_id ) { + $recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; + $interlocutor = $this->User->findFirst(array( 'id' => $recipient_id)); + $messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), + 'order' => 'created_at', + 'include' => array('sender', 'recipient'))); + return $this->render(array('partial' =>'thread', + 'locals' => array('interlocutor' => $interlocutor, + 'messages' => $messages))); + } + } + } + } + } function send_successfully () { } function show () { - if (!empty($this->params['t'])){ - $thread = $this->Message->FindFirst(array( 'thread_id' => $this->params['t'] )); + if (!empty($this->params['t'])) { + $thread = $this->Message->findFirst(array('thread_id' => $this->params['t'] )); $user_id = $this->current_user->getId(); if ($thread->sender_id == $user_id || $thread->recipient_id == $user_id ) { - $this->recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; + $recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; + $this->interlocutor = $this->User->findFirst(array( 'id' => $recipient_id)); $this->messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), - 'order' => 'created_at')); - $this->interlocutors[$user_id] = $this->current_user; - $this->interlocutors[$this->recipient_id] = $this->User->findFirst(array( 'id' => $this->recipient_id)); + 'order' => 'created_at', + 'include' => array('sender', 'recipient'))); return; } } $this->addError('_common', 'Thread unavailable', 'Sorry, the contents of this thread are temporarily unavailable. Please check back later.'); } + function inbox_count () { + $messages = $this->Message->find('all', array('conditions' => array('is_read' => '0'))); + return $this->render(array('partial' =>'count', + 'locals' => array('count' => count($messages)))); + } + + function mark_unread () { + return $this->_mark_messages(0); + } + + function mark_read () { + return $this->_mark_messages(1); + } + + function _mark_messages ($is_read) { + if (!empty($this->params['check_messages'])) { + $messages = $this->Message->find('all', + array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); + if ($messages) { + foreach ($messages as $message_loop_key => $message) { + if ($message->sender_id = $this->current_user->getId() || + $message->recipient_id = $this->current_user->getId()) { + $message->is_read = $is_read; + $message->save(); + } + } + } + } + return $this->render(array('partial' => 'rows', + 'locals' => array('messages' => $this->_getInboxMessages(), + 'target' => 'sender'))); + } + + function delete_thread () { + if (!empty($this->params['check_messages'])) { + $threads = $this->Message->find('all', + array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); + if ($threads) { + foreach ($threads as $thread_loop_key => $thread) { + if ($thread->sender_id = $this->current_user->getId() || + $thread->recipient_id = $this->current_user->getId()) { + $this->Message->destroyAll("thread_id = $thread->thread_id"); + } + } + } + } + return $this->render(array('partial' => 'rows', + 'locals' => array('messages' => $this->_getInboxMessages(), + 'target' => 'sender'))); + } } ?> \ No newline at end of file Modified: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php 2008-03-09 12:04:52 UTC (rev 45) +++ app/locales/message/ru.php 2008-03-09 12:04:55 UTC (rev 46) @@ -19,6 +19,8 @@ $dictionary['All'] = 'все'; $dictionary['Mark as'] = 'Отметить как'; $dictionary['Delete'] = 'Удалить'; +$dictionary['New message'] = 'Новое сообщение'; +$dictionary['Message is readed'] = 'Сообщение прочитано'; $dictionary['Message successfully sended'] = 'Сообщение отправлено'; $dictionary['Thread unavailable'] = 'Нить сообщений недоступна'; $dictionary['Sorry, the contents of this thread are temporarily unavailable. Please check back later.'] = 'К сожалению, содержание этой нити сообщений временно недоступно. Повторите попытку позже.'; @@ -27,5 +29,7 @@ $dictionary['and'] = 'и'; $dictionary['Reply'] = 'Ответ'; $dictionary['Back to'] = 'Обратно во'; +$dictionary['Delete Thread'] = 'Удалить нить сообщений'; +$dictionary['Are you sure you want to delete this thread'] = 'Вы уверены, что хотите удалить эту нить сообщений'; ?> Modified: app/shared_model.php =================================================================== --- app/shared_model.php 2008-03-09 12:04:52 UTC (rev 45) +++ app/shared_model.php 2008-03-09 12:04:55 UTC (rev 46) @@ -14,6 +14,15 @@ */ class ActiveRecord extends AkActiveRecord { + + function _make_in_statement_from_array ($column_name, $values) { + $options = array(); + foreach ($values as $value) { + $options[] = $this->castAttributeForDatabase($column_name, $value); + } + return join(", ", $options); + } + } ?> Added: app/views/message/_count.tpl =================================================================== --- app/views/message/_count.tpl (rev 0) +++ app/views/message/_count.tpl 2008-03-09 12:04:55 UTC (rev 46) @@ -0,0 +1 @@ +{count} \ No newline at end of file Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-09 12:04:52 UTC (rev 45) +++ app/views/message/_rows.tpl 2008-03-09 12:04:55 UTC (rev 46) @@ -1,11 +1,25 @@ <table class="message_row"> <tbody> {loop messages} -<tr><? $sender = $message->$target->load() ?> - <td class="msg_icon"> </td> - <td class="checkbox"><input onclick="" type="checkbox"></td> +<? $sender = $message->$target->load() ?> +<tr class="<? if (!$message->is_read) { echo 'new_message'; } ?>"> + <td class="msg_icon"> + <? if ($target == 'sender') { + echo '<a href="">'; + if (!$message->is_read) { + echo '<img src="/images/email.png" alt="_{New message}" class="">'; + } else { + echo '<img src="/images/email_open.png" alt="_{Message is readed}" class="">'; + } + echo '</a>'; + } else { + echo '<span> </span>'; + } + ?> + </td> + <td class="checkbox"><input onclick="oncheck(this, {?message.is_read}{message.is_read}{else}0{end})" type="checkbox" class="check{?message.is_read}read{else}unread{end}" id="{message.id}" name="check_messages[]" value="{message.id}"></td> <td class="profile_photo"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> - <td class="name_and_datetime"> + <td class="info"> <span class="name"><a href="">{sender.name?}</a></span> <span class="datetime">{message.created_at?}</span> </td> @@ -13,7 +27,7 @@ <div class="wrapper"> <a href="/message/show?t={message.thread_id?}" class="subject">{message.subject?}</a> <div class="body_wrap"> - <? (utf8_strlen($message->body) > 50) ? $msg_body = utf8_substr($message->body, 0, 50) . " [..]" : $msg_body = $message->body; ?> + <? (utf8_strlen($message->body) > 47) ? $msg_body = utf8_substr($message->body, 0, 47) . " [..]" : $msg_body = $message->body; ?> <a href="/message/show?t={message.thread_id?}" class="body">{msg_body?}</a> </div> </div> @@ -30,4 +44,5 @@ </tbody> </table> -<div class="inbox_footer"><div class="mailbox_size">1 Message Threads</div></div> +<div class="inbox_footer"><div class="mailbox_size">{message_threads} _{Message Threads}</div></div> + Added: app/views/message/_thread.tpl =================================================================== --- app/views/message/_thread.tpl (rev 0) +++ app/views/message/_thread.tpl 2008-03-09 12:04:55 UTC (rev 46) @@ -0,0 +1,17 @@ +<div class="head"> + <h2 class="subject">{messages-0.subject}</h2> + <div class="interlocutors">_{Between} + <a href="">_{You}</a> _{and} <a href="">{interlocutor.name}</a> + </div> +</div> +{loop messages} +<div class="message" id="msg{message_loop_counter}"> + <div class="message_author_pict"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></div> + <div class="message_author_info"> + <div class="name"><a href="">{message.sender.name?}</a></div> + <div class="date">{message.created_at?}</div> + </div> + <div class="message_body">{message.body?}</div> +</div> +<div class="divide_line"> </div> +{end} Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-09 12:04:52 UTC (rev 45) +++ app/views/message/inbox.tpl 2008-03-09 12:04:55 UTC (rev 46) @@ -3,9 +3,9 @@ <div class="inbox_submenu"> <div class="menu_block selector"> <label for="action_select">_{Select}: - <select class="" onchange="" id="action_select" name="action_selector"> + <select class="" onchange="onselect(this)" id="action_select" name="action_selector"> <option selected="selected" value="_">---------</option> - <option value="">_{None}</option> + <option value="none">_{None}</option> <option value="read">_{Read}</option> <option value="unread">_{Unread}</option> <option value="all">_{All}</option> @@ -14,15 +14,83 @@ </div> <div class="menu_block"> <ul id="inbox_action" class="buttons"> - <li class="disabled"><a>_{Mark as}:</a></li> - <li class="disabled"><a href="#" onclick="" id="unread">_{Unread},</a></li> - <li class="disabled"><a href="#" onclick="" id="read">_{Read};</a></li> - <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> + <li><a class="disabled">_{Mark as}:</a></li> + <li><a href="#" onclick="mark_as_unread(this)" id="unread_link" class="disabled">_{Unread},</a></li> + <li><a href="#" onclick="mark_as_read(this)" id="read_link" class="disabled">_{Read};</a></li> + <li><a href="#" onclick="delete_thread(this)" id="delete_link" class="disabled">_{Delete}</a></li> </ul> </div> </div> -<?= $controller->render(array('partial' => 'rows', - 'locals' => array('messages' => $inbox_messages, - 'target' => 'sender'))) ?> +<form id="messages_form" action="/message/inbox" method="post" onsubmit="return false;"> + <div id="messages"> + <?= $controller->render(array('partial' => 'rows', + 'locals' => array('messages' => $inbox_messages, + 'target' => 'sender'))) ?> + </div> +</form> +<script> +function oncheck (element, is_read) { + checkread = $$('input[type=checkbox].checkread:checked'); + checkunread = $$('input[type=checkbox].checkunread:checked'); + + checkread.length ? $("unread_link").removeClassName('disabled') : $("unread_link").addClassName('disabled'); + checkunread.length ? $("read_link").removeClassName('disabled') : $("read_link").addClassName('disabled'); + checkunread.length || checkread.length ? $("delete_link").removeClassName('disabled') : $("delete_link").addClassName('disabled'); +}; + +function onselect (element) { + var checkboxes; + switch (element.getValue()) { + case "none": + checkboxes = $$('input[type=checkbox]:checked'); + break; + case "read": + checkboxes = $$('input[type=checkbox].checkread:not(:checked)'); + checkboxes = checkboxes.concat($$('input[type=checkbox].checkunread:checked')); + break; + case "unread": + checkboxes = $$('input[type=checkbox].checkread:checked'); + checkboxes = checkboxes.concat($$('input[type=checkbox].checkunread:not(:checked)')); + break; + case "all": + checkboxes = $$('input[type=checkbox]:not(:checked)'); + break; + } + if (checkboxes) { + checkboxes.invoke('click'); + } +}; + +function mark_as_unread (element) { + new Ajax.Updater('messages', + '/message/mark_unread', + { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + disable_action_links(); + return false; +} + +function mark_as_read (element) { + new Ajax.Updater('messages', + '/message/mark_read', + { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + disable_action_links(); + return false; +} + +function delete_thread (element) { + new Ajax.Updater('messages', + '/message/delete_thread', + { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + disable_action_links(); + return false; +} + +function disable_action_links () { + $("read_link").addClassName('disabled'); + $("unread_link").addClassName('disabled'); + $("delete_link").addClassName('disabled'); +} + +</script> Modified: app/views/message/show.tpl =================================================================== --- app/views/message/show.tpl 2008-03-09 12:04:52 UTC (rev 45) +++ app/views/message/show.tpl 2008-03-09 12:04:55 UTC (rev 46) @@ -3,45 +3,33 @@ <?= $controller->renderErrors() ?> <div class="messages_thread"> - <div class="thread_head"> - <h2 class="subject">{messages-0.subject} - <div class="interlocutors">_{Between} - <a href="">_{You}</a> _{and} - <a href=""><? $recipient = $interlocutors[$recipient_id] ?>{recipient.name}</a></div> - </h2> + <div id="messages"> + <?= $controller->render(array('partial' =>'thread', + 'locals' => array('interlocutor' => $interlocutor, + 'messages' => $messages))); ?> </div> - <hr width="600px"> -{loop messages} - <? $interlocutor = $interlocutors[$message->sender_id] ?> - <div class="message" id="msg{message_loop_counter}"> - <div class="column author_picture"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></div> - <div class="column author_info"> - <div class="name"><a href="">{interlocutor.name?}</a></div> - <div class="date">{message.created_at?}</div> - <div class="extras"></div> - </div> - <div class="column body"> - <div class="text">{message.body?}</div> - </div> - </div> - <div class="msg_divide_btm"> </div> -{end} - <div class="reply_container"> - <form action="/message/send" method="post"> - <div class="row"><label>_{Reply}:</label></div> - <div class="row"><?= $form_helper->text_area('message', 'body', array('class' => 'textinput'))?></div> - <input id="message_recipient" name="message[recipient]" type="hidden" value="{recipient_id}" /> - <input id="message_thread_id" name="message[thread_id]" type="hidden" value="{message.thread_id}" /> - <input id="message_subject" name="message[subject]" type="hidden" value="re: {message.subject}" /> - <div class="msg_divide_btm"> </div> - <div class="row"> - <div class="submits"> - <input class="submitinput" type="submit" value="_{Send}"> - <input class="cancelinput" type="button" value="_{Back to} _{Inbox}" onclick=""> - </div> - <div class="sub_controls"><a href="#" onclick="">_{Delete}</a></div> + <form id="reply_message_form" action="/message/show" method="post" onsubmit="return false;"> + <label>_{Reply}:</label> + <?= $form_helper->text_area('message', 'body', array('class' => 'textinput'))?> + <input id="message_recipient" name="message[recipient]" type="hidden" value="{interlocutor.id}" /> + <input id="message_thread_id" name="message[thread_id]" type="hidden" value="{messages-0.thread_id}" /> + <input id="message_subject" name="message[subject]" type="hidden" value="re: {messages-0.subject}" /> + <div class="divide_line"> </div> + <div class="submits"> + <input class="submitinput" type="submit" value="_{Send}" onclick="new Ajax.Updater('messages', '/message/reply', { method:'post', asynchronous:true, parameters:Form.serialize('reply_message_form')}); $('message_body').clear(); return false;"> + <input class="cancelinput" type="button" value="_{Back to} _{Inbox}" onclick=""> + </div> + <div class="sub_controls"><a href="#" onclick="Element.show('dlg'); return false;">_{Delete}</a></div> </form> </div> - </div> + +<div class="action_dialog" id="dlg"> + <div class="header">_{Delete Thread}</div> + <div class="body">_{Are you sure you want to delete this thread}?</div> + <div class="footer"><div class="buttons"> + <input class="submitinput" type="button" value="_{Delete}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div></div> +</div> Modified: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl 2008-03-09 12:04:52 UTC (rev 45) +++ app/views/shared/loggedin/pageheader.tpl 2008-03-09 12:04:55 UTC (rev 46) @@ -1,8 +1,16 @@ <ul id="headermenuleft"> <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/basic">_{edit}</a></li> <li><a class="globallink" href="/friend/">_{Friends}</a></li> - <li><a class="globallink" href="/message/">_{Messages} (0)</a></li> + <li><a class="globallink" href="/message/">_{Messages} (<span id="messages_count">0</span>)</a></li> </ul> <ul id="headermenuright"> <li><a href="/user/logout">_{Logout}</a></li> -</ul> \ No newline at end of file +</ul> + +<script> +window.onload = function () { + new Ajax.PeriodicalUpdater('messages_count', '/message/inbox_count', { + method: 'get', frequency: 3, decay: 0 + }); +} +</script> Modified: config/routes.php =================================================================== --- config/routes.php 2008-03-09 12:04:52 UTC (rev 45) +++ config/routes.php 2008-03-09 12:04:55 UTC (rev 46) @@ -2,7 +2,7 @@ // You can find more about routes on /lib/AkRouters.php and /test/test_AkRouter.php -$Map->connect('/:controller/:action', array('controller' => 'default', 'action' => 'index')); +$Map->connect('/:controller/:action/:id', array('controller' => 'default', 'action' => 'index')); $Map->connect('/', array('controller' => 'default', 'action' => 'index')); ?> Added: public/images/email.png =================================================================== (Binary files differ) Property changes on: public/images/email.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/email_open.png =================================================================== (Binary files differ) Property changes on: public/images/email_open.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-09 12:04:52 UTC (rev 45) +++ public/stylesheets/Message.css 2008-03-09 12:04:55 UTC (rev 46) @@ -31,11 +31,8 @@ display: block; } -.inbox_submenu .disabled a { +.inbox_submenu .disabled { color: #aaaaaa; -} - -.inbox_submenu .disabled a:hover { cursor: default; text-decoration: none; } @@ -57,6 +54,14 @@ width: 100%; } +.message_row .new_message { + background: #f4f8fc; +} + +.message_row .new_message .msg .subject { + font-weight: bold; +} + .message_row tr td { border-bottom: 1px solid #e1e1e1; padding: 5px 0px 5px 0px; @@ -67,8 +72,8 @@ display: block; margin-top: 1px; width: 17px; - height: 14px; - padding-left: 10px; + height: 19px; + padding: 0px 10px 0px 10px; text-decoration: none; } @@ -81,7 +86,7 @@ line-height: 1px; } -.message_row .name_and_datetime .name { +.message_row .info .name { display: block; width: 130px; margin-right: 20px; @@ -89,17 +94,13 @@ text-overflow: ellipsis; } -.name_and_datetime .datetime { +.message_row .info .datetime { display: block; padding: 1px 0px 0px 0px; font-size: 9px; color: #777777; } -.name_and_datetime .unread_name { - font-weight: bold; -} - .message_row .msg { margin-right: 10px; line-height: 14px; @@ -167,94 +168,75 @@ padding: 20px 30px 0px 30px; } -.thread_head { - margin: 0px 0px 0px 10px; +.head { + padding: 0px 0px 5px 185px; + border-bottom: 1px solid #777777; } -.thread_head h2 { - margin: 0px 20px 1px 153px; - padding: 0px 0px 0px 22px; +.head h2 { font-size: 15px; color: #333333; } -.thread_head h2 .interlocutors { +.head .interlocutors { + padding: 3px 0px 0px 0px; font-size: 11px; font-weight: normal; } .message { - display: block; - margin-top: 10px; - overflow: hidden; + //height: 1%; } -.message .column { +.message:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.message div { float: left; - padding: 0px 0px 10px 0px; + padding: 5px 0px 10px 0px; } -.message .author_picture { +.message_author_pict { width: 50px; padding-bottom: 0px; } -.message .author_picture img { +.message_author_pict img { display: block; } -.message .author_info { +.message_author_info { width: 120px; - padding: 0px 10px 0px 0px; font-weight: normal; font-size: 9px; - text-align: right; } -.message .author_info .name { - padding: 3px 5px 0px 5px; +.message_author_info .name { + padding: 3px 0px 0px 0px; font-size: 11px; font-weight: bold; - overflow: hidden; + float: right; + text-align: right; } -.message.unread .author_info .name { - padding: 3px 5px 4px 20px; - background: #eff2f7 url('/inbox/images/new_message.gif') no-repeat 7px 5px; - border-top: 1px solid #d8dfea; - overflow: hidden; -} - -.message .author_info .date { - display: block; - padding: 2px 5px 2px 0px; +.message_author_info .date { + padding: 2px 0px 2px 0px; color: #777777; -} - -.message .author_info .extras a { float: right; - padding-right: 5px; - margin-bottom: 1px; } -.message .body { - padding: 3px 0px 14px 5px; -} - -.message.unread .body { - padding-top: 4px; -} - -.message .body .text { - width: 300px; +.message_body { + margin: 3px 5px 14px 15px; + width: 380px; word-wrap: break-word; } -.message .body .text.no_body { - color: #777777; -} - -.msg_divide_btm { +.divide_line { height: 1px; margin: 1px 0px 0px 185px; background: #dddddd; @@ -268,27 +250,71 @@ overflow: auto; } -.reply_container .row { - display: block; +.reply_container form { padding: 5px 0px 0px 185px; - margin-right: 20px; - clear: both; } -.row textarea { +.reply_container form label { + margin: 0px 0px 5px 0px; +} + +.reply_container form textarea { height: 100px; - width: 355px; + width: 360px; padding: 5px 0px 15px 3px; font-size: 11px; - overflow: hidden; + overflow: auto; } -.row .submits { +.reply_container form .submits { float: left; } -.row .sub_controls { +.reply_container form .sub_controls { padding-top: 11px; font-size: 9px; float: right; } + +.reply_container form .divide_line { + height: 1px; + margin: 1px 0px 0px 0px; + background: #dddddd; + overflow: hidden; +} + +.action_dialog { + border: 6px solid #999999; + width: 465px; + overflow: auto; + top: 34px; + position: relative; + z-index: 100; +} + +.action_dialog .header { + background-color: #6d84b4; + border: 1px solid #3b5998; + color: #ffffff; + font-weight: bold; + font-size: 13px; + padding: 6px 0px 6px 10px; +} + +.action_dialog .body { + background-color: #ffffff; + color: #000000; + font-size: 11px; + padding: 15px; +} + +.action_dialog .footer { + background-color: #f2f2f2; + border: 1px solid #a6a6a6; + overflow: auto; +} + +.action_dialog .footer .buttons { + margin: 0px 6px 0px 0px; + float: right; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-09 12:04:48
|
Revision: 45 http://isocial.svn.sourceforge.net/isocial/?rev=45&view=rev Author: aguidrevitch Date: 2008-03-09 05:04:52 -0700 (Sun, 09 Mar 2008) Log Message: ----------- minor updates Modified Paths: -------------- app/helpers/city_helper.php app/locales/user/ru.php app/views/default/index.tpl app/views/layouts/application.tpl app/views/message/send_successfully.tpl app/views/profile/groups.tpl app/views/profile/picture.tpl app/views/user/confirm.tpl app/views/user/forgot_password.tpl app/views/user/home.tpl app/views/user/laststep.tpl app/views/user/reset_password.tpl app/views/user/thankyou.tpl public/stylesheets/Application.css public/stylesheets/autocomplete.css Modified: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php 2008-03-07 13:55:11 UTC (rev 44) +++ app/helpers/city_helper.php 2008-03-09 12:04:52 UTC (rev 45) @@ -54,16 +54,14 @@ $tag_options = array_merge(array( 'name' => "city", 'id' => "auto_{$object}_{$method}", - 'onblur' => "if (!$('{$object}_{$method}').value || \$F(this.id) != \$F('{$object}_{$method}_prev')) { $(this.id).value = ''; $('{$object}_{$method}').value = null; $('{$object}_{$method}_prev').value = null; new Effect.Highlight(this.id, { startcolor: '#ff0000'})}", + 'onblur' => "city_updated(this, '{$object}_{$method}_prev', '{$object}_{$method}')", 'autocomplete' => 'on', ), $tag_options); $completion_options = array_merge(array( 'skip_style' => true, 'url' => array('action' => 'auto_complete_for_city'), - 'minChars' => 3, 'frequency' => 0.4, - 'callback' => "function (element, value) { $('{$object}_{$method}').value = null; return value} ", - 'afterUpdateElement' => "function (text, li) { $('{$object}_{$method}').value = li.id; $('{$object}_{$method}_prev').value = text.value; } " + 'afterUpdateElement' => "function (text, li) { $('{$object}_{$method}').value = li.id; $('{$object}_{$method}_prev').value = text.value; }" ), $completion_options); $hidden = $this->_controller->form_helper->hidden_field($object, $method); Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-03-07 13:55:11 UTC (rev 44) +++ app/locales/user/ru.php 2008-03-09 12:04:52 UTC (rev 45) @@ -44,8 +44,8 @@ $dictionary['Confirmation error'] = 'Ошибка подтверждения'; $dictionary['bad confirmation link'] = 'ссылка подтверждения содержит ошибки'; $dictionary['Password reset error'] = 'Ошибка сброса пароля'; -$dictionary['no user found with the given email'] = 'пользователь с указанным email не зарегистрирован'; -$dictionary['bad reset link'] = 'ссылка сброса пароля содержит ошибки'; +$dictionary['No user found with the given e-mail'] = 'пользователь с указанным email не зарегистрирован'; +$dictionary['Bad reset link'] = 'ссылка сброса пароля содержит ошибки'; $dictionary['Trouble Accessing Your Account'] = 'Проблема с доступом к Вашей учетной записи'; $dictionary['Forgot Password'] = 'Забыли пароль'; $dictionary['Enter your login email below'] = 'Введите свой email адрес ниже'; Modified: app/views/default/index.tpl =================================================================== --- app/views/default/index.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/default/index.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -1,3 +1,3 @@ -<p> +<p class="indent"> <a class="linkbutton" href="/user/register"><div>_{Sign Up}</div></a> </p> \ No newline at end of file Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/layouts/application.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -8,6 +8,7 @@ <link href="/stylesheets/<?= $controller->getControllerName() ?>.css" rel="stylesheet" type="text/css"> <script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/scriptaculous.js" type="text/javascript"></script> +<script src="/javascripts/autocomplete.js" type="text/javascript"></script> </head> <body id="application"> <div id="main"> Modified: app/views/message/send_successfully.tpl =================================================================== --- app/views/message/send_successfully.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/message/send_successfully.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -1,3 +1,3 @@ <?= $controller->renderPartial("menu") ?> -<p>_{Message successfully sended}</p> \ No newline at end of file +<p class="indent">_{Message successfully sent}</p> \ No newline at end of file Modified: app/views/profile/groups.tpl =================================================================== --- app/views/profile/groups.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/profile/groups.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -2,4 +2,4 @@ <?= $controller->renderErrors() ?> -<p>Coming soon</p> \ No newline at end of file +<p class="indent">Coming soon</p> \ No newline at end of file Modified: app/views/profile/picture.tpl =================================================================== --- app/views/profile/picture.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/profile/picture.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -2,4 +2,4 @@ <?= $controller->renderErrors() ?> -<p>Coming soon</p> \ No newline at end of file +<p class="indent">Coming soon</p> \ No newline at end of file Modified: app/views/user/confirm.tpl =================================================================== --- app/views/user/confirm.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/user/confirm.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -4,6 +4,6 @@ if ($controller->getErrors()) { echo $controller->renderErrors(); } else { ?> - <p>_{Thank you for registration}</p><br> - <p><a href="/user/login">_{go to login}</a></p> + <p class="indent">_{Thank you for registration}</p><br> + <p class="indent"><a href="/user/login">_{go to login}</a></p> <? } ?> Modified: app/views/user/forgot_password.tpl =================================================================== --- app/views/user/forgot_password.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/user/forgot_password.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -2,7 +2,7 @@ <?= $controller->renderErrors() ?> -<p>_{Forgot Password}? _{Enter your login email below}. +<p class="indent">_{Forgot Password}? _{Enter your login email below}. _{We will send you an email with a link to reset your password}.</p> <form action="/user/forgot_password" method="post"> @@ -18,4 +18,4 @@ </div> </form> -<p>_{If you have a different problem accessing your account, please see our} <a href="/help">_{Login Problems Help Page}</a>.</p> \ No newline at end of file +<p class="indent">_{If you have a different problem accessing your account, please see our} <a href="/help">_{Login Problems Help Page}</a>.</p> \ No newline at end of file Modified: app/views/user/home.tpl =================================================================== --- app/views/user/home.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/user/home.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -1 +1 @@ -<p>_{Hello}, <?= $current_user->name ?></p> +<p class="indent">_{Hello}, <?= $current_user->name ?></p> Modified: app/views/user/laststep.tpl =================================================================== --- app/views/user/laststep.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/user/laststep.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -1,2 +1,2 @@ <div class="title">_{Last step}</div> -<p>_{Check please your email and click on confirmation link}.</p> +<p class="indent">_{Check please your email and click on confirmation link}.</p> Modified: app/views/user/reset_password.tpl =================================================================== --- app/views/user/reset_password.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/user/reset_password.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -2,7 +2,7 @@ <?= $controller->renderErrors(); ?> -<p>_{Please enter a new password}.</p> +<p class="indent">_{Please enter a new password}.</p> <form action="/user/reset_password" method="post"> <div class="editform"> <div class="formrow"> Modified: app/views/user/thankyou.tpl =================================================================== --- app/views/user/thankyou.tpl 2008-03-07 13:55:11 UTC (rev 44) +++ app/views/user/thankyou.tpl 2008-03-09 12:04:52 UTC (rev 45) @@ -1,2 +1,2 @@ <div class="title">_{Thank you for registration}</div> -<p>_{Registration complete}</p> +<p class="indent">_{Registration complete}</p> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-03-07 13:55:11 UTC (rev 44) +++ public/stylesheets/Application.css 2008-03-09 12:04:52 UTC (rev 45) @@ -193,8 +193,7 @@ padding: 0; } -#content p { - margin: 0px; +#pagecontent #content p.indent { padding: 30px; } Modified: public/stylesheets/autocomplete.css =================================================================== --- public/stylesheets/autocomplete.css 2008-03-07 13:55:11 UTC (rev 44) +++ public/stylesheets/autocomplete.css 2008-03-09 12:04:52 UTC (rev 45) @@ -1,8 +1,10 @@ span.indicator { - display: none; + display: none; + margin-left: 4px; } + span.indicator img { - vertical-align: middle + vertical-align: middle; } div.auto_complete { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-07 13:55:08
|
Revision: 44 http://isocial.svn.sourceforge.net/isocial/?rev=44&view=rev Author: aguidrevitch Date: 2008-03-07 05:55:11 -0800 (Fri, 07 Mar 2008) Log Message: ----------- prototype.js upgraded to 1.6.0.2 Modified Paths: -------------- public/javascripts/prototype.js Modified: public/javascripts/prototype.js =================================================================== --- public/javascripts/prototype.js 2008-03-07 09:59:55 UTC (rev 43) +++ public/javascripts/prototype.js 2008-03-07 13:55:11 UTC (rev 44) @@ -1,5 +1,5 @@ -/* Prototype JavaScript framework, version 1.6.0.1 - * (c) 2005-2007 Sam Stephenson +/* Prototype JavaScript framework, version 1.6.0.2 + * (c) 2005-2008 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ @@ -7,7 +7,7 @@ *--------------------------------------------------------------------------*/ var Prototype = { - Version: '1.6.0.1', + Version: '1.6.0.2', Browser: { IE: !!(window.attachEvent && !window.opera), @@ -110,7 +110,7 @@ try { if (Object.isUndefined(object)) return 'undefined'; if (object === null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); + return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; @@ -171,7 +171,8 @@ }, isArray: function(object) { - return object && object.constructor === Array; + return object != null && typeof object == "object" && + 'splice' in object && 'join' in object; }, isHash: function(object) { @@ -578,7 +579,7 @@ } return before + String.interpret(ctx); - }.bind(this)); + }); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; @@ -812,14 +813,14 @@ } if (Prototype.Browser.WebKit) { - function $A(iterable) { + $A = function(iterable) { if (!iterable) return []; if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && iterable.toArray) return iterable.toArray(); var length = iterable.length || 0, results = new Array(length); while (length--) results[length] = iterable[length]; return results; - } + }; } Array.from = $A; @@ -1298,7 +1299,7 @@ var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' - || (this.options.evalJS && contentType + || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } @@ -1316,6 +1317,15 @@ } }, + isSameOrigin: function() { + var m = this.url.match(/^\s*https?:\/\/[^\/]*/); + return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ + protocol: location.protocol, + domain: document.domain, + port: location.port ? ':' + location.port : '' + })); + }, + getHeader: function(name) { try { return this.transport.getResponseHeader(name) || null; @@ -1391,7 +1401,8 @@ if (!json) return null; json = decodeURIComponent(escape(json)); try { - return json.evalJSON(this.request.options.sanitizeJSON); + return json.evalJSON(this.request.options.sanitizeJSON || + !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } @@ -1404,7 +1415,8 @@ this.responseText.blank()) return null; try { - return this.responseText.evalJSON(options.sanitizeJSON); + return this.responseText.evalJSON(options.sanitizeJSON || + !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } @@ -1610,7 +1622,7 @@ var content, insert, tagName, childNodes; - for (position in insertions) { + for (var position in insertions) { content = insertions[position]; position = position.toLowerCase(); insert = Element._insertionTranslations[position]; @@ -1674,7 +1686,7 @@ }, descendants: function(element) { - return $(element).getElementsBySelector("*"); + return $(element).select("*"); }, firstDescendant: function(element) { @@ -1863,7 +1875,8 @@ do { ancestor = ancestor.parentNode; } while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); } - if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); + if (nextAncestor && nextAncestor.sourceIndex) + return (e > a && e < nextAncestor.sourceIndex); } while (element = element.parentNode) @@ -2007,7 +2020,7 @@ if (element) { if (element.tagName == 'BODY') break; var p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; + if (p !== 'static') break; } } while (element); return Element._returnOffset(valueL, valueT); @@ -2200,12 +2213,31 @@ } else if (Prototype.Browser.IE) { - $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { + // IE doesn't report offsets correctly for static elements, so we change them + // to "relative" to get the values, then change them back. + Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( + function(proceed, element) { + element = $(element); + var position = element.getStyle('position'); + if (position !== 'static') return proceed(element); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + + $w('positionedOffset viewportOffset').each(function(method) { Element.Methods[method] = Element.Methods[method].wrap( function(proceed, element) { element = $(element); var position = element.getStyle('position'); - if (position != 'static') return proceed(element); + if (position !== 'static') return proceed(element); + // Trigger hasLayout on the offset parent so that IE6 reports + // accurate offsetTop and offsetLeft values for position: fixed. + var offsetParent = element.getOffsetParent(); + if (offsetParent && offsetParent.getStyle('position') === 'fixed') + offsetParent.setStyle({ zoom: 1 }); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); @@ -2287,7 +2319,10 @@ }; Element._attributeTranslations.write = { - names: Object.clone(Element._attributeTranslations.read.names), + names: Object.extend({ + cellpadding: 'cellPadding', + cellspacing: 'cellSpacing' + }, Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; @@ -2407,7 +2442,7 @@ }; } -if (document.createElement('div').outerHTML) { +if ('outerHTML' in document.createElement('div')) { Element.Methods.replace = function(element, content) { element = $(element); @@ -2901,13 +2936,13 @@ }, criteria: { - tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', - className: 'n = h.className(n, r, "#{1}", c); c = false;', - id: 'n = h.id(n, r, "#{1}", c); c = false;', - attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', + tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', + className: 'n = h.className(n, r, "#{1}", c); c = false;', + id: 'n = h.id(n, r, "#{1}", c); c = false;', + attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', attr: function(m) { m[3] = (m[5] || m[6]); - return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); + return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); }, pseudo: function(m) { if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); @@ -2957,7 +2992,7 @@ attr: function(element, matches) { var nodeValue = Element.readAttribute(element, matches[1]); - return Selector.operators[matches[2]](nodeValue, matches[3]); + return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); } }, @@ -2972,14 +3007,15 @@ // marks an array of nodes for counting mark: function(nodes) { + var _true = Prototype.emptyFunction; for (var i = 0, node; node = nodes[i]; i++) - node._counted = true; + node._countedByPrototype = _true; return nodes; }, unmark: function(nodes) { for (var i = 0, node; node = nodes[i]; i++) - node._counted = undefined; + node._countedByPrototype = undefined; return nodes; }, @@ -2987,15 +3023,15 @@ // "ofType" flag indicates whether we're indexing for nth-of-type // rather than nth-child index: function(parentNode, reverse, ofType) { - parentNode._counted = true; + parentNode._countedByPrototype = Prototype.emptyFunction; if (reverse) { for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; } } else { for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; } }, @@ -3004,8 +3040,8 @@ if (nodes.length == 0) return nodes; var results = [], n; for (var i = 0, l = nodes.length; i < l; i++) - if (!(n = nodes[i])._counted) { - n._counted = true; + if (!(n = nodes[i])._countedByPrototype) { + n._countedByPrototype = Prototype.emptyFunction; results.push(Element.extend(n)); } return Selector.handlers.unmark(results); @@ -3117,16 +3153,18 @@ return results; }, - attrPresence: function(nodes, root, attr) { + attrPresence: function(nodes, root, attr, combinator) { if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); var results = []; for (var i = 0, node; node = nodes[i]; i++) if (Element.hasAttribute(node, attr)) results.push(node); return results; }, - attr: function(nodes, root, attr, value, operator) { + attr: function(nodes, root, attr, value, operator, combinator) { if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); var handler = Selector.operators[operator], results = []; for (var i = 0, node; node = nodes[i]; i++) { var nodeValue = Element.readAttribute(node, attr); @@ -3205,7 +3243,7 @@ var h = Selector.handlers, results = [], indexed = [], m; h.mark(nodes); for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._counted) { + if (!node.parentNode._countedByPrototype) { h.index(node.parentNode, reverse, ofType); indexed.push(node.parentNode); } @@ -3243,7 +3281,7 @@ var exclusions = new Selector(selector).findElements(root); h.mark(exclusions); for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._counted) results.push(node); + if (!node._countedByPrototype) results.push(node); h.unmark(exclusions); return results; }, @@ -3277,11 +3315,19 @@ '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } }, + split: function(expression) { + var expressions = []; + expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { + expressions.push(m[1].strip()); + }); + return expressions; + }, + matchElements: function(elements, expression) { - var matches = new Selector(expression).findElements(), h = Selector.handlers; + var matches = $$(expression), h = Selector.handlers; h.mark(matches); for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._counted) results.push(element); + if (element._countedByPrototype) results.push(element); h.unmark(matches); return results; }, @@ -3294,11 +3340,7 @@ }, findChildElements: function(element, expressions) { - var exprs = expressions.join(','); - expressions = []; - exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); + expressions = Selector.split(expressions.join(',')); var results = [], h = Selector.handlers; for (var i = 0, l = expressions.length, selector; i < l; i++) { selector = new Selector(expressions[i].strip()); @@ -3309,13 +3351,22 @@ }); if (Prototype.Browser.IE) { - // IE returns comment nodes on getElementsByTagName("*"). - // Filter them out. - Selector.handlers.concat = function(a, b) { - for (var i = 0, node; node = b[i]; i++) - if (node.tagName !== "!") a.push(node); - return a; - }; + Object.extend(Selector.handlers, { + // IE returns comment nodes on getElementsByTagName("*"). + // Filter them out. + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + if (node.tagName !== "!") a.push(node); + return a; + }, + + // IE improperly serializes _countedByPrototype in (inner|outer)HTML. + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node.removeAttribute('_countedByPrototype'); + return nodes; + } + }); } function $$() { @@ -3793,9 +3844,9 @@ var cache = Event.cache; function getEventID(element) { - if (element._eventID) return element._eventID; + if (element._prototypeEventID) return element._prototypeEventID[0]; arguments.callee.id = arguments.callee.id || 1; - return element._eventID = ++arguments.callee.id; + return element._prototypeEventID = [++arguments.callee.id]; } function getDOMEventName(eventName) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-07 09:59:54
|
Revision: 43 http://isocial.svn.sourceforge.net/isocial/?rev=43&view=rev Author: aguidrevitch Date: 2008-03-07 01:59:55 -0800 (Fri, 07 Mar 2008) Log Message: ----------- scriptaculous 1.8.1 imported Modified Paths: -------------- public/javascripts/builder.js public/javascripts/controls.js public/javascripts/dragdrop.js public/javascripts/effects.js public/javascripts/prototype.js public/javascripts/scriptaculous.js public/javascripts/slider.js public/javascripts/unittest.js Added Paths: ----------- public/javascripts/autocomplete.js public/javascripts/sound.js Added: public/javascripts/autocomplete.js =================================================================== --- public/javascripts/autocomplete.js (rev 0) +++ public/javascripts/autocomplete.js 2008-03-07 09:59:55 UTC (rev 43) @@ -0,0 +1,12 @@ +function city_updated (input, prev, hidden) { + if ($F(input)) { + if ($F(input) != $F(prev)) { + $(input).value = ''; + $(hidden).value = ''; + $(prev).value = ''; + new Effect.Highlight(input, { startcolor: '#ff0000'}); + } + } else { + $(hidden).value = ''; + } +} Modified: public/javascripts/builder.js =================================================================== --- public/javascripts/builder.js 2008-03-06 15:55:30 UTC (rev 42) +++ public/javascripts/builder.js 2008-03-07 09:59:55 UTC (rev 43) @@ -1,6 +1,6 @@ -// script.aculo.us builder.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 +// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ @@ -48,7 +48,8 @@ // attributes (or text) if(arguments[1]) if(this._isStringOrNumber(arguments[1]) || - (arguments[1] instanceof Array)) { + (arguments[1] instanceof Array) || + arguments[1].tagName) { this._children(element, arguments[1]); } else { var attrs = this._attributes(arguments[1]); @@ -66,7 +67,7 @@ } if(element.tagName.toUpperCase() != elementName) element = parentElement.getElementsByTagName(elementName)[0]; - } + } } // text, or array of children @@ -88,10 +89,14 @@ var attrs = []; for(attribute in attributes) attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + - '="' + attributes[attribute].toString().escapeHTML() + '"'); + '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); return attrs.join(" "); }, _children: function(element, children) { + if(children.tagName) { + element.appendChild(children); + return; + } if(typeof children=='object') { // array can hold nodes and text children.flatten().each( function(e) { if(typeof e=='object') @@ -101,8 +106,8 @@ element.appendChild(Builder._text(e)); }); } else - if(Builder._isStringOrNumber(children)) - element.appendChild(Builder._text(children)); + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); }, _isStringOrNumber: function(param) { return(typeof param=='string' || typeof param=='number'); Modified: public/javascripts/controls.js =================================================================== --- public/javascripts/controls.js 2008-03-06 15:55:30 UTC (rev 42) +++ public/javascripts/controls.js 2008-03-07 09:59:55 UTC (rev 43) @@ -1,8 +1,8 @@ -// script.aculo.us controls.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 +// script.aculo.us controls.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) -// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) // Contributors: // Richard Livsey // Rahul Bhargava @@ -39,22 +39,23 @@ if(typeof Effect == 'undefined') throw("controls.js requires including script.aculo.us' effects.js library"); -var Autocompleter = {} -Autocompleter.Base = function() {}; -Autocompleter.Base.prototype = { +var Autocompleter = { } +Autocompleter.Base = Class.create({ baseInitialize: function(element, update, options) { - this.element = $(element); + element = $(element) + this.element = element; this.update = $(update); this.hasFocus = false; this.changed = false; this.active = false; this.index = 0; this.entryCount = 0; + this.oldElementValue = this.element.value; if(this.setOptions) this.setOptions(options); else - this.options = options || {}; + this.options = options || { }; this.options.paramName = this.options.paramName || this.element.name; this.options.tokens = this.options.tokens || []; @@ -76,6 +77,9 @@ if(typeof(this.options.tokens) == 'string') this.options.tokens = new Array(this.options.tokens); + // Force carriage returns as token delimiters anyway + if (!this.options.tokens.include('\n')) + this.options.tokens.push('\n'); this.observer = null; @@ -83,15 +87,14 @@ Element.hide(this.update); - Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); - Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this)); }, show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && - (navigator.appVersion.indexOf('MSIE')>0) && - (navigator.userAgent.indexOf('Opera')<0) && + (Prototype.Browser.IE) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ @@ -141,17 +144,17 @@ case Event.KEY_UP: this.markPrevious(); this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); + Event.stop(event); return; case Event.KEY_DOWN: this.markNext(); this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); + Event.stop(event); return; } else if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return; + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; this.changed = true; this.hasFocus = true; @@ -197,7 +200,6 @@ this.index==i ? Element.addClassName(this.getEntry(i),"selected") : Element.removeClassName(this.getEntry(i),"selected"); - if(this.hasFocus) { this.show(); this.active = true; @@ -240,21 +242,22 @@ } var value = ''; if (this.options.select) { - var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; + var nodes = $(selectedElement).select('.' + this.options.select) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); } else value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - var lastTokenPos = this.findLastToken(); - if (lastTokenPos != -1) { - var newValue = this.element.value.substr(0, lastTokenPos + 1); - var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); if (whitespace) newValue += whitespace[0]; - this.element.value = newValue + value; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); } else { this.element.value = value; } + this.oldElementValue = this.element.value; this.element.focus(); if (this.options.afterUpdateElement) @@ -298,39 +301,48 @@ onObserverEvent: function() { this.changed = false; + this.tokenBounds = null; if(this.getToken().length>=this.options.minChars) { - this.startIndicator(); this.getUpdatedChoices(); } else { this.active = false; this.hide(); } + this.oldElementValue = this.element.value; }, getToken: function() { - var tokenPos = this.findLastToken(); - if (tokenPos != -1) - var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,''); - else - var ret = this.element.value; - - return /\n/.test(ret) ? '' : ret; + var bounds = this.getTokenBounds(); + return this.element.value.substring(bounds[0], bounds[1]).strip(); }, - findLastToken: function() { - var lastTokenPos = -1; - - for (var i=0; i<this.options.tokens.length; i++) { - var thisTokenPos = this.element.value.lastIndexOf(this.options.tokens[i]); - if (thisTokenPos > lastTokenPos) - lastTokenPos = thisTokenPos; + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = this.element.value; + if (value.strip().empty()) return [-1, 0]; + var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + var tp; + for (var index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; } - return lastTokenPos; + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); } -} +}); -Ajax.Autocompleter = Class.create(); -Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { +Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) + return index; + return boundary; +}; + +Ajax.Autocompleter = Class.create(Autocompleter.Base, { initialize: function(element, update, url, options) { this.baseInitialize(element, update, options); this.options.asynchronous = true; @@ -340,7 +352,9 @@ }, getUpdatedChoices: function() { - entry = encodeURIComponent(this.options.paramName) + '=' + + this.startIndicator(); + + var entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); this.options.parameters = this.options.callback ? @@ -348,14 +362,13 @@ if(this.options.defaultParams) this.options.parameters += '&' + this.options.defaultParams; - + new Ajax.Request(this.url, this.options); }, onComplete: function(request) { this.updateChoices(request.responseText); } - }); // The local array autocompleter. Used when you'd prefer to @@ -393,8 +406,7 @@ // In that case, the other options above will not apply unless // you support them. -Autocompleter.Local = Class.create(); -Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), { +Autocompleter.Local = Class.create(Autocompleter.Base, { initialize: function(element, update, array, options) { this.baseInitialize(element, update, options); this.options.array = array; @@ -450,13 +462,12 @@ ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } - }, options || {}); + }, options || { }); } }); -// AJAX in-place editor -// -// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor +// AJAX in-place editor and collection editor +// Full rewrite by Christophe Porteneuve <td...@td...> (April 2007). // Use this if you notice weird scrolling problems on some browsers, // the DOM might be a bit confused when this gets called so do this @@ -467,353 +478,472 @@ }, 1); } -Ajax.InPlaceEditor = Class.create(); -Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99"; -Ajax.InPlaceEditor.prototype = { +Ajax.InPlaceEditor = Class.create({ initialize: function(element, url, options) { this.url = url; - this.element = $(element); - - this.options = Object.extend({ - paramName: "value", - okButton: true, - okText: "ok", - cancelLink: true, - cancelText: "cancel", - savingText: "Saving...", - clickToEditText: "Click to edit", - okText: "ok", - rows: 1, - onComplete: function(transport, element) { - new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); - }, - onFailure: function(transport) { - alert("Error communicating with the server: " + transport.responseText.stripTags()); - }, - callback: function(form) { - return Form.serialize(form); - }, - handleLineBreaks: true, - loadingText: 'Loading...', - savingClassName: 'inplaceeditor-saving', - loadingClassName: 'inplaceeditor-loading', - formClassName: 'inplaceeditor-form', - highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor, - highlightendcolor: "#FFFFFF", - externalControl: null, - submitOnBlur: false, - ajaxOptions: {}, - evalScripts: false - }, options || {}); - - if(!this.options.formId && this.element.id) { - this.options.formId = this.element.id + "-inplaceeditor"; - if ($(this.options.formId)) { - // there's already a form with that name, don't specify an id - this.options.formId = null; - } + this.element = element = $(element); + this.prepareOptions(); + this._controls = { }; + arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! + Object.extend(this.options, options || { }); + if (!this.options.formId && this.element.id) { + this.options.formId = this.element.id + '-inplaceeditor'; + if ($(this.options.formId)) + this.options.formId = ''; } - - if (this.options.externalControl) { + if (this.options.externalControl) this.options.externalControl = $(this.options.externalControl); - } - - this.originalBackground = Element.getStyle(this.element, 'background-color'); - if (!this.originalBackground) { - this.originalBackground = "transparent"; - } - + if (!this.options.externalControl) + this.options.externalControlOnly = false; + this._originalBackground = this.element.getStyle('background-color') || 'transparent'; this.element.title = this.options.clickToEditText; - - this.onclickListener = this.enterEditMode.bindAsEventListener(this); - this.mouseoverListener = this.enterHover.bindAsEventListener(this); - this.mouseoutListener = this.leaveHover.bindAsEventListener(this); - Event.observe(this.element, 'click', this.onclickListener); - Event.observe(this.element, 'mouseover', this.mouseoverListener); - Event.observe(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.observe(this.options.externalControl, 'click', this.onclickListener); - Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener); - } + this._boundCancelHandler = this.handleFormCancellation.bind(this); + this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); + this._boundFailureHandler = this.handleAJAXFailure.bind(this); + this._boundSubmitHandler = this.handleFormSubmission.bind(this); + this._boundWrapperHandler = this.wrapUp.bind(this); + this.registerListeners(); }, - enterEditMode: function(evt) { - if (this.saving) return; - if (this.editing) return; - this.editing = true; - this.onEnterEditMode(); - if (this.options.externalControl) { - Element.hide(this.options.externalControl); - } - Element.hide(this.element); - this.createForm(); - this.element.parentNode.insertBefore(this.form, this.element); - if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); - // stop the event to avoid a page refresh in Safari - if (evt) { - Event.stop(evt); - } - return false; + checkForEscapeOrReturn: function(e) { + if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; + if (Event.KEY_ESC == e.keyCode) + this.handleFormCancellation(e); + else if (Event.KEY_RETURN == e.keyCode) + this.handleFormSubmission(e); }, - createForm: function() { - this.form = document.createElement("form"); - this.form.id = this.options.formId; - Element.addClassName(this.form, this.options.formClassName) - this.form.onsubmit = this.onSubmit.bind(this); - - this.createEditField(); - - if (this.options.textarea) { - var br = document.createElement("br"); - this.form.appendChild(br); + createControl: function(mode, handler, extraClasses) { + var control = this.options[mode + 'Control']; + var text = this.options[mode + 'Text']; + if ('button' == control) { + var btn = document.createElement('input'); + btn.type = 'submit'; + btn.value = text; + btn.className = 'editor_' + mode + '_button'; + if ('cancel' == mode) + btn.onclick = this._boundCancelHandler; + this._form.appendChild(btn); + this._controls[mode] = btn; + } else if ('link' == control) { + var link = document.createElement('a'); + link.href = '#'; + link.appendChild(document.createTextNode(text)); + link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; + link.className = 'editor_' + mode + '_link'; + if (extraClasses) + link.className += ' ' + extraClasses; + this._form.appendChild(link); + this._controls[mode] = link; } - - if (this.options.okButton) { - okButton = document.createElement("input"); - okButton.type = "submit"; - okButton.value = this.options.okText; - okButton.className = 'editor_ok_button'; - this.form.appendChild(okButton); - } - - if (this.options.cancelLink) { - cancelLink = document.createElement("a"); - cancelLink.href = "#"; - cancelLink.appendChild(document.createTextNode(this.options.cancelText)); - cancelLink.onclick = this.onclickCancel.bind(this); - cancelLink.className = 'editor_cancel'; - this.form.appendChild(cancelLink); - } }, - hasHTMLLineBreaks: function(string) { - if (!this.options.handleLineBreaks) return false; - return string.match(/<br/i) || string.match(/<p>/i); - }, - convertHTMLLineBreaks: function(string) { - return string.replace(/<br>/gi, "\n").replace(/<br\/>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<p>/gi, ""); - }, createEditField: function() { - var text; - if(this.options.loadTextURL) { - text = this.options.loadingText; - } else { - text = this.getText(); - } - - var obj = this; - - if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) { - this.options.textarea = false; - var textField = document.createElement("input"); - textField.obj = this; - textField.type = "text"; - textField.name = this.options.paramName; - textField.value = text; - textField.style.backgroundColor = this.options.highlightcolor; - textField.className = 'editor_field'; + var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); + var fld; + if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { + fld = document.createElement('input'); + fld.type = 'text'; var size = this.options.size || this.options.cols || 0; - if (size != 0) textField.size = size; - if (this.options.submitOnBlur) - textField.onblur = this.onSubmit.bind(this); - this.editField = textField; + if (0 < size) fld.size = size; } else { - this.options.textarea = true; - var textArea = document.createElement("textarea"); - textArea.obj = this; - textArea.name = this.options.paramName; - textArea.value = this.convertHTMLLineBreaks(text); - textArea.rows = this.options.rows; - textArea.cols = this.options.cols || 40; - textArea.className = 'editor_field'; - if (this.options.submitOnBlur) - textArea.onblur = this.onSubmit.bind(this); - this.editField = textArea; + fld = document.createElement('textarea'); + fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); + fld.cols = this.options.cols || 40; } - - if(this.options.loadTextURL) { + fld.name = this.options.paramName; + fld.value = text; // No HTML breaks conversion anymore + fld.className = 'editor_field'; + if (this.options.submitOnBlur) + fld.onblur = this._boundSubmitHandler; + this._controls.editor = fld; + if (this.options.loadTextURL) this.loadExternalText(); - } - this.form.appendChild(this.editField); + this._form.appendChild(this._controls.editor); }, - getText: function() { - return this.element.innerHTML; + createForm: function() { + var ipe = this; + function addText(mode, condition) { + var text = ipe.options['text' + mode + 'Controls']; + if (!text || condition === false) return; + ipe._form.appendChild(document.createTextNode(text)); + }; + this._form = $(document.createElement('form')); + this._form.id = this.options.formId; + this._form.addClassName(this.options.formClassName); + this._form.onsubmit = this._boundSubmitHandler; + this.createEditField(); + if ('textarea' == this._controls.editor.tagName.toLowerCase()) + this._form.appendChild(document.createElement('br')); + if (this.options.onFormCustomization) + this.options.onFormCustomization(this, this._form); + addText('Before', this.options.okControl || this.options.cancelControl); + this.createControl('ok', this._boundSubmitHandler); + addText('Between', this.options.okControl && this.options.cancelControl); + this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); + addText('After', this.options.okControl || this.options.cancelControl); }, - loadExternalText: function() { - Element.addClassName(this.form, this.options.loadingClassName); - this.editField.disabled = true; - new Ajax.Request( - this.options.loadTextURL, - Object.extend({ - asynchronous: true, - onComplete: this.onLoadedExternalText.bind(this) - }, this.options.ajaxOptions) - ); + destroy: function() { + if (this._oldInnerHTML) + this.element.innerHTML = this._oldInnerHTML; + this.leaveEditMode(); + this.unregisterListeners(); }, - onLoadedExternalText: function(transport) { - Element.removeClassName(this.form, this.options.loadingClassName); - this.editField.disabled = false; - this.editField.value = transport.responseText.stripTags(); - Field.scrollFreeActivate(this.editField); + enterEditMode: function(e) { + if (this._saving || this._editing) return; + this._editing = true; + this.triggerCallback('onEnterEditMode'); + if (this.options.externalControl) + this.options.externalControl.hide(); + this.element.hide(); + this.createForm(); + this.element.parentNode.insertBefore(this._form, this.element); + if (!this.options.loadTextURL) + this.postProcessEditField(); + if (e) Event.stop(e); }, - onclickCancel: function() { - this.onComplete(); - this.leaveEditMode(); - return false; + enterHover: function(e) { + if (this.options.hoverClassName) + this.element.addClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onEnterHover'); }, - onFailure: function(transport) { - this.options.onFailure(transport); - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - this.oldInnerHTML = null; + getText: function() { + return this.element.innerHTML; + }, + handleAJAXFailure: function(transport) { + this.triggerCallback('onFailure', transport); + if (this._oldInnerHTML) { + this.element.innerHTML = this._oldInnerHTML; + this._oldInnerHTML = null; } - return false; }, - onSubmit: function() { - // onLoading resets these so we need to save them away for the Ajax call - var form = this.form; - var value = this.editField.value; - - // do this first, sometimes the ajax call returns before we get a chance to switch on Saving... - // which means this will actually switch on Saving... *after* we've left edit mode causing Saving... - // to be displayed indefinitely - this.onLoading(); - - if (this.options.evalScripts) { - new Ajax.Request( - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this), - asynchronous:true, - evalScripts:true - }, this.options.ajaxOptions)); - } else { - new Ajax.Updater( - { success: this.element, - // don't update on failure (this could be an option) - failure: null }, - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this) - }, this.options.ajaxOptions)); + handleFormCancellation: function(e) { + this.wrapUp(); + if (e) Event.stop(e); + }, + handleFormSubmission: function(e) { + var form = this._form; + var value = $F(this._controls.editor); + this.prepareSubmission(); + var params = this.options.callback(form, value) || ''; + if (Object.isString(params)) + params = params.toQueryParams(); + params.editorId = this.element.id; + if (this.options.htmlResponse) { + var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Updater({ success: this.element }, this.url, options); + } else { + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.url, options); } - // stop the event to avoid a page refresh in Safari - if (arguments.length > 1) { - Event.stop(arguments[0]); - } - return false; + if (e) Event.stop(e); }, - onLoading: function() { - this.saving = true; + leaveEditMode: function() { + this.element.removeClassName(this.options.savingClassName); this.removeForm(); this.leaveHover(); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + if (this.options.externalControl) + this.options.externalControl.show(); + this._saving = false; + this._editing = false; + this._oldInnerHTML = null; + this.triggerCallback('onLeaveEditMode'); + }, + leaveHover: function(e) { + if (this.options.hoverClassName) + this.element.removeClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onLeaveHover'); + }, + loadExternalText: function() { + this._form.addClassName(this.options.loadingClassName); + this._controls.editor.disabled = true; + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._form.removeClassName(this.options.loadingClassName); + var text = transport.responseText; + if (this.options.stripLoadedTextTags) + text = text.stripTags(); + this._controls.editor.value = text; + this._controls.editor.disabled = false; + this.postProcessEditField(); + }.bind(this), + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + postProcessEditField: function() { + var fpc = this.options.fieldPostCreation; + if (fpc) + $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); + }, + prepareOptions: function() { + this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); + Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); + [this._extraDefaultOptions].flatten().compact().each(function(defs) { + Object.extend(this.options, defs); + }.bind(this)); + }, + prepareSubmission: function() { + this._saving = true; + this.removeForm(); + this.leaveHover(); this.showSaving(); }, + registerListeners: function() { + this._listeners = { }; + var listener; + $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { + listener = this[pair.value].bind(this); + this._listeners[pair.key] = listener; + if (!this.options.externalControlOnly) + this.element.observe(pair.key, listener); + if (this.options.externalControl) + this.options.externalControl.observe(pair.key, listener); + }.bind(this)); + }, + removeForm: function() { + if (!this._form) return; + this._form.remove(); + this._form = null; + this._controls = { }; + }, showSaving: function() { - this.oldInnerHTML = this.element.innerHTML; + this._oldInnerHTML = this.element.innerHTML; this.element.innerHTML = this.options.savingText; - Element.addClassName(this.element, this.options.savingClassName); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); + this.element.addClassName(this.options.savingClassName); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); }, - removeForm: function() { - if(this.form) { - if (this.form.parentNode) Element.remove(this.form); - this.form = null; + triggerCallback: function(cbName, arg) { + if ('function' == typeof this.options[cbName]) { + this.options[cbName](this, arg); } }, - enterHover: function() { - if (this.saving) return; - this.element.style.backgroundColor = this.options.highlightcolor; - if (this.effect) { - this.effect.cancel(); - } - Element.addClassName(this.element, this.options.hoverClassName) + unregisterListeners: function() { + $H(this._listeners).each(function(pair) { + if (!this.options.externalControlOnly) + this.element.stopObserving(pair.key, pair.value); + if (this.options.externalControl) + this.options.externalControl.stopObserving(pair.key, pair.value); + }.bind(this)); }, - leaveHover: function() { - if (this.options.backgroundColor) { - this.element.style.backgroundColor = this.oldBackground; - } - Element.removeClassName(this.element, this.options.hoverClassName) - if (this.saving) return; - this.effect = new Effect.Highlight(this.element, { - startcolor: this.options.highlightcolor, - endcolor: this.options.highlightendcolor, - restorecolor: this.originalBackground + wrapUp: function(transport) { + this.leaveEditMode(); + // Can't use triggerCallback due to backward compatibility: requires + // binding + direct element + this._boundComplete(transport, this.element); + } +}); + +Object.extend(Ajax.InPlaceEditor.prototype, { + dispose: Ajax.InPlaceEditor.prototype.destroy +}); + +Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { + initialize: function($super, element, url, options) { + this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; + $super(element, url, options); + }, + + createEditField: function() { + var list = document.createElement('select'); + list.name = this.options.paramName; + list.size = 1; + this._controls.editor = list; + this._collection = this.options.collection || []; + if (this.options.loadCollectionURL) + this.loadCollection(); + else + this.checkForExternalText(); + this._form.appendChild(this._controls.editor); + }, + + loadCollection: function() { + this._form.addClassName(this.options.loadingClassName); + this.showLoadingText(this.options.loadingCollectionText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + var js = transport.responseText.strip(); + if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check + throw 'Server returned an invalid collection representation.'; + this._collection = eval(js); + this.checkForExternalText(); + }.bind(this), + onFailure: this.onFailure }); + new Ajax.Request(this.options.loadCollectionURL, options); }, - leaveEditMode: function() { - Element.removeClassName(this.element, this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); - if (this.options.externalControl) { - Element.show(this.options.externalControl); + + showLoadingText: function(text) { + this._controls.editor.disabled = true; + var tempOption = this._controls.editor.firstChild; + if (!tempOption) { + tempOption = document.createElement('option'); + tempOption.value = ''; + this._controls.editor.appendChild(tempOption); + tempOption.selected = true; } - this.editing = false; - this.saving = false; - this.oldInnerHTML = null; - this.onLeaveEditMode(); + tempOption.update((text || '').stripScripts().stripTags()); }, - onComplete: function(transport) { - this.leaveEditMode(); - this.options.onComplete.bind(this)(transport, this.element); + + checkForExternalText: function() { + this._text = this.getText(); + if (this.options.loadTextURL) + this.loadExternalText(); + else + this.buildOptionList(); }, - onEnterEditMode: function() {}, - onLeaveEditMode: function() {}, - dispose: function() { - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - } - this.leaveEditMode(); - Event.stopObserving(this.element, 'click', this.onclickListener); - Event.stopObserving(this.element, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.stopObserving(this.options.externalControl, 'click', this.onclickListener); - Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener); - } + + loadExternalText: function() { + this.showLoadingText(this.options.loadingText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._text = transport.responseText.strip(); + this.buildOptionList(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + + buildOptionList: function() { + this._form.removeClassName(this.options.loadingClassName); + this._collection = this._collection.map(function(entry) { + return 2 === entry.length ? entry : [entry, entry].flatten(); + }); + var marker = ('value' in this.options) ? this.options.value : this._text; + var textFound = this._collection.any(function(entry) { + return entry[0] == marker; + }.bind(this)); + this._controls.editor.update(''); + var option; + this._collection.each(function(entry, index) { + option = document.createElement('option'); + option.value = entry[0]; + option.selected = textFound ? entry[0] == marker : 0 == index; + option.appendChild(document.createTextNode(entry[1])); + this._controls.editor.appendChild(option); + }.bind(this)); + this._controls.editor.disabled = false; + Field.scrollFreeActivate(this._controls.editor); } +}); + +//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** +//**** This only exists for a while, in order to let **** +//**** users adapt to the new API. Read up on the new **** +//**** API and convert your code to it ASAP! **** + +Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { + if (!options) return; + function fallback(name, expr) { + if (name in options || expr === undefined) return; + options[name] = expr; + }; + fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : + options.cancelLink == options.cancelButton == false ? false : undefined))); + fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : + options.okLink == options.okButton == false ? false : undefined))); + fallback('highlightColor', options.highlightcolor); + fallback('highlightEndColor', options.highlightendcolor); }; -Ajax.InPlaceCollectionEditor = Class.create(); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, { - createEditField: function() { - if (!this.cached_selectTag) { - var selectTag = document.createElement("select"); - var collection = this.options.collection || []; - var optionTag; - collection.each(function(e,i) { - optionTag = document.createElement("option"); - optionTag.value = (e instanceof Array) ? e[0] : e; - if((typeof this.options.value == 'undefined') && - ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true; - if(this.options.value==optionTag.value) optionTag.selected = true; - optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); - selectTag.appendChild(optionTag); - }.bind(this)); - this.cached_selectTag = selectTag; +Object.extend(Ajax.InPlaceEditor, { + DefaultOptions: { + ajaxOptions: { }, + autoRows: 3, // Use when multi-line w/ rows == 1 + cancelControl: 'link', // 'link'|'button'|false + cancelText: 'cancel', + clickToEditText: 'Click to edit', + externalControl: null, // id|elt + externalControlOnly: false, + fieldPostCreation: 'activate', // 'activate'|'focus'|false + formClassName: 'inplaceeditor-form', + formId: null, // id|elt + highlightColor: '#ffff99', + highlightEndColor: '#ffffff', + hoverClassName: '', + htmlResponse: true, + loadingClassName: 'inplaceeditor-loading', + loadingText: 'Loading...', + okControl: 'button', // 'link'|'button'|false + okText: 'ok', + paramName: 'value', + rows: 1, // If 1 and multi-line, uses autoRows + savingClassName: 'inplaceeditor-saving', + savingText: 'Saving...', + size: 0, + stripLoadedTextTags: false, + submitOnBlur: false, + textAfterControls: '', + textBeforeControls: '', + textBetweenControls: '' + }, + DefaultCallbacks: { + callback: function(form) { + return Form.serialize(form); + }, + onComplete: function(transport, element) { + // For backward compatibility, this one is bound to the IPE, and passes + // the element directly. It was too often customized, so we don't break it. + new Effect.Highlight(element, { + startcolor: this.options.highlightColor, keepBackgroundImage: true }); + }, + onEnterEditMode: null, + onEnterHover: function(ipe) { + ipe.element.style.backgroundColor = ipe.options.highlightColor; + if (ipe._effect) + ipe._effect.cancel(); + }, + onFailure: function(transport, ipe) { + alert('Error communication with the server: ' + transport.responseText.stripTags()); + }, + onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. + onLeaveEditMode: null, + onLeaveHover: function(ipe) { + ipe._effect = new Effect.Highlight(ipe.element, { + startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, + restorecolor: ipe._originalBackground, keepBackgroundImage: true + }); } - - this.editField = this.cached_selectTag; - if(this.options.loadTextURL) this.loadExternalText(); - this.form.appendChild(this.editField); - this.options.callback = function(form, value) { - return "value=" + encodeURIComponent(value); - } + }, + Listeners: { + click: 'enterEditMode', + keydown: 'checkForEscapeOrReturn', + mouseover: 'enterHover', + mouseout: 'leaveHover' } }); +Ajax.InPlaceCollectionEditor.DefaultOptions = { + loadingCollectionText: 'Loading options...' +}; + // Delayed observer, like Form.Element.Observer, // but waits for delay after last key input // Ideal for live-search fields -Form.Element.DelayedObserver = Class.create(); -Form.Element.DelayedObserver.prototype = { +Form.Element.DelayedObserver = Class.create({ initialize: function(element, delay, callback) { this.delay = delay || 0.5; this.element = $(element); @@ -832,4 +962,4 @@ this.timer = null; this.callback(this.element, $F(this.element)); } -}; +}); Modified: public/javascripts/dragdrop.js =================================================================== --- public/javascripts/dragdrop.js 2008-03-06 15:55:30 UTC (rev 42) +++ public/javascripts/dragdrop.js 2008-03-07 09:59:55 UTC (rev 43) @@ -1,12 +1,12 @@ -// script.aculo.us dragdrop.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 +// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sa...@or...) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sa...@or...) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ -if(typeof Effect == 'undefined') +if(Object.isUndefined(Effect)) throw("dragdrop.js requires including script.aculo.us' effects.js library"); var Droppables = { @@ -22,14 +22,13 @@ greedy: true, hoverclass: null, tree: false - }, arguments[1] || {}); + }, arguments[1] || { }); // cache containers if(options.containment) { options._containers = []; var containment = options.containment; - if((typeof containment == 'object') && - (containment.constructor == Array)) { + if(Object.isArray(containment)) { containment.each( function(c) { options._containers.push($(c)) }); } else { options._containers.push($(containment)); @@ -89,21 +88,23 @@ show: function(point, element) { if(!this.drops.length) return; - var affected = []; + var drop, affected = []; - if(this.last_active) this.deactivate(this.last_active); this.drops.each( function(drop) { if(Droppables.isAffected(point, element, drop)) affected.push(drop); }); - if(affected.length>0) { + if(affected.length>0) drop = Droppables.findDeepestChild(affected); + + if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); + if (drop) { Position.within(drop.element, point[0], point[1]); if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); - Droppables.activate(drop); + if (drop != this.last_active) Droppables.activate(drop); } }, @@ -112,8 +113,10 @@ Position.prepare(); if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) - if (this.last_active.onDrop) - this.last_active.onDrop(element, this.last_active.element, event); + if (this.last_active.onDrop) { + this.last_active.onDrop(element, this.last_active.element, event); + return true; + } }, reset: function() { @@ -221,10 +224,7 @@ /*--------------------------------------------------------------------------*/ -var Draggable = Class.create(); -Draggable._dragging = {}; - -Draggable.prototype = { +var Draggable = Class.create({ initialize: function(element) { var defaults = { handle: false, @@ -235,7 +235,7 @@ }); }, endeffect: function(element) { - var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0; + var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, queue: {scope:'_draggable', position:'end'}, afterFinish: function(){ @@ -245,6 +245,7 @@ }, zindex: 1000, revert: false, + quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, @@ -252,7 +253,7 @@ delay: 0 }; - if(!arguments[1] || typeof arguments[1].endeffect == 'undefined') + if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) Object.extend(defaults, { starteffect: function(element) { element._opacity = Element.getOpacity(element); @@ -261,11 +262,11 @@ } }); - var options = Object.extend(defaults, arguments[1] || {}); + var options = Object.extend(defaults, arguments[1] || { }); this.element = $(element); - if(options.handle && (typeof options.handle == 'string')) + if(options.handle && Object.isString(options.handle)) this.handle = this.element.down('.'+options.handle, 0); if(!this.handle) this.handle = $(options.handle); @@ -278,7 +279,6 @@ Element.makePositioned(this.element); // fix IE - this.delta = this.currentDelta(); this.options = options; this.dragging = false; @@ -300,7 +300,7 @@ }, initDrag: function(event) { - if(typeof Draggable._dragging[this.element] != 'undefined' && + if(!Object.isUndefined(Draggable._dragging[this.element]) && Draggable._dragging[this.element]) return; if(Event.isLeftClick(event)) { // abort on form elements, fixes a Firefox issue @@ -323,6 +323,8 @@ startDrag: function(event) { this.dragging = true; + if(!this.delta) + this.delta = this.currentDelta(); if(this.options.zindex) { this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); @@ -331,7 +333,9 @@ if(this.options.ghosting) { this._clone = this.element.cloneNode(true); - Position.absolutize(this.element); + this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); + if (!this.element._originallyAbsolute) + Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone, this.element); } @@ -353,8 +357,12 @@ updateDrag: function(event, pointer) { if(!this.dragging) this.startDrag(event); - Position.prepare(); - Droppables.show(pointer, this.element); + + if(!this.options.quiet){ + Position.prepare(); + Droppables.show(pointer, this.element); + } + Draggables.notify('onDrag', this, event); this.draw(pointer); @@ -382,30 +390,44 @@ } // fix AppleWebKit rendering - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + if(Prototype.Browser.WebKit) window.scrollBy(0,0); Event.stop(event); }, finishDrag: function(event, success) { this.dragging = false; + + if(this.options.quiet){ + Position.prepare(); + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + Droppables.show(pointer, this.element); + } if(this.options.ghosting) { - Position.relativize(this.element); + if (!this.element._originallyAbsolute) + Position.relativize(this.element); + delete this.element._originallyAbsolute; Element.remove(this._clone); this._clone = null; } - if(success) Droppables.fire(event, this.element); + var dropped = false; + if(success) { + dropped = Droppables.fire(event, this.element); + if (!dropped) dropped = false; + } + if(dropped && this.options.onDropped) this.options.onDropped(this.element); Draggables.notify('onEnd', this, event); var revert = this.options.revert; - if(revert && typeof revert == 'function') revert = revert(this.element); + if(revert && Object.isFunction(revert)) revert = revert(this.element); var d = this.currentDelta(); if(revert && this.options.reverteffect) { - this.options.reverteffect(this.element, - d[1]-this.delta[1], d[0]-this.delta[0]); + if (dropped == 0 || revert != 'failure') + this.options.reverteffect(this.element, + d[1]-this.delta[1], d[0]-this.delta[0]); } else { this.delta = d; } @@ -453,15 +475,15 @@ }.bind(this)); if(this.options.snap) { - if(typeof this.options.snap == 'function') { + if(Object.isFunction(this.options.snap)) { p = this.options.snap(p[0],p[1],this); } else { - if(this.options.snap instanceof Array) { + if(Object.isArray(this.options.snap)) { p = p.map( function(v, i) { - return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this)) + return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)) } else { p = p.map( function(v) { - return Math.round(v/this.options.snap)*this.options.snap }.bind(this)) + return (v/this.options.snap).round()*this.options.snap }.bind(this)) } }} @@ -545,12 +567,13 @@ } return { top: T, left: L, width: W, height: H }; } -} +}); +Draggable._dragging = { }; + /*--------------------------------------------------------------------------*/ -var SortableObserver = Class.create(); -SortableObserver.prototype = { +var SortableObserver = Class.create({ initialize: function(element, observer) { this.element = $(element); this.observer = observer; @@ -566,12 +589,12 @@ if(this.lastValue != Sortable.serialize(this.element)) this.observer(this.element) } -} +}); var Sortable = { SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, - sortables: {}, + sortables: { }, _findRootElement: function(element) { while (element.tagName.toUpperCase() != "BODY") { @@ -614,13 +637,20 @@ delay: 0, hoverclass: null, ghosting: false, + quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, format: this.SERIALIZE_RULE, + + // these take arrays of elements or ids and can be + // used for better initialization performance + elements: false, + handles: false, + onChange: Prototype.emptyFunction, onUpdate: Prototype.emptyFunction - }, arguments[1] || {}); + }, arguments[1] || { }); // clear any old sortable with same element this.destroy(element); @@ -628,6 +658,7 @@ // build options for the draggables var options_for_draggable = { revert: true, + quiet: options.quiet, scroll: options.scroll, scrollSpeed: options.scrollSpeed, scrollSensitivity: options.scrollSensitivity, @@ -681,10 +712,9 @@ options.droppables.push(element); } - (this.findElements(element, options) || []).each( function(e) { - // handles are per-draggable - var handle = options.handle ? - $(e).down('.'+options.handle,0) : e; + (options.elements || this.findElements(element, options) || []).each( function(e,i) { + var handle = options.handles ? $(options.handles[i]) : + (options.handle ? $(e).select('.' + options.handle)[0] : e); options.draggables.push( new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); Droppables.add(e, options_for_droppable); @@ -844,7 +874,7 @@ only: sortableOptions.only, name: element.id, format: sortableOptions.format - }, arguments[1] || {}); + }, arguments[1] || { }); var root = { id: null, @@ -868,7 +898,7 @@ sequence: function(element) { element = $(element); - var options = Object.extend(this.options(element), arguments[1] || {}); + var options = Object.extend(this.options(element), arguments[1] || { }); return $(this.findElements(element, options) || []).map( function(item) { return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; @@ -877,9 +907,9 @@ setSequence: function(element, new_sequence) { element = $(element); - var options = Object.extend(this.options(element), arguments[2] || {}); + var options = Object.extend(this.options(element), arguments[2] || { }); - var nodeMap = {}; + var nodeMap = { }; this.findElements(element, options).each( function(n) { if (n.id.match(options.format)) nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; @@ -897,7 +927,7 @@ serialize: function(element) { element = $(element); - var options = Object.extend(Sortable.options(element), arguments[1] || {}); + var options = Object.extend(Sortable.options(element), arguments[1] || { }); var name = encodeURIComponent( (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); @@ -921,7 +951,7 @@ return Element.isParent(child.parentNode, element); } -Element.findChildren = function(element, only, recursive, tagName) { +Element.findChildren = function(element, only, recursive, tagName) { if(!element.hasChildNodes()) return null; tagName = tagName.toUpperCase(); if(only) only = [only].flatten(); Modified: public/javascripts/effects.js =================================================================== --- public/javascripts/effects.js 2008-03-06 15:55:30 UTC (rev 42) +++ public/javascripts/effects.js 2008-03-07 09:59:55 UTC (rev 43) @@ -1,6 +1,6 @@ -// script.aculo.us effects.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 +// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // Contributors: // Justin Palmer (http://encytemedia.com/) // Mark Pilgrim (http://diveintomark.org/) @@ -13,17 +13,17 @@ // returns self (or first argument) if not convertable String.prototype.parseColor = function() { var color = '#'; - if(this.slice(0,4) == 'rgb(') { + if (this.slice(0,4) == 'rgb(') { var cols = this.slice(4,this.length-1).split(','); var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); } else { - if(this.slice(0,1) == '#') { - if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); - if(this.length==7) color = this.toLowerCase(); + if (this.slice(0,1) == '#') { + if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if (this.length==7) color = this.toLowerCase(); } } - return(color.length==7 ? color : (arguments[0] || this)); -} + return (color.length==7 ? color : (arguments[0] || this)); +}; /*--------------------------------------------------------------------------*/ @@ -32,7 +32,7 @@ return (node.nodeType==3 ? node.nodeValue : (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); }).flatten().join(''); -} +}; Element.collectTextNodesIgnoreClass = function(element, className) { return $A($(element).childNodes).collect( function(node) { @@ -40,26 +40,18 @@ ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? Element.collectTextNodesIgnoreClass(node, className) : '')); }).flatten().join(''); -} +}; Element.setContentZoom = function(element, percent) { element = $(element); element.setStyle({fontSize: (percent/100) + 'em'}); - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + if (Prototype.Browser.WebKit) window.scrollBy(0,0); return element; -} +}; -Element.getOpacity = function(element){ - return $(element).getStyle('opacity'); -} - -Element.setOpacity = function(element, value){ - return $(element).setStyle({opacity:value}); -} - Element.getInlineOpacity = function(element){ return $(element).style.opacity || ''; -} +}; Element.forceRerendering = function(element) { try { @@ -72,31 +64,63 @@ /*--------------------------------------------------------------------------*/ -Array.prototype.call = function() { - var args = arguments; - this.each(function(f){ f.apply(this, args) }); -} - -/*--------------------------------------------------------------------------*/ - var Effect = { _elementDoesNotExistError: { name: 'ElementDoesNotExistError', message: 'The specified DOM element does not exist, but is required for this effect to operate' }, + Transitions: { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + 0.5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; + return pos > 1 ? 1 : pos; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; + }, + pulse: function(pos, pulses) { + pulses = pulses || 5; + return ( + ((pos % (1/pulses)) * pulses).round() == 0 ? + ((pos * pulses * 2) - (pos * pulses * 2).floor()) : + 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) + ); + }, + spring: function(pos) { + return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } + }, + DefaultOptions: { + duration: 1.0, // seconds + fps: 100, // 100= assume... [truncated message content] |
From: <agu...@us...> - 2008-03-06 15:55:28
|
Revision: 42 http://isocial.svn.sourceforge.net/isocial/?rev=42&view=rev Author: aguidrevitch Date: 2008-03-06 07:55:30 -0800 (Thu, 06 Mar 2008) Log Message: ----------- redundant javascript removed Modified Paths: -------------- app/views/layouts/application.tpl Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-05 20:19:44 UTC (rev 41) +++ app/views/layouts/application.tpl 2008-03-06 15:55:30 UTC (rev 42) @@ -8,7 +8,6 @@ <link href="/stylesheets/<?= $controller->getControllerName() ?>.css" rel="stylesheet" type="text/css"> <script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/scriptaculous.js" type="text/javascript"></script> -<script src="/javascripts/autocomplete.js" type="text/javascript"></script> </head> <body id="application"> <div id="main"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-05 20:19:44
|
Revision: 41 http://isocial.svn.sourceforge.net/isocial/?rev=41&view=rev Author: aguidrevitch Date: 2008-03-05 12:19:44 -0800 (Wed, 05 Mar 2008) Log Message: ----------- minimal city autocompletion helper added Modified Paths: -------------- app/application_controller.php app/controllers/profile_controller.php app/installers/city_installer.php app/installers/country_installer.php app/locales/profile/ru.php app/models/city.php app/views/layouts/application.tpl app/views/profile/basic.tpl public/stylesheets/autocomplete.css Added Paths: ----------- README.txt app/helpers/city_helper.php app/installers/religious_view_installer.php app/models/religious_view.php localities_to_sql.pl Added: README.txt =================================================================== --- README.txt (rev 0) +++ README.txt 2008-03-05 20:19:44 UTC (rev 41) @@ -0,0 +1,6 @@ +City/Country databases: + + * http://www.world-gazetteer.com/wg.php?x=1129163518&men=stdl&lng=en&gln=xx&dat=32&srt=npan&col=aohdq + * http://www.world-gazetteer.com/dataen.zip + * http://earth-info.nga.mil/gns/html/namefiles.htm + * http://www.maxmind.com/app/worldcities Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-05 18:39:57 UTC (rev 40) +++ app/application_controller.php 2008-03-05 20:19:44 UTC (rev 41) @@ -1,6 +1,7 @@ <?php require_once(AK_LIB_DIR.DS.'AkActionController.php'); +require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); /** * This file is application-wide controller file. You can put all @@ -19,6 +20,7 @@ var $_errors = array(); var $models = array('User'); + var $app_helpers = array('City'); var $current_user; function beforeAction ( $method = '' ) { @@ -171,6 +173,52 @@ return "=?utf-8?B?" . base64_encode($value) . "?="; } + + function auto_complete_for_city () { + if (empty($this->params['city'])) { + $this->renderNothing(); + } else { + $query = $this->params['city']; + + $entries = $this->City->find('all', + array('conditions' => + array( + 'first_id IS NOT NULL AND name LIKE ?', $query . '%' + ), + 'include' => 'country', + 'limit' => 10 + ) + ); + + $limit = empty($entries) ? 10 : 10 - count($entries); + if ($limit) { + $aquery = utf8_to_ascii($query); + if ($aquery != $query) { + $asciied = $this->City->find('all', + array('conditions' => + array( + 'first_id IS NOT NULL AND name LIKE ?', $aquery . '%' + ), + 'include' => 'country', + 'limit' => $limit + ) + ); + } + } + + if (empty($entries) && empty($asciied)) { + $entries = array(); + } else if (empty($entries)) { + $entries = $asciied; + } else if (empty($asciied)) { + $entries = $entries; + } else { + $entries = array_merge($entries, $asciied); + } + $this->renderText( $this->city_helper->auto_complete_result($entries, $query) ); + } + } + function _auto_complete_result ($items, $field, $phrase = '') { // converting to an array $entries = array(); Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-03-05 18:39:57 UTC (rev 40) +++ app/controllers/profile_controller.php 2008-03-05 20:19:44 UTC (rev 41) @@ -2,7 +2,7 @@ class ProfileController extends ApplicationController { - var $models = 'user, basic_profile, sex, country, city, political_view'; + var $models = 'user, basic_profile, sex, country, city, political_view, religious_view'; function index () { } @@ -10,15 +10,65 @@ function basic () { } - function auto_complete_for_basic_hometown () { - if (!empty($this->params['basic']['country_id'])) { - $conditions = array('country_id = ? AND name LIKE ?', $this->params['basic']['country_id'], '%' . $this->params['basic']['hometown'] . '%' ); + function auto_complete_for_basic_city () { + if (empty($this->params['basic']['city'])) { + $this->renderNothing(); } else { - $conditions = array('name LIKE ?', '%' . $this->params['basic']['hometown'] . '%' ); + $query = $this->params['basic']['city']; + + $entries = $this->City->find('all', + array('conditions' => + array( + 'first_id IS NOT NULL AND name LIKE ?', $query . '%' + ), + 'include' => 'country', + 'limit' => 10 + ) + ); + + $limit = empty($entries) ? 10 : 10 - count($entries); + if ($limit) { + $aquery = utf8_to_ascii($query); + if ($aquery != $query) { + $asciied = $this->City->find('all', + array('conditions' => + array( + 'first_id IS NOT NULL AND name LIKE ?', $aquery . '%' + ), + 'include' => 'country', + 'limit' => $limit + ) + ); + } + } + + if (empty($entries) && empty($asciied)) { + $entries = array(); + } else if (empty($entries)) { + $entries = $asciied; + } else if (empty($asciied)) { + $entries = $entries; + } else { + $entries = array_merge($entries, $asciied); + } + $this->renderText( $this->_city_auto_complete_result($entries, $query) ); } - $entries = $this->City->find('all', array('conditions' => $conditions)); - $this->renderText( $this->_auto_complete_result($entries, 'name', $this->params['basic']['hometown']) ); } + + function auto_complete_for_basic_religious_view () { + if (empty($this->params['basic']['religious_view'])) { + $this->renderNothing(); + } else { + $entries = $this->ReligiousView->find('all', + array('conditions' => + array( + 'name LIKE ?', '%' . $this->params['basic']['religious_view'] . '%' + ), + ) + ); + $this->renderText( $this->_auto_complete_result($entries, 'name', $this->params['basic']['religious_view']) ); + } + } function contact () { } Added: app/helpers/city_helper.php =================================================================== --- app/helpers/city_helper.php (rev 0) +++ app/helpers/city_helper.php 2008-03-05 20:19:44 UTC (rev 41) @@ -0,0 +1,79 @@ +<?php + +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'javascript_helper.php'); +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'tag_helper.php'); +require_once(AK_LIB_DIR.DS.'AkActionView'.DS.'helpers'.DS.'form_helper.php'); + +class CityHelper extends AkActionViewHelper +{ + + function auto_complete_field($field_id, $options = array()) + { + $function = "var {$field_id}_auto_completer = new Ajax.Autocompleter("; + $function .= "'{$field_id}', "; + $function .= !empty($options['update']) ? "'{$options['update']}', " : "'{$field_id}_auto_complete', "; + $function .= "'".UrlHelper::url_for($options['url'])."'"; + + $js_options = array(); + foreach (array('paramName', + 'tokens', + 'frequency', + 'minChars', + 'indicator', + 'updateElement', + 'afterUpdateElement', + 'callback', + 'parameters') as $key) { + if (!empty($options[$key])) { + $js_options[$key] = $options[$key]; + } + } + + $function .= ', '.JavaScriptHelper::_options_for_javascript($js_options).')'; + return JavaScriptHelper::javascript_tag($function); + } + + function auto_complete_result($cities, $phrase = null) + { + if (empty($cities)) { + return ''; + } + foreach ($cities as $city) { + $name = !empty($phrase) + ? TextHelper::highlight( TextHelper::h($city->name), $phrase) + : TextHelper::h($city->name); + $item = TagHelper::content_tag('div', $name) ; + $comment = TagHelper::content_tag('div', $city->country->name, array('class' => 'informal')) ; + $items[] = TagHelper::content_tag('li', $name . $comment, array('id' => $city->getId())); + } + return TagHelper::content_tag('ul', join('', array_unique($items))); + } + + function city_field($object, $method, $tag_options = array(), $completion_options = array()) + { + $tag_options = array_merge(array( + 'name' => "city", + 'id' => "auto_{$object}_{$method}", + 'onblur' => "if (!$('{$object}_{$method}').value || \$F(this.id) != \$F('{$object}_{$method}_prev')) { $(this.id).value = ''; $('{$object}_{$method}').value = null; $('{$object}_{$method}_prev').value = null; new Effect.Highlight(this.id, { startcolor: '#ff0000'})}", + 'autocomplete' => 'on', + ), $tag_options); + $completion_options = array_merge(array( + 'skip_style' => true, + 'url' => array('action' => 'auto_complete_for_city'), + 'minChars' => 3, + 'frequency' => 0.4, + 'callback' => "function (element, value) { $('{$object}_{$method}').value = null; return value} ", + 'afterUpdateElement' => "function (text, li) { $('{$object}_{$method}').value = li.id; $('{$object}_{$method}_prev').value = text.value; } " + ), $completion_options); + + $hidden = $this->_controller->form_helper->hidden_field($object, $method); + $hidden_prev = $this->_controller->form_helper->hidden_field($object, $method, array('id' => "{$object}_{$method}_prev", 'name' => "{$object}_{$method}_prev")); + $text_field = $this->_controller->form_helper->text_field($object, $method, $tag_options); + $div = TagHelper::content_tag('div', '', array('id' => "auto_{$object}_{$method}_auto_complete", 'class' => 'auto_complete')); + $javascript = $this->auto_complete_field("auto_{$object}_{$method}", $completion_options); + + return $hidden . $hidden_prev . $text_field . $div . $javascript; + } +} + +?> Modified: app/installers/city_installer.php =================================================================== --- app/installers/city_installer.php 2008-03-05 18:39:57 UTC (rev 40) +++ app/installers/city_installer.php 2008-03-05 20:19:44 UTC (rev 41) @@ -6,8 +6,13 @@ $this->execute( "CREATE TABLE `cities` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `oid` int(11), `country_id` int(11), + `first_id` int(11), + `second_id` int(11), + `third_id` int(11), `name` char(100) NOT NULL DEFAULT '', + INDEX oid_idx (oid), FOREIGN KEY (country_id) REFERENCES countries(id) ) ENGINE=InnoDB"); Modified: app/installers/country_installer.php =================================================================== --- app/installers/country_installer.php 2008-03-05 18:39:57 UTC (rev 40) +++ app/installers/country_installer.php 2008-03-05 20:19:44 UTC (rev 41) @@ -5,257 +5,12 @@ { $this->execute( "CREATE TABLE `countries` ( - `id` int(11) PRIMARY KEY + `id` int(11) PRIMARY KEY, + `oid` int(11), + `name` char(255), + UNIQUE name_idx (name), + INDEX oid_idx (oid) ) ENGINE=InnoDB"); - - $fields = array(); - foreach (Ak::langs() as $lang) { - $fields[] = $lang . "_name"; - $this->execute("ALTER TABLE countries ADD column ${lang}_name char(255) NOT NULL DEFAULT \"\""); - } - $fields = join(", ", $fields); - - foreach (array(1 => "Åland Islands", - 2 => "Afghanistan", - 3 => "Albania", - 4 => "Algeria", - 5 => "American Samoa", - 6 => "Andorra", - 7 => "Angola", - 8 => "Anguilla", - 9 => "Antigua and Barbuda", - 10 => "Argentina", - 11 => "Armenia", - 12 => "Aruba", - 13 => "Australia", - 14 => "Austria", - 15 => "Azerbaijan", - 16 => "Bahamas", - 17 => "Bahrain", - 18 => "Bangladesh", - 19 => "Barbados", - 20 => "Belarus", - 21 => "Belgium", - 22 => "Belize", - 23 => "Benin", - 24 => "Bermuda", - 25 => "Bhutan", - 26 => "Bolivia", - 27 => "Bosnia and Herzegovina", - 28 => "Botswana", - 29 => "Brazil", - 30 => "British Virgin Islands", - 31 => "Brunei Darussalam", - 32 => "Bulgaria", - 33 => "Burkina Faso", - 34 => "Burundi", - 35 => "Côte d'Ivoire", - 36 => "Cambodia", - 37 => "Cameroon", - 38 => "Canada", - 39 => "Cape Verde", - 40 => "Cayman Islands", - 41 => "Central African Republic", - 42 => "Chad", - 43 => "Chile", - 44 => "China", - 45 => "Colombia", - 46 => "Comoros", - 47 => "Congo, Democratic Republic", - 48 => "Congo", - 49 => "Cook Islands", - 50 => "Costa Rica", - 51 => "Croatia", - 52 => "Cuba", - 53 => "Cyprus", - 54 => "Czech Republic", - 55 => "Denmark", - 56 => "Djibouti", - 57 => "Dominican Republic", - 58 => "Dominica", - 59 => "Ecuador", - 60 => "Egypt", - 61 => "El Salvador", - 62 => "Equatorial Guinea", - 63 => "Eritrea", - 64 => "Estonia", - 65 => "Ethiopia", - 66 => "Faeroe Islands", - 67 => "Falkland Islands (Malvinas)", - 68 => "Fiji", - 69 => "Finland", - 70 => "France", - 71 => "French Guiana", - 72 => "French Polynesia", - 73 => "Gabon", - 74 => "Gambia", - 75 => "Georgia", - 76 => "Germany", - 77 => "Ghana", - 78 => "Gibraltar", - 79 => "Greece", - 80 => "Greenland", - 81 => "Grenada", - 82 => "Guadeloupe", - 83 => "Guam", - 84 => "Guatemala", - 85 => "Guinea-Bissau", - 86 => "Guinea", - 87 => "Guyana", - 88 => "Haiti", - 89 => "Honduras", - 90 => "Hong Kong", - 91 => "Hungary", - 92 => "Iceland", - 93 => "India", - 94 => "Indonesia", - 95 => "Iran (Islamic Republic of)", - 96 => "Iraq", - 97 => "Ireland", - 98 => "Isle of Man", - 99 => "Israel", - 100 => "Italy", - 101 => "Jamaica", - 102 => "Japan", - 103 => "Jordan", - 104 => "Kazakhstan", - 105 => "Kenya", - 106 => "Kiribati", - 107 => "Korea, Republic of", - 108 => "Korea, South", - 109 => "Kuwait", - 110 => "Kyrgyzstan", - 111 => "Lao People's Democratic Republic", - 112 => "Latvia", - 113 => "Lebanon", - 114 => "Lesotho", - 115 => "Liberia", - 116 => "Libyan Arab Jamahiriya", - 117 => "Liechtenstein", - 118 => "Lithuania", - 119 => "Luxembourg", - 120 => "Macao", - 121 => "Macedonia", - 122 => "Madagascar", - 123 => "Malawi", - 124 => "Malaysia", - 125 => "Maldives", - 126 => "Mali", - 127 => "Malta", - 128 => "Marshall Islands", - 129 => "Martinique", - 130 => "Mauritania", - 131 => "Mauritius", - 132 => "Mayotte", - 133 => "Mexico", - 134 => "Micronesia", - 135 => "Monaco", - 136 => "Mongolia", - 137 => "Montserrat", - 138 => "Morocco", - 139 => "Mozambique", - 140 => "Myanmar", - 141 => "Namibia", - 142 => "Nauru", - 143 => "Nepal", - 144 => "Netherlands Antilles", - 145 => "Netherlands", - 146 => "New Caledonia", - 147 => "New Zealand", - 148 => "Nicaragua", - 149 => "Nigeria", - 150 => "Niger", - 151 => "Niue", - 152 => "Norfolk Island", - 153 => "Northern Mariana Islands", - 154 => "Norway", - 155 => "Occupied Palestinian Territory", - 156 => "Oman", - 157 => "Pakistan", - 158 => "Palau", - 159 => "Panama", - 160 => "Papua New Guinea", - 161 => "Paraguay", - 162 => "Peru", - 163 => "Philippines", - 164 => "Pitcairn", - 165 => "Poland", - 166 => "Portugal", - 167 => "Puerto Rico", - 168 => "Qatar", - 169 => "Réunion", - 170 => "Republic of Moldova", - 171 => "Romania", - 172 => "Russian Federation", - 173 => "Rwanda", - 174 => "Saint Helena", - 175 => "Saint Kitts and Nevis", - 176 => "Saint Lucia", - 177 => "Saint Pierre and Miquelon", - 178 => "Saint Vincent and the Grenadines", - 179 => "Samoa", - 180 => "San Marino", - 181 => "Sao Tome and Principe", - 182 => "Saudi Arabia", - 183 => "Senegal", - 184 => "Serbia and Montenegro", - 185 => "Seychelles", - 186 => "Sierra Leone", - 187 => "Singapore", - 188 => "Slovakia", - 189 => "Slovenia", - 190 => "Solomon Islands", - 191 => "Somalia", - 192 => "South Africa", - 193 => "Spain", - 194 => "Sri Lanka", - 195 => "Sudan", - 196 => "Suriname", - 197 => "Svalbard and Jan Mayen Islands", - 198 => "Swaziland", - 199 => "Sweden", - 200 => "Switzerland", - 201 => "Syrian Arab Republic", - 202 => "Tajikistan", - 203 => "Tanzania", - 204 => "Thailand", - 205 => "Timor-Leste", - 206 => "Togo", - 207 => "Tokelau", - 208 => "Tonga", - 209 => "Trinidad and Tobago", - 210 => "Tunisia", - 211 => "Turkey", - 212 => "Turkmenistan", - 213 => "Turks and Caicos Islands", - 214 => "Tuvalu", - 215 => "Uganda", - 216 => "Ukraine", - 217 => "United Arab Emirates", - 218 => "United Kingdom", - 219 => "United States Virgin Islands", - 220 => "United States", - 221 => "Uruguay", - 222 => "Uzbekistan", - 223 => "Vanuatu", - 224 => "Vatican City State (Holy See)", - 225 => "Venezuela", - 226 => "Viet Nam", - 227 => "Wallis and Futuna Islands", - 228 => "Western Sahara", - 229 => "Yemen", - 230 => "Zambia", - 231 => "Zimbabwe") as $id => $country) - { - - $values = array(); - foreach (Ak::langs() as $lang) { - Ak::lang($lang); - $values[] = '"' . Ak::t($country) . '"'; - } - $values = join(", ", $values); - $this->execute("INSERT INTO countries (id, $fields) VALUES ($id, $values)"); - } } function down_1() Added: app/installers/religious_view_installer.php =================================================================== --- app/installers/religious_view_installer.php (rev 0) +++ app/installers/religious_view_installer.php 2008-03-05 20:19:44 UTC (rev 41) @@ -0,0 +1,22 @@ +<?php +class ReligiousViewInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `religious_views` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `name` char(100) NOT NULL DEFAULT '' + ) ENGINE=InnoDB"); + + } + + function down_1() + { + /**/ + $this->dropTable('religious_view'); + /**/ + } +} + +?> Modified: app/locales/profile/ru.php =================================================================== --- app/locales/profile/ru.php 2008-03-05 18:39:57 UTC (rev 40) +++ app/locales/profile/ru.php 2008-03-05 20:19:44 UTC (rev 41) @@ -15,14 +15,14 @@ $dictionary['Select Sex:'] = 'Выберите пол:'; $dictionary['Birthday'] = 'Дата рождения'; -$dictionary['Country'] = 'Страна'; +$dictionary['Country of birth'] = 'Страна рождения'; $dictionary['Select Country:'] = 'Выберите страну:'; $dictionary['Hometown'] = 'Родной город'; $dictionary['Political views'] = 'Политические взгляды'; $dictionary['Select Political Views:'] = 'Выберите политические взгляды:'; -$dictionary['Religious views'] = 'Религия'; +$dictionary['Religious views'] = 'Вероисповедание'; $dictionary['Only my friends'] = 'Только для друзей'; $dictionary['Emails'] = 'Адреса Email'; Modified: app/models/city.php =================================================================== --- app/models/city.php 2008-03-05 18:39:57 UTC (rev 40) +++ app/models/city.php 2008-03-05 20:19:44 UTC (rev 41) @@ -2,6 +2,7 @@ class City extends ActiveRecord { + var $belongs_to = array('country'); } ?> Added: app/models/religious_view.php =================================================================== --- app/models/religious_view.php (rev 0) +++ app/models/religious_view.php 2008-03-05 20:19:44 UTC (rev 41) @@ -0,0 +1,7 @@ +<?php + +class ReligiousView extends ActiveRecord +{ +} + +?> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-05 18:39:57 UTC (rev 40) +++ app/views/layouts/application.tpl 2008-03-05 20:19:44 UTC (rev 41) @@ -8,6 +8,7 @@ <link href="/stylesheets/<?= $controller->getControllerName() ?>.css" rel="stylesheet" type="text/css"> <script src="/javascripts/prototype.js" type="text/javascript"></script> <script src="/javascripts/scriptaculous.js" type="text/javascript"></script> +<script src="/javascripts/autocomplete.js" type="text/javascript"></script> </head> <body id="application"> <div id="main"> Modified: app/views/profile/basic.tpl =================================================================== --- app/views/profile/basic.tpl 2008-03-05 18:39:57 UTC (rev 40) +++ app/views/profile/basic.tpl 2008-03-05 20:19:44 UTC (rev 41) @@ -2,6 +2,7 @@ <?= $controller->renderErrors() ?> + <form action="/profile/basic" method="post"> <div class="editform"> <div class="formrow"> @@ -13,26 +14,53 @@ <?= $date_helper->date_select('basic', 'birthdate', array('start_year' => 1940) )?> </div> <div class="formrow"> + <label>_{Hometown}:</label> + <?= $city_helper->city_field('basic', 'city', array('class' => 'shorttextinput')); ?> + </div> + <div id="basic_country_div" class="formrow" style="display:none"> <label>_{Country}:</label> - <?= $form_options_helper->select('basic', 'country_id', $Country->collect($Country->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Country:')) )?> + <?= $form_options_helper->select('basic', 'country_id', $Country->collect($Country->find('all', array('order' => 'name')), 'name', 'id'), array(), array('prompt' => $controller->t('Select Country:')) )?> </div> <div class="formrow"> - <label>_{Hometown}:</label> - <?= $javascript_macros_helper->text_field_with_auto_complete('basic', 'hometown', array('autocomplete' => 'on', 'class' => 'shorttextinput'), array('skip_style' => true, 'with' => '"basic%5Bcountry_id%5D=" + $F("basic_country_id") + "&" + value') )?> - </div> - <div class="formrow"> <label>_{Political views}:</label> <?= $form_options_helper->select('basic', 'political_view_id', $PoliticalView->collect($PoliticalView->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Political Views:')) )?> </div> <div class="formrow"> <label>_{Religious views}:</label> - <?= $form_helper->text_field('basic', 'religious_views', array('class' => 'shorttextinput') ) ?> + <?= $javascript_macros_helper->text_field_with_auto_complete('basic', 'religious_view', array('autocomplete' => 'on', 'class' => 'shorttextinput'), array('skip_style' => true) )?> </div> <div class="formrow"> <label></label> <input class="submitinput" type="submit" value="_{Save Changes}"> <input class="cancelinput" type="button" value="_{Cancel}"> + <a href="javascript: alert($F('basic_city') + ':' + $F('basic_city_prev'))">asdfsadf</a> </div> </div> </form> +<script type="text/javascript"> + + + function city_changed () { + if (!$F('basic_city')) { + $('basic_country_div').hide(); + } + } + + function city_blurred () { + // check city existence + if ($F('basic_city')) { + // order is important !!! + $('basic_country_id').focus(); + $('basic_country_div').show(); + } + } + + /* + window.onload = function () { + $('basic_city').observe("keyup", city_changed); + $('auto_basic_city').observe("change", city_blurred); + } + */ + +</script> Added: localities_to_sql.pl =================================================================== --- localities_to_sql.pl (rev 0) +++ localities_to_sql.pl 2008-03-05 20:19:44 UTC (rev 41) @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use File::Slurp; + +my $id = 1; +my %countries; +my %other; +foreach( read_file($ARGV[0]) ) { + chomp(); + my @data = split /\t/; + + my $oid = $data[0]; + my $name = $data[1]; + if ($data[4] eq 'country') { + + $countries{$name} = $id; + print "INSERT INTO countries VALUES ($id, $oid, '$name');\n"; + $id++; + } else { + $other{$name} = $oid; + } +} + +$id = 1; +foreach ( read_file($ARGV[0]) ) { + chomp(); + my @data = split /\t/; + if ($data[4] ne 'country' && defined $data[8]) { + my $oid = $data[0]; + my $country_id = defined $data[8] && $countries{$data[8]} ? $countries{$data[8]} : 'NULL'; + my $first_id = defined $data[9] && $other{$data[9]} ? $other{$data[9]} : 'NULL'; + my $second_id = defined $data[10] && $other{$data[10]} ? $other{$data[10]} : 'NULL'; + my $third_id = defined $data[11] && $other{$data[11]} ? $other{$data[11]} : 'NULL'; + + my @names = ($data[1], split(/\s*,\s*/, $data[2]), split(/\s*,\s*/, $data[3])); + foreach my $name (@names) { + $name =~ s/\"/'/g; + print "INSERT INTO cities VALUES ($id, $oid, $country_id, $first_id, $second_id, $third_id, \"$name\");\n"; + $id++; + } + } +} Property changes on: localities_to_sql.pl ___________________________________________________________________ Name: svn:executable + * Modified: public/stylesheets/autocomplete.css =================================================================== --- public/stylesheets/autocomplete.css 2008-03-05 18:39:57 UTC (rev 40) +++ public/stylesheets/autocomplete.css 2008-03-05 20:19:44 UTC (rev 41) @@ -1,3 +1,10 @@ +span.indicator { + display: none; +} +span.indicator img { + vertical-align: middle +} + div.auto_complete { margin-top: -1px; background: #ffffff; @@ -22,6 +29,11 @@ padding: 4px; cursor: pointer; } +div.auto_complete ul li .informal { + color: #bdc7d8; + font-weight: bold; + padding-left: 6px; +} div.auto_complete ul li.selected { background-color: #3b5998; @@ -40,3 +52,4 @@ margin:0; padding:0; } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-05 20:00:16
|
Revision: 40 http://isocial.svn.sourceforge.net/isocial/?rev=40&view=rev Author: aguidrevitch Date: 2008-03-05 10:39:57 -0800 (Wed, 05 Mar 2008) Log Message: ----------- utf8_to_ascii (romanization) added Added Paths: ----------- app/vendor/utf8_to_ascii/ app/vendor/utf8_to_ascii/ChangeLog app/vendor/utf8_to_ascii/LICENSE app/vendor/utf8_to_ascii/README app/vendor/utf8_to_ascii/db/ app/vendor/utf8_to_ascii/db/x00.php app/vendor/utf8_to_ascii/db/x01.php app/vendor/utf8_to_ascii/db/x02.php app/vendor/utf8_to_ascii/db/x03.php app/vendor/utf8_to_ascii/db/x04.php app/vendor/utf8_to_ascii/db/x05.php app/vendor/utf8_to_ascii/db/x06.php app/vendor/utf8_to_ascii/db/x07.php app/vendor/utf8_to_ascii/db/x09.php app/vendor/utf8_to_ascii/db/x0a.php app/vendor/utf8_to_ascii/db/x0b.php app/vendor/utf8_to_ascii/db/x0c.php app/vendor/utf8_to_ascii/db/x0d.php app/vendor/utf8_to_ascii/db/x0e.php app/vendor/utf8_to_ascii/db/x0f.php app/vendor/utf8_to_ascii/db/x10.php app/vendor/utf8_to_ascii/db/x11.php app/vendor/utf8_to_ascii/db/x12.php app/vendor/utf8_to_ascii/db/x13.php app/vendor/utf8_to_ascii/db/x14.php app/vendor/utf8_to_ascii/db/x15.php app/vendor/utf8_to_ascii/db/x16.php app/vendor/utf8_to_ascii/db/x17.php app/vendor/utf8_to_ascii/db/x18.php app/vendor/utf8_to_ascii/db/x1e.php app/vendor/utf8_to_ascii/db/x1f.php app/vendor/utf8_to_ascii/db/x20.php app/vendor/utf8_to_ascii/db/x21.php app/vendor/utf8_to_ascii/db/x22.php app/vendor/utf8_to_ascii/db/x23.php app/vendor/utf8_to_ascii/db/x24.php app/vendor/utf8_to_ascii/db/x25.php app/vendor/utf8_to_ascii/db/x26.php app/vendor/utf8_to_ascii/db/x27.php app/vendor/utf8_to_ascii/db/x28.php app/vendor/utf8_to_ascii/db/x2e.php app/vendor/utf8_to_ascii/db/x2f.php app/vendor/utf8_to_ascii/db/x30.php app/vendor/utf8_to_ascii/db/x31.php app/vendor/utf8_to_ascii/db/x32.php app/vendor/utf8_to_ascii/db/x33.php app/vendor/utf8_to_ascii/db/x4d.php app/vendor/utf8_to_ascii/db/x4e.php app/vendor/utf8_to_ascii/db/x4f.php app/vendor/utf8_to_ascii/db/x50.php app/vendor/utf8_to_ascii/db/x51.php app/vendor/utf8_to_ascii/db/x52.php app/vendor/utf8_to_ascii/db/x53.php app/vendor/utf8_to_ascii/db/x54.php app/vendor/utf8_to_ascii/db/x55.php app/vendor/utf8_to_ascii/db/x56.php app/vendor/utf8_to_ascii/db/x57.php app/vendor/utf8_to_ascii/db/x58.php app/vendor/utf8_to_ascii/db/x59.php app/vendor/utf8_to_ascii/db/x5a.php app/vendor/utf8_to_ascii/db/x5b.php app/vendor/utf8_to_ascii/db/x5c.php app/vendor/utf8_to_ascii/db/x5d.php app/vendor/utf8_to_ascii/db/x5e.php app/vendor/utf8_to_ascii/db/x5f.php app/vendor/utf8_to_ascii/db/x60.php app/vendor/utf8_to_ascii/db/x61.php app/vendor/utf8_to_ascii/db/x62.php app/vendor/utf8_to_ascii/db/x63.php app/vendor/utf8_to_ascii/db/x64.php app/vendor/utf8_to_ascii/db/x65.php app/vendor/utf8_to_ascii/db/x66.php app/vendor/utf8_to_ascii/db/x67.php app/vendor/utf8_to_ascii/db/x68.php app/vendor/utf8_to_ascii/db/x69.php app/vendor/utf8_to_ascii/db/x6a.php app/vendor/utf8_to_ascii/db/x6b.php app/vendor/utf8_to_ascii/db/x6c.php app/vendor/utf8_to_ascii/db/x6d.php app/vendor/utf8_to_ascii/db/x6e.php app/vendor/utf8_to_ascii/db/x6f.php app/vendor/utf8_to_ascii/db/x70.php app/vendor/utf8_to_ascii/db/x71.php app/vendor/utf8_to_ascii/db/x72.php app/vendor/utf8_to_ascii/db/x73.php app/vendor/utf8_to_ascii/db/x74.php app/vendor/utf8_to_ascii/db/x75.php app/vendor/utf8_to_ascii/db/x76.php app/vendor/utf8_to_ascii/db/x77.php app/vendor/utf8_to_ascii/db/x78.php app/vendor/utf8_to_ascii/db/x79.php app/vendor/utf8_to_ascii/db/x7a.php app/vendor/utf8_to_ascii/db/x7b.php app/vendor/utf8_to_ascii/db/x7c.php app/vendor/utf8_to_ascii/db/x7d.php app/vendor/utf8_to_ascii/db/x7e.php app/vendor/utf8_to_ascii/db/x7f.php app/vendor/utf8_to_ascii/db/x80.php app/vendor/utf8_to_ascii/db/x81.php app/vendor/utf8_to_ascii/db/x82.php app/vendor/utf8_to_ascii/db/x83.php app/vendor/utf8_to_ascii/db/x84.php app/vendor/utf8_to_ascii/db/x85.php app/vendor/utf8_to_ascii/db/x86.php app/vendor/utf8_to_ascii/db/x87.php app/vendor/utf8_to_ascii/db/x88.php app/vendor/utf8_to_ascii/db/x89.php app/vendor/utf8_to_ascii/db/x8a.php app/vendor/utf8_to_ascii/db/x8b.php app/vendor/utf8_to_ascii/db/x8c.php app/vendor/utf8_to_ascii/db/x8d.php app/vendor/utf8_to_ascii/db/x8e.php app/vendor/utf8_to_ascii/db/x8f.php app/vendor/utf8_to_ascii/db/x90.php app/vendor/utf8_to_ascii/db/x91.php app/vendor/utf8_to_ascii/db/x92.php app/vendor/utf8_to_ascii/db/x93.php app/vendor/utf8_to_ascii/db/x94.php app/vendor/utf8_to_ascii/db/x95.php app/vendor/utf8_to_ascii/db/x96.php app/vendor/utf8_to_ascii/db/x97.php app/vendor/utf8_to_ascii/db/x98.php app/vendor/utf8_to_ascii/db/x99.php app/vendor/utf8_to_ascii/db/x9a.php app/vendor/utf8_to_ascii/db/x9b.php app/vendor/utf8_to_ascii/db/x9c.php app/vendor/utf8_to_ascii/db/x9d.php app/vendor/utf8_to_ascii/db/x9e.php app/vendor/utf8_to_ascii/db/x9f.php app/vendor/utf8_to_ascii/db/xa0.php app/vendor/utf8_to_ascii/db/xa1.php app/vendor/utf8_to_ascii/db/xa2.php app/vendor/utf8_to_ascii/db/xa3.php app/vendor/utf8_to_ascii/db/xa4.php app/vendor/utf8_to_ascii/db/xac.php app/vendor/utf8_to_ascii/db/xad.php app/vendor/utf8_to_ascii/db/xae.php app/vendor/utf8_to_ascii/db/xaf.php app/vendor/utf8_to_ascii/db/xb0.php app/vendor/utf8_to_ascii/db/xb1.php app/vendor/utf8_to_ascii/db/xb2.php app/vendor/utf8_to_ascii/db/xb3.php app/vendor/utf8_to_ascii/db/xb4.php app/vendor/utf8_to_ascii/db/xb5.php app/vendor/utf8_to_ascii/db/xb6.php app/vendor/utf8_to_ascii/db/xb7.php app/vendor/utf8_to_ascii/db/xb8.php app/vendor/utf8_to_ascii/db/xb9.php app/vendor/utf8_to_ascii/db/xba.php app/vendor/utf8_to_ascii/db/xbb.php app/vendor/utf8_to_ascii/db/xbc.php app/vendor/utf8_to_ascii/db/xbd.php app/vendor/utf8_to_ascii/db/xbe.php app/vendor/utf8_to_ascii/db/xbf.php app/vendor/utf8_to_ascii/db/xc0.php app/vendor/utf8_to_ascii/db/xc1.php app/vendor/utf8_to_ascii/db/xc2.php app/vendor/utf8_to_ascii/db/xc3.php app/vendor/utf8_to_ascii/db/xc4.php app/vendor/utf8_to_ascii/db/xc5.php app/vendor/utf8_to_ascii/db/xc6.php app/vendor/utf8_to_ascii/db/xc7.php app/vendor/utf8_to_ascii/db/xc8.php app/vendor/utf8_to_ascii/db/xc9.php app/vendor/utf8_to_ascii/db/xca.php app/vendor/utf8_to_ascii/db/xcb.php app/vendor/utf8_to_ascii/db/xcc.php app/vendor/utf8_to_ascii/db/xcd.php app/vendor/utf8_to_ascii/db/xce.php app/vendor/utf8_to_ascii/db/xcf.php app/vendor/utf8_to_ascii/db/xd0.php app/vendor/utf8_to_ascii/db/xd1.php app/vendor/utf8_to_ascii/db/xd2.php app/vendor/utf8_to_ascii/db/xd3.php app/vendor/utf8_to_ascii/db/xd4.php app/vendor/utf8_to_ascii/db/xd5.php app/vendor/utf8_to_ascii/db/xd6.php app/vendor/utf8_to_ascii/db/xd7.php app/vendor/utf8_to_ascii/db/xf9.php app/vendor/utf8_to_ascii/db/xfa.php app/vendor/utf8_to_ascii/db/xfb.php app/vendor/utf8_to_ascii/db/xfc.php app/vendor/utf8_to_ascii/db/xfd.php app/vendor/utf8_to_ascii/db/xfe.php app/vendor/utf8_to_ascii/db/xff.php app/vendor/utf8_to_ascii/tests/ app/vendor/utf8_to_ascii/tests/data/ app/vendor/utf8_to_ascii/tests/data/utf8.txt app/vendor/utf8_to_ascii/tests/index.php app/vendor/utf8_to_ascii/utf8_to_ascii.php Added: app/vendor/utf8_to_ascii/ChangeLog =================================================================== --- app/vendor/utf8_to_ascii/ChangeLog (rev 0) +++ app/vendor/utf8_to_ascii/ChangeLog 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,34 @@ +2006-10-25 17:12 harryf + + * README: More detail / notes + +2006-10-25 15:34 harryf + + * tests/index.php: Add simple unit test + +2006-10-25 15:34 harryf + + * utf8_to_ascii.php: Move from global to local static variable + +2006-09-04 23:34 harryf + + * builddb.pl: Fix example script name + +2006-09-04 23:34 harryf + + * utf8_to_ascii.php: Performance optimization / re-write - elimate + string splitting with preg_match_all - most of the time was going + here - re-implement ord calculation - reduce #calls to PHP ord() + fn. Improve ab average response time for the example from ~9s to + ~0.41s + +2006-03-04 00:43 harryf + + * LICENSE, README, builddb.pl, utf8_to_ascii.php, tests/index.php, + tests/data/utf8.txt: Initial import + +2006-03-04 00:43 harryf + + * LICENSE, README, builddb.pl, utf8_to_ascii.php, tests/index.php, + tests/data/utf8.txt: Initial revision + Added: app/vendor/utf8_to_ascii/LICENSE =================================================================== --- app/vendor/utf8_to_ascii/LICENSE (rev 0) +++ app/vendor/utf8_to_ascii/LICENSE 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,128 @@ + The "Artistic License" + + Preamble + +The intent of this document is to state the conditions under which a +Package may be copied, such that the Copyright Holder maintains some +semblance of artistic control over the development of the package, +while giving the users of the package the right to use and distribute +the Package in a more-or-less customary fashion, plus the right to make +reasonable modifications. + +Definitions: + + "Package" refers to the collection of files distributed by the + Copyright Holder, and derivatives of that collection of files + created through textual modification. + + "Standard Version" refers to such a Package if it has not been + modified, or has been modified in accordance with the wishes + of the Copyright Holder as specified below. + + "Copyright Holder" is whoever is named in the copyright or + copyrights for the package. + + "You" is you, if you're thinking about copying or distributing + this Package. + + "Reasonable copying fee" is whatever you can justify on the + basis of media cost, duplication charges, time of people involved, + and so on. (You will not be required to justify it to the + Copyright Holder, but only to the computing community at large + as a market that must bear the fee.) + + "Freely Available" means that no fee is charged for the item + itself, though there may be fees involved in handling the item. + It also means that recipients of the item may redistribute it + under the same conditions they received it. + +1. You may make and give away verbatim copies of the source form of the +Standard Version of this Package without restriction, provided that you +duplicate all of the original copyright notices and associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications +derived from the Public Domain or from the Copyright Holder. A Package +modified in such a way shall still be considered the Standard Version. + +3. You may otherwise modify your copy of this Package in any way, provided +that you insert a prominent notice in each changed file stating how and +when you changed that file, and provided that you do at least ONE of the +following: + + a) place your modifications in the Public Domain or otherwise make them + Freely Available, such as by posting said modifications to Usenet or + an equivalent medium, or placing the modifications on a major archive + site such as uunet.uu.net, or by allowing the Copyright Holder to include + your modifications in the Standard Version of the Package. + + b) use the modified Package only within your corporation or organization. + + c) rename any non-standard executables so the names do not conflict + with standard executables, which must also be provided, and provide + a separate manual page for each non-standard executable that clearly + documents how it differs from the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or +executable form, provided that you do at least ONE of the following: + + a) distribute a Standard Version of the executables and library files, + together with instructions (in the manual page or equivalent) on where + to get the Standard Version. + + b) accompany the distribution with the machine-readable source of + the Package with your modifications. + + c) give non-standard executables non-standard names, and clearly + document the differences in manual pages (or equivalent), together + with instructions on where to get the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of this +Package. You may charge any fee you choose for support of this +Package. You may not charge a fee for this Package itself. However, +you may distribute this Package in aggregate with other (possibly +commercial) programs as part of a larger (possibly commercial) software +distribution provided that you do not advertise this Package as a +product of your own. You may embed this Package's interpreter within +an executable of yours (by linking); this shall be construed as a mere +form of aggregation, provided that the complete Standard Version of the +interpreter is so embedded. + +6. The scripts and library files supplied as input to or produced as +output from the programs of this Package do not automatically fall +under the copyright of this Package, but belong to whoever generated +them, and may be sold commercially, and may be aggregated with this +Package. If such scripts or library files are aggregated with this +Package via the so-called "undump" or "unexec" methods of producing a +binary executable image, then distribution of such an image shall +neither be construed as a distribution of this Package nor shall it +fall under the restrictions of Paragraphs 3 and 4, provided that you do +not represent such an executable image as a Standard Version of this +Package. + +7. C subroutines (or comparably compiled subroutines in other +languages) supplied by you and linked into this Package in order to +emulate subroutines and variables of the language defined by this +Package shall not be considered part of this Package, but are the +equivalent of input as in Paragraph 6, provided these subroutines do +not change the language in any way that would cause it to fail the +regression tests for the language. + +8. Aggregation of this Package with a commercial distribution is always +permitted provided that the use of this Package is embedded; that is, +when no overt attempt is made to make this Package's interfaces visible +to the end user of the commercial distribution. Such use shall not be +construed as a distribution of this Package. + +9. The name of the Copyright Holder may not be used to endorse or promote +products derived from this software without specific prior written permission. + +10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + The End + Added: app/vendor/utf8_to_ascii/README =================================================================== --- app/vendor/utf8_to_ascii/README (rev 0) +++ app/vendor/utf8_to_ascii/README 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,40 @@ +UTF8 TO ASCII + +US-ASCII transliterations of Unicode text + +Ported Sean M. Burke's Text::Unidecode Perl module + +http://search.cpan.org/~sburke/Text-Unidecode-0.04/ +http://interglacial.com/~sburke/ + +Use is simple; + +<?php +require_once '/path/to/utf8_to_ascii/utf8_to_ascii.php'; +$utf8 = file_get_contents('/tmp/someutf8.txt'); +$ascii = utf8_to_ascii($utf8); +?> + +Some notes; + +- Make sure you provide is well-formed UTF-8! +http://phputf8.sourceforge.net/#UTF_8_Validation_and_Cleaning + +- For European languages, it should replace Unicode character +with corresponding ascii characters and produce a readable +result. For other languages, the results will be less +meaningful - it's a "dumb" character for character replacement +True trasliteration is a little more complex than this; +See: http://en.wikipedia.org/wiki/Transliteration + +- For any characters for which there's no replacement +character available, a (default) '?' will be inserted. The second +argument can be used to define an alternative replacement char + +- Don't panic about all the files in the db subdirectory - they +are not all loaded at once - in fact they are only loaded if they +are needed to convert a given character (i.e. which files get +loaded depends on the input) + +For a little more see; +http://www.sitepoint.com/blogs/2006/03/03/us-ascii-transliterations-of-unicode-text/ Added: app/vendor/utf8_to_ascii/db/x00.php =================================================================== (Binary files differ) Property changes on: app/vendor/utf8_to_ascii/db/x00.php ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: app/vendor/utf8_to_ascii/db/x01.php =================================================================== --- app/vendor/utf8_to_ascii/db/x01.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x01.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x01] = array( +'A','a','A','a','A','a','C','c','C','c','C','c','C','c','D','d','D','d','E','e','E','e','E','e','E','e','E','e','G','g','G','g','G','g','G','g','H','h','H','h','I','i','I','i','I','i','I','i','I','i','IJ','','J','j','K','k','k','L','l','L','l','L','l','L','l','L','l','N','n','N','n','N','n',"'n",'ng','NG','O','o','O','o','O','o','OE','oe','R','r','R','r','R','r','S','s','S','s','S','s','S','s','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','U','u','W','w','Y','y','Y','Z','z','Z','z','Z','z','s','b','B','B','b','6','6','O','C','c','D','D','D','d','d','3','@','E','F','f','G','G','hv','I','I','K','k','l','l','W','N','n','O','O','o','OI','oi','P','p','YR','2','2','SH','sh','t','T','t','T','U','u','Y','V','Y','y','Z','z','ZH','ZH','zh','zh','2','5','5','ts','w','|','||','|=','!','DZ','Dz','dz','LJ','Lj','lj','NJ','Nj','nj','A','a','I','i','O','o','U','u','U','u','U','u','U','u','U','u','@','A','a','A','a','AE','ae','G','g','G','g','K','k','O','o','O','o','ZH','zh','j','DZ','D','dz','G','g','HV','W','N','n','A','a','AE','ae','O','o', +); Added: app/vendor/utf8_to_ascii/db/x02.php =================================================================== --- app/vendor/utf8_to_ascii/db/x02.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x02.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x02] = array( +'A','a','A','a','E','e','E','e','I','i','I','i','O','o','O','o','R','r','R','r','U','u','U','u','S','s','T','t','Y','y','H','h','[?]','[?]','OU','ou','Z','z','A','a','E','e','O','o','O','o','O','o','O','o','Y','y','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','a','a','a','b','o','c','d','d','e','@','@','e','e','e','e','j','g','g','g','g','u','Y','h','h','i','i','I','l','l','l','lZ','W','W','m','n','n','n','o','OE','O','F','R','R','R','R','r','r','R','R','R','s','S','j','S','S','t','t','U','U','v','^','W','Y','Y','z','z','Z','Z','?','?','?','C','@','B','E','G','H','j','k','L','q','?','?','dz','dZ','dz','ts','tS','tC','fN','ls','lz','WW',']]','[?]','[?]','k','h','j','r','r','r','r','w','y',"'",'"','`',"'",'`','`',"'",'?','?','<','>','^','V','^','V',"'",'-','/','\\',',','_','\\','/',':','.','`',"'",'^','V','+','-','V','.','@',',','~','"','R','X','G','l','s','x','?','','','','','','','','V','=','"','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x03.php =================================================================== --- app/vendor/utf8_to_ascii/db/x03.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x03.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x03] = array( +'','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','','','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]',"'",',','[?]','[?]','[?]','[?]','','[?]','[?]','[?]','?','[?]','[?]','[?]','[?]','[?]','','','A',';','E','E','I','[?]','O','[?]','U','O','I','A','B','G','D','E','Z','E','Th','I','K','L','M','N','Ks','O','P','R','[?]','S','T','U','Ph','Kh','Ps','O','I','U','a','e','e','i','u','a','b','g','d','e','z','e','th','i','k','l','m','n','x','o','p','r','s','s','t','u','ph','kh','ps','o','i','u','o','u','o','[?]','b','th','U','U','U','ph','p','&','[?]','[?]','St','st','W','w','Q','q','Sp','sp','Sh','sh','F','f','Kh','kh','H','h','G','g','CH','ch','Ti','ti','k','r','c','j','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x04.php =================================================================== --- app/vendor/utf8_to_ascii/db/x04.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x04.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x04] = array( +'Ie','Io','Dj','Gj','Ie','Dz','I','Yi','J','Lj','Nj','Tsh','Kj','I','U','Dzh','A','B','V','G','D','Ie','Zh','Z','I','I','K','L','M','N','O','P','R','S','T','U','F','Kh','Ts','Ch','Sh','Shch','','Y',"'",'E','Iu','Ia','a','b','v','gh','d','ie','zh','z','i','i','k','l','m','n','o','p','r','s','t','u','f','kh','ts','ch','sh','shch','','y',"'",'e','iu','ia','ie','io','dj','gj','ie','dz','i','yi','j','lj','nj','tsh','kj','i','u','dzh','O','o','E','e','Ie','ie','E','e','Ie','ie','O','o','Io','io','Ks','ks','Ps','ps','F','f','Y','y','Y','y','u','u','O','o','O','o','Ot','ot','Q','q','*1000*','','','','','[?]','*100.000*','*1.000.000*','[?]','[?]','"','"',"R'","r'","G'","g'","G'","g'","G'","g'","Zh'","zh'","Z'","z'","K'","k'","K'","k'","K'","k'","K'","k'","N'","n'",'Ng','ng',"P'","p'",'Kh','kh',"S'","s'","T'","t'",'U','u',"U'","u'","Kh'","kh'",'Tts','tts',"Ch'","ch'","Ch'","ch'",'H','h','Ch','ch',"Ch'","ch'",'`','Zh','zh',"K'","k'",'[?]','[?]',"N'","n'",'[?]','[?]','Ch','ch','[?]','[?]','[?]','a','a','A','a','Ae','ae','Ie','ie','@','@','@','@','Zh','zh','Z','z','Dz','dz','I','i','I','i','O','o','O','o','O','o','E','e','U','u','U','u','U','u','Ch','ch','[?]','[?]','Y','y','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x05.php =================================================================== --- app/vendor/utf8_to_ascii/db/x05.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x05.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x05] = array( +'[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','A','B','G','D','E','Z','E','E','T`','Zh','I','L','Kh','Ts','K','H','Dz','Gh','Ch','M','Y','N','Sh','O','Ch`','P','J','Rh','S','V','T','R','Ts`','W','P`','K`','O','F','[?]','[?]','<',"'",'/','!',',','?','.','[?]','a','b','g','d','e','z','e','e','t`','zh','i','l','kh','ts','k','h','dz','gh','ch','m','y','n','sh','o','ch`','p','j','rh','s','v','t','r','ts`','w','p`','k`','o','f','ew','[?]','.','-','[?]','[?]','[?]','[?]','[?]','[?]','','','','','','','','','','','','','','','','','','[?]','','','','','','','','','','','','','','@','e','a','o','i','e','e','a','a','o','[?]','u',"'",'','','','','','',':','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','','b','g','d','h','v','z','kh','t','y','k','k','l','m','m','n','n','s','`','p','p','ts','ts','q','r','sh','t','[?]','[?]','[?]','[?]','[?]','V','oy','i',"'",'"','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x06.php =================================================================== --- app/vendor/utf8_to_ascii/db/x06.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x06.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x06] = array( +'[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]',',','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]',';','[?]','[?]','[?]','?','[?]','','a',"'","w'",'',"y'",'','b','@','t','th','j','H','kh','d','dh','r','z','s','sh','S','D','T','Z','`','G','[?]','[?]','[?]','[?]','[?]','','f','q','k','l','m','n','h','w','~','y','an','un','in','a','u','i','W','','',"'","'",'[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','%','.',',','*','[?]','[?]','',"'","'","'",'',"'","'w","'u","'y",'tt','tth','b','t','T','p','th','bh',"'h",'H','ny','dy','H','ch','cch','dd','D','D','Dt','dh','ddh','d','D','D','rr','R','R','R','R','R','R','j','R','S','S','S','S','S','T','GH','F','F','F','v','f','ph','Q','Q','kh','k','K','K','ng','K','g','G','N','G','G','G','L','L','L','L','N','N','N','N','N','h','Ch','hy','h','H','@','W','oe','oe','u','yu','yu','W','v','y','Y','Y','W','','','y',"y'",'.','ae','','','','','','','','@','#','','','','','','','','','','','^','','','','','[?]','[?]','0','1','2','3','4','5','6','7','8','9','Sh','D','Gh','&','+m', +); Added: app/vendor/utf8_to_ascii/db/x07.php =================================================================== --- app/vendor/utf8_to_ascii/db/x07.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x07.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x07] = array( +'//','/',',','!','!','-',',',',',';','?','~','{','}','*','[?]','',"'",'','b','g','g','d','d','h','w','z','H','t','t','y','yh','k','l','m','n','s','s','`','p','p','S','q','r','sh','t','[?]','[?]','[?]','a','a','a','A','A','A','e','e','e','E','i','i','u','u','u','o','','`',"'",'','','X','Q','@','@','|','+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','h','sh','n','r','b','L','k',"'",'v','m','f','dh','th','l','g','ny','s','d','z','t','y','p','j','ch','tt','hh','kh','th','z','sh','s','d','t','z','`','gh','q','w','a','aa','i','ee','u','oo','e','ey','o','oa','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x09.php =================================================================== --- app/vendor/utf8_to_ascii/db/x09.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x09.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x09] = array( + +); Added: app/vendor/utf8_to_ascii/db/x0a.php =================================================================== --- app/vendor/utf8_to_ascii/db/x0a.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x0a.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x0a] = array( +'[?]','N','N','H','[?]','a','aa','i','ii','u','uu','R','L','eN','e','e','ai','oN','o','o','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','nnn','p','ph','b','bh','m','y','r','rr','l','l','lll','v','sh','ss','s','h','[?]','[?]',"'","'",'aa','i','ii','u','uu','R','RR','eN','e','e','ai','oN','o','o','au','','[?]','[?]','AUM',"'","'",'`',"'",'[?]','[?]','[?]','q','khh','ghh','z','dddh','rh','f','yy','RR','LL','L','LL',' / ',' // ','0','1','2','3','4','5','6','7','8','9','.','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','N','N','H','[?]','a','aa','i','ii','u','uu','R','RR','[?]','[?]','e','ai','[?]','[?]','o','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bh','m','y','r','[?]','l','[?]','[?]','[?]','sh','ss','s','h','[?]','[?]',"'",'[?]','aa','i','ii','u','uu','R','RR','[?]','[?]','e','ai','[?]','[?]','o','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','+','[?]','[?]','[?]','[?]','rr','rh','[?]','yy','RR','LL','L','LL','[?]','[?]','0','1','2','3','4','5','6','7','8','9',"r'",'r`','Rs','Rs','1/','2/','3/','4/',' 1 - 1/','/16','','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x0b.php =================================================================== --- app/vendor/utf8_to_ascii/db/x0b.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x0b.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x0b] = array( +'[?]','[?]','N','[?]','[?]','a','aa','i','ii','u','uu','[?]','[?]','[?]','[?]','ee','ai','[?]','[?]','oo','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bb','m','y','r','[?]','l','ll','[?]','v','sh','[?]','s','h','[?]','[?]',"'",'[?]','aa','i','ii','u','uu','[?]','[?]','[?]','[?]','ee','ai','[?]','[?]','oo','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','khh','ghh','z','rr','[?]','f','[?]','[?]','[?]','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','N','H','','','G.E.O.','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','N','N','H','[?]','a','aa','i','ii','u','uu','R','[?]','eN','[?]','e','ai','oN','[?]','o','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bh','m','ya','r','[?]','l','ll','[?]','v','sh','ss','s','h','[?]','[?]',"'","'",'aa','i','ii','u','uu','R','RR','eN','[?]','e','ai','oN','[?]','o','au','','[?]','[?]','AUM','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','RR','[?]','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x0c.php =================================================================== --- app/vendor/utf8_to_ascii/db/x0c.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x0c.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x0c] = array( +'[?]','N','N','H','[?]','a','aa','i','ii','u','uu','R','L','[?]','[?]','e','ai','[?]','[?]','o','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bh','m','y','r','[?]','l','ll','[?]','','sh','ss','s','h','[?]','[?]',"'","'",'aa','i','ii','u','uu','R','[?]','[?]','[?]','e','ai','[?]','[?]','o','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','+','+','[?]','[?]','[?]','[?]','rr','rh','[?]','yy','RR','LL','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','N','H','[?]','a','aa','i','ii','u','uu','[?]','[?]','[?]','e','ee','ai','[?]','o','oo','au','k','[?]','[?]','[?]','ng','c','[?]','j','[?]','ny','tt','[?]','[?]','[?]','nn','t','[?]','[?]','[?]','n','nnn','p','[?]','[?]','[?]','m','y','r','rr','l','ll','lll','v','[?]','ss','s','h','[?]','[?]','[?]','[?]','aa','i','ii','u','uu','[?]','[?]','[?]','e','ee','ai','[?]','o','oo','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','+10+','+100+','+1000+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x0d.php =================================================================== --- app/vendor/utf8_to_ascii/db/x0d.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x0d.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x0d] = array( +'[?]','N','N','H','[?]','a','aa','i','ii','u','uu','R','L','[?]','e','ee','ai','[?]','o','oo','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bh','m','y','r','rr','l','ll','[?]','v','sh','ss','s','h','[?]','[?]','[?]','[?]','aa','i','ii','u','uu','R','RR','[?]','e','ee','ai','[?]','o','oo','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','+','+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','RR','LL','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','N','H','[?]','a','aa','i','ii','u','uu','R','L','[?]','e','ee','ai','[?]','o','oo','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bh','m','y','r','rr','l','ll','[?]','v','sh','ss','s','h','[?]','[?]','[?]','[?]','aa','i','ii','u','uu','R','RR','[?]','e','ee','ai','[?]','o','oo','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','+','+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','lll','[?]','RR','LL','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x0e.php =================================================================== --- app/vendor/utf8_to_ascii/db/x0e.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x0e.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x0e] = array( +'[?]','[?]','N','H','[?]','a','aa','i','ii','u','uu','R','L','[?]','e','ee','ai','[?]','o','oo','au','k','kh','g','gh','ng','c','ch','j','jh','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','[?]','p','ph','b','bh','m','y','r','rr','l','ll','lll','v','sh','ss','s','h','[?]','[?]','[?]','[?]','aa','i','ii','u','uu','R','[?]','[?]','e','ee','ai','','o','oo','au','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','RR','LL','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','N','H','[?]','a','aa','ae','aae','i','ii','u','uu','R','RR','L','LL','e','ee','ai','o','oo','au','[?]','[?]','[?]','k','kh','g','gh','ng','nng','c','ch','j','jh','ny','jny','nyj','tt','tth','dd','ddh','nn','nndd','t','th','d','dh','n','[?]','nd','p','ph','b','bh','m','mb','y','r','[?]','l','[?]','[?]','v','sh','ss','s','h','ll','f','[?]','[?]','[?]','','[?]','[?]','[?]','[?]','aa','ae','aae','i','ii','u','[?]','uu','[?]','R','e','ee','ai','o','oo','au','L','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','RR','LL',' . ','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x0f.php =================================================================== --- app/vendor/utf8_to_ascii/db/x0f.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x0f.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x0f] = array( +'[?]','k','kh','kh','kh','kh','kh','ng','cch','ch','ch','ch','ch','y','d','t','th','th','th','n','d','t','th','th','th','n','b','p','ph','f','ph','f','ph','m','y','r','R','l','L','w','s','s','s','h','l','`','h','~','a','a','aa','am','i','ii','ue','uue','u','uu',"'",'[?]','[?]','[?]','[?]','Bh.','e','ae','o','ai','ai','ao','+','','','','','','','M','',' * ','0','1','2','3','4','5','6','7','8','9',' // ',' /// ','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','k','kh','[?]','kh','[?]','[?]','ng','ch','[?]','s','[?]','[?]','ny','[?]','[?]','[?]','[?]','[?]','[?]','d','h','th','th','[?]','n','b','p','ph','f','ph','f','[?]','m','y','r','[?]','l','[?]','w','[?]','[?]','s','h','[?]','`','','~','a','','aa','am','i','ii','y','yy','u','uu','[?]','o','l','ny','[?]','[?]','e','ei','o','ay','ai','[?]','+','[?]','','','','','','M','[?]','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','hn','hm','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x10.php =================================================================== --- app/vendor/utf8_to_ascii/db/x10.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x10.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x10] = array( +'AUM','','','','','','','',' // ',' * ','','-',' / ',' / ',' // ',' -/ ',' +/ ',' X/ ',' /XX/ ',' /X/ ',', ','','','','','','','','','','','','0','1','2','3','4','5','6','7','8','9','.5','1.5','2.5','3.5','4.5','5.5','6.5','7.5','8.5','-.5','+','*','^','_','','~','[?]',']','[[',']]','','','k','kh','g','gh','ng','c','ch','j','[?]','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','p','ph','b','bh','m','ts','tsh','dz','dzh','w','zh','z',"'",'y','r','l','sh','ssh','s','h','a','kss','r','[?]','[?]','[?]','[?]','[?]','[?]','aa','i','ii','u','uu','R','RR','L','LL','e','ee','o','oo','M','H','i','ii','','','','','','','','','','','[?]','[?]','[?]','[?]','k','kh','g','gh','ng','c','ch','j','[?]','ny','tt','tth','dd','ddh','nn','t','th','d','dh','n','p','ph','b','bh','m','ts','tsh','dz','dzh','w','zh','z',"'",'y','r','l','sh','ss','s','h','a','kss','w','y','r','[?]','X',' :X: ',' /O/ ',' /o/ ',' \\o\ ',' (O) ','','','','','','','','','','[?]','[?]','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x11.php =================================================================== --- app/vendor/utf8_to_ascii/db/x11.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x11.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x11] = array( +'k','kh','g','gh','ng','c','ch','j','jh','ny','nny','tt','tth','dd','ddh','nn','tt','th','d','dh','n','p','ph','b','bh','m','y','r','l','w','s','h','ll','a','[?]','i','ii','u','uu','e','[?]','o','au','[?]','aa','i','ii','u','uu','e','ai','[?]','[?]','[?]','N',"'",':','','[?]','[?]','[?]','[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9',' / ',' // ','n*','r*','l*','e*','sh','ss','R','RR','L','LL','R','RR','L','LL','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','A','B','G','D','E','V','Z','T`','I','K','L','M','N','O','P','Zh','R','S','T','U','P`','K`',"G'",'Q','Sh','Ch`','C`',"Z'",'C','Ch','X','J','H','E','Y','W','Xh','OE','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','a','b','g','d','e','v','z','t`','i','k','l','m','n','o','p','zh','r','s','t','u','p`','k`',"g'",'q','sh','ch`','c`',"z'",'c','ch','x','j','h','e','y','w','xh','oe','f','[?]','[?]','[?]','[?]',' // ','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x12.php =================================================================== --- app/vendor/utf8_to_ascii/db/x12.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x12.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x12] = array( +'g','gg','n','d','dd','r','m','b','bb','s','ss','','j','jj','c','k','t','p','h','ng','nn','nd','nb','dg','rn','rr','rh','rN','mb','mN','bg','bn','','bs','bsg','bst','bsb','bss','bsj','bj','bc','bt','bp','bN','bbN','sg','sn','sd','sr','sm','sb','sbg','sss','s','sj','sc','sk','st','sp','sh','','','','','Z','g','d','m','b','s','Z','','j','c','t','p','N','j','','','','','ck','ch','','','pb','pN','hh','Q','[?]','[?]','[?]','[?]','[?]','','','a','ae','ya','yae','eo','e','yeo','ye','o','wa','wae','oe','yo','u','weo','we','wi','yu','eu','yi','i','a-o','a-u','ya-o','ya-yo','eo-o','eo-u','eo-eu','yeo-o','yeo-u','o-eo','o-e','o-ye','o-o','o-u','yo-ya','yo-yae','yo-yeo','yo-o','yo-i','u-a','u-ae','u-eo-eu','u-ye','u-u','yu-a','yu-eo','yu-e','yu-yeo','yu-ye','yu-u','yu-i','eu-u','eu-eu','yi-u','i-a','i-ya','i-o','i-u','i-eu','i-U','U','U-eo','U-u','U-i','UU','[?]','[?]','[?]','[?]','[?]','g','gg','gs','n','nj','nh','d','l','lg','lm','lb','ls','lt','lp','lh','m','b','bs','s','ss','ng','j','c','k','t','p','h','gl','gsg','ng','nd','ns','nZ','nt','dg','tl','lgs','ln','ld','lth','ll','lmg','lms','lbs','lbh','rNp','lss','lZ','lk','lQ','mg','ml','mb','ms','mss','mZ','mc','mh','mN','bl','bp','ph','pN','sg','sd','sl','sb','Z','g','ss','','kh','N','Ns','NZ','pb','pN','hn','hl','hm','hb','Q','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x13.php =================================================================== --- app/vendor/utf8_to_ascii/db/x13.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x13.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x13] = array( +'ha','hu','hi','haa','hee','he','ho','[?]','la','lu','li','laa','lee','le','lo','lwa','hha','hhu','hhi','hhaa','hhee','hhe','hho','hhwa','ma','mu','mi','maa','mee','me','mo','mwa','sza','szu','szi','szaa','szee','sze','szo','szwa','ra','ru','ri','raa','ree','re','ro','rwa','sa','su','si','saa','see','se','so','swa','sha','shu','shi','shaa','shee','she','sho','shwa','qa','qu','qi','qaa','qee','qe','qo','[?]','qwa','[?]','qwi','qwaa','qwee','qwe','[?]','[?]','qha','qhu','qhi','qhaa','qhee','qhe','qho','[?]','qhwa','[?]','qhwi','qhwaa','qhwee','qhwe','[?]','[?]','ba','bu','bi','baa','bee','be','bo','bwa','va','vu','vi','vaa','vee','ve','vo','vwa','ta','tu','ti','taa','tee','te','to','twa','ca','cu','ci','caa','cee','ce','co','cwa','xa','xu','xi','xaa','xee','xe','xo','[?]','xwa','[?]','xwi','xwaa','xwee','xwe','[?]','[?]','na','nu','ni','naa','nee','ne','no','nwa','nya','nyu','nyi','nyaa','nyee','nye','nyo','nywa',"'a","'u",'[?]',"'aa","'ee","'e","'o","'wa",'ka','ku','ki','kaa','kee','ke','ko','[?]','kwa','[?]','kwi','kwaa','kwee','kwe','[?]','[?]','kxa','kxu','kxi','kxaa','kxee','kxe','kxo','[?]','kxwa','[?]','kxwi','kxwaa','kxwee','kxwe','[?]','[?]','wa','wu','wi','waa','wee','we','wo','[?]','`a','`u','`i','`aa','`ee','`e','`o','[?]','za','zu','zi','zaa','zee','ze','zo','zwa','zha','zhu','zhi','zhaa','zhee','zhe','zho','zhwa','ya','yu','yi','yaa','yee','ye','yo','[?]','da','du','di','daa','dee','de','do','dwa','dda','ddu','ddi','ddaa','ddee','dde','ddo','ddwa', +); Added: app/vendor/utf8_to_ascii/db/x14.php =================================================================== --- app/vendor/utf8_to_ascii/db/x14.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x14.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x14] = array( +'ja','ju','ji','jaa','jee','je','jo','jwa','ga','gu','gi','gaa','gee','ge','go','[?]','gwa','[?]','gwi','gwaa','gwee','gwe','[?]','[?]','gga','ggu','ggi','ggaa','ggee','gge','ggo','[?]','tha','thu','thi','thaa','thee','the','tho','thwa','cha','chu','chi','chaa','chee','che','cho','chwa','pha','phu','phi','phaa','phee','phe','pho','phwa','tsa','tsu','tsi','tsaa','tsee','tse','tso','tswa','tza','tzu','tzi','tzaa','tzee','tze','tzo','[?]','fa','fu','fi','faa','fee','fe','fo','fwa','pa','pu','pi','paa','pee','pe','po','pwa','rya','mya','fya','[?]','[?]','[?]','[?]','[?]','[?]',' ','.',',',';',':',':: ','?','//','1','2','3','4','5','6','7','8','9','10+','20+','30+','40+','50+','60+','70+','80+','90+','100+','10,000+','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','a','e','i','o','u','v','ga','ka','ge','gi','go','gu','gv','ha','he','hi','ho','hu','hv','la','le','li','lo','lu','lv','ma','me','mi','mo','mu','na','hna','nah','ne','ni','no','nu','nv','qua','que','qui','quo','quu','quv','sa','s','se','si','so','su','sv','da','ta','de','te','di','ti','do','du','dv','dla','tla','tle','tli','tlo','tlu','tlv','tsa','tse','tsi','tso','tsu','tsv','wa','we','wi','wo','wu','wv','ya','ye','yi','yo','yu','yv','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x15.php =================================================================== --- app/vendor/utf8_to_ascii/db/x15.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x15.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x15] = array( +'[?]','e','aai','i','ii','o','oo','oo','ee','i','a','aa','we','we','wi','wi','wii','wii','wo','wo','woo','woo','woo','wa','wa','waa','waa','waa','ai','w',"'",'t','k','sh','s','n','w','n','[?]','w','c','?','l','en','in','on','an','pe','paai','pi','pii','po','poo','poo','hee','hi','pa','paa','pwe','pwe','pwi','pwi','pwii','pwii','pwo','pwo','pwoo','pwoo','pwa','pwa','pwaa','pwaa','pwaa','p','p','h','te','taai','ti','tii','to','too','too','dee','di','ta','taa','twe','twe','twi','twi','twii','twii','two','two','twoo','twoo','twa','twa','twaa','twaa','twaa','t','tte','tti','tto','tta','ke','kaai','ki','kii','ko','koo','koo','ka','kaa','kwe','kwe','kwi','kwi','kwii','kwii','kwo','kwo','kwoo','kwoo','kwa','kwa','kwaa','kwaa','kwaa','k','kw','keh','kih','koh','kah','ce','caai','ci','cii','co','coo','coo','ca','caa','cwe','cwe','cwi','cwi','cwii','cwii','cwo','cwo','cwoo','cwoo','cwa','cwa','cwaa','cwaa','cwaa','c','th','me','maai','mi','mii','mo','moo','moo','ma','maa','mwe','mwe','mwi','mwi','mwii','mwii','mwo','mwo','mwoo','mwoo','mwa','mwa','mwaa','mwaa','mwaa','m','m','mh','m','m','ne','naai','ni','nii','no','noo','noo','na','naa','nwe','nwe','nwa','nwa','nwaa','nwaa','nwaa','n','ng','nh','le','laai','li','lii','lo','loo','loo','la','laa','lwe','lwe','lwi','lwi','lwii','lwii','lwo','lwo','lwoo','lwoo','lwa','lwa','lwaa','lwaa','l','l','l','se','saai','si','sii','so','soo','soo','sa','saa','swe','swe','swi','swi','swii','swii','swo','swo','swoo','swoo', +); Added: app/vendor/utf8_to_ascii/db/x16.php =================================================================== --- app/vendor/utf8_to_ascii/db/x16.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x16.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x16] = array( +'swa','swa','swaa','swaa','swaa','s','s','sw','s','sk','skw','sW','spwa','stwa','skwa','scwa','she','shi','shii','sho','shoo','sha','shaa','shwe','shwe','shwi','shwi','shwii','shwii','shwo','shwo','shwoo','shwoo','shwa','shwa','shwaa','shwaa','sh','ye','yaai','yi','yii','yo','yoo','yoo','ya','yaa','ywe','ywe','ywi','ywi','ywii','ywii','ywo','ywo','ywoo','ywoo','ywa','ywa','ywaa','ywaa','ywaa','y','y','y','yi','re','re','le','raai','ri','rii','ro','roo','lo','ra','raa','la','rwaa','rwaa','r','r','r','fe','faai','fi','fii','fo','foo','fa','faa','fwaa','fwaa','f','the','the','thi','thi','thii','thii','tho','thoo','tha','thaa','thwaa','thwaa','th','tthe','tthi','ttho','ttha','tth','tye','tyi','tyo','tya','he','hi','hii','ho','hoo','ha','haa','h','h','hk','qaai','qi','qii','qo','qoo','qa','qaa','q','tlhe','tlhi','tlho','tlha','re','ri','ro','ra','ngaai','ngi','ngii','ngo','ngoo','nga','ngaa','ng','nng','she','shi','sho','sha','the','thi','tho','tha','th','lhi','lhii','lho','lhoo','lha','lhaa','lh','the','thi','thii','tho','thoo','tha','thaa','th','b','e','i','o','a','we','wi','wo','wa','ne','ni','no','na','ke','ki','ko','ka','he','hi','ho','ha','ghu','gho','ghe','ghee','ghi','gha','ru','ro','re','ree','ri','ra','wu','wo','we','wee','wi','wa','hwu','hwo','hwe','hwee','hwi','hwa','thu','tho','the','thee','thi','tha','ttu','tto','tte','ttee','tti','tta','pu','po','pe','pee','pi','pa','p','gu','go','ge','gee','gi','ga','khu','kho','khe','khee','khi','kha','kku','kko','kke','kkee','kki', +); Added: app/vendor/utf8_to_ascii/db/x17.php =================================================================== --- app/vendor/utf8_to_ascii/db/x17.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x17.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x17] = array( +'kka','kk','nu','no','ne','nee','ni','na','mu','mo','me','mee','mi','ma','yu','yo','ye','yee','yi','ya','ju','ju','jo','je','jee','ji','ji','ja','jju','jjo','jje','jjee','jji','jja','lu','lo','le','lee','li','la','dlu','dlo','dle','dlee','dli','dla','lhu','lho','lhe','lhee','lhi','lha','tlhu','tlho','tlhe','tlhee','tlhi','tlha','tlu','tlo','tle','tlee','tli','tla','zu','zo','ze','zee','zi','za','z','z','dzu','dzo','dze','dzee','dzi','dza','su','so','se','see','si','sa','shu','sho','she','shee','shi','sha','sh','tsu','tso','tse','tsee','tsi','tsa','chu','cho','che','chee','chi','cha','ttsu','ttso','ttse','ttsee','ttsi','ttsa','X','.','qai','ngai','nngi','nngii','nngo','nngoo','nnga','nngaa','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]',' ','b','l','f','s','n','h','d','t','c','q','m','g','ng','z','r','a','o','u','e','i','ch','th','ph','p','x','p','<','>','[?]','[?]','[?]','f','v','u','yr','y','w','th','th','a','o','ac','ae','o','o','o','oe','on','r','k','c','k','g','ng','g','g','w','h','h','h','h','n','n','n','i','e','j','g','ae','a','eo','p','z','s','s','s','c','z','t','t','d','b','b','p','p','e','m','m','m','l','l','ng','ng','d','o','ear','ior','qu','qu','qu','s','yr','yr','yr','q','x','.',':','+','17','18','19','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x18.php =================================================================== --- app/vendor/utf8_to_ascii/db/x18.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x18.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x18] = array( +'[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','k','kh','g','gh','ng','c','ch','j','jh','ny','t','tth','d','ddh','nn','t','th','d','dh','n','p','ph','b','bh','m','y','r','l','v','sh','ss','s','h','l','q','a','aa','i','ii','u','uk','uu','uuv','ry','ryy','ly','lyy','e','ai','oo','oo','au','a','aa','aa','i','ii','y','yy','u','uu','ua','oe','ya','ie','e','ae','ai','oo','au','M','H','a`','','','','r','','!','','','','','','.',' // ',':','+','++',' * ',' /// ','KR',"'",'[?]','[?]','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x1e.php =================================================================== --- app/vendor/utf8_to_ascii/db/x1e.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x1e.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x1e] = array( +' @ ',' ... ',', ','. ',': ',' // ','','-',', ','. ','','','','','','[?]','0','1','2','3','4','5','6','7','8','9','[?]','[?]','[?]','[?]','[?]','[?]','a','e','i','o','u','O','U','ee','n','ng','b','p','q','g','m','l','s','sh','t','d','ch','j','y','r','w','f','k','kha','ts','z','h','zr','lh','zh','ch','-','e','i','o','u','O','U','ng','b','p','q','g','m','t','d','ch','j','ts','y','w','k','g','h','jy','ny','dz','e','i','iy','U','u','ng','k','g','h','p','sh','t','d','j','f','g','h','ts','z','r','ch','zh','i','k','r','f','zh','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','H','X','W','M',' 3 ',' 333 ','a','i','k','ng','c','tt','tth','dd','nn','t','d','p','ph','ss','zh','z','a','t','zh','gh','ng','c','jh','tta','ddh','t','dh','ss','cy','zh','z','u','y','bh',"'",'[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x1f.php =================================================================== --- app/vendor/utf8_to_ascii/db/x1f.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x1f.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x1f] = array( + +); Added: app/vendor/utf8_to_ascii/db/x20.php =================================================================== --- app/vendor/utf8_to_ascii/db/x20.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x20.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x20] = array( + +); Added: app/vendor/utf8_to_ascii/db/x21.php =================================================================== --- app/vendor/utf8_to_ascii/db/x21.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x21.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x21] = array( + +); Added: app/vendor/utf8_to_ascii/db/x22.php =================================================================== --- app/vendor/utf8_to_ascii/db/x22.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x22.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x22] = array( + +); Added: app/vendor/utf8_to_ascii/db/x23.php =================================================================== --- app/vendor/utf8_to_ascii/db/x23.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x23.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x23] = array( + +); Added: app/vendor/utf8_to_ascii/db/x24.php =================================================================== --- app/vendor/utf8_to_ascii/db/x24.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x24.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x24] = array( +'A','a','B','b','B','b','B','b','C','c','D','d','D','d','D','d','D','d','D','d','E','e','E','e','E','e','E','e','E','e','F','f','G','g','H','h','H','h','H','h','H','h','H','h','I','i','I','i','K','k','K','k','K','k','L','l','L','l','L','l','L','l','M','m','M','m','M','m','N','n','N','n','N','n','N','n','O','o','O','o','O','o','O','o','P','p','P','p','R','r','R','r','R','r','R','r','S','s','S','s','S','s','S','s','S','s','T','t','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','V','v','V','v','W','w','W','w','W','w','W','w','W','w','X','x','X','x','Y','y','Z','z','Z','z','Z','z','h','t','w','y','a','S','[?]','[?]','[?]','[?]','A','a','A','a','A','a','A','a','A','a','A','a','A','a','A','a','A','a','A','a','A','a','A','a','E','e','E','e','E','e','E','e','E','e','E','e','E','e','E','e','I','i','I','i','O','o','O','o','O','o','O','o','O','o','O','o','O','o','O','o','O','o','O','o','O','o','O','o','U','u','U','u','U','u','U','u','U','u','U','u','U','u','Y','y','Y','y','Y','y','Y','y','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x25.php =================================================================== --- app/vendor/utf8_to_ascii/db/x25.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x25.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,4 @@ +<?php +$UTF8_TO_ASCII[0x25] = array( +'a','a','a','a','a','a','a','a','A','A','A','A','A','A','A','A','e','e','e','e','e','e','[?]','[?]','E','E','E','E','E','E','[?]','[?]','e','e','e','e','e','e','e','e','E','E','E','E','E','E','E','E','i','i','i','i','i','i','i','i','I','I','I','I','I','I','I','I','o','o','o','o','o','o','[?]','[?]','O','O','O','O','O','O','[?]','[?]','u','u','u','u','u','u','u','u','[?]','U','[?]','U','[?]','U','[?]','U','o','o','o','o','o','o','o','o','O','O','O','O','O','O','O','O','a','a','e','e','e','e','i','i','o','o','u','u','o','o','[?]','[?]','a','a','a','a','a','a','a','a','A','A','A','A','A','A','A','A','e','e','e','e','e','e','e','e','E','E','E','E','E','E','E','E','o','o','o','o','o','o','o','o','O','O','O','O','O','O','O','O','a','a','a','a','a','[?]','a','a','A','A','A','A','A',"'",'i',"'",'~','"~','e','e','e','[?]','e','e','E','E','E','E','E',"'`","''","'~",'i','i','i','i','[?]','[?]','i','i','I','I','I','I','[?]',"`'","`'",'`~','u','u','u','u','R','R','u','u','U','U','U','U','R','"`',"0x22'",'`','[?]','[?]','o','o','o','[?]','o','o','O','O','O','O','O',"'",'`', +); Added: app/vendor/utf8_to_ascii/db/x26.php =================================================================== --- app/vendor/utf8_to_ascii/db/x26.php (rev 0) +++ app/vendor/utf8_to_ascii/db/x26.php 2008-03-05 18:39:57 UTC (rev 40) @@ -0,0 +1,7 @@ +<?php +$UTF8_TO_ASCII[0x26] = array( +' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','','','','','-','-','-','-','--','--','||','_',"'","'",',',"'",'"','"',',,','"','+','++','*','*>','.','..','...','.',' +',' + +','','','','','',' ','%0','%00',"'","''","'''",'`','``','```','^','<','>','*','!!','!?','-','_','-','^','***','--','/','-[',']-','[?]','?!','!?','7','PP','(]','[)','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','','','','','','','0','','','','4','5','6','7','8','9','+','-','=','(',')','n','0','1','2','3','4','5','6','7','8','9','+','-','=','(',')','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','ECU','CL','Cr','FF','L','mil','N','Pts','Rs','W','NS','D','EU','K','T','Dr','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','','','','','','','','','','','','','','','','','','','','','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]','[?]', +); Added: app/vendor/utf8_to_ascii/db/x27.php =================================================================== --- app/vendor/utf8_to_ascii/db/x27.php (rev 0) +++ app/vendor/utf... [truncated message content] |
From: <di...@us...> - 2008-03-05 18:37:33
|
Revision: 39 http://isocial.svn.sourceforge.net/isocial/?rev=39&view=rev Author: dim0s77 Date: 2008-03-05 10:37:38 -0800 (Wed, 05 Mar 2008) Log Message: ----------- added messaging basis Modified Paths: -------------- app/application_controller.php app/controllers/message_controller.php app/installers/message_installer.php app/locales/message/ru.php app/models/user.php app/views/message/inbox.tpl app/views/message/outbox.tpl app/views/message/send.tpl public/stylesheets/Message.css Added Paths: ----------- app/controllers/friend_controller.php app/installers/friend_installer.php app/models/friend.php app/models/message.php app/views/friend/ app/views/friend/show.tpl app/views/message/_rows.tpl app/views/message/send_successfully.tpl app/views/message/show.tpl public/images/new_message.gif public/images/nophoto_men_b.gif public/images/nophoto_men_sm.gif public/images/nophoto_women_b.gif public/images/nophoto_women_sm.gif public/images/x_to_hide.gif public/images/x_to_hide_hover.gif Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-04 16:29:23 UTC (rev 38) +++ app/application_controller.php 2008-03-05 18:37:38 UTC (rev 39) @@ -3,15 +3,15 @@ require_once(AK_LIB_DIR.DS.'AkActionController.php'); /** -* This file is application-wide controller file. You can put all -* application-wide controller-related methods here. -* -* Add your application-wide methods in the class below, your controllers -* will inherit them. -* -* @package ActionController -* @subpackage Base -*/ + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * Add your application-wide methods in the class below, your controllers + * will inherit them. + * + * @package ActionController + * @subpackage Base + */ class ApplicationController extends AkActionController { @@ -66,9 +66,9 @@ function clearErrors ($field) { if ($field) { $this->_errors[$field] = array(); - } else { - $this->_errors = array(); - } + } else { + $this->_errors = array(); + } } function addError($field, $message, $comment) { @@ -78,15 +78,15 @@ } $this->_errors[$field][] = array( - $this->t($message), - $this->t($comment) - ); + $this->t($message), + $this->t($comment) + ); } // before ActionMailer gets imported this function will be used function sendMail ( $to, $template = '', $locals = array() ) { if (!$template) { - // http://trac.akelos.org/ticket/122 + // http://trac.akelos.org/ticket/122 // $template = strtolower($this->getControllerName()) . DS . "email" . DS . strtolower($this->getActionName()); $template = "email" . DS . strtolower($this->getActionName()); } @@ -160,11 +160,11 @@ function _fix_email ($value) { // eats last space !!! - if (preg_match('/(.*?)\s+(<?\S+@\S+>?)/', $value, $matches)) { - $name = $this->_to_base64_utf8($matches[1]); - $value = $name . " " . $matches[2]; - } - return $value; + if (preg_match('/(.*?)\s+(<?\S+@\S+>?)/', $value, $matches)) { + $name = $this->_to_base64_utf8($matches[1]); + $value = $name . " " . $matches[2]; + } + return $value; } function _to_base64_utf8 ($value) { @@ -172,17 +172,16 @@ } function _auto_complete_result ($items, $field, $phrase = '') { - // converting to an array $entries = array(); foreach ($items as $item) { - $entry = array(); - foreach ($item->getColumns() as $column => $details) { - $entry[$column] = $item->get($column); - } - $entries[] = $entry; - } - + $entry = array(); + foreach ($item->getColumns() as $column => $details) { + $entry[$column] = $item->get($column); + } + $entries[] = $entry; + } + return $this->javascript_macros_helper->auto_complete_result($entries, $field, $phrase); } Added: app/controllers/friend_controller.php =================================================================== --- app/controllers/friend_controller.php (rev 0) +++ app/controllers/friend_controller.php 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,24 @@ +<?php + +class FriendController extends ApplicationController +{ + var $models = 'user, message'; + + function index () { + $this->redirectTo(array('action' => 'show')); + } + + function show () { + } + + function search () { + } + + function add () { + } + + function delete () { + } + +} +?> \ No newline at end of file Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-04 16:29:23 UTC (rev 38) +++ app/controllers/message_controller.php 2008-03-05 18:37:38 UTC (rev 39) @@ -2,20 +2,87 @@ class MessageController extends ApplicationController { - //var $models = 'user, message'; + var $models = 'user'; function index () { $this->redirectTo(array('action' => 'inbox')); } function inbox () { + $messages = $this->current_user->inbox_message->load(); + $inbox_messages = array(); + if(!empty($messages)) { + foreach ($messages as $message_loop_key => $message) { + if (isset($inbox_messages[$message->thread_id])) { + if ($inbox_messages[$message->thread_id]->id < $message->id) { + $inbox_messages[$message->thread_id] = $message; + } + } else { + $inbox_messages[$message->thread_id] = $message; + } + } + } + $this->inbox_messages = $inbox_messages; } function outbox () { + $messages = $this->current_user->outbox_message->load(); + $outbox_messages = array(); + if(!empty($messages)) { + foreach ($messages as $message_loop_key => $message) { + if (isset($outbox_messages[$message->thread_id])) { + if ($outbox_messages[$message->thread_id]->id < $message->id) { + $outbox_messages[$message->thread_id] = $message; + } + } else { + $outbox_messages[$message->thread_id] = $message; + } + } + } + $this->outbox_messages = $outbox_messages; } function send () { + if (!empty($this->params['message'])){ + $recipient = $this->User->findFirst(array( 'id' => $this->params['message']['recipient'] )); + if ($recipient) { + $message = $this->current_user->outbox_message->build(); + $message->recipient->assign($recipient); + $message->setAttributes($this->params['message']); + if ($message->save()) { + if (!$message->thread_id) { + $message->thread_id = $message->getId(); + if ($message->save()) { + $this->redirectTo(array('action' => 'send_successfully')); + return; + } + } + $this->redirectTo(array('action' => 'send_successfully')); + return; + } + } + $this->addError('_common', 'Sending message error', 'please, try again'); + } } + + function send_successfully () { + } + function show () { + if (!empty($this->params['t'])){ + $thread = $this->Message->FindFirst(array( 'thread_id' => $this->params['t'] )); + $user_id = $this->current_user->getId(); + if ($thread->sender_id == $user_id || $thread->recipient_id == $user_id ) { + $this->recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; + $this->messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), + 'order' => 'created_at')); + $this->interlocutors[$user_id] = $this->current_user; + $this->interlocutors[$this->recipient_id] = $this->User->findFirst(array( 'id' => $this->recipient_id)); + return; + } + } + $this->addError('_common', 'Thread unavailable', 'Sorry, the contents of this thread are temporarily unavailable. Please check back later.'); + } + } ?> \ No newline at end of file Added: app/installers/friend_installer.php =================================================================== --- app/installers/friend_installer.php (rev 0) +++ app/installers/friend_installer.php 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,27 @@ +<?php +class FriendInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `friends` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL DEFAULT 0, + `friend_id` int(11) NOT NULL DEFAULT 0, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (friend_id) REFERENCES users(id), + UNIQUE forward_key (user_id, friend_id), + UNIQUE reverse_key (friend_id, user_id) + ) ENGINE=InnoDB"); + + } + + function down_1() + { + /**/ + $this->dropTable('friends'); + /**/ + } +} + +?> Modified: app/installers/message_installer.php =================================================================== --- app/installers/message_installer.php 2008-03-04 16:29:23 UTC (rev 38) +++ app/installers/message_installer.php 2008-03-05 18:37:38 UTC (rev 39) @@ -8,11 +8,13 @@ `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `sender_id` int(11) NOT NULL DEFAULT 0, `recipient_id` int(11) NOT NULL DEFAULT 0, + `thread_id` int(11) NOT NULL DEFAULT 0, `subject` char(255) NOT NULL DEFAULT '', `body` text NOT NULL DEFAULT '', `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, - `read` tinyint(1) NOT NULL DEFAULT '0' + `is_read` tinyint(1) NOT NULL DEFAULT '0', + FOREIGN KEY (sender_id) REFERENCES users(id), + FOREIGN KEY (recipient_id) REFERENCES users(id) ) ENGINE=InnoDB"); } Modified: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php 2008-03-04 16:29:23 UTC (rev 38) +++ app/locales/message/ru.php 2008-03-05 18:37:38 UTC (rev 39) @@ -13,13 +13,19 @@ $dictionary['Send'] = 'Послать'; $dictionary['Cancel'] = 'Отмена'; $dictionary['Select'] = 'Выбрать'; -$dictionary['None'] = 'Ничего'; -$dictionary['Read'] = 'Прочтенные'; -$dictionary['Unread'] = 'Непрочтенные'; -$dictionary['All'] = 'Все'; -$dictionary['Mark as Unread'] = 'Отметить как непрочтенные'; -$dictionary['Mark as Read'] = 'Отметить как прочтенные'; +$dictionary['None'] = 'ничего'; +$dictionary['Read'] = 'прочтенные'; +$dictionary['Unread'] = 'непрочтенные'; +$dictionary['All'] = 'все'; +$dictionary['Mark as'] = 'Отметить как'; $dictionary['Delete'] = 'Удалить'; +$dictionary['Message successfully sended'] = 'Сообщение отправлено'; +$dictionary['Thread unavailable'] = 'Нить сообщений недоступна'; +$dictionary['Sorry, the contents of this thread are temporarily unavailable. Please check back later.'] = 'К сожалению, содержание этой нити сообщений временно недоступно. Повторите попытку позже.'; +$dictionary['Between'] = 'в беседе участвуют:'; +$dictionary['You'] = 'Вы'; +$dictionary['and'] = 'и'; +$dictionary['Reply'] = 'Ответ'; +$dictionary['Back to'] = 'Обратно во'; - ?> Added: app/models/friend.php =================================================================== --- app/models/friend.php (rev 0) +++ app/models/friend.php 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,7 @@ +<?php + +class Friend extends ActiveRecord +{ +} + +?> \ No newline at end of file Added: app/models/message.php =================================================================== --- app/models/message.php (rev 0) +++ app/models/message.php 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,10 @@ +<?php + +class Message extends ActiveRecord +{ + var $belongs_to = array('sender' => array('class_name' => 'User', 'primary_key_name' => 'sender_id'), + 'recipient' => array('class_name' => 'User', 'primary_key_name' => 'recipient_id')); + +} + +?> Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-03-04 16:29:23 UTC (rev 38) +++ app/models/user.php 2008-03-05 18:37:38 UTC (rev 39) @@ -2,6 +2,10 @@ class User extends ActiveRecord { + var $has_many = array('outbox_messages' => array('class_name' => 'Message', 'order' => 'created_at desc', 'foreign_key' => 'sender_id'), + 'inbox_messages' => array('class_name' => 'Message', 'order' => 'created_at desc', 'foreign_key' => 'recipient_id'), + ); + function login($email, $password) { return $this->findFirst(array( 'email' => $email, 'password' => md5($password) )); } @@ -43,6 +47,21 @@ unset($this->password_confirmation); } + function getFriends () + { + return $this->findBySql(array( + "SELECT users.* FROM users + INNER JOIN friends + ON friends.user_id = ? AND + friends.friend_id = users.id + UNION + SELECT users.* FROM users + INNER JOIN friends + ON friends.friend_id = ? AND + friends.user_id = users.id", + $this->getId(), $this->getId())); + } + } ?> Added: app/views/friend/show.tpl =================================================================== --- app/views/friend/show.tpl (rev 0) +++ app/views/friend/show.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,3 @@ +show all friends +<? $friends = $current_user->getFriends() ?> +{friends} \ No newline at end of file Added: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl (rev 0) +++ app/views/message/_rows.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,33 @@ +<table class="message_row"> +<tbody> +{loop messages} +<tr><? $sender = $message->$target->load() ?> + <td class="msg_icon"> </td> + <td class="checkbox"><input onclick="" type="checkbox"></td> + <td class="profile_photo"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> + <td class="name_and_datetime"> + <span class="name"><a href="">{sender.name?}</a></span> + <span class="datetime">{message.created_at?}</span> + </td> + <td class="msg"> + <div class="wrapper"> + <a href="/message/show?t={message.thread_id?}" class="subject">{message.subject?}</a> + <div class="body_wrap"> + <? (utf8_strlen($message->body) > 50) ? $msg_body = utf8_substr($message->body, 0, 50) . " [..]" : $msg_body = $message->body; ?> + <a href="/message/show?t={message.thread_id?}" class="body">{msg_body?}</a> + </div> + </div> + </td> + <td class="delete_msg"> + <a href="#" onclick=""> </a> + </td> +</tr> +{else} +<div class="no_messages">_{You currently don't have any messages}.<br><br> + <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> +</div> +{end} +</tbody> +</table> + +<div class="inbox_footer"><div class="mailbox_size">1 Message Threads</div></div> Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-04 16:29:23 UTC (rev 38) +++ app/views/message/inbox.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -14,12 +14,15 @@ </div> <div class="menu_block"> <ul id="inbox_action" class="buttons"> - <li class="disabled"><a href="#" onclick="" id="unread">_{Mark as Unread}</a></li> - <li class="disabled"><a href="#" onclick="" id="read">_{Mark as Read}</a></li> + <li class="disabled"><a>_{Mark as}:</a></li> + <li class="disabled"><a href="#" onclick="" id="unread">_{Unread},</a></li> + <li class="disabled"><a href="#" onclick="" id="read">_{Read};</a></li> <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> </ul> </div> </div> -<div class="no_messages">_{You currently don't have any messages}.<br><br> - <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> -</div> + +<?= $controller->render(array('partial' => 'rows', + 'locals' => array('messages' => $inbox_messages, + 'target' => 'sender'))) ?> + Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-03-04 16:29:23 UTC (rev 38) +++ app/views/message/outbox.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -4,7 +4,7 @@ <div class="menu_block selector"> <label for="action_select">_{Select}: <select class="" onchange="" id="action_select" name="action_selector"> - <option selected="selected" value="_">---</option> + <option selected="selected" value="_">---------</option> <option value="">_{None}</option> <option value="read">_{Read}</option> <option value="unread">_{Unread}</option> @@ -18,6 +18,8 @@ </ul> </div> </div> -<div class="no_messages">_{You currently don't have any messages}.<br><br> - <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> -</div> + +<?= $controller->render(array('partial' => 'rows', + 'locals' => array('messages' => $outbox_messages, + 'target' => 'recipient'))) ?> + Modified: app/views/message/send.tpl =================================================================== --- app/views/message/send.tpl 2008-03-04 16:29:23 UTC (rev 38) +++ app/views/message/send.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -6,7 +6,10 @@ <div class="editform"> <div class="formrow"> <label>_{To}:</label> - <?= $form_helper->text_field('message', '', array('class' => 'textinput') )?> + <?= $form_options_helper->select('message', + 'recipient', + $User->collect($current_user->getFriends(), 'name', 'id'), + array('class' => 'textinput') ); ?> </div> <div class="formrow"> <label>_{Subject}:</label> @@ -14,10 +17,10 @@ </div> <div class="formrow"> <label>_{Message}:</label> - <textarea id="message" name="message" class="textinput"></textarea> + <?= $form_helper->text_area('message', 'body', array('class' => 'textinput'))?> </div> <div class="formrow"> - <label></label> + <label><?= $form_helper->hidden_field('message', 'thread_id') ?></label> <input class="submitinput" type="submit" value="_{Send}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> Added: app/views/message/send_successfully.tpl =================================================================== --- app/views/message/send_successfully.tpl (rev 0) +++ app/views/message/send_successfully.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,3 @@ +<?= $controller->renderPartial("menu") ?> + +<p>_{Message successfully sended}</p> \ No newline at end of file Added: app/views/message/show.tpl =================================================================== --- app/views/message/show.tpl (rev 0) +++ app/views/message/show.tpl 2008-03-05 18:37:38 UTC (rev 39) @@ -0,0 +1,47 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<div class="messages_thread"> + <div class="thread_head"> + <h2 class="subject">{messages-0.subject} + <div class="interlocutors">_{Between} + <a href="">_{You}</a> _{and} + <a href=""><? $recipient = $interlocutors[$recipient_id] ?>{recipient.name}</a></div> + </h2> + </div> + <hr width="600px"> +{loop messages} + <? $interlocutor = $interlocutors[$message->sender_id] ?> + <div class="message" id="msg{message_loop_counter}"> + <div class="column author_picture"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></div> + <div class="column author_info"> + <div class="name"><a href="">{interlocutor.name?}</a></div> + <div class="date">{message.created_at?}</div> + <div class="extras"></div> + </div> + <div class="column body"> + <div class="text">{message.body?}</div> + </div> + </div> + <div class="msg_divide_btm"> </div> +{end} + + <div class="reply_container"> + <form action="/message/send" method="post"> + <div class="row"><label>_{Reply}:</label></div> + <div class="row"><?= $form_helper->text_area('message', 'body', array('class' => 'textinput'))?></div> + <input id="message_recipient" name="message[recipient]" type="hidden" value="{recipient_id}" /> + <input id="message_thread_id" name="message[thread_id]" type="hidden" value="{message.thread_id}" /> + <input id="message_subject" name="message[subject]" type="hidden" value="re: {message.subject}" /> + <div class="msg_divide_btm"> </div> + <div class="row"> + <div class="submits"> + <input class="submitinput" type="submit" value="_{Send}"> + <input class="cancelinput" type="button" value="_{Back to} _{Inbox}" onclick=""> + </div> + <div class="sub_controls"><a href="#" onclick="">_{Delete}</a></div> + </form> + </div> + +</div> Added: public/images/new_message.gif =================================================================== (Binary files differ) Property changes on: public/images/new_message.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/nophoto_men_b.gif =================================================================== (Binary files differ) Property changes on: public/images/nophoto_men_b.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/nophoto_men_sm.gif =================================================================== (Binary files differ) Property changes on: public/images/nophoto_men_sm.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/nophoto_women_b.gif =================================================================== (Binary files differ) Property changes on: public/images/nophoto_women_b.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/nophoto_women_sm.gif =================================================================== (Binary files differ) Property changes on: public/images/nophoto_women_sm.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/x_to_hide.gif =================================================================== (Binary files differ) Property changes on: public/images/x_to_hide.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/x_to_hide_hover.gif =================================================================== (Binary files differ) Property changes on: public/images/x_to_hide_hover.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-03-04 16:29:23 UTC (rev 38) +++ public/stylesheets/Message.css 2008-03-05 18:37:38 UTC (rev 39) @@ -1,12 +1,294 @@ -#content .inbox_submenu { background:#f7f7f7; border-bottom:1px solid #ccc; padding: 8px 20px 28px; } -.inbox_submenu .menu_block { float:left; } -.inbox_submenu .menu_block.selector { padding-right:5px; } -.inbox_submenu .menu_block.selector select { margin-left:5px; } -.inbox_submenu .buttons { list-style:none; margin:0px; padding:0px; } -.inbox_submenu .buttons li { float:left; } -.inbox_submenu .buttons li a { padding:4px 5px 4px 5px; display:block; } -.inbox_submenu .disabled a { color:#aaa; } -.inbox_submenu .disabled a:hover { cursor:default; text-decoration:none; } +#content .inbox_submenu { + background: #f7f7f7; + border-bottom: 1px solid #ccc; + padding: 8px 20px 28px 20px; +} -.no_messages { color:#666; font-size:13px; padding:100px 0px 110px 0px; text-align:center; } -.no_messages strong { color:#333; font-weight:bold; } +.inbox_submenu .menu_block { + float: left; +} + +.inbox_submenu .menu_block.selector { + padding-right: 5px; +} + +.inbox_submenu .menu_block.selector select { + margin-left: 5px; +} + +.inbox_submenu .buttons { + list-style: none; + margin: 0px; + padding: 0px; +} + +.inbox_submenu .buttons li { + float: left; +} + +.inbox_submenu .buttons li a { + padding: 4px 5px 4px 5px; + display: block; +} + +.inbox_submenu .disabled a { + color: #aaaaaa; +} + +.inbox_submenu .disabled a:hover { + cursor: default; + text-decoration: none; +} + +.no_messages { + color: #666666; + font-size: 13px; + padding: 100px 0px 110px 0px; + text-align: center; +} + +.no_messages strong { + color: #333333; + font-weight: bold; +} + +.message_row { + border-collapse: collapse; + width: 100%; +} + +.message_row tr td { + border-bottom: 1px solid #e1e1e1; + padding: 5px 0px 5px 0px; + vertical-align: middle; +} + +.message_row .msg_icon a, .message_row .msg_icon span { + display: block; + margin-top: 1px; + width: 17px; + height: 14px; + padding-left: 10px; + text-decoration: none; +} + +.message_row .checkbox { + width: 25px; +} + +.message_row .profile_photo { + width: 60px; + line-height: 1px; +} + +.message_row .name_and_datetime .name { + display: block; + width: 130px; + margin-right: 20px; + word-wrap: break-word; + text-overflow: ellipsis; +} + +.name_and_datetime .datetime { + display: block; + padding: 1px 0px 0px 0px; + font-size: 9px; + color: #777777; +} + +.name_and_datetime .unread_name { + font-weight: bold; +} + +.message_row .msg { + margin-right: 10px; + line-height: 14px; +} + +.message_row .msg .wrapper { + width: 350px; + padding: 2px 0px 2px 0px; + display: block; + text-overflow: ellipsis; +} + +.message_row .msg a { + margin-right: 5px; +} + +.message_row .msg .subject { + padding: 2px 0px 3px 22px; + background-position: 0px 1px 0px 1px; + background-repeat: no-repeat; +} + +.message_row .msg .body_wrap { + padding-left: 22px; +} + +.body_wrap .body { + font-weight: normal; + color: #8d9ccf; +} + +.message_row .delete_msg { + width: 24px; + padding-left: 10px; +} + +.message_row .delete_msg a { + display: block; + margin-top: 1px; + width: 13px; + height: 14px; + background: transparent url(/images/x_to_hide.gif) no-repeat; +} + +.message_row .delete_msg a:hover { + background: #3B5998 url(/images/x_to_hide_hover.gif) no-repeat; +} + +.inbox_footer { + display: block; + margin-top: -1px; + padding: 0px 10px 8px 13px; + border-top: 1px solid #cccccc; + background: #f7f7f7; + overflow: auto; +} + +.inbox_footer .mailbox_size { + float: left; + padding: 7px 0px 0px 0px; + color: #999999; +} + +.messages_thread { + padding: 20px 30px 0px 30px; +} + +.thread_head { + margin: 0px 0px 0px 10px; +} + +.thread_head h2 { + margin: 0px 20px 1px 153px; + padding: 0px 0px 0px 22px; + font-size: 15px; + color: #333333; +} + +.thread_head h2 .interlocutors { + font-size: 11px; + font-weight: normal; +} + +.message { + display: block; + margin-top: 10px; + overflow: hidden; +} + +.message .column { + float: left; + padding: 0px 0px 10px 0px; +} + +.message .author_picture { + width: 50px; + padding-bottom: 0px; +} + +.message .author_picture img { + display: block; +} + +.message .author_info { + width: 120px; + padding: 0px 10px 0px 0px; + font-weight: normal; + font-size: 9px; + text-align: right; +} + +.message .author_info .name { + padding: 3px 5px 0px 5px; + font-size: 11px; + font-weight: bold; + overflow: hidden; +} + +.message.unread .author_info .name { + padding: 3px 5px 4px 20px; + background: #eff2f7 url('/inbox/images/new_message.gif') no-repeat 7px 5px; + border-top: 1px solid #d8dfea; + overflow: hidden; +} + +.message .author_info .date { + display: block; + padding: 2px 5px 2px 0px; + color: #777777; +} + +.message .author_info .extras a { + float: right; + padding-right: 5px; + margin-bottom: 1px; +} + +.message .body { + padding: 3px 0px 14px 5px; +} + +.message.unread .body { + padding-top: 4px; +} + +.message .body .text { + width: 300px; + word-wrap: break-word; +} + +.message .body .text.no_body { + color: #777777; +} + +.msg_divide_btm { + height: 1px; + margin: 1px 0px 0px 185px; + background: #dddddd; + overflow: hidden; +} + +.reply_container { + margin: 10px 0px 15px 0px; + border: 0px; + background: #ffffff; + overflow: auto; +} + +.reply_container .row { + display: block; + padding: 5px 0px 0px 185px; + margin-right: 20px; + clear: both; +} + +.row textarea { + height: 100px; + width: 355px; + padding: 5px 0px 15px 3px; + font-size: 11px; + overflow: hidden; +} + +.row .submits { + float: left; +} + +.row .sub_controls { + padding-top: 11px; + font-size: 9px; + float: right; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-04 16:29:17
|
Revision: 38 http://isocial.svn.sourceforge.net/isocial/?rev=38&view=rev Author: aguidrevitch Date: 2008-03-04 08:29:23 -0800 (Tue, 04 Mar 2008) Log Message: ----------- autocomplete city selection, city belongs to country Modified Paths: -------------- app/application_controller.php app/controllers/profile_controller.php app/installers/basic_profile_installer.php app/views/layouts/application.tpl app/views/profile/basic.tpl app/views/user/home.tpl Added Paths: ----------- app/installers/city_installer.php app/models/city.php public/stylesheets/autocomplete.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-03 18:02:41 UTC (rev 37) +++ app/application_controller.php 2008-03-04 16:29:23 UTC (rev 38) @@ -170,6 +170,22 @@ function _to_base64_utf8 ($value) { return "=?utf-8?B?" . base64_encode($value) . "?="; } + + function _auto_complete_result ($items, $field, $phrase = '') { + + // converting to an array + $entries = array(); + foreach ($items as $item) { + $entry = array(); + foreach ($item->getColumns() as $column => $details) { + $entry[$column] = $item->get($column); + } + $entries[] = $entry; + } + + return $this->javascript_macros_helper->auto_complete_result($entries, $field, $phrase); + } + } ?> Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-03-03 18:02:41 UTC (rev 37) +++ app/controllers/profile_controller.php 2008-03-04 16:29:23 UTC (rev 38) @@ -2,7 +2,7 @@ class ProfileController extends ApplicationController { - var $models = 'user, basic_profile, sex, country, political_view'; + var $models = 'user, basic_profile, sex, country, city, political_view'; function index () { } @@ -10,6 +10,16 @@ function basic () { } + function auto_complete_for_basic_hometown () { + if (!empty($this->params['basic']['country_id'])) { + $conditions = array('country_id = ? AND name LIKE ?', $this->params['basic']['country_id'], '%' . $this->params['basic']['hometown'] . '%' ); + } else { + $conditions = array('name LIKE ?', '%' . $this->params['basic']['hometown'] . '%' ); + } + $entries = $this->City->find('all', array('conditions' => $conditions)); + $this->renderText( $this->_auto_complete_result($entries, 'name', $this->params['basic']['hometown']) ); + } + function contact () { } Modified: app/installers/basic_profile_installer.php =================================================================== --- app/installers/basic_profile_installer.php 2008-03-03 18:02:41 UTC (rev 37) +++ app/installers/basic_profile_installer.php 2008-03-04 16:29:23 UTC (rev 38) @@ -9,7 +9,7 @@ `user_id` int(11) NOT NULL, `sex_id` int(11), `country_id` int(11), - `hometown` char(255) NOT NULL DEFAULT '', + `city_id` int(11), `birthdate` datetime DEFAULT NULL, `political_view_id` int(11), `created_at` datetime NOT NULL, @@ -17,6 +17,7 @@ FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (sex_id) REFERENCES sexes(id), FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (city_id) REFERENCES cities(id), FOREIGN KEY (political_view_id) REFERENCES political_views(id) ) ENGINE=InnoDB"); Added: app/installers/city_installer.php =================================================================== --- app/installers/city_installer.php (rev 0) +++ app/installers/city_installer.php 2008-03-04 16:29:23 UTC (rev 38) @@ -0,0 +1,24 @@ +<?php +class CityInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `cities` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `country_id` int(11), + `name` char(100) NOT NULL DEFAULT '', + FOREIGN KEY (country_id) REFERENCES countries(id) + ) ENGINE=InnoDB"); + + } + + function down_1() + { + /**/ + $this->dropTable('cities'); + /**/ + } +} + +?> Added: app/models/city.php =================================================================== --- app/models/city.php (rev 0) +++ app/models/city.php 2008-03-04 16:29:23 UTC (rev 38) @@ -0,0 +1,7 @@ +<?php + +class City extends ActiveRecord +{ +} + +?> Modified: app/views/layouts/application.tpl =================================================================== --- app/views/layouts/application.tpl 2008-03-03 18:02:41 UTC (rev 37) +++ app/views/layouts/application.tpl 2008-03-04 16:29:23 UTC (rev 38) @@ -3,8 +3,11 @@ <head> <title><?= @$title ?></title> <link href="/stylesheets/reset.css" rel="stylesheet" type="text/css"> +<link href="/stylesheets/autocomplete.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/Application.css" rel="stylesheet" type="text/css"> <link href="/stylesheets/<?= $controller->getControllerName() ?>.css" rel="stylesheet" type="text/css"> +<script src="/javascripts/prototype.js" type="text/javascript"></script> +<script src="/javascripts/scriptaculous.js" type="text/javascript"></script> </head> <body id="application"> <div id="main"> Modified: app/views/profile/basic.tpl =================================================================== --- app/views/profile/basic.tpl 2008-03-03 18:02:41 UTC (rev 37) +++ app/views/profile/basic.tpl 2008-03-04 16:29:23 UTC (rev 38) @@ -18,7 +18,7 @@ </div> <div class="formrow"> <label>_{Hometown}:</label> - <?= $form_helper->text_field('basic', '', array('class' => 'shorttextinput') )?> + <?= $javascript_macros_helper->text_field_with_auto_complete('basic', 'hometown', array('autocomplete' => 'on', 'class' => 'shorttextinput'), array('skip_style' => true, 'with' => '"basic%5Bcountry_id%5D=" + $F("basic_country_id") + "&" + value') )?> </div> <div class="formrow"> <label>_{Political views}:</label> Modified: app/views/user/home.tpl =================================================================== --- app/views/user/home.tpl 2008-03-03 18:02:41 UTC (rev 37) +++ app/views/user/home.tpl 2008-03-04 16:29:23 UTC (rev 38) @@ -1 +1 @@ -_{Hello}, <?= $current_user->name ?> +<p>_{Hello}, <?= $current_user->name ?></p> Added: public/stylesheets/autocomplete.css =================================================================== --- public/stylesheets/autocomplete.css (rev 0) +++ public/stylesheets/autocomplete.css 2008-03-04 16:29:23 UTC (rev 38) @@ -0,0 +1,42 @@ +div.auto_complete { + margin-top: -1px; + background: #ffffff; + width: 100%; +} + +div.auto_complete ul { + border-top: 1px solid #bdc7d8; + border-left: 1px solid #bdc7d8; + border-right: 1px solid #bdc7d8; + font-family: verdana, arial, sans-serif; + font-size: 11px; + margin:0; + padding:0; + width:100%; + list-style-type:none; +} + +div.auto_complete ul li { + margin: 0; + border-bottom: 1px solid #bdc7d8; + padding: 4px; + cursor: pointer; +} + +div.auto_complete ul li.selected { + background-color: #3b5998; + color: white; +} + +div.auto_complete ul li strong.highlight { + background:#d8dfea; + margin:0; + padding:0; +} + +div.auto_complete ul li.selected strong.highlight { + background:#5670a6; + color:#fff; + margin:0; + padding:0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-03 18:03:25
|
Revision: 37 http://isocial.svn.sourceforge.net/isocial/?rev=37&view=rev Author: aguidrevitch Date: 2008-03-03 10:02:41 -0800 (Mon, 03 Mar 2008) Log Message: ----------- profile editing stubs added, minor css updates Modified Paths: -------------- akelos.diff app/controllers/default_controller.php app/controllers/user_controller.php app/locales/layout/en.php app/locales/layout/ru.php app/views/default/index.tpl app/views/message/_menu.tpl app/views/message/send.tpl app/views/shared/loggedin/compiled/sidebar.tpl.php app/views/shared/loggedin/pageheader.tpl app/views/shared/loggedin/sidebar.tpl app/views/user/forgot_password.tpl app/views/user/laststep.tpl app/views/user/login.tpl app/views/user/register.tpl app/views/user/reset_password.tpl app/views/user/thankyou.tpl public/stylesheets/Application.css public/stylesheets/Default.css public/stylesheets/Message.css public/stylesheets/User.css Added Paths: ----------- app/controllers/profile_controller.php app/installers/basic_profile_installer.php app/installers/country_installer.php app/installers/political_view_installer.php app/installers/sex_installer.php app/locales/profile/ app/locales/profile/en.php app/locales/profile/ru.php app/models/country.php app/models/political_view.php app/models/sex.php app/views/default/_sidebar.tpl app/views/profile/ app/views/profile/_menu.tpl app/views/profile/basic.tpl app/views/profile/contact.tpl app/views/profile/groups.tpl app/views/profile/index.tpl app/views/profile/personal.tpl app/views/profile/picture.tpl app/views/profile/relationships.tpl public/images/group.png public/images/lock.png public/images/magnifier.png public/images/photo.png public/stylesheets/Profile.css Modified: akelos.diff =================================================================== --- akelos.diff 2008-02-29 16:43:08 UTC (rev 36) +++ akelos.diff 2008-03-03 18:02:41 UTC (rev 37) @@ -1,6 +1,6 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 478) +--- lib/Ak.php (revision 500) +++ lib/Ak.php (working copy) @@ -186,6 +186,11 @@ return @$string[$try_whith_lang]; @@ -23,3 +23,16 @@ }else { $string = isset($framework_dictionary[$string]) ? $framework_dictionary[$string] : $string; } +Index: lib/AkActiveRecord.php +=================================================================== +--- lib/AkActiveRecord.php (revision 500) ++++ lib/AkActiveRecord.php (working copy) +@@ -4721,7 +4721,7 @@ + $resulting_array = array(); + if(!empty($source_array) && is_array($source_array)) { + foreach ($source_array as $source_item){ +- $resulting_array[$source_item->get($key_index)] = $source_item->get($value_index); ++ $resulting_array[$source_item->get($key_index, false)] = $source_item->get($value_index, false); + } + } + return $resulting_array; Modified: app/controllers/default_controller.php =================================================================== --- app/controllers/default_controller.php 2008-02-29 16:43:08 UTC (rev 36) +++ app/controllers/default_controller.php 2008-03-03 18:02:41 UTC (rev 37) @@ -14,7 +14,7 @@ function renderSidebar() { - return $this->renderShared("default/sidebar"); + return $this->renderPartial("sidebar"); } function renderPageHeader() Added: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php (rev 0) +++ app/controllers/profile_controller.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,30 @@ +<?php + +class ProfileController extends ApplicationController +{ + var $models = 'user, basic_profile, sex, country, political_view'; + + function index () { + } + + function basic () { + } + + function contact () { + } + + function relationships () { + } + + function personal () { + } + + function groups () { + } + + function picture () { + } + +} + +?> \ No newline at end of file Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-29 16:43:08 UTC (rev 36) +++ app/controllers/user_controller.php 2008-03-03 18:02:41 UTC (rev 37) @@ -80,8 +80,8 @@ if ($confirmation->uuid == $this->params['uuid']) { $user->active = 1; if ($user->save()) { + $confirmation->destroy(); $this->sendMail($user->email); - $confirmation->destroy(); return; } } Added: app/installers/basic_profile_installer.php =================================================================== --- app/installers/basic_profile_installer.php (rev 0) +++ app/installers/basic_profile_installer.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,33 @@ +<?php +class BasicProfileInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `basic_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `sex_id` int(11), + `country_id` int(11), + `hometown` char(255) NOT NULL DEFAULT '', + `birthdate` datetime DEFAULT NULL, + `political_view_id` int(11), + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (sex_id) REFERENCES sexes(id), + FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (political_view_id) REFERENCES political_views(id) + ) ENGINE=InnoDB"); + + } + + function down_1() + { + /**/ + $this->dropTable('basic_profiles'); + /**/ + } +} + +?> Added: app/installers/country_installer.php =================================================================== --- app/installers/country_installer.php (rev 0) +++ app/installers/country_installer.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,269 @@ +<?php +class CountryInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `countries` ( + `id` int(11) PRIMARY KEY + ) ENGINE=InnoDB"); + + $fields = array(); + foreach (Ak::langs() as $lang) { + $fields[] = $lang . "_name"; + $this->execute("ALTER TABLE countries ADD column ${lang}_name char(255) NOT NULL DEFAULT \"\""); + } + $fields = join(", ", $fields); + + foreach (array(1 => "Åland Islands", + 2 => "Afghanistan", + 3 => "Albania", + 4 => "Algeria", + 5 => "American Samoa", + 6 => "Andorra", + 7 => "Angola", + 8 => "Anguilla", + 9 => "Antigua and Barbuda", + 10 => "Argentina", + 11 => "Armenia", + 12 => "Aruba", + 13 => "Australia", + 14 => "Austria", + 15 => "Azerbaijan", + 16 => "Bahamas", + 17 => "Bahrain", + 18 => "Bangladesh", + 19 => "Barbados", + 20 => "Belarus", + 21 => "Belgium", + 22 => "Belize", + 23 => "Benin", + 24 => "Bermuda", + 25 => "Bhutan", + 26 => "Bolivia", + 27 => "Bosnia and Herzegovina", + 28 => "Botswana", + 29 => "Brazil", + 30 => "British Virgin Islands", + 31 => "Brunei Darussalam", + 32 => "Bulgaria", + 33 => "Burkina Faso", + 34 => "Burundi", + 35 => "Côte d'Ivoire", + 36 => "Cambodia", + 37 => "Cameroon", + 38 => "Canada", + 39 => "Cape Verde", + 40 => "Cayman Islands", + 41 => "Central African Republic", + 42 => "Chad", + 43 => "Chile", + 44 => "China", + 45 => "Colombia", + 46 => "Comoros", + 47 => "Congo, Democratic Republic", + 48 => "Congo", + 49 => "Cook Islands", + 50 => "Costa Rica", + 51 => "Croatia", + 52 => "Cuba", + 53 => "Cyprus", + 54 => "Czech Republic", + 55 => "Denmark", + 56 => "Djibouti", + 57 => "Dominican Republic", + 58 => "Dominica", + 59 => "Ecuador", + 60 => "Egypt", + 61 => "El Salvador", + 62 => "Equatorial Guinea", + 63 => "Eritrea", + 64 => "Estonia", + 65 => "Ethiopia", + 66 => "Faeroe Islands", + 67 => "Falkland Islands (Malvinas)", + 68 => "Fiji", + 69 => "Finland", + 70 => "France", + 71 => "French Guiana", + 72 => "French Polynesia", + 73 => "Gabon", + 74 => "Gambia", + 75 => "Georgia", + 76 => "Germany", + 77 => "Ghana", + 78 => "Gibraltar", + 79 => "Greece", + 80 => "Greenland", + 81 => "Grenada", + 82 => "Guadeloupe", + 83 => "Guam", + 84 => "Guatemala", + 85 => "Guinea-Bissau", + 86 => "Guinea", + 87 => "Guyana", + 88 => "Haiti", + 89 => "Honduras", + 90 => "Hong Kong", + 91 => "Hungary", + 92 => "Iceland", + 93 => "India", + 94 => "Indonesia", + 95 => "Iran (Islamic Republic of)", + 96 => "Iraq", + 97 => "Ireland", + 98 => "Isle of Man", + 99 => "Israel", + 100 => "Italy", + 101 => "Jamaica", + 102 => "Japan", + 103 => "Jordan", + 104 => "Kazakhstan", + 105 => "Kenya", + 106 => "Kiribati", + 107 => "Korea, Republic of", + 108 => "Korea, South", + 109 => "Kuwait", + 110 => "Kyrgyzstan", + 111 => "Lao People's Democratic Republic", + 112 => "Latvia", + 113 => "Lebanon", + 114 => "Lesotho", + 115 => "Liberia", + 116 => "Libyan Arab Jamahiriya", + 117 => "Liechtenstein", + 118 => "Lithuania", + 119 => "Luxembourg", + 120 => "Macao", + 121 => "Macedonia", + 122 => "Madagascar", + 123 => "Malawi", + 124 => "Malaysia", + 125 => "Maldives", + 126 => "Mali", + 127 => "Malta", + 128 => "Marshall Islands", + 129 => "Martinique", + 130 => "Mauritania", + 131 => "Mauritius", + 132 => "Mayotte", + 133 => "Mexico", + 134 => "Micronesia", + 135 => "Monaco", + 136 => "Mongolia", + 137 => "Montserrat", + 138 => "Morocco", + 139 => "Mozambique", + 140 => "Myanmar", + 141 => "Namibia", + 142 => "Nauru", + 143 => "Nepal", + 144 => "Netherlands Antilles", + 145 => "Netherlands", + 146 => "New Caledonia", + 147 => "New Zealand", + 148 => "Nicaragua", + 149 => "Nigeria", + 150 => "Niger", + 151 => "Niue", + 152 => "Norfolk Island", + 153 => "Northern Mariana Islands", + 154 => "Norway", + 155 => "Occupied Palestinian Territory", + 156 => "Oman", + 157 => "Pakistan", + 158 => "Palau", + 159 => "Panama", + 160 => "Papua New Guinea", + 161 => "Paraguay", + 162 => "Peru", + 163 => "Philippines", + 164 => "Pitcairn", + 165 => "Poland", + 166 => "Portugal", + 167 => "Puerto Rico", + 168 => "Qatar", + 169 => "Réunion", + 170 => "Republic of Moldova", + 171 => "Romania", + 172 => "Russian Federation", + 173 => "Rwanda", + 174 => "Saint Helena", + 175 => "Saint Kitts and Nevis", + 176 => "Saint Lucia", + 177 => "Saint Pierre and Miquelon", + 178 => "Saint Vincent and the Grenadines", + 179 => "Samoa", + 180 => "San Marino", + 181 => "Sao Tome and Principe", + 182 => "Saudi Arabia", + 183 => "Senegal", + 184 => "Serbia and Montenegro", + 185 => "Seychelles", + 186 => "Sierra Leone", + 187 => "Singapore", + 188 => "Slovakia", + 189 => "Slovenia", + 190 => "Solomon Islands", + 191 => "Somalia", + 192 => "South Africa", + 193 => "Spain", + 194 => "Sri Lanka", + 195 => "Sudan", + 196 => "Suriname", + 197 => "Svalbard and Jan Mayen Islands", + 198 => "Swaziland", + 199 => "Sweden", + 200 => "Switzerland", + 201 => "Syrian Arab Republic", + 202 => "Tajikistan", + 203 => "Tanzania", + 204 => "Thailand", + 205 => "Timor-Leste", + 206 => "Togo", + 207 => "Tokelau", + 208 => "Tonga", + 209 => "Trinidad and Tobago", + 210 => "Tunisia", + 211 => "Turkey", + 212 => "Turkmenistan", + 213 => "Turks and Caicos Islands", + 214 => "Tuvalu", + 215 => "Uganda", + 216 => "Ukraine", + 217 => "United Arab Emirates", + 218 => "United Kingdom", + 219 => "United States Virgin Islands", + 220 => "United States", + 221 => "Uruguay", + 222 => "Uzbekistan", + 223 => "Vanuatu", + 224 => "Vatican City State (Holy See)", + 225 => "Venezuela", + 226 => "Viet Nam", + 227 => "Wallis and Futuna Islands", + 228 => "Western Sahara", + 229 => "Yemen", + 230 => "Zambia", + 231 => "Zimbabwe") as $id => $country) + { + + $values = array(); + foreach (Ak::langs() as $lang) { + Ak::lang($lang); + $values[] = '"' . Ak::t($country) . '"'; + } + $values = join(", ", $values); + $this->execute("INSERT INTO countries (id, $fields) VALUES ($id, $values)"); + } + } + + function down_1() + { + /**/ + $this->dropTable('countries'); + /**/ + } +} + +?> Added: app/installers/political_view_installer.php =================================================================== --- app/installers/political_view_installer.php (rev 0) +++ app/installers/political_view_installer.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,46 @@ +<?php +class PoliticalViewInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `political_views` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT + ) ENGINE=InnoDB"); + + $fields = array(); + foreach (Ak::langs() as $lang) { + $fields[] = $lang . "_name"; + $this->execute("ALTER TABLE political_views ADD column ${lang}_name char(255) NOT NULL DEFAULT \"\""); + } + $fields = join(", ", $fields); + + foreach (array(1 => "Very Liberal", + 2 => "Liberal", + 3 => "Moderate", + 4 => "Conservative", + 5 => "Very Conservative", + 6 => "Apathetic", + 7 => "Libertarian", + ) as $id => $view) + { + + $values = array(); + foreach (Ak::langs() as $lang) { + Ak::lang($lang); + $values[] = '"' . Ak::t($view) . '"'; + } + $values = join(", ", $values); + $this->execute("INSERT INTO political_views (id, $fields) VALUES ($id, $values)"); + } + } + + function down_1() + { + /**/ + $this->dropTable('political_views'); + /**/ + } +} + +?> Added: app/installers/sex_installer.php =================================================================== --- app/installers/sex_installer.php (rev 0) +++ app/installers/sex_installer.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,39 @@ +<?php +class SexInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `sexes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT + ) ENGINE=InnoDB"); + + $fields = array(); + foreach (Ak::langs() as $lang) { + $fields[] = $lang . "_name"; + $this->execute("ALTER TABLE sexes ADD column ${lang}_name char(255) NOT NULL DEFAULT \"\""); + } + $fields = join(", ", $fields); + + foreach (array(1 => "Male", + 2 => "Female") as $id => $sex) + { + $values = array(); + foreach (Ak::langs() as $lang) { + Ak::lang($lang); + $values[] = '"' . Ak::t($sex) . '"'; + } + $values = join(", ", $values); + $this->execute("INSERT INTO sexes (id, $fields) VALUES ($id, $values)"); + } + } + + function down_1() + { + /**/ + $this->dropTable('sexes'); + /**/ + } +} + +?> Modified: app/locales/layout/en.php =================================================================== --- app/locales/layout/en.php 2008-02-29 16:43:08 UTC (rev 36) +++ app/locales/layout/en.php 2008-03-03 18:02:41 UTC (rev 37) @@ -16,4 +16,8 @@ $dictionary['Sign Up'] = 'Sign Up'; $dictionary['Everyone Can Join'] = 'Everyone Can Join'; + +$dictionary['PhotoApp'] = 'Photos'; +$dictionary['GroupApp'] = 'Groups'; + ?> Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-02-29 16:43:08 UTC (rev 36) +++ app/locales/layout/ru.php 2008-03-03 18:02:41 UTC (rev 37) @@ -17,7 +17,14 @@ $dictionary['Everyone Can Join'] = 'Подключиться может каждый'; $dictionary['or'] = 'или'; $dictionary['Profile'] = 'Профиль'; +$dictionary['edit'] = 'настроить'; $dictionary['Friends'] = 'Друзья'; $dictionary['Messages'] = 'Сообщения'; +$dictionary['Save Changes'] = 'Сохранить'; +$dictionary['Cancel'] = 'Отмена'; + +$dictionary['PhotoApp'] = 'Фото'; +$dictionary['GroupApp'] = 'Группы'; + ?> Added: app/locales/profile/en.php =================================================================== --- app/locales/profile/en.php (rev 0) +++ app/locales/profile/en.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,7 @@ +<?php + +// File created on: 2008-02-17 15:13:51 + +$dictionary = array(); + +?> Added: app/locales/profile/ru.php =================================================================== --- app/locales/profile/ru.php (rev 0) +++ app/locales/profile/ru.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,47 @@ +<?php + +// File created on: 2008-02-17 15:13:51 + +$dictionary = array(); + +$dictionary['Basic'] = 'Основные'; +$dictionary['Contact'] = 'Контакты'; +$dictionary['Relationships'] = 'Семейное положение'; +$dictionary['Personal'] = 'Интересы'; +$dictionary['Groups'] = 'Группы'; +$dictionary['Picture'] = 'Фото'; + +$dictionary['Sex'] = 'Пол'; +$dictionary['Select Sex:'] = 'Выберите пол:'; + +$dictionary['Birthday'] = 'Дата рождения'; +$dictionary['Country'] = 'Страна'; +$dictionary['Select Country:'] = 'Выберите страну:'; +$dictionary['Hometown'] = 'Родной город'; + +$dictionary['Political views'] = 'Политические взгляды'; +$dictionary['Select Political Views:'] = 'Выберите политические взгляды:'; + +$dictionary['Religious views'] = 'Религия'; + +$dictionary['Only my friends'] = 'Только для друзей'; +$dictionary['Emails'] = 'Адреса Email'; +$dictionary['IM Screen Name(s)'] = 'IM'; +$dictionary['Mobile phone'] = 'Мобильный номер'; +$dictionary['Land phone'] = 'Домашний номер'; +$dictionary['City'] = 'Город'; +$dictionary['Address'] = 'Адрес'; +$dictionary['Website'] = 'Веб сайт'; + +$dictionary['Relationship status'] = 'Семейное положение'; +$dictionary['Select Status:'] = 'Выберите положение:'; +$dictionary['Former Name'] = 'Девичья фамилия'; +$dictionary['Interested In'] = 'Ищу'; +$dictionary['Looking for'] = 'Для'; + +$dictionary['Activities'] = 'Род занятий'; +$dictionary['Interests'] = 'Интересы'; +$dictionary['Favorite Music'] = 'Любимая музыка'; +$dictionary['Favorite TV Shows'] = 'Любимые ТВ шоу'; + +?> Added: app/models/country.php =================================================================== --- app/models/country.php (rev 0) +++ app/models/country.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,7 @@ +<?php + +class Country extends ActiveRecord +{ +} + +?> Added: app/models/political_view.php =================================================================== --- app/models/political_view.php (rev 0) +++ app/models/political_view.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,7 @@ +<?php + +class PoliticalView extends ActiveRecord +{ +} + +?> Added: app/models/sex.php =================================================================== --- app/models/sex.php (rev 0) +++ app/models/sex.php 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,7 @@ +<?php + +class Sex extends ActiveRecord +{ +} + +?> Added: app/views/default/_sidebar.tpl =================================================================== --- app/views/default/_sidebar.tpl (rev 0) +++ app/views/default/_sidebar.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,20 @@ +<div id="quicklogin"> + <form action="/user/login" method="post"> + <label> + <span>_{Email}:</span> + <input class="sidetextinput" type="text" name="email"> + </label> + <label> + <span>_{Password}:</span> + <input class="sidetextinput" type="password" name="password"> + </label> + <label class="persistent"> + <input class="checkboxinput" type="checkbox" name="remember_me"> + <span>_{Remember me}</span> + </label> + <input class="submitinput" type="submit" value="_{Login}"> + + </form> + + <a href="/user/forgot_password">_{Forgot Password?}</a> +</div> \ No newline at end of file Modified: app/views/default/index.tpl =================================================================== --- app/views/default/index.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/default/index.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -1 +1,3 @@ +<p> <a class="linkbutton" href="/user/register"><div>_{Sign Up}</div></a> +</p> \ No newline at end of file Modified: app/views/message/_menu.tpl =================================================================== --- app/views/message/_menu.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/message/_menu.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -1,7 +1,8 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/message/inbox" class="<?= $controller->getActionName() == 'inbox' ? 'selected' : '' ?>">_{Inbox}</a></li><li><a href="/message/outbox" class="last <?= $controller->getActionName() == 'outbox' ? 'selected' : '' ?>">_{Outbox}</a></li> + <li class="first"><a href="/message/inbox" class="<?= $controller->getActionName() == 'inbox' ? 'selected' : '' ?>">_{Inbox}</a></li><? + ?><li><a href="/message/outbox" class="last <?= $controller->getActionName() == 'outbox' ? 'selected' : '' ?>">_{Outbox}</a></li> </ul> </div> <div class="right"> Modified: app/views/message/send.tpl =================================================================== --- app/views/message/send.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/message/send.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -3,7 +3,7 @@ <?= $controller->renderErrors() ?> <form action="/message/send" method="post"> - <div class="messageform"> + <div class="editform"> <div class="formrow"> <label>_{To}:</label> <?= $form_helper->text_field('message', '', array('class' => 'textinput') )?> Added: app/views/profile/_menu.tpl =================================================================== --- app/views/profile/_menu.tpl (rev 0) +++ app/views/profile/_menu.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,13 @@ +<div class="tabs"> + <div class="left"> + <ul class="toggle_tabs"> + <li class="first"> + <a href="/profile/basic" class="<?= $controller->getActionName() == 'basic' ? 'selected' : '' ?>">_{Basic}</a></li><? + ?><li><a href="/profile/contact" class="<?= $controller->getActionName() == 'contact' ? 'selected' : '' ?>">_{Contact}</a></li><? + ?><li><a href="/profile/relationships" class="<?= $controller->getActionName() == 'relationships' ? 'selected' : '' ?>">_{Relationships}</a></li><? + ?><li><a href="/profile/personal" class="<?= $controller->getActionName() == 'personal' ? 'selected' : '' ?>">_{Personal}</a></li><? + ?><li><a href="/profile/groups" class="<?= $controller->getActionName() == 'groups' ? 'selected' : '' ?>">_{Groups}</a></li><? + ?><li><a href="/profile/picture" class="last <?= $controller->getActionName() == 'picture' ? 'selected' : '' ?>">_{Picture}</a></li> + </ul> + </div> +</div> Added: app/views/profile/basic.tpl =================================================================== --- app/views/profile/basic.tpl (rev 0) +++ app/views/profile/basic.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,38 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<form action="/profile/basic" method="post"> + <div class="editform"> + <div class="formrow"> + <label>_{Sex}:</label> + <?= $form_options_helper->select('basic', 'sex_id', $Sex->collect($Sex->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Sex:')) )?> + </div> + <div class="formrow"> + <label>_{Birthday}:</label> + <?= $date_helper->date_select('basic', 'birthdate', array('start_year' => 1940) )?> + </div> + <div class="formrow"> + <label>_{Country}:</label> + <?= $form_options_helper->select('basic', 'country_id', $Country->collect($Country->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Country:')) )?> + </div> + <div class="formrow"> + <label>_{Hometown}:</label> + <?= $form_helper->text_field('basic', '', array('class' => 'shorttextinput') )?> + </div> + <div class="formrow"> + <label>_{Political views}:</label> + <?= $form_options_helper->select('basic', 'political_view_id', $PoliticalView->collect($PoliticalView->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Political Views:')) )?> + </div> + <div class="formrow"> + <label>_{Religious views}:</label> + <?= $form_helper->text_field('basic', 'religious_views', array('class' => 'shorttextinput') ) ?> + </div> + <div class="formrow"> + <label></label> + <input class="submitinput" type="submit" value="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + </div> +</form> + Added: app/views/profile/contact.tpl =================================================================== --- app/views/profile/contact.tpl (rev 0) +++ app/views/profile/contact.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,135 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<form action="/profile/contact" method="post"> + <div class="editform"> + <div class="formrow"> + <label>_{Emails}:</label> + <div class="formcol"> + <div class="middle"> + <?= $current_user->email ?> + </div> + <a href="#" class="lock">_{Only my friends}</a> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"> + <div class="middle"> + <a href="#">Add / Remove Emails</a> + </div> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"><div class="divider"></div></div> + </div> + <div class="formrow"> + <label>_{IM Screen Name(s)}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_helper->text_field('contact', 'im', array('class' => 'shorttextinput') )?> + </div> + <select class="imselect"> + <option>AIM</option> + <option>Google talk</option> + <option>Skype</option> + <option>Windows Live</option> + <option>Yahoo</option> + <option>Gadu-Gadu</option> + <option>ICQ</option> + </select> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"> + <div class="middle"> + <a href="#">Add another screen name</a> + </div> + <a href="#" class="lock">_{Only my friends}</a> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"><div class="divider"></div></div> + </div> + + <div class="formrow"> + <label>_{Mobile phone}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_helper->text_field('contact', 'mobile', array('class' => 'shorttextinput') )?> + </div> + <a href="#" class="lock">_{Only my friends}</a> + </div> + </div> + <div class="formrow"> + <label>_{Land phone}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_helper->text_field('contact', 'land', array('class' => 'shorttextinput') )?> + </div> + <a href="#" class="lock">_{Only my friends}</a> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"><div class="divider"></div></div> + </div> + + <div class="formrow"> + <label>_{Country}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_options_helper->select('basic', 'country_id', $Country->collect($Country->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Country:')) )?> + </div> + </div> + </div> + <div class="formrow"> + <label>_{City}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_helper->text_field('address', 'city', array('class' => 'textinput') )?> + </div> + </div> + </div> + <div class="formrow"> + <label>_{Address}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_helper->text_field('address', 'mobile', array('class' => 'textinput') )?> + </div> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"> + <div class="middle"></div> + <a href="#" class="lock">_{Only my friends}</a> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"><div class="divider"></div></div> + </div> + + <div class="formrow"> + <label>_{Website}:</label> + <div class="formcol"> + <div class="middle"> + <?= $form_helper->text_area('address', 'website' )?> + </div> + <a href="#" class="lock">_{Only my friends}</a> + </div> + </div> + + <div class="formrow"> + <label></label> + <input class="submitinput" type="submit" value="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + </div> +</form> + Added: app/views/profile/groups.tpl =================================================================== --- app/views/profile/groups.tpl (rev 0) +++ app/views/profile/groups.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,5 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<p>Coming soon</p> \ No newline at end of file Added: app/views/profile/index.tpl =================================================================== --- app/views/profile/index.tpl (rev 0) +++ app/views/profile/index.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1 @@ +Profile \ No newline at end of file Added: app/views/profile/personal.tpl =================================================================== --- app/views/profile/personal.tpl (rev 0) +++ app/views/profile/personal.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,34 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<form action="/profile/personal" method="post"> + <div class="editform"> + <div class="formrow"> + <label>_{Activities}:</label> + <?= $form_helper->text_area('personal', 'activities')?> + </div> + + <div class="formrow"> + <label>_{Interests}:</label> + <?= $form_helper->text_area('personal', 'interests')?> + </div> + + <div class="formrow"> + <label>_{Favorite Music}:</label> + <?= $form_helper->text_area('personal', 'music')?> + </div> + + <div class="formrow"> + <label>_{Favorite TV Shows}:</label> + <?= $form_helper->text_area('personal', 'tv_shows')?> + </div> + + <div class="formrow"> + <label></label> + <input class="submitinput" type="submit" value="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + </div> +</form> + Added: app/views/profile/picture.tpl =================================================================== --- app/views/profile/picture.tpl (rev 0) +++ app/views/profile/picture.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,5 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<p>Coming soon</p> \ No newline at end of file Added: app/views/profile/relationships.tpl =================================================================== --- app/views/profile/relationships.tpl (rev 0) +++ app/views/profile/relationships.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,55 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<form action="/profile/relationships" method="post"> + <div class="editform"> + <div class="formrow"> + <label>_{Relationship Status}:</label> + <div class="formcol"> + <?= $form_options_helper->select('relationship', 'status', array('Single', 'In a relationship', 'Engaged', 'Married', 'It\'s complicated', 'In an open relationship'), array(), array('prompt' => $controller->t('Select Status:')) )?> + </div> + </div> + + <div class="formrow"> + <label>_{Former Name}:</label> + <div class="formcol"> + <?= $form_helper->text_field('relationship', 'former_name', array('class' => 'textinput') )?> + </div> + </div> + <div class="formrow"> + <label></label> + <div class="formcol"> + <div class="note"> + _{<strong>Note</strong>: Please enter a full name. Former Name is only used to help people find you in search and will not show up in your profile.} + </div> + </div> + </div> + + <div class="formrow"> + <label>_{Interested In}:</label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('relationship', 'interested_in_men', array('class' => 'checkboxinput')) ?> Men</label> + <label class="checkbox"><?= $form_helper->check_box('relationship', 'interested_in_women', array('class' => 'checkboxinput')) ?> Women</label> + </div> + </div> + + <div class="formrow"> + <label>_{Looking for}:</label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_friendship', array('class' => 'checkboxinput')) ?> Friendship</label> + <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_dating', array('class' => 'checkboxinput')) ?> Dating</label> + <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_relationship', array('class' => 'checkboxinput')) ?> A Relationship</label> + <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_networking', array('class' => 'checkboxinput')) ?> Networking</label> + </div> + </div> + + + <div class="formrow"> + <label></label> + <input class="submitinput" type="submit" value="_{Save Changes}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + </div> +</form> + Modified: app/views/shared/loggedin/compiled/sidebar.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/sidebar.tpl.php 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/shared/loggedin/compiled/sidebar.tpl.php 2008-03-03 18:02:41 UTC (rev 37) @@ -7,12 +7,11 @@ <div id="qsearchfield"> <input id="query" name="query" type="text" class="textinput"> </div> - <div id="qsearchimage">a - </div> + <div id="qsearchimage"></div> </div> </form> </div> <div id="applications"> - <div>Photos</div> - <div>Groups</div> + <a href="/photo" class="photoapp"><?php echo $text_helper->translate('PhotoApp', array()); ?></a> + <a href="/groups" class="groupsapp"><?php echo $text_helper->translate('GroupApp', array()); ?></a> </div> \ No newline at end of file Modified: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/shared/loggedin/pageheader.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -1,5 +1,5 @@ <ul id="headermenuleft"> - <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/edit">_{edit}</a></li> + <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/basic">_{edit}</a></li> <li><a class="globallink" href="/friend/">_{Friends}</a></li> <li><a class="globallink" href="/message/">_{Messages} (0)</a></li> </ul> Modified: app/views/shared/loggedin/sidebar.tpl =================================================================== --- app/views/shared/loggedin/sidebar.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/shared/loggedin/sidebar.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -7,12 +7,11 @@ <div id="qsearchfield"> <input id="query" name="query" type="text" class="textinput"> </div> - <div id="qsearchimage">a - </div> + <div id="qsearchimage"></div> </div> </form> </div> <div id="applications"> - <div>Photos</div> - <div>Groups</div> + <a href="/photo" class="photoapp">_{PhotoApp}</a> + <a href="/groups" class="groupsapp">_{GroupApp}</a> </div> \ No newline at end of file Modified: app/views/user/forgot_password.tpl =================================================================== --- app/views/user/forgot_password.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/user/forgot_password.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -6,7 +6,7 @@ _{We will send you an email with a link to reset your password}.</p> <form action="/user/forgot_password" method="post"> - <div class="loginform"> + <div class="editform"> <div class="formrow"> <label>_{Email}:</label> <input class="textinput" type="text" name="email"> Modified: app/views/user/laststep.tpl =================================================================== --- app/views/user/laststep.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/user/laststep.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -1,2 +1,2 @@ <div class="title">_{Last step}</div> -<div>_{Check please your email and click on confirmation link}.</div> +<p>_{Check please your email and click on confirmation link}.</p> Modified: app/views/user/login.tpl =================================================================== --- app/views/user/login.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/user/login.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -3,7 +3,7 @@ <?= $controller->renderErrors() ?> <form action="/user/login" method="post"> - <div class="loginform"> + <div class="editform"> <div class="formrow"> <label>_{Email}:</label> <input class="textinput" type="text" name="email"> @@ -14,8 +14,9 @@ </div> <div class="formrow"> <label></label> - <input class="checkboxinput" type="checkbox" name="remember_me"> - <span>_{Remember me}</span> + <label class="checkbox"> + <input class="checkboxinput" type="checkbox" name="remember_me"> _{Remember me} + </label> </div> <div class="formrow"> <label></label> Modified: app/views/user/register.tpl =================================================================== --- app/views/user/register.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/user/register.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -3,7 +3,7 @@ <?= $controller->renderErrors() ?> <form action="/user/register" method="post"> - <div class="loginform"> + <div class="editform"> <div class="formrow"> <label>_{Name}:</label> <?= $form_helper->text_field('user', 'name', array('class' => 'textinput') )?> Modified: app/views/user/reset_password.tpl =================================================================== --- app/views/user/reset_password.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/user/reset_password.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -1,12 +1,10 @@ <div class="title">_{Reset Password}</div> -<? -if ($controller->getErrors()) { - echo $controller->renderErrors(); -} else { ?> -<div align="center">_{Please enter a new password}.</div> +<?= $controller->renderErrors(); ?> + +<p>_{Please enter a new password}.</p> <form action="/user/reset_password" method="post"> - <div class="loginform"> + <div class="editform"> <div class="formrow"> <label>_{New Password}:</label> <input class="textinput" type="password" name="user[password]"> Modified: app/views/user/thankyou.tpl =================================================================== --- app/views/user/thankyou.tpl 2008-02-29 16:43:08 UTC (rev 36) +++ app/views/user/thankyou.tpl 2008-03-03 18:02:41 UTC (rev 37) @@ -1,2 +1,2 @@ <div class="title">_{Thank you for registration}</div> - +<p>_{Registration complete}</p> Added: public/images/group.png =================================================================== (Binary files differ) Property changes on: public/images/group.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/lock.png =================================================================== (Binary files differ) Property changes on: public/images/lock.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/magnifier.png =================================================================== (Binary files differ) Property changes on: public/images/magnifier.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: public/images/photo.png =================================================================== (Binary files differ) Property changes on: public/images/photo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-02-29 16:43:08 UTC (rev 36) +++ public/stylesheets/Application.css 2008-03-03 18:02:41 UTC (rev 37) @@ -10,14 +10,22 @@ font-size: 11px; } +select{ + border:1px solid #BDC7D8; + font-family:verdana,arial,sans-serif; + font-size:11px; + padding:2px; +} + label { - clear: left; + color: #666666; display: block; cursor: pointer; - font-weight: bolder; + font-weight: bold; } label.persistent { + display: block; line-height: 16px; font: 11px normal; padding: 1px 0px 3px 0px; @@ -27,13 +35,6 @@ font-weight: normal; } -select{ - border:1px solid #BDC7D8; - font-family:verdana,arial,sans-serif; - font-size:11px; - padding:2px; -} - a { color: #3b5998; text-decoration: none; @@ -124,8 +125,8 @@ #pageheader { color: white; background-color: #3b5998; - line-height: 28px; - height: 28px; + line-height: 2em; + height: 2em; padding: 9px 0px 4px 0px; } @@ -192,6 +193,11 @@ padding: 0; } +#content p { + margin: 0px; + padding: 30px; +} + #pagefooter { clear: both; height: 50px; @@ -243,11 +249,35 @@ } #qsearchimage { - width: 21px; - background-color: blue; - height: 21px; + float: left; + background: url('/images/magnifier.png') no-repeat 0px; + width: 16px; + height: 16px; + margin: 3px; + cursor: pointer; } +#applications { + clear: both; + font-size: 11px; + margin: 10px; + padding: 10px 0px 0px 0px; +} + +#applications a { + display: block; + line-height: 16px; + padding-left: 20px; +} + +.photoapp { + background: url('/images/photo.png') no-repeat 0px; +} + +.groupsapp { + background: url('/images/group.png') no-repeat 0px; +} + .linksarea a { padding: 2px 5px 2px 5px; } @@ -277,15 +307,19 @@ } .textinput, .passwordinput { - width: 123px; + width: 200px; margin: 0px 0px 5px 0px; padding: 3px; font-size: 11px; } +.shorttextinput { + width: 80px; +} + .checkboxinput { border: 0px; - margin: 0px 0px 4px 0px; + margin: 4px 0px 0px 0px; } .error { @@ -312,3 +346,159 @@ border-bottom: 1px solid #dddddd; margin-bottom: 10px; } + +#content .tabs { + display:block; + padding: 20px 0px 15px 0px; + border-bottom: 1px solid #898989; +} + +.tabs .left { + float: left; + padding-left: 10px; +} + +.tabs .right { + float: right; + padding-right: 10px; +} + +.toggle_tabs { + display: block; + margin: 0px; + padding: 0px; + list-style: none; + text-align: center; +} + +.toggle_tabs li { + display: inline; + padding: 2px 0px 3px 0px; + background: #f1f1f1; +} + +.toggle_tabs li a { + border: 1px solid #898989; + border-left: 0px; + color: #333; + font-weight: bold; + padding:2px 8px 3px 9px; +} + +.toggle_tabs li a small { + font-size: 11px; + font-weight:normal; +} + +.toggle_tabs li a:focus { + outline: 0px; +} + +.toggle_tabs li.first a { + border: 1px solid #898989; +} + +.toggle_tabs li a.selected { + margin-left: -1px; + background: #6d84b4; + border: 1px solid #3b5998; + border-left: 1px solid #5973a9; + border-right: 1px solid #5973a9; + color:#fff; +} + +.toggle_tabs li.last a.selected { + margin-left: -1px; + border-left: 1px solid #5973a9; + border-right: 1px solid #36538f; +} + +.toggle_tabs li.first a.selected { + margin: 0px; + border-left: 1px solid #36538f; + border-right: 1px solid #5973a9; +} + +.toggle_tabs li.first.last a.selected { + border: 1px solid #36538f; +} + +.toggle_tabs li a.selected:hover { + text-decoration: none; +} + +.toggle_tabs li a.disabled { + color: #999; + cursor: default; +} + +.toggle_tabs li a.disabled:hover { + text-decoration:none; +} + +.divider { + margin: 5px 0px 5px 0px; + border-bottom: 1px solid #cccccc; +} + +#content .editform { + margin: 20px auto 20px auto; + width: 600px; +} + +.editform .formrow { + clear: both; + vertical-align: top; + padding: 0px 0px 3px 0px; + line-height: 16px; +} + +.formrow label { + display: block; + width: 150px; + float: left; + text-align: right; + padding: 3px 10px 3px; +} + +.formrow label.checkbox { + font-weight: normal; + color: #000; + text-align: left; + padding: 3px 0px 3px; +} + +.formrow .formcol { + float: left; + width: 360px; + padding: 3px 0px 3px 0px; + margin: 0px; +} + +.formrow .formcol .middle { + float: left; +} + +.formrow .formcol .lock { + display: block; + float: right; + padding-left: 20px; + background: url('/images/lock.png') no-repeat 0px; +} + +.formrow textarea { + width: 200px; + height: 100px; +} + +.formrow .textinput { + margin: 0px; +} + +.formrow .shorttextinput { + width: 200px; +} + +.formrow .note { + font-size: 10px; +} Modified: public/stylesheets/Default.css =================================================================== --- public/stylesheets/Default.css 2008-02-29 16:43:08 UTC (rev 36) +++ public/stylesheets/Default.css 2008-03-03 18:02:41 UTC (rev 37) @@ -1,3 +1,6 @@ -#pagecontent #content { - padding: 30px; +.sidetextinput { + width: 120px; + margin: 0px 0px 5px 0px; + padding: 3px; + font-size: 11px; } \ No newline at end of file Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-02-29 16:43:08 UTC (rev 36) +++ public/stylesheets/Message.css 2008-03-03 18:02:41 UTC (rev 37) @@ -1,21 +1,3 @@ -#content .tabs { padding: 20px 0 15px; border-bottom:1px solid #898989; display:block; } -.tabs .left { padding-left: 10px; float: left; } -.tabs .right { padding-right:10px;float:right; } - -.toggle_tabs { margin:0; padding:0; list-style:none; text-align:center; display: block;} -.toggle_tabs li { display: block; float:left; padding:2px 0px 3px; background:#f1f1f1; } -.toggle_tabs li a { border:1px solid #898989; border-left:0; color:#333; font-weight:bold; padding:2px 8px 3px 9px; } -.toggle_tabs li a small { font-size:11px; font-weight:normal; } -.toggle_tabs li a:focus { outline:0px; } -.toggle_tabs li.first a { border:1px solid #898989; } -.toggle_tabs li a.selected { margin-left:-1px; background:#6d84b4; border:1px solid #3b5998; border-left:1px solid #5973a9; border-right:1px solid #5973a9; color:#fff; } -.toggle_tabs li.last a.selected { margin-left:-1px; border-left:1px solid #5973a9; border-right:1px solid #36538f; } -.toggle_tabs li.first a.selected { margin:0; border-left:1px solid #36538f; border-right:1px solid #5973a9; } -.toggle_tabs li.first.last a.selected { border:1px solid #36538f; } -.toggle_tabs li a.selected:hover { text-decoration:none; } -.toggle_tabs li a.disabled { color:#999;cursor:default; } -.toggle_tabs li a.disabled:hover { text-decoration:none; } - #content .inbox_submenu { background:#f7f7f7; border-bottom:1px solid #ccc; padding: 8px 20px 28px; } .inbox_submenu .menu_block { float:left; } .inbox_submenu .menu_block.selector { padding-right:5px; } @@ -28,30 +10,3 @@ .no_messages { color:#666; font-size:13px; padding:100px 0px 110px 0px; text-align:center; } .no_messages strong { color:#333; font-weight:bold; } - -#content .messageform { - margin: 20px auto 20px auto; - width: 510px; -} - -.messageform .formrow { - vertical-align: top; - padding: 0px 0px 3px 0px; -} - -.formrow label { - display: block; - width: 90px; - float: left; - text-align: right; - padding: 3px 10px 3px; -} - -.formrow textarea { - height: 150px; -} - -.formrow .textinput { - width: 350px; -} - Added: public/stylesheets/Profile.css =================================================================== --- public/stylesheets/Profile.css (rev 0) +++ public/stylesheets/Profile.css 2008-03-03 18:02:41 UTC (rev 37) @@ -0,0 +1,3 @@ +.imselect { + margin-left: 10px; +} \ No newline at end of file Modified: public/stylesheets/User.css =================================================================== --- public/stylesheets/User.css 2008-02-29 16:43:08 UTC (rev 36) +++ public/stylesheets/User.css 2008-03-03 18:02:41 UTC (rev 37) @@ -1,25 +1,3 @@ -#content .loginform { - margin: 20px auto 20px auto; - width: 310px; +#content editform { + padding: 30px; } - -.loginform .formrow { - vertical-align: top; - padding: 0px 0px 3px 0px; -} - -.formrow label { - display: block; - width: 110px; - float: left; - padding: 3px 0px 3px 0px; -} - -.formrow .textinput { - width: 175px; -} - -.formrow .forgotpassword { - line-height: 16px; - margin: 10px 0px 10px 0px; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-02-29 16:43:03
|
Revision: 36 http://isocial.svn.sourceforge.net/isocial/?rev=36&view=rev Author: aguidrevitch Date: 2008-02-29 08:43:08 -0800 (Fri, 29 Feb 2008) Log Message: ----------- menu items shouldn't be inline Modified Paths: -------------- public/stylesheets/Message.css Modified: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css 2008-02-29 15:54:54 UTC (rev 35) +++ public/stylesheets/Message.css 2008-02-29 16:43:08 UTC (rev 36) @@ -2,8 +2,8 @@ .tabs .left { padding-left: 10px; float: left; } .tabs .right { padding-right:10px;float:right; } -.toggle_tabs { margin:0; padding:0; list-style:none; text-align:center; display: block; } -.toggle_tabs li { display:inline; padding:2px 0px 3px; background:#f1f1f1; } +.toggle_tabs { margin:0; padding:0; list-style:none; text-align:center; display: block;} +.toggle_tabs li { display: block; float:left; padding:2px 0px 3px; background:#f1f1f1; } .toggle_tabs li a { border:1px solid #898989; border-left:0; color:#333; font-weight:bold; padding:2px 8px 3px 9px; } .toggle_tabs li a small { font-size:11px; font-weight:normal; } .toggle_tabs li a:focus { outline:0px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-29 15:54:48
|
Revision: 35 http://isocial.svn.sourceforge.net/isocial/?rev=35&view=rev Author: dim0s77 Date: 2008-02-29 07:54:54 -0800 (Fri, 29 Feb 2008) Log Message: ----------- remove compiled template Removed Paths: ------------- app/views/shared/loggedin/compiled/pageheader.tpl.php Deleted: app/views/shared/loggedin/compiled/pageheader.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 15:53:28 UTC (rev 34) +++ app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 15:54:54 UTC (rev 35) @@ -1,8 +0,0 @@ -<ul id="headermenuleft"> - <li><a class="globallink" href="/profile/"><?php echo $text_helper->translate('Profile', array()); ?></a> <a href="/profile/edit"><?php echo $text_helper->translate('edit', array()); ?></a></li> - <li><a class="globallink" href="/friend/"><?php echo $text_helper->translate('Friends', array()); ?></a></li> - <li><a class="globallink" href="/message/"><?php echo $text_helper->translate('Messages', array()); ?> (0)</a></li> -</ul> -<ul id="headermenuright"> - <li><a href="/user/logout"><?php echo $text_helper->translate('Logout', array()); ?></a></li> -</ul> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-29 15:53:22
|
Revision: 34 http://isocial.svn.sourceforge.net/isocial/?rev=34&view=rev Author: dim0s77 Date: 2008-02-29 07:53:28 -0800 (Fri, 29 Feb 2008) Log Message: ----------- added the basis for messaging Modified Paths: -------------- app/application_controller.php app/controllers/default_controller.php app/controllers/user_controller.php app/locales/layout/ru.php app/views/shared/loggedin/compiled/pageheader.tpl.php app/views/shared/loggedin/pageheader.tpl app/views/user/home.tpl public/stylesheets/Application.css Added Paths: ----------- app/controllers/message_controller.php app/installers/message_installer.php app/locales/message/ app/locales/message/en.php app/locales/message/ru.php app/views/message/ app/views/message/_menu.tpl app/views/message/inbox.tpl app/views/message/outbox.tpl app/views/message/send.tpl public/stylesheets/Message.css Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/application_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -150,12 +150,12 @@ function renderSidebar() { - return $this->renderShared("default/sidebar"); + return $this->renderShared("loggedin/sidebar"); } function renderPageHeader() { - return $this->renderShared("default/pageheader"); + return $this->renderShared("loggedin/pageheader"); } function _fix_email ($value) { Modified: app/controllers/default_controller.php =================================================================== --- app/controllers/default_controller.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/controllers/default_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -8,9 +8,20 @@ function index() { if ($this->_getUserFromSession()) { - $this->redirectTo(array( 'controller' => 'user', 'action' => 'index')); - } + $this->redirectTo(array( 'controller' => 'user', 'action' => 'index')); + } } + + function renderSidebar() + { + return $this->renderShared("default/sidebar"); + } + + function renderPageHeader() + { + return $this->renderShared("default/pageheader"); + } + } ?> \ No newline at end of file Added: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php (rev 0) +++ app/controllers/message_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,21 @@ +<?php + +class MessageController extends ApplicationController +{ + //var $models = 'user, message'; + + function index () { + $this->redirectTo(array('action' => 'inbox')); + } + + function inbox () { + } + + function outbox () { + } + + function send () { + } + +} +?> \ No newline at end of file Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/controllers/user_controller.php 2008-02-29 15:53:28 UTC (rev 34) @@ -8,16 +8,7 @@ function beforeAction ( $method = '' ) { $user = $this->_getUserFromSession(); - if (!$user && - $method != 'login' && - $method != 'logout' && - $method != 'register' && - $method != 'thankyou' && - $method != 'laststep' && - $method != 'confirm' && - $method != 'forgot_password' && - $method != 'reset_password' - ) { + if (!$user && $method == 'home') { $this->redirectToAction( 'login' ); } } @@ -149,15 +140,15 @@ } function renderSidebar () { - if ($this->current_user) { - return $this->renderShared("loggedin/sidebar"); + if (!$this->current_user) { + return $this->renderShared("default/sidebar"); } return parent::renderSidebar(); } function renderPageHeader () { - if ($this->current_user) { - return $this->renderShared("loggedin/pageheader"); + if (!$this->current_user) { + return $this->renderShared("default/pageheader"); } return parent::renderPageHeader(); } Added: app/installers/message_installer.php =================================================================== --- app/installers/message_installer.php (rev 0) +++ app/installers/message_installer.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,28 @@ +<?php +class MessageInstaller extends AkInstaller +{ + function up_1() + { + $this->execute( + "CREATE TABLE `messages` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `sender_id` int(11) NOT NULL DEFAULT 0, + `recipient_id` int(11) NOT NULL DEFAULT 0, + `subject` char(255) NOT NULL DEFAULT '', + `body` text NOT NULL DEFAULT '', + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + `read` tinyint(1) NOT NULL DEFAULT '0' + ) ENGINE=InnoDB"); + + } + + function down_1() + { + /**/ + $this->dropTable('messages'); + /**/ + } +} + +?> Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/locales/layout/ru.php 2008-02-29 15:53:28 UTC (rev 34) @@ -18,6 +18,6 @@ $dictionary['or'] = 'или'; $dictionary['Profile'] = 'Профиль'; $dictionary['Friends'] = 'Друзья'; -$dictionary['Inbox'] = 'Сообщения'; +$dictionary['Messages'] = 'Сообщения'; ?> Added: app/locales/message/en.php =================================================================== --- app/locales/message/en.php (rev 0) +++ app/locales/message/en.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,7 @@ +<?php + +// File created on: 2008-02-17 15:13:51 + +$dictionary = array(); + +?> Added: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php (rev 0) +++ app/locales/message/ru.php 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,25 @@ +<?php + +// File created on: 2008-02-17 15:13:51 + +$dictionary = array(); +$dictionary['Inbox'] = 'Входящие'; +$dictionary['Outbox'] = 'Отправленные'; +$dictionary['Send Message'] = 'Послать сообщение'; +$dictionary['You currently don\'t have any messages'] = 'В настоящее время у Вас нет сообщений'; +$dictionary['To'] = 'Кому'; +$dictionary['Subject'] = 'Тема'; +$dictionary['Message'] = 'Сообщение'; +$dictionary['Send'] = 'Послать'; +$dictionary['Cancel'] = 'Отмена'; +$dictionary['Select'] = 'Выбрать'; +$dictionary['None'] = 'Ничего'; +$dictionary['Read'] = 'Прочтенные'; +$dictionary['Unread'] = 'Непрочтенные'; +$dictionary['All'] = 'Все'; +$dictionary['Mark as Unread'] = 'Отметить как непрочтенные'; +$dictionary['Mark as Read'] = 'Отметить как прочтенные'; +$dictionary['Delete'] = 'Удалить'; + + +?> Added: app/views/message/_menu.tpl =================================================================== --- app/views/message/_menu.tpl (rev 0) +++ app/views/message/_menu.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,12 @@ +<div class="tabs"> + <div class="left"> + <ul class="toggle_tabs"> + <li class="first"><a href="/message/inbox" class="<?= $controller->getActionName() == 'inbox' ? 'selected' : '' ?>">_{Inbox}</a></li><li><a href="/message/outbox" class="last <?= $controller->getActionName() == 'outbox' ? 'selected' : '' ?>">_{Outbox}</a></li> + </ul> + </div> + <div class="right"> + <ul class="toggle_tabs"> + <li class="first last"><a href="/message/send" class="<?= $controller->getActionName() == 'send' ? 'selected' : '' ?>">_{Send Message}</a></li> + </ul> + </div> +</div> Added: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl (rev 0) +++ app/views/message/inbox.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,25 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="inbox_submenu"> + <div class="menu_block selector"> + <label for="action_select">_{Select}: + <select class="" onchange="" id="action_select" name="action_selector"> + <option selected="selected" value="_">---------</option> + <option value="">_{None}</option> + <option value="read">_{Read}</option> + <option value="unread">_{Unread}</option> + <option value="all">_{All}</option> + </select> + </label> + </div> + <div class="menu_block"> + <ul id="inbox_action" class="buttons"> + <li class="disabled"><a href="#" onclick="" id="unread">_{Mark as Unread}</a></li> + <li class="disabled"><a href="#" onclick="" id="read">_{Mark as Read}</a></li> + <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> + </ul> + </div> +</div> +<div class="no_messages">_{You currently don't have any messages}.<br><br> + <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> +</div> Added: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl (rev 0) +++ app/views/message/outbox.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,23 @@ +<?= $controller->renderPartial("menu") ?> + +<div class="inbox_submenu"> + <div class="menu_block selector"> + <label for="action_select">_{Select}: + <select class="" onchange="" id="action_select" name="action_selector"> + <option selected="selected" value="_">---</option> + <option value="">_{None}</option> + <option value="read">_{Read}</option> + <option value="unread">_{Unread}</option> + <option value="all">_{All}</option> + </select> + </label> + </div> + <div class="menu_block"> + <ul id="inbox_action" class="buttons"> + <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> + </ul> + </div> +</div> +<div class="no_messages">_{You currently don't have any messages}.<br><br> + <img src="/images/icons/message.gif" alt="" class=""> <a href="/message/send">_{Send Message}.</a> +</div> Added: app/views/message/send.tpl =================================================================== --- app/views/message/send.tpl (rev 0) +++ app/views/message/send.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,25 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<form action="/message/send" method="post"> + <div class="messageform"> + <div class="formrow"> + <label>_{To}:</label> + <?= $form_helper->text_field('message', '', array('class' => 'textinput') )?> + </div> + <div class="formrow"> + <label>_{Subject}:</label> + <?= $form_helper->text_field('message', 'subject', array('class' => 'textinput'))?> + </div> + <div class="formrow"> + <label>_{Message}:</label> + <textarea id="message" name="message" class="textinput"></textarea> + </div> + <div class="formrow"> + <label></label> + <input class="submitinput" type="submit" value="_{Send}"> + <input class="cancelinput" type="button" value="_{Cancel}"> + </div> + </div> +</form> Modified: app/views/shared/loggedin/compiled/pageheader.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 10:19:57 UTC (rev 33) +++ app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 15:53:28 UTC (rev 34) @@ -1,7 +1,7 @@ <ul id="headermenuleft"> <li><a class="globallink" href="/profile/"><?php echo $text_helper->translate('Profile', array()); ?></a> <a href="/profile/edit"><?php echo $text_helper->translate('edit', array()); ?></a></li> <li><a class="globallink" href="/friend/"><?php echo $text_helper->translate('Friends', array()); ?></a></li> - <li><a class="globallink" href="/message/"><?php echo $text_helper->translate('Inbox', array()); ?> (0)</a></li> + <li><a class="globallink" href="/message/"><?php echo $text_helper->translate('Messages', array()); ?> (0)</a></li> </ul> <ul id="headermenuright"> <li><a href="/user/logout"><?php echo $text_helper->translate('Logout', array()); ?></a></li> Modified: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl 2008-02-29 10:19:57 UTC (rev 33) +++ app/views/shared/loggedin/pageheader.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -1,7 +1,7 @@ <ul id="headermenuleft"> <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/edit">_{edit}</a></li> <li><a class="globallink" href="/friend/">_{Friends}</a></li> - <li><a class="globallink" href="/message/">_{Inbox} (0)</a></li> + <li><a class="globallink" href="/message/">_{Messages} (0)</a></li> </ul> <ul id="headermenuright"> <li><a href="/user/logout">_{Logout}</a></li> Modified: app/views/user/home.tpl =================================================================== --- app/views/user/home.tpl 2008-02-29 10:19:57 UTC (rev 33) +++ app/views/user/home.tpl 2008-02-29 15:53:28 UTC (rev 34) @@ -1 +1 @@ -Hello <?= $current_user->name ?> +_{Hello}, <?= $current_user->name ?> Modified: public/stylesheets/Application.css =================================================================== --- public/stylesheets/Application.css 2008-02-29 10:19:57 UTC (rev 33) +++ public/stylesheets/Application.css 2008-02-29 15:53:28 UTC (rev 34) @@ -3,7 +3,7 @@ font-size: 11px; } -input { +input, textarea { padding: 3px; border: 1px solid #bdc7d8; font-family: verdana, arial, sans-serif; @@ -17,17 +17,23 @@ font-weight: bolder; } - label.persistent { line-height: 16px; font: 11px normal; padding: 1px 0px 3px 0px; } -label input { +label input, label select { font-weight: normal; } +select{ + border:1px solid #BDC7D8; + font-family:verdana,arial,sans-serif; + font-size:11px; + padding:2px; +} + a { color: #3b5998; text-decoration: none; @@ -183,7 +189,7 @@ #pagecontent #content { clear: both; - padding: 20px; + padding: 0; } #pagefooter { @@ -258,6 +264,17 @@ border-right: 1px solid #0e1f5b; } +.cancelinput { + cursor: pointer; + color: black; + background-color: lightgray; + padding: 2px 15px 3px 15px; + margin: 5px 0px 5px 0px; + border-top: 1px solid #d9dfea; + border-left: 1px solid #d9dfea; + border-bottom: 1px solid #0e1f5b; + border-right: 1px solid #0e1f5b; +} .textinput, .passwordinput { width: 123px; @@ -291,7 +308,7 @@ #content .title { font-weight: bold; font-size: 13px; - padding: 0px 0px 10px 0px; + padding: 10px 20px; border-bottom: 1px solid #dddddd; margin-bottom: 10px; } Added: public/stylesheets/Message.css =================================================================== --- public/stylesheets/Message.css (rev 0) +++ public/stylesheets/Message.css 2008-02-29 15:53:28 UTC (rev 34) @@ -0,0 +1,57 @@ +#content .tabs { padding: 20px 0 15px; border-bottom:1px solid #898989; display:block; } +.tabs .left { padding-left: 10px; float: left; } +.tabs .right { padding-right:10px;float:right; } + +.toggle_tabs { margin:0; padding:0; list-style:none; text-align:center; display: block; } +.toggle_tabs li { display:inline; padding:2px 0px 3px; background:#f1f1f1; } +.toggle_tabs li a { border:1px solid #898989; border-left:0; color:#333; font-weight:bold; padding:2px 8px 3px 9px; } +.toggle_tabs li a small { font-size:11px; font-weight:normal; } +.toggle_tabs li a:focus { outline:0px; } +.toggle_tabs li.first a { border:1px solid #898989; } +.toggle_tabs li a.selected { margin-left:-1px; background:#6d84b4; border:1px solid #3b5998; border-left:1px solid #5973a9; border-right:1px solid #5973a9; color:#fff; } +.toggle_tabs li.last a.selected { margin-left:-1px; border-left:1px solid #5973a9; border-right:1px solid #36538f; } +.toggle_tabs li.first a.selected { margin:0; border-left:1px solid #36538f; border-right:1px solid #5973a9; } +.toggle_tabs li.first.last a.selected { border:1px solid #36538f; } +.toggle_tabs li a.selected:hover { text-decoration:none; } +.toggle_tabs li a.disabled { color:#999;cursor:default; } +.toggle_tabs li a.disabled:hover { text-decoration:none; } + +#content .inbox_submenu { background:#f7f7f7; border-bottom:1px solid #ccc; padding: 8px 20px 28px; } +.inbox_submenu .menu_block { float:left; } +.inbox_submenu .menu_block.selector { padding-right:5px; } +.inbox_submenu .menu_block.selector select { margin-left:5px; } +.inbox_submenu .buttons { list-style:none; margin:0px; padding:0px; } +.inbox_submenu .buttons li { float:left; } +.inbox_submenu .buttons li a { padding:4px 5px 4px 5px; display:block; } +.inbox_submenu .disabled a { color:#aaa; } +.inbox_submenu .disabled a:hover { cursor:default; text-decoration:none; } + +.no_messages { color:#666; font-size:13px; padding:100px 0px 110px 0px; text-align:center; } +.no_messages strong { color:#333; font-weight:bold; } + +#content .messageform { + margin: 20px auto 20px auto; + width: 510px; +} + +.messageform .formrow { + vertical-align: top; + padding: 0px 0px 3px 0px; +} + +.formrow label { + display: block; + width: 90px; + float: left; + text-align: right; + padding: 3px 10px 3px; +} + +.formrow textarea { + height: 150px; +} + +.formrow .textinput { + width: 350px; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-02-29 12:59:03
|
Revision: 33 http://isocial.svn.sourceforge.net/isocial/?rev=33&view=rev Author: aguidrevitch Date: 2008-02-29 02:19:57 -0800 (Fri, 29 Feb 2008) Log Message: ----------- sharing errors, sidebar, pageheader templates Modified Paths: -------------- app/application_controller.php app/controllers/user_controller.php app/views/user/confirm.tpl app/views/user/forgot_password.tpl app/views/user/login.tpl app/views/user/register.tpl app/views/user/reset_password.tpl config/DEFAULT-config.php Added Paths: ----------- app/views/shared/ app/views/shared/compiled/ app/views/shared/compiled/errors.tpl.php app/views/shared/default/ app/views/shared/default/compiled/ app/views/shared/default/compiled/pageheader.tpl.php app/views/shared/default/compiled/sidebar.tpl.php app/views/shared/default/pageheader.tpl app/views/shared/default/sidebar.tpl app/views/shared/errors.tpl app/views/shared/loggedin/ app/views/shared/loggedin/compiled/ app/views/shared/loggedin/compiled/pageheader.tpl.php app/views/shared/loggedin/compiled/sidebar.tpl.php app/views/shared/loggedin/pageheader.tpl app/views/shared/loggedin/sidebar.tpl Removed Paths: ------------- app/views/default/_pageheader.tpl app/views/default/_sidebar.tpl app/views/user/_errors.tpl app/views/user/_pageheader.tpl app/views/user/_pageheader_loggedin.tpl app/views/user/_sidebar.tpl app/views/user/_sidebar_loggedin.tpl Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-02-26 11:33:47 UTC (rev 32) +++ app/application_controller.php 2008-02-29 10:19:57 UTC (rev 33) @@ -138,14 +138,24 @@ return $this->_errors; } + function renderShared ( $template ) + { + return $this->render(array('template' => AK_VIEWS_DIR . DS . "shared/$template" , 'layout' => false, 'partial' => true)); + } + + function renderErrors () + { + return $this->renderShared("errors"); + } + function renderSidebar() { - return $this->renderPartial("sidebar"); + return $this->renderShared("default/sidebar"); } function renderPageHeader() { - return $this->renderPartial("pageheader"); + return $this->renderShared("default/pageheader"); } function _fix_email ($value) { Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-26 11:33:47 UTC (rev 32) +++ app/controllers/user_controller.php 2008-02-29 10:19:57 UTC (rev 33) @@ -150,14 +150,14 @@ function renderSidebar () { if ($this->current_user) { - return $this->renderPartial("sidebar_loggedin"); + return $this->renderShared("loggedin/sidebar"); } return parent::renderSidebar(); } function renderPageHeader () { if ($this->current_user) { - return $this->renderPartial("pageheader_loggedin"); + return $this->renderShared("loggedin/pageheader"); } return parent::renderPageHeader(); } Deleted: app/views/default/_pageheader.tpl =================================================================== --- app/views/default/_pageheader.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/default/_pageheader.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,3 +0,0 @@ -<ul id="headermenuright"> - <li><a href="/user/login">_{Login}</a></li> -</ul> \ No newline at end of file Deleted: app/views/default/_sidebar.tpl =================================================================== --- app/views/default/_sidebar.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/default/_sidebar.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,20 +0,0 @@ -<div id="quicklogin"> - <form action="/user/login" method="post"> - <label> - <span>_{Email}:</span> - <input class="textinput" type="text" name="email"> - </label> - <label> - <span>_{Password}:</span> - <input class="textinput" type="password" name="password"> - </label> - <label class="persistent"> - <input class="checkboxinput" type="checkbox" name="remember_me"> - <span>_{Remember me}</span> - </label> - <input class="submitinput" type="submit" value="_{Login}"> - - </form> - - <a href="/user/forgot_password">_{Forgot Password?}</a> -</div> \ No newline at end of file Added: app/views/shared/compiled/errors.tpl.php =================================================================== --- app/views/shared/compiled/errors.tpl.php (rev 0) +++ app/views/shared/compiled/errors.tpl.php 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,14 @@ +<?php if (count($controller->getErrors())) { + foreach ($controller->getErrors() as $field => $values) { + foreach ($values as $value) { + echo '<div class="error">'; + echo '<h1>' . $value[0] . '</h1>'; + if (isset($value[1])) { + echo '<p>' . $value[1] . '</p>'; + } + echo '</div>'; + } + break; + } +} +?> Added: app/views/shared/default/compiled/pageheader.tpl.php =================================================================== --- app/views/shared/default/compiled/pageheader.tpl.php (rev 0) +++ app/views/shared/default/compiled/pageheader.tpl.php 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,3 @@ +<ul id="headermenuright"> + <li><a href="/user/login"><?php echo $text_helper->translate('Login', array()); ?></a></li> +</ul> \ No newline at end of file Added: app/views/shared/default/compiled/sidebar.tpl.php =================================================================== --- app/views/shared/default/compiled/sidebar.tpl.php (rev 0) +++ app/views/shared/default/compiled/sidebar.tpl.php 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,4 @@ +<div id="quicklogin"> + <?php echo $text_helper->translate('Everyone Can Join', array()); ?> +<a class="linkbutton" href="/user/register"><div><?php echo $text_helper->translate('Sign Up', array()); ?></div></a> +</div> \ No newline at end of file Added: app/views/shared/default/pageheader.tpl =================================================================== --- app/views/shared/default/pageheader.tpl (rev 0) +++ app/views/shared/default/pageheader.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,3 @@ +<ul id="headermenuright"> + <li><a href="/user/login">_{Login}</a></li> +</ul> \ No newline at end of file Added: app/views/shared/default/sidebar.tpl =================================================================== --- app/views/shared/default/sidebar.tpl (rev 0) +++ app/views/shared/default/sidebar.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,4 @@ +<div id="quicklogin"> + _{Everyone Can Join} +<a class="linkbutton" href="/user/register"><div>_{Sign Up}</div></a> +</div> \ No newline at end of file Added: app/views/shared/errors.tpl =================================================================== --- app/views/shared/errors.tpl (rev 0) +++ app/views/shared/errors.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,15 @@ +<? +if (count($controller->getErrors())) { + foreach ($controller->getErrors() as $field => $values) { + foreach ($values as $value) { + echo '<div class="error">'; + echo '<h1>' . $value[0] . '</h1>'; + if (isset($value[1])) { + echo '<p>' . $value[1] . '</p>'; + } + echo '</div>'; + } + break; + } +} +?> Added: app/views/shared/loggedin/compiled/pageheader.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/pageheader.tpl.php (rev 0) +++ app/views/shared/loggedin/compiled/pageheader.tpl.php 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,8 @@ +<ul id="headermenuleft"> + <li><a class="globallink" href="/profile/"><?php echo $text_helper->translate('Profile', array()); ?></a> <a href="/profile/edit"><?php echo $text_helper->translate('edit', array()); ?></a></li> + <li><a class="globallink" href="/friend/"><?php echo $text_helper->translate('Friends', array()); ?></a></li> + <li><a class="globallink" href="/message/"><?php echo $text_helper->translate('Inbox', array()); ?> (0)</a></li> +</ul> +<ul id="headermenuright"> + <li><a href="/user/logout"><?php echo $text_helper->translate('Logout', array()); ?></a></li> +</ul> \ No newline at end of file Added: app/views/shared/loggedin/compiled/sidebar.tpl.php =================================================================== --- app/views/shared/loggedin/compiled/sidebar.tpl.php (rev 0) +++ app/views/shared/loggedin/compiled/sidebar.tpl.php 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,18 @@ +<div id="qsearch"> + <div> + <h2>Search</h2> + </div> + <form action="/search"> + <div id="qsearchwrapper"> + <div id="qsearchfield"> + <input id="query" name="query" type="text" class="textinput"> + </div> + <div id="qsearchimage">a + </div> + </div> + </form> +</div> +<div id="applications"> + <div>Photos</div> + <div>Groups</div> +</div> \ No newline at end of file Added: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl (rev 0) +++ app/views/shared/loggedin/pageheader.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,8 @@ +<ul id="headermenuleft"> + <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/edit">_{edit}</a></li> + <li><a class="globallink" href="/friend/">_{Friends}</a></li> + <li><a class="globallink" href="/message/">_{Inbox} (0)</a></li> +</ul> +<ul id="headermenuright"> + <li><a href="/user/logout">_{Logout}</a></li> +</ul> \ No newline at end of file Added: app/views/shared/loggedin/sidebar.tpl =================================================================== --- app/views/shared/loggedin/sidebar.tpl (rev 0) +++ app/views/shared/loggedin/sidebar.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -0,0 +1,18 @@ +<div id="qsearch"> + <div> + <h2>Search</h2> + </div> + <form action="/search"> + <div id="qsearchwrapper"> + <div id="qsearchfield"> + <input id="query" name="query" type="text" class="textinput"> + </div> + <div id="qsearchimage">a + </div> + </div> + </form> +</div> +<div id="applications"> + <div>Photos</div> + <div>Groups</div> +</div> \ No newline at end of file Deleted: app/views/user/_errors.tpl =================================================================== --- app/views/user/_errors.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/_errors.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,15 +0,0 @@ -<? -if (count($controller->getErrors())) { - foreach ($controller->getErrors() as $field => $values) { - foreach ($values as $value) { - echo '<div class="error">'; - echo '<h1>' . $value[0] . '</h1>'; - if (isset($value[1])) { - echo '<p>' . $value[1] . '</p>'; - } - echo '</div>'; - } - break; - } -} -?> Deleted: app/views/user/_pageheader.tpl =================================================================== --- app/views/user/_pageheader.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/_pageheader.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,3 +0,0 @@ -<ul id="headermenuright"> - <li><a href="/user/login">_{Login}</a></li> -</ul> \ No newline at end of file Deleted: app/views/user/_pageheader_loggedin.tpl =================================================================== --- app/views/user/_pageheader_loggedin.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/_pageheader_loggedin.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,8 +0,0 @@ -<ul id="headermenuleft"> - <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/edit">_{edit}</a></li> - <li><a class="globallink" href="/friend/">_{Friends}</a></li> - <li><a class="globallink" href="/message/">_{Inbox} (0)</a></li> -</ul> -<ul id="headermenuright"> - <li><a href="/user/logout">_{Logout}</a></li> -</ul> \ No newline at end of file Deleted: app/views/user/_sidebar.tpl =================================================================== --- app/views/user/_sidebar.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/_sidebar.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,4 +0,0 @@ -<div id="quicklogin"> - _{Everyone Can Join} -<a class="linkbutton" href="/user/register"><div>_{Sign Up}</div></a> -</div> \ No newline at end of file Deleted: app/views/user/_sidebar_loggedin.tpl =================================================================== --- app/views/user/_sidebar_loggedin.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/_sidebar_loggedin.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,18 +0,0 @@ -<div id="qsearch"> - <div> - <h2>Search</h2> - </div> - <form action="/search"> - <div id="qsearchwrapper"> - <div id="qsearchfield"> - <input id="query" name="query" type="text" class="textinput"> - </div> - <div id="qsearchimage">a - </div> - </div> - </form> -</div> -<div id="applications"> - <div>Photos</div> - <div>Groups</div> -</div> \ No newline at end of file Modified: app/views/user/confirm.tpl =================================================================== --- app/views/user/confirm.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/confirm.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -2,7 +2,7 @@ <? if ($controller->getErrors()) { - echo $controller->renderPartial("errors"); + echo $controller->renderErrors(); } else { ?> <p>_{Thank you for registration}</p><br> <p><a href="/user/login">_{go to login}</a></p> Modified: app/views/user/forgot_password.tpl =================================================================== --- app/views/user/forgot_password.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/forgot_password.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,6 +1,6 @@ <div class="title">_{Trouble Accessing Your Account}?</div> -<?= $controller->renderPartial("errors") ?> +<?= $controller->renderErrors() ?> <p>_{Forgot Password}? _{Enter your login email below}. _{We will send you an email with a link to reset your password}.</p> Modified: app/views/user/login.tpl =================================================================== --- app/views/user/login.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/login.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,6 +1,6 @@ <div class="title">_{iSocial Login}</div> -<?= $controller->renderPartial("errors") ?> +<?= $controller->renderErrors() ?> <form action="/user/login" method="post"> <div class="loginform"> Modified: app/views/user/register.tpl =================================================================== --- app/views/user/register.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/register.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -1,6 +1,6 @@ <div class="title">_{Sign Up}</div> -<?= $controller->renderPartial("errors") ?> +<?= $controller->renderErrors() ?> <form action="/user/register" method="post"> <div class="loginform"> Modified: app/views/user/reset_password.tpl =================================================================== --- app/views/user/reset_password.tpl 2008-02-26 11:33:47 UTC (rev 32) +++ app/views/user/reset_password.tpl 2008-02-29 10:19:57 UTC (rev 33) @@ -2,7 +2,7 @@ <? if ($controller->getErrors()) { - echo $controller->renderPartial("errors"); + echo $controller->renderErrors(); } else { ?> <div align="center">_{Please enter a new password}.</div> <form action="/user/reset_password" method="post"> Modified: config/DEFAULT-config.php =================================================================== --- config/DEFAULT-config.php 2008-02-26 11:33:47 UTC (rev 32) +++ config/DEFAULT-config.php 2008-02-29 10:19:57 UTC (rev 33) @@ -50,6 +50,8 @@ // disable automatic translations define('AK_AUTOMATICALLY_UPDATE_LANGUAGE_FILES', false); +// disable security checks, at least before http://trac.akelos.org/ticket/122 gets fixed +define('AK_TEMPLATE_SECURITY_CHECK', false); define('I_NOREPLAY_EMAIL', ''); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-26 11:33:42
|
Revision: 32 http://isocial.svn.sourceforge.net/isocial/?rev=32&view=rev Author: dim0s77 Date: 2008-02-26 03:33:47 -0800 (Tue, 26 Feb 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/locales/user/ru.php app/views/user/email/confirm.tpl Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-02-26 11:27:32 UTC (rev 31) +++ app/locales/user/ru.php 2008-02-26 11:33:47 UTC (rev 32) @@ -47,7 +47,7 @@ $dictionary['no user found with the given email'] = 'пользователь с указанным email не зарегистрирован'; $dictionary['bad reset link'] = 'ссылка сброса пароля содержит ошибки'; $dictionary['Trouble Accessing Your Account'] = 'Проблема с доступом к Вашей учетной записи'; -$dictionary['Forgot password'] = 'Забыли пароль'; +$dictionary['Forgot Password'] = 'Забыли пароль'; $dictionary['Enter your login email below'] = 'Введите свой email адрес ниже'; $dictionary['We will send you an email with a link to reset your password'] = 'Мы вышлем Вам письмо, содержащее ссылку для сброса пароля'; $dictionary['Reset Password'] = 'Сбросить пароль'; Modified: app/views/user/email/confirm.tpl =================================================================== --- app/views/user/email/confirm.tpl 2008-02-26 11:27:32 UTC (rev 31) +++ app/views/user/email/confirm.tpl 2008-02-26 11:33:47 UTC (rev 32) @@ -7,7 +7,7 @@ <p>_{Thank you for signing up on iSocial}.</p> <? $link = AK_SITE_URL . "user/login" ?> -<p>_{Link for login} <a href="{link}">here</a>.</p> +<p>_{Link for login} <a href="{link}">_{here}</a>.</p> <p>_{With best regards},<br> _{The iSocial Team}</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-26 11:27:27
|
Revision: 31 http://isocial.svn.sourceforge.net/isocial/?rev=31&view=rev Author: dim0s77 Date: 2008-02-26 03:27:32 -0800 (Tue, 26 Feb 2008) Log Message: ----------- translated of user email templates. minor fixes Modified Paths: -------------- app/locales/user/ru.php app/views/user/email/confirm.tpl app/views/user/email/forgot_password.tpl app/views/user/email/register.tpl Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-02-26 11:13:30 UTC (rev 30) +++ app/locales/user/ru.php 2008-02-26 11:27:32 UTC (rev 31) @@ -29,7 +29,7 @@ $dictionary['Check please your email and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш email и подтвердите регистрацию переходом по ссылке'; $dictionary['go to login'] = 'войти'; $dictionary['Confirmation'] = 'Подтверждение'; -$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрация в iSocial'; +$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрацию в iSocial'; $dictionary['With best regards'] = 'С наилучшими пожеланиями'; $dictionary['The iSocial Team'] = 'команда iSocial'; $dictionary['Hey'] = 'Привет'; @@ -56,5 +56,11 @@ $dictionary['If you have a different problem accessing your account, please see our'] = 'Если у Вас другая проблема доступа к учетной записи, смотрите нашу'; $dictionary['Login Problems Help Page'] = 'страницу помощи'; $dictionary['Please enter a new password'] = 'Введите, пожалуйста, новый пароль'; +$dictionary['Link for login'] = 'Ссылка для входа'; +$dictionary['here'] = 'здесь'; +$dictionary['iSocial Password Reset Confirmation'] = 'Подтверждение сброса пароля на iSocial'; +$dictionary['You recently requested a new password'] = 'Вы недавно запросили новый пароль'; +$dictionary['To reset your password, follow the link below'] = 'Чтобы сбросить Ваш старый пароль, перейдите по ссылке ниже'; +$dictionary['If you did not reset your password, please disregard this message'] = 'Если Вы не хотите менять пароль, не обращайте внимание на это письмо'; ?> Modified: app/views/user/email/confirm.tpl =================================================================== --- app/views/user/email/confirm.tpl 2008-02-26 11:13:30 UTC (rev 30) +++ app/views/user/email/confirm.tpl 2008-02-26 11:27:32 UTC (rev 31) @@ -1,13 +1,13 @@ -Subject: _{Thank you for signing up on ISocial} -From: "iSocial" <no-...@ma...> +Subject: _{Thank you for signing up on iSocial} +From: iSocial <no-...@ma...> <? $user = $controller->User->findFirst(array( 'email' => $controller->params['email'] )) ?> -<p>_{Hey} <?= $user->name ?></p> +<p>_{Hey}, <?= $user->name ?>!</p> -<p>_{Thank you for signing up on ISocial}.</p> +<p>_{Thank you for signing up on iSocial}.</p> <? $link = AK_SITE_URL . "user/login" ?> -<p>Link for login <a href="{link}">here</a>.</p> +<p>_{Link for login} <a href="{link}">here</a>.</p> <p>_{With best regards},<br> -_{The ISocial Team}</p> +_{The iSocial Team}</p> Modified: app/views/user/email/forgot_password.tpl =================================================================== --- app/views/user/email/forgot_password.tpl 2008-02-26 11:13:30 UTC (rev 30) +++ app/views/user/email/forgot_password.tpl 2008-02-26 11:27:32 UTC (rev 31) @@ -1,8 +1,8 @@ -Subject: _{ISocial Password Reset Confirmation} -From: "iSocial" <no-...@ma...> +Subject: _{iSocial Password Reset Confirmation} +From: iSocial <no-...@ma...> <? $user = $controller->User->findFirst(array( 'email' => $controller->params['email'] )) ?> -<p>_{Hey} <?= $user->name ?></p> +<p>_{Hey}, <?= $user->name ?>!</p> <p>_{You recently requested a new password}. _{To reset your password, follow the link below}:<br> @@ -15,4 +15,4 @@ _{Check out} <a href="{link}">{link}</a> _{if you have any questions}.</p> <p>_{Thanks},<br> -_{The ISocial Team}</p> +_{The iSocial Team}</p> Modified: app/views/user/email/register.tpl =================================================================== --- app/views/user/email/register.tpl 2008-02-26 11:13:30 UTC (rev 30) +++ app/views/user/email/register.tpl 2008-02-26 11:27:32 UTC (rev 31) @@ -1,18 +1,18 @@ -Subject: _{ISocial confirm registration} -From: "iSocial" <no-...@ma...> +Subject: _{iSocial confirm registration} +From: iSocial <no-...@ma...> -<p>_{Hey} <?= $controller->User->name ?></p> +<p>_{Hey}, <?= $controller->User->name ?>!</p> -<p>_{You recently registered for ISocial using this email address.} _{To complete your registration, follow the link below}:<br> +<p>_{You recently registered for iSocial using this email address.} _{To complete your registration, follow the link below}:<br> <? $link = AK_SITE_URL . "user/confirm?uuid=" . $controller->Confirmation->uuid . "&email=" . $controller->User->email ?> <a href="<?= $link ?>"><?= $link ?></a><br> (_{If clicking on the link doesn't work, try copying and pasting it into your browser})</p> -<p>_{If you did not register for ISocial, please disregard this message}.<br> +<p>_{If you did not register for iSocial, please disregard this message}.<br> <? $link = AK_SITE_URL . "help" ?> _{Check out} <a href="{link}">{link}</a> _{if you have any questions}.</p> <p>_{Thanks},<br> -_{The ISocial Team}</p> +_{The iSocial Team}</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-26 11:13:25
|
Revision: 30 http://isocial.svn.sourceforge.net/isocial/?rev=30&view=rev Author: dim0s77 Date: 2008-02-26 03:13:30 -0800 (Tue, 26 Feb 2008) Log Message: ----------- translated other user templates. minor fixes Modified Paths: -------------- app/controllers/user_controller.php app/locales/user/ru.php app/views/user/confirm.tpl app/views/user/forgot_password.tpl app/views/user/laststep.tpl app/views/user/login.tpl app/views/user/register.tpl Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-26 10:07:55 UTC (rev 29) +++ app/controllers/user_controller.php 2008-02-26 11:13:30 UTC (rev 30) @@ -42,7 +42,7 @@ $this->addError( '_common', - 'Incorrect email/password combination', + 'Incorrect e-mail/password combination', 'Passwords are case sensitive. Please check your CAPS lock key' ); } @@ -99,7 +99,7 @@ } // some error occured. // it doesn't really matter which exactly - $this->addError('_common', 'Confirmation error', 'Bad confirmation link'); + $this->addError('_common', 'Confirmation error', 'bad confirmation link'); } function laststep () { @@ -119,7 +119,7 @@ } return; } - $this->addError('_common', 'Password reset error', 'No user found with the given email'); + $this->addError('_common', 'Password reset error', 'No user found with the given e-mail'); } function reset_password () { @@ -145,7 +145,7 @@ } } } - $this->addError('_common', 'Password reset error', 'Bad reset link'); + $this->addError('_common', 'Password reset error', 'bad reset link'); } function renderSidebar () { Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-02-26 10:07:55 UTC (rev 29) +++ app/locales/user/ru.php 2008-02-26 11:13:30 UTC (rev 30) @@ -6,39 +6,55 @@ $dictionary['iSocial Login'] = 'Вход в iSocial'; $dictionary['Sign Up for iSocial'] = 'Регистрация в iSocial'; $dictionary['Sign Up'] = 'Регистрация'; -$dictionary['Incorrect email/password combination'] = 'Неправильное имя и/или пароль'; -$dictionary['Passwords are case sensitive. Please check your CAPS lock key'] = 'Пароли чувствительны к регистру. Проверьте состояние индикатора Caps Lock'; +$dictionary['Incorrect email/password combination'] = 'Неправильные email и/или пароль'; +$dictionary['Passwords are case sensitive. Please check your CAPS lock key'] = 'Пароли чувствительны к регистру. Проверьте, не нажата ли клавиша Caps Lock'; $dictionary['Name'] = 'Имя'; -$dictionary['Confirm password'] = 'Подтвердите пароль'; +$dictionary['Confirm Password'] = 'Подтвердите пароль'; $dictionary['Name is missing'] = 'Не указано имя'; -$dictionary['please enter the name'] = 'это поле не может быть пустым'; -$dictionary['Incorrect email'] = 'Неверный e-mail адрес'; -$dictionary['please enter the correct email'] = 'введите корректный e-mail адрес, например va...@pu...'; -$dictionary['Email is taken'] = 'Пользователь с таким e-mail адресом уже зарегистрирован'; -$dictionary['please enter other email'] = 'введите другой e-mail адрес'; +$dictionary['please enter the name'] = 'пожалуйста, введите свое имя'; +$dictionary['this field can\'t be empty'] = 'это поле не может быть пустым'; +$dictionary['Incorrect email'] = 'Неверный email адрес'; +$dictionary['please enter the correct email'] = 'пожалуйста, введите корректный email адрес, например, va...@pu...'; +$dictionary['email is taken'] = 'Пользователь с таким email адресом уже зарегистрирован'; +$dictionary['please enter other email'] = 'введите другой email адрес'; $dictionary['Password is missing'] = 'Не указан пароль'; -$dictionary['please enter the password'] = 'это поле не может быть пустым'; +$dictionary['please enter the password'] = 'пожалуйста, введите пароль'; $dictionary['Password confirmation is missing'] = 'Повторите пароль'; -$dictionary['please enter the password confirmation'] = 'это поле не может быть пустым'; +$dictionary['please enter the password confirmation'] = 'пожалуйста, проверьте подтверждение пароля'; $dictionary['Passwords don\'t match'] = 'Пароли не совпадают'; $dictionary['please reenter both passwords'] = 'убедитесь, что оба пароля совпадают'; $dictionary['Thank you for registration'] = 'Спасибо за регистрацию'; $dictionary['Everyone Can Join'] = 'Присоединиться может каждый'; $dictionary['Last step'] = 'Последний шаг'; -$dictionary['Check please your e-mail and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш e-mail и подтвердите регистрацию переходом по ссылке'; +$dictionary['Check please your email and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш email и подтвердите регистрацию переходом по ссылке'; $dictionary['go to login'] = 'войти'; $dictionary['Confirmation'] = 'Подтверждение'; -$dictionary['Thank you for signing up on ISocial'] = 'Спасибо за регистрация в iSocial'; +$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрация в iSocial'; $dictionary['With best regards'] = 'С наилучшими пожеланиями'; -$dictionary['The ISocial Team'] = 'команда iSocial'; +$dictionary['The iSocial Team'] = 'команда iSocial'; $dictionary['Hey'] = 'Привет'; -$dictionary['ISocial confirm registration'] = 'Подтверждение регистрации в iSocial'; -$dictionary['You recently registered for ISocial using this e-mail address.'] = 'Вы только что зарегистрировались в iSocial используя этот e-mail адрес'; +$dictionary['iSocial confirm registration'] = 'Подтверждение регистрации в iSocial'; +$dictionary['You recently registered for iSocial using this email address.'] = 'Вы только что зарегистрировались в iSocial используя этот email адрес'; $dictionary['To complete your registration, follow the link below'] = 'Для завершения регистрации, перейдите по ссылке ниже'; $dictionary['If clicking on the link doesn\'t work, try copying and pasting it into your browser'] = 'Если переход по ссылке не работает, попробуйте скопировать ее и вставить в адресную строку Вашего браузера'; -$dictionary['If you did not register for ISocial, please disregard this message'] = 'Если Вы не регистрировались в iSocial, проигнорируйте, пожалуйста, это сообщение'; -$dictionary['Check out'] = 'Проверьте и подтвердите'; +$dictionary['If you did not register for iSocial, please disregard this message'] = 'Если Вы не регистрировались в iSocial, проигнорируйте, пожалуйста, это сообщение'; +$dictionary['Check out'] = 'Посетите'; $dictionary['if you have any questions'] = 'если у Вас есть какие-либо вопросы'; $dictionary['Thanks'] = 'Спасибо'; +$dictionary['Confirmation error'] = 'Ошибка подтверждения'; +$dictionary['bad confirmation link'] = 'ссылка подтверждения содержит ошибки'; +$dictionary['Password reset error'] = 'Ошибка сброса пароля'; +$dictionary['no user found with the given email'] = 'пользователь с указанным email не зарегистрирован'; +$dictionary['bad reset link'] = 'ссылка сброса пароля содержит ошибки'; +$dictionary['Trouble Accessing Your Account'] = 'Проблема с доступом к Вашей учетной записи'; +$dictionary['Forgot password'] = 'Забыли пароль'; +$dictionary['Enter your login email below'] = 'Введите свой email адрес ниже'; +$dictionary['We will send you an email with a link to reset your password'] = 'Мы вышлем Вам письмо, содержащее ссылку для сброса пароля'; +$dictionary['Reset Password'] = 'Сбросить пароль'; +$dictionary['New Password'] = 'Новый пароль'; +$dictionary['Change Password'] = 'Изменить пароль'; +$dictionary['If you have a different problem accessing your account, please see our'] = 'Если у Вас другая проблема доступа к учетной записи, смотрите нашу'; +$dictionary['Login Problems Help Page'] = 'страницу помощи'; +$dictionary['Please enter a new password'] = 'Введите, пожалуйста, новый пароль'; ?> Modified: app/views/user/confirm.tpl =================================================================== --- app/views/user/confirm.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/confirm.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -4,6 +4,6 @@ if ($controller->getErrors()) { echo $controller->renderPartial("errors"); } else { ?> - <p>_{Thank you for registration}</p> + <p>_{Thank you for registration}</p><br> <p><a href="/user/login">_{go to login}</a></p> <? } ?> Modified: app/views/user/forgot_password.tpl =================================================================== --- app/views/user/forgot_password.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/forgot_password.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -2,7 +2,7 @@ <?= $controller->renderPartial("errors") ?> -<p>_{Forgot your password}? _{Enter your login email below}. +<p>_{Forgot Password}? _{Enter your login email below}. _{We will send you an email with a link to reset your password}.</p> <form action="/user/forgot_password" method="post"> Modified: app/views/user/laststep.tpl =================================================================== --- app/views/user/laststep.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/laststep.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -1,2 +1,2 @@ <div class="title">_{Last step}</div> -<div>_{Check please your e-mail and click on confirmation link}.</div> +<div>_{Check please your email and click on confirmation link}.</div> Modified: app/views/user/login.tpl =================================================================== --- app/views/user/login.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/login.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -27,7 +27,7 @@ </div> <p class="formrow forgotpassword"> <label></label> - <a href="/user/forgot_password">_{Forgot Password?}</a> + <a href="/user/forgot_password">_{Forgot Password}?</a> </p> </div> </form> Modified: app/views/user/register.tpl =================================================================== --- app/views/user/register.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/register.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -17,7 +17,7 @@ <input class="textinput" type="password" name="user[password]"> </div> <div class="formrow"> - <label>_{Confirm password}:</label> + <label>_{Confirm Password}:</label> <input class="textinput" type="password" name="user[password_confirmation]"> </div> <div class="formrow"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |