private mail compositor changes

This commit is contained in:
Mario Vavti 2015-10-02 17:51:37 +02:00
parent 9b8aa8d09e
commit 5ba39fef9a
6 changed files with 74 additions and 97 deletions

View File

@ -226,10 +226,11 @@ function mail_content(&$a) {
// the ugly select box // the ugly select box
$select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10); //$select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10);
$tpl = get_markup_template('prv_message.tpl'); $tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$new' => true,
'$header' => t('Send Private Message'), '$header' => t('Send Private Message'),
'$to' => t('To:'), '$to' => t('To:'),
'$showinputs' => 'true', '$showinputs' => 'true',
@ -347,10 +348,6 @@ function mail_content(&$a) {
$recp = (($message['from_xchan'] === $channel['channel_hash']) ? 'to' : 'from'); $recp = (($message['from_xchan'] === $channel['channel_hash']) ? 'to' : 'from');
// FIXME - move this HTML to template
$select = $message[$recp]['xchan_name'] . '<input type="hidden" name="messageto" value="' . $message[$recp]['xchan_hash'] . '" />';
$parent = '<input type="hidden" name="replyto" value="' . $message['parent_mid'] . '" />';
$tpl = get_markup_template('mail_display.tpl'); $tpl = get_markup_template('mail_display.tpl');
$o = replace_macros($tpl, array( $o = replace_macros($tpl, array(
'$mailbox' => $mailbox, '$mailbox' => $mailbox,
@ -366,14 +363,15 @@ function mail_content(&$a) {
// reply // reply
'$header' => t('Send Reply'), '$header' => t('Send Reply'),
'$to' => t('To:'), '$to' => t('To:'),
'$showinputs' => '', '$reply' => true,
'$subject' => t('Subject:'), '$subject' => t('Subject:'),
'$subjtxt' => $message['title'], '$subjtxt' => $message['title'],
'$readonly' => 'readonly="readonly"', '$readonly' => 'readonly="readonly"',
'$yourmessage' => t('Your message:'), '$yourmessage' => sprintf(t('Your message for %s'), $message[$recp]['xchan_name']),
'$text' => '', '$text' => '',
'$select' => $select, '$select' => $select,
'$parent' => $parent, '$parent' => $message['parent_mid'],
'$recphash' => $message[$recp]['xchan_hash'],
'$upload' => t('Upload photo'), '$upload' => t('Upload photo'),
'$attach' => t('Attach file'), '$attach' => t('Attach file'),
'$insert' => t('Insert web link'), '$insert' => t('Insert web link'),

View File

@ -1,32 +1,3 @@
/* message/new */
#prvmail-to-label,
#prvmail-subject-label,
#prvmail-expires-label,
#prvmail-message-label {
margin-bottom: 10px;
margin-top: 20px;
}
#prvmail-submit {
float: left;
margin-top: 10px;
margin-right: 30px;
}
#prvmail-upload-wrapper,
#prvmail-attach-wrapper,
#prvmail-link-wrapper,
#prvmail-expire-wrapper,
#prvmail-encrypt-wrapper,
#prvmail-rotator-wrapper {
float: left;
margin-top: 10px;
cursor: pointer;
}
/* message/id */
.mail-conv-sender { .mail-conv-sender {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
@ -49,3 +20,7 @@
.mail-conv-body img { .mail-conv-body img {
max-width: 100%; max-width: 100%;
} }
#prvmail-rotator {
margin: 15px;
}

View File

@ -1722,6 +1722,7 @@ img.mail-conv-sender-photo {
} }
.wall-item-content, .wall-item-content,
.mail-conv-body,
.page-body { .page-body {
font-size: $font_size; font-size: $font_size;
clear: both; clear: both;

View File

@ -11,6 +11,7 @@
<div class="mail-conv-content"> <div class="mail-conv-content">
<div class="mail-conv-body"> <div class="mail-conv-body">
{{$mail.body}} {{$mail.body}}
<div class="clear"></div>
</div> </div>
<div class="pull-right dropdown"> <div class="pull-right dropdown">
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="mail-item-menu-{{$mail.id}}"> <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="mail-item-menu-{{$mail.id}}">

View File

@ -48,17 +48,6 @@ else
<script type="text/javascript" src="view/js/ajaxupload.js" ></script> <script type="text/javascript" src="view/js/ajaxupload.js" ></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var uploader = new window.AjaxUpload(
'prvmail-upload-wrapper',
{ action: 'wall_upload/{{$nickname}}',
name: 'userfile',
onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); },
onComplete: function(file,response) {
addmailtext(response);
$('#prvmail-rotator').spin(false);
}
}
);
var file_uploader = new window.AjaxUpload( var file_uploader = new window.AjaxUpload(
'prvmail-attach-wrapper', 'prvmail-attach-wrapper',

View File

@ -1,56 +1,69 @@
<h3>{{$header}}</h3> {{if $new}}
<div class="generic-content-wrapper">
<div id="prvmail-wrapper" > <div class="section-title-wrapper">
<form id="prvmail-form" action="mail" method="post" > <h2>{{$header}}</h2>
</div>
{{$parent}} <div class="section-content-wrapper">
<div id="prvmail-to-label">{{$to}}</div>
{{if $showinputs}}
<input class="form-control" type="text" id="recip" name="messagerecip" value="{{$prefill}}" maxlength="255" tabindex="10" />
<input type="hidden" id="recip-complete" name="messageto" value="{{$preid}}">
{{else}}
{{$select}}
{{/if}} {{/if}}
<div id="prvmail-wrapper" >
<form id="prvmail-form" action="mail" method="post" >
<input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" /> <input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" />
<input type="hidden" name="media_str" id="jot-media" value="" /> <input type="hidden" name="media_str" id="jot-media" value="" />
<div id="prvmail-subject-label">{{$subject}}</div> {{if $new}}
<input class="form-control" type="text" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" {{$readonly}} tabindex="11" /> <div class="form-group">
<label for="recip">{{$to}}</label>
<input class="form-control" type="text" id="recip" name="messagerecip" value="{{$prefill}}" maxlength="255" />
<input type="hidden" id="recip-complete" name="messageto" value="{{$preid}}">
</div>
<div class="form-group">
<label for="prvmail-subject">{{$subject}}</label>
<input class="form-control" type="text" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" />
</div>
{{/if}}
<div id="prvmail-message-label">{{$yourmessage}}</div> {{if $reply}}
<textarea class="prvmail-text form-control" id="prvmail-text" name="body" tabindex="12">{{$text}}</textarea> <input type="hidden" name="replyto" value="{{$parent}}" />
<input type="hidden" name="messageto" value="{{$recphash}}" />
<input type="hidden" name="subject" value="{{$subjtxt}}" />
{{/if}}
<div class="form-group">
<label for="prvmail-text">{{$yourmessage}}</label>
<textarea class="form-control" id="prvmail-text" name="body"">{{$text}}</textarea>
</div>
<div id="prvmail-submit-wrapper" > <div id="prvmail-submit-wrapper" class="form-group">
<input type="submit" id="prvmail-submit" name="submit" value="{{$submit}}" tabindex="13" /> <div id="prvmail-submit" class="pull-right">
<button id="prvmail-upload-wrapper" class="btn btn-default btn-sm" > <button class="btn btn-primary btn-sm" type="submit" id="prvmail-submit" name="submit" value="{{$submit}}">{{$submit}}</button>
<i id="prvmail-upload" class="icon-camera jot-icons" title="{{$upload}}"></i> </div>
</button> <div id="prvmail-tools" class="btn-group pull-left">
<button id="prvmail-attach-wrapper" class="btn btn-default btn-sm" >
<button id="prvmail-attach-wrapper" class="btn btn-default btn-sm" > <i id="prvmail-attach" class="icon-paper-clip jot-icons" title="{{$attach}}"></i>
<i id="prvmail-attach" class="icon-paper-clip jot-icons" title="{{$attach}}"></i> </button>
</button> <button id="prvmail-link-wrapper" class="btn btn-default btn-sm" onclick="prvmailJotGetLink(); return false;" >
<i id="prvmail-link" class="icon-link jot-icons" title="{{$insert}}" ></i>
<button id="prvmail-link-wrapper" class="btn btn-default btn-sm" onclick="prvmailJotGetLink(); return false;" > </button>
<i id="prvmail-link" class="icon-link jot-icons" title="{{$insert}}" ></i> {{if $feature_expire}}
</button> <button id="prvmail-expire-wrapper" class="btn btn-default btn-sm" onclick="prvmailGetExpiry();return false;" >
{{if $feature_expire}} <i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" ></i>
<button id="prvmail-expire-wrapper" class="btn btn-default btn-sm" onclick="prvmailGetExpiry();return false;" > </button>
<i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" ></i> {{/if}}
</button> {{if $feature_encrypt}}
{{/if}} <button id="prvmail-encrypt-wrapper" class="btn btn-default btn-sm" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;">
{{if $feature_encrypt}} <i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" ></i>
<button id="prvmail-encrypt-wrapper" class="btn btn-default btn-sm" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;"> </button>
<i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" ></i> {{/if}}
</button> </div>
{{/if}} <div id="prvmail-rotator-wrapper" class="pull-left">
<div id="prvmail-rotator-wrapper" > <div id="prvmail-rotator"></div>
<div id="prvmail-rotator"></div> </div>
</div> <div class="clear"></div>
</div> </div>
<div id="prvmail-end" class="clear"></div> </form>
</form> </div>
{{if $new}}
</div>
</div> </div>
{{/if}}