diff options
-rw-r--r-- | include/widgets.php | 14 | ||||
-rw-r--r-- | js/icon_translate.js | 4 | ||||
-rw-r--r-- | mod/network.php | 2 | ||||
-rw-r--r-- | mod/notes.php | 16 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 10 | ||||
-rw-r--r-- | view/tpl/notes.tpl | 13 |
6 files changed, 58 insertions, 1 deletions
diff --git a/include/widgets.php b/include/widgets.php index 632f85436..2e8169bd7 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -135,3 +135,17 @@ function widget_follow($args) { )); } + + +function widget_notes($arr) { + if(! local_user()) + return ''; + $text = htmlspecialchars(get_pconfig(local_user(),'notes','text')); + + $o = replace_macros(get_markup_template('notes.tpl'), array( + '$banner' => t('Notes'), + '$text' => $text, + '$save' => t('Save'), + )); + return $o; +} diff --git a/js/icon_translate.js b/js/icon_translate.js index dad805404..9e69e0b7d 100644 --- a/js/icon_translate.js +++ b/js/icon_translate.js @@ -1,3 +1,6 @@ +// Include this file and adjust as necessary for alternate icon sets which use different icon names. + +$(document).ready(function() { $('.icon-smile').addClass(''); $('.icon-star-empty').addClass(''); @@ -47,3 +50,4 @@ $('.icon-check').addClass(''); $('.icon-globe').addClass(''); $('.icon-circle-blank').addClass(''); +});
\ No newline at end of file diff --git a/mod/network.php b/mod/network.php index efb3116ae..13092d47d 100644 --- a/mod/network.php +++ b/mod/network.php @@ -54,7 +54,7 @@ function network_init(&$a) { $a->set_widget('suggestions',widget_suggestions(array())); $a->set_widget('savedsearch',saved_searches($search)); $a->set_widget('filer',fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''))); - + $a->set_widget('notes',widget_notes(array())); if($search) { if(strpos($search,'@') === 0) { diff --git a/mod/notes.php b/mod/notes.php new file mode 100644 index 000000000..ce3460aa4 --- /dev/null +++ b/mod/notes.php @@ -0,0 +1,16 @@ +<?php /** @file */ + +function notes_init(&$a) { + if(! local_user()) + return; + logger('mod_notes: ' . print_r($_REQUEST,true)); + + $ret = array('success' => true); + if($_REQUEST['note_text']) { + $body = escape_tags($_REQUEST['note_text']); + set_pconfig(local_user(),'notes','text',$body); + } + logger('notes saved.'); + json_return_and_die($ret); + +}
\ No newline at end of file diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index ede7c4abd..83781ebb9 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2999,3 +2999,13 @@ img.mail-list-sender-photo { color: black; } .suggest-widget-more { margin-top: 10px; } + + +#note-text { + width: 190px; + max-width: 190px; + height: 150px; +} +#note-save { margin-top: 10px; } + + diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl new file mode 100644 index 000000000..7300779f4 --- /dev/null +++ b/view/tpl/notes.tpl @@ -0,0 +1,13 @@ +<div class="widget"> +<script> +function notePost() { + $('#note-rotator').spin('tiny'); + $.post('notes', { 'note_text' : $('#note-text').val() },function(data) { $('#note-rotator').spin(false); }); +} +</script> + +<h3>{{$banner}}</h3> +<textarea name="note_text" id="note-text">{{$text}}</textarea> +<input type="submit" name="submit" id="note-save" value="{{$save}}" onclick="notePost(); return true;"> +<div id="note-rotator"></div> +</div> |