provide a separate input field for rpost attachments

This commit is contained in:
Mario Vavti 2015-04-16 23:26:11 +02:00
parent 90d3a6c02d
commit 9addc4581e
8 changed files with 26 additions and 10 deletions

View File

@ -1208,6 +1208,7 @@ function status_editor($a, $x, $popup = false) {
'$shortpermset' => t('permissions'), '$shortpermset' => t('permissions'),
'$ptyp' => (($notes_cid) ? 'note' : 'wall'), '$ptyp' => (($notes_cid) ? 'note' : 'wall'),
'$content' => ((x($x,'body')) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8') : ''), '$content' => ((x($x,'body')) ? htmlspecialchars($x['body'], ENT_COMPAT,'UTF-8') : ''),
'$attachment' => ((x($x, 'attachment')) ? $x['attachment'] : ''),
'$post_id' => '', '$post_id' => '',
'$baseurl' => $a->get_baseurl(true), '$baseurl' => $a->get_baseurl(true),
'$defloc' => $x['default_location'], '$defloc' => $x['default_location'],

View File

@ -22,7 +22,6 @@ require_once('include/attach.php');
function item_post(&$a) { function item_post(&$a) {
// This will change. Figure out who the observer is and whether or not // This will change. Figure out who the observer is and whether or not
// they have permission to post here. Else ignore the post. // they have permission to post here. Else ignore the post.
@ -399,6 +398,7 @@ function item_post(&$a) {
$verb = notags(trim($_REQUEST['verb'])); $verb = notags(trim($_REQUEST['verb']));
$title = escape_tags(trim($_REQUEST['title'])); $title = escape_tags(trim($_REQUEST['title']));
$body = trim($_REQUEST['body']); $body = trim($_REQUEST['body']);
$body .= trim($_REQUEST['attachment']);
$postopts = ''; $postopts = '';
$private = ( $private = (

View File

@ -124,6 +124,7 @@ function rpost_content(&$a) {
'profile_uid' => local_channel(), 'profile_uid' => local_channel(),
'title' => $_REQUEST['title'], 'title' => $_REQUEST['title'],
'body' => $_REQUEST['body'], 'body' => $_REQUEST['body'],
'attachment' => $_REQUEST['attachment'],
'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''), 'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''),
'return_path' => 'rpost/return' 'return_path' => 'rpost/return'
); );

View File

@ -25,12 +25,17 @@ code {
margin-bottom: 5px; margin-bottom: 5px;
} }
#profile-jot-text { .profile-jot-text {
height: 39px; height: 39px;
padding: 8px; padding: 8px;
width: 100%; width: 100%;
} }
.jot-attachment {
padding: 8px;
width: 100%;
}
#profile-jot-text-loading { #profile-jot-text-loading {
float: left; float: left;
padding: 30px 0px 0px 12px; padding: 30px 0px 0px 12px;

View File

@ -7,12 +7,12 @@
{{if $isadir}}{{include file="field_checkbox.tpl" field=$recurse}}{{/if}} {{if $isadir}}{{include file="field_checkbox.tpl" field=$recurse}}{{/if}}
<div id="attach-edit-tools-share" class="btn-group form-group"> <div id="attach-edit-tools-share" class="btn-group form-group">
{{if !$isadir}} {{if !$isadir}}
<a href="/rpost?body=[attachment]{{$file.hash}},{{$file.revision}}[/attachment]" id="attach-btn" class="btn btn-default btn-xs" title="{{$attach_btn_title}}"> <a href="/rpost?attachment=[attachment]{{$file.hash}},{{$file.revision}}[/attachment]" id="attach-btn" class="btn btn-default btn-xs" title="{{$attach_btn_title}}">
<i class="icon-paperclip jot-icons"></i> <i class="icon-share jot-icons"></i>
</a> </a>
{{/if}} {{/if}}
<button id="link-btn" class="btn btn-default btn-xs" type="button" onclick="openClose('link-code');" title="{{$link_btn_title}}"> <button id="link-btn" class="btn btn-default btn-xs" type="button" onclick="openClose('link-code');" title="{{$link_btn_title}}">
<i class="icon-share jot-icons"></i> <i class="icon-link jot-icons"></i>
</button> </button>
</div> </div>
<div id="attach-edit-perms" class="btn-group pull-right"> <div id="attach-edit-perms" class="btn-group pull-right">

View File

@ -107,6 +107,9 @@ function enableOnUser(){
/* enable tinymce on focus and click */ /* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser); $("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser); $("#profile-jot-text").click(enableOnUser);
if($("#jot-attachment").val()) enableOnUser();
var upload_title = $('#wall-image-upload').attr('title'); var upload_title = $('#wall-image-upload').attr('title');
var attach_title = $('#wall-file-upload').attr('title'); var attach_title = $('#wall-file-upload').attr('title');
try { try {

View File

@ -10,7 +10,8 @@
<input type="hidden" name="coord" id="jot-coord" value="" /> <input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="post_id" value="{{$post_id}}" /> <input type="hidden" name="post_id" value="{{$post_id}}" />
<input type="hidden" name="webpage" value="{{$webpage}}" /> <input type="hidden" name="webpage" value="{{$webpage}}" />
<input type="hidden" name="preview" id="jot-preview" value="0" /> <input type="hidden" id="jot-consensus" name="consensus" value="{{if $consensus}}{{$consensus}}{{else}}0{{/if}}" /> <input type="hidden" name="preview" id="jot-preview" value="0" />
<input type="hidden" id="jot-consensus" name="consensus" value="{{if $consensus}}{{$consensus}}{{else}}0{{/if}}" />
{{if $showacl}}{{$acl}}{{/if}} {{if $showacl}}{{$acl}}{{/if}}
{{$mimeselect}} {{$mimeselect}}
{{$layoutselect}} {{$layoutselect}}
@ -20,21 +21,26 @@
</div> </div>
{{/if}} {{/if}}
{{if $webpage}} {{if $webpage}}
<div id="jot-pagetitle-wrap" class="jothidden" style="display:none"> <div id="jot-pagetitle-wrap" class="jothidden">
<input name="pagetitle" id="jot-pagetitle" type="text" placeholder="{{$placeholdpagetitle}}" value="{{$pagetitle}}"> <input name="pagetitle" id="jot-pagetitle" type="text" placeholder="{{$placeholdpagetitle}}" value="{{$pagetitle}}">
</div> </div>
{{/if}} {{/if}}
<div id="jot-title-wrap" class="jothidden" style="display:none"> <div id="jot-title-wrap" class="jothidden">
<input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" tabindex=1 value="{{$title}}"> <input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" tabindex=1 value="{{$title}}">
</div> </div>
{{if $catsenabled}} {{if $catsenabled}}
<div id="jot-category-wrap" class="jothidden" style="display:none"> <div id="jot-category-wrap" class="jothidden">
<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" data-role="cat-tagsinput"> <input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" data-role="cat-tagsinput">
</div> </div>
{{/if}} {{/if}}
<div id="jot-text-wrap"> <div id="jot-text-wrap">
<textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex=2 placeholder="{{$share}}">{{$content}}</textarea> <textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex=2 placeholder="{{$share}}">{{$content}}</textarea>
</div> </div>
{{if $attachment}}
<div id="jot-attachment-wrap">
<input class="jot-attachment" name="attachment" id="jot-attachment" type="text" value="{{$attachment}}" readonly="readonly" onclick="this.select();">
</div>
{{/if}}
<div id="profile-jot-submit-wrapper" class="jothidden"> <div id="profile-jot-submit-wrapper" class="jothidden">
<div id="profile-jot-submit-left" class="btn-toolbar pull-left"> <div id="profile-jot-submit-left" class="btn-toolbar pull-left">
<div class="btn-group"> <div class="btn-group">

View File

@ -41,7 +41,7 @@
{{if $edit}}<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>{{/if}} {{if $edit}}<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>{{/if}}
</td> </td>
<td class="webpage-list-tool"> <td class="webpage-list-tool">
{{if $item.bb_element}}<a href="rpost?body={{$item.bb_element}}" title="{{$share}}"><i class="icon-share"></i></a>{{/if}} {{if $item.bb_element}}<a href="rpost?attachment={{$item.bb_element}}" title="{{$share}}"><i class="icon-share"></i></a>{{/if}}
</td> </td>
<td class="webpage-list-tool"> <td class="webpage-list-tool">
{{if $edit}}<a href="#" title="{{$delete}}" onclick="dropItem('item/drop/{{$item.url}}', '#webpage-list-item-{{$item.url}}'); return false;"><i class="icon-trash drop-icons"></i></a>{{/if}} {{if $edit}}<a href="#" title="{{$delete}}" onclick="dropItem('item/drop/{{$item.url}}', '#webpage-list-item-{{$item.url}}'); return false;"><i class="icon-trash drop-icons"></i></a>{{/if}}