This commit is contained in:
friendica 2015-04-16 15:41:43 -07:00
commit 507d04a987
13 changed files with 64 additions and 40 deletions

View File

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

View File

@ -221,21 +221,6 @@ 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 .= '<br /><br /><a class="page-delete-link" href="item/drop/' . $itm[0]['id'] . '" >' . t('Delete Webpage') . '</a><br />';
$x = array(
'type' => 'webpage',
'title' => $itm[0]['title'],
'body' => $itm[0]['body'],
'term' => $itm[0]['term'],
'created' => $itm[0]['created'],
'edited' => $itm[0]['edited'],
'mimetype' => $itm[0]['mimetype'],
'pagetitle' => $page_title,
'mid' => $itm[0]['mid']
);
$o .= EOL . EOL . t('Share') . EOL . '<textarea onclick="this.select();" class="shareable_element_text" >[element]' . base64url_encode(json_encode($x)) . '[/element]</textarea>' . EOL . EOL;
return $o;
}

View File

@ -154,7 +154,7 @@ function filestorage_content(&$a) {
'$cpdesc' => t('Copy/paste this code to attach file to a post'),
'$cpldesc' => t('Copy/paste this URL to link file from a web page'),
'$submit' => t('Submit'),
'$attach_btn_title' => t('Attach this file to a new post'),
'$attach_btn_title' => t('Share this file'),
'$link_btn_title' => t('Show URL to this file'),
'$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes')))
));

View File

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

View File

@ -94,6 +94,13 @@ function rpost_content(&$a) {
$channel = $a->get_channel();
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post')
));
@ -111,12 +118,13 @@ function rpost_content(&$a) {
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel),
'acl' => populate_acl($channel_acl),
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
'title' => $_REQUEST['title'],
'body' => $_REQUEST['body'],
'attachment' => $_REQUEST['attachment'],
'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''),
'return_path' => 'rpost/return'
);

View File

@ -124,7 +124,7 @@ function webpages_content(&$a) {
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$editor .= status_editor($a,$x);
$editor = status_editor($a,$x);
// Get a list of webpages. We can't display all them because endless scroll makes that unusable,
// so just list titles and an edit link.
@ -141,12 +141,24 @@ function webpages_content(&$a) {
$pages = array();
foreach($r as $rr) {
unobscure($rr);
$element_arr = array(
'type' => 'webpage',
'title' => $rr['title'],
'body' => $rr['body'],
'term' => $rr['term'],
'created' => $rr['created'],
'edited' => $rr['edited'],
'mimetype' => $rr['mimetype'],
'pagetitle' => $rr['sid'],
'mid' => $rr['mid']
);
$pages[$rr['iid']][] = array(
'url' => $rr['iid'],
'pagetitle' => $rr['sid'],
'title' => $rr['title'],
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited'])
'url' => $rr['iid'],
'pagetitle' => $rr['sid'],
'title' => $rr['title'],
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']),
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
);
}
}
@ -158,8 +170,9 @@ function webpages_content(&$a) {
$o .= replace_macros(get_markup_template('webpagelist.tpl'), array(
'$listtitle' => t('Webpages'),
'$baseurl' => $url,
'$create' => t('Create'),
'$create' => t('Create'),
'$edit' => t('Edit'),
'$share' => t('Share'),
'$delete' => t('Delete'),
'$pages' => $pages,
'$channel' => $which,

View File

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

View File

@ -15,14 +15,14 @@
padding: 7px 3px 7px 10px;
}
#webpage-list-table th:nth-child(5),
#webpage-list-table td:nth-child(5){
#webpage-list-table th:nth-child(6),
#webpage-list-table td:nth-child(6){
padding: 7px 3px;
white-space: nowrap;
}
#webpage-list-table th:nth-child(6),
#webpage-list-table td:nth-child(6){
#webpage-list-table th:nth-child(7),
#webpage-list-table td:nth-child(7){
padding: 7px 10px 7px 7px;
white-space: nowrap;
}

View File

@ -1922,15 +1922,14 @@ nav .dropdown-menu {
}
[id^="cloud-index-"]:hover td,
.cloud-index-active, {
.cloud-index-active {
background-color: $item_colour;
}
[id^="webpage-list-item"]:hover td {
[id^="webpage-list-item-"]:hover td {
background-color: $item_colour;
}
nav ul li .undefined,
nav ul li .notify-seen,
nav ul li .notify-unseen

View File

@ -7,12 +7,12 @@
{{if $isadir}}{{include file="field_checkbox.tpl" field=$recurse}}{{/if}}
<div id="attach-edit-tools-share" class="btn-group form-group">
{{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}}">
<i class="icon-paperclip jot-icons"></i>
<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-share jot-icons"></i>
</a>
{{/if}}
<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>
</div>
<div id="attach-edit-perms" class="btn-group pull-right">

View File

@ -107,6 +107,9 @@ function enableOnUser(){
/* enable tinymce on focus and click */
$("#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 {

View File

@ -10,7 +10,8 @@
<input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="post_id" value="{{$post_id}}" />
<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}}
{{$mimeselect}}
{{$layoutselect}}
@ -20,21 +21,26 @@
</div>
{{/if}}
{{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}}">
</div>
{{/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}}">
</div>
{{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">
</div>
{{/if}}
<div id="jot-text-wrap">
<textarea class="profile-jot-text" id="profile-jot-text" name="body" tabindex=2 placeholder="{{$share}}">{{$content}}</textarea>
</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-left" class="btn-toolbar pull-left">
<div class="btn-group">

View File

@ -20,6 +20,7 @@
<th width="95%">{{$title_txt}}</th>
<th width="1%"></th>
<th width="1%"></th>
<th width="1%"></th>
<th width="1%" class="hidden-xs">{{$created_txt}}</th>
<th width="1%" class="hidden-xs">{{$edited_txt}}</th>
</tr>
@ -40,6 +41,9 @@
{{if $edit}}<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>{{/if}}
</td>
<td class="webpage-list-tool">
{{if $item.bb_element}}<a href="rpost?attachment={{$item.bb_element}}" title="{{$share}}"><i class="icon-share"></i></a>{{/if}}
</td>
<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}}
</td>
<td class="hidden-xs">