From 61e4ee753dd0e823c47a5cf2e485f7f69fb4d125 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 17 Apr 2015 11:20:22 +0200 Subject: [PATCH] allow jot to be displayed expanded, remove deprected datetimepicker js and some random fixes --- include/conversation.php | 3 ++- mod/editwebpage.php | 19 +++++++++---------- mod/rpost.php | 10 +++++----- mod/webpages.php | 1 + view/css/mod_webpages.css | 9 --------- view/theme/redbasic/css/style.css | 16 ++++++++++------ view/tpl/edpost_head.tpl | 13 ++++++++++++- view/tpl/jot-header.tpl | 2 -- view/tpl/jot.tpl | 15 +-------------- view/tpl/webpagelist.tpl | 2 +- 10 files changed, 41 insertions(+), 49 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index cdb7807b6..5ae2250a8 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1233,7 +1233,8 @@ function status_editor($a, $x, $popup = false) { '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), - '$expiryModalCANCEL' => t('Cancel') + '$expiryModalCANCEL' => t('Cancel'), + '$expanded' => ((x($x, 'expanded')) ? $x['expanded'] : false), )); if ($popup === true) { diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 55cd3b4ef..a7564a126 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -135,12 +135,7 @@ function editwebpage_content(&$a) { $layoutselect = ''; else $layoutselect = layout_select($itm[0]['uid'],$itm[0]['layout_mid']); - - $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( - '$title' => t('Edit Webpage') - )); - $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( '$baseurl' => $a->get_baseurl(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), @@ -150,7 +145,6 @@ function editwebpage_content(&$a) { '$confirmdelete' => t('Delete webpage?') )); - $tpl = get_markup_template("jot.tpl"); $jotplugins = ''; @@ -164,8 +158,9 @@ function editwebpage_content(&$a) { $rp = 'webpages/' . $which; -logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage'))); - $o .= replace_macros($tpl,array( + logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage'))); + + $editor = replace_macros($tpl,array( '$return_path' => $rp, '$webpage' => ITEM_WEBPAGE, '$placeholdpagetitle' => t('Page link title'), @@ -218,8 +213,12 @@ logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos )); - if(($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) - $o .= '

' . t('Delete Webpage') . '
'; + $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( + '$title' => t('Edit Webpage'), + '$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false), + '$editor' => $editor, + '$id' => $itm[0]['id'] + )); return $o; diff --git a/mod/rpost.php b/mod/rpost.php index 737d705f6..0c0916646 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -101,10 +101,6 @@ function rpost_content(&$a) { 'deny_gid' => $channel['channel_deny_gid'] ); - $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( - '$title' => t('Edit post') - )); - if($_REQUEST['url']) { $x = z_fetch_url(z_root() . '/parse_url?f=&url=' . urlencode($_REQUEST['url'])); if($x['success']) @@ -129,8 +125,12 @@ function rpost_content(&$a) { 'return_path' => 'rpost/return' ); + $editor = status_editor($a,$x); - $o .= status_editor($a,$x); + $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( + '$title' => t('Edit post'), + '$editor' => $editor + )); return $o; diff --git a/mod/webpages.php b/mod/webpages.php index 5013d803a..b303b8652 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -115,6 +115,7 @@ function webpages_content(&$a) { 'profile_uid' => intval($owner), 'mimetype' => $mimetype, 'layout' => $layout, + 'expanded' => true ); if($_REQUEST['title']) diff --git a/view/css/mod_webpages.css b/view/css/mod_webpages.css index 7e4dbf569..075b789b8 100644 --- a/view/css/mod_webpages.css +++ b/view/css/mod_webpages.css @@ -30,12 +30,3 @@ .webpage-list-tool { padding: 7px 10px; } - -/* this forces collapsed jot to appear expanded */ -.jothidden { - display: block !important; -} - -#profile-jot-text { - height: 200px; -} diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index b0614fcc4..fbdb803e9 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1586,11 +1586,14 @@ img.mail-list-sender-photo { font-weight: bold; } -.jothidden >input, .jothidden >input { - border: 1px solid #fff; +.jothidden > input { + border: 1px solid $bgcolour; + background-color: $bgcolour; } -.jothidden >input:hover, .jothidden >input:focus { +.jothidden > input:hover, +.jothidden > input:focus { border: 1px solid #cccccc; + background-color: #fff; } #profile-jot-text { @@ -2210,8 +2213,8 @@ aside .nav > li > a:hover, aside .nav > li > a:focus { /* Modified original CSS to match input in Redbasic */ .jothidden .bootstrap-tagsinput { - border-color:#fff; - background-color: #fff; + border-color: $bgcolour; + background-color: $bgcolour; box-shadow: none; display: inline-block; border-radius: $radiuspx; @@ -2225,7 +2228,8 @@ aside .nav > li > a:hover, aside .nav > li > a:focus { } .jothidden .bootstrap-tagsinput:hover, .jothidden .bootstrap-tagsinput:focus { - border: 1px solid #cccccc; + border: 1px solid #ccc; + background-color: #fff; } /* Abusing theme-green is less work than makeing a new new one */ diff --git a/view/tpl/edpost_head.tpl b/view/tpl/edpost_head.tpl index 890b746bf..20e597909 100755 --- a/view/tpl/edpost_head.tpl +++ b/view/tpl/edpost_head.tpl @@ -1 +1,12 @@ -

{{$title}}

+
+ {{if $delete}} + + {{/if}} +

{{$title}}

+
+
+
+ {{$editor}} +
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index f9ce65a86..4121882b7 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -108,8 +108,6 @@ function enableOnUser(){ $("#profile-jot-text").focus(enableOnUser); $("#profile-jot-text").click(enableOnUser); - if($("#jot-attachment").val()) enableOnUser(); - var upload_title = $('#wall-image-upload').attr('title'); var attach_title = $('#wall-file-upload').attr('title'); try { diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 24fea70f1..2fcd4d59b 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -176,20 +176,7 @@ - -{{if $content}} +{{if $content || $attachment || $expanded}} {{/if}} diff --git a/view/tpl/webpagelist.tpl b/view/tpl/webpagelist.tpl index a3d42b0b4..2c79a496d 100644 --- a/view/tpl/webpagelist.tpl +++ b/view/tpl/webpagelist.tpl @@ -8,7 +8,7 @@
{{if $editor}} -
+
{{$editor}}
{{/if}}