Merge pull request #9125 from MrPetovan/bug/8999-fix-new-pm
Fix new private message recipient input
This commit is contained in:
commit
560746eb3b
11 changed files with 106 additions and 197 deletions
|
@ -155,7 +155,7 @@
|
|||
acl.initialize();
|
||||
|
||||
let suggestionTemplate = function (item) {
|
||||
return '<div><img src="' + item.micro + '" alt="" style="float: left; width: auto; height: 2.8em; margin-right: 0.5em;"> <strong>' + item.name + '</strong><br /><em>' + item.addr + '</em></div>';
|
||||
return '<div><img src="' + item.micro + '" alt="" style="float: left; width: auto; height: 2.8em; margin-right: 0.5em;"><p style="margin-left: 3.3em;"><strong>' + item.name + '</strong><br /><em>' + item.addr + '</em></p></div>';
|
||||
};
|
||||
|
||||
$acl_allow_input.tagsinput({
|
54
view/templates/acl/message_recipient.tpl
Normal file
54
view/templates/acl/message_recipient.tpl
Normal file
|
@ -0,0 +1,54 @@
|
|||
<select name="recipient" class="form-control input-lg" id="recipient">
|
||||
{{foreach $contacts as $contact}}
|
||||
<option value="{{$contact.id}}"{{if $contact.id == $selected}} selected{{/if}}>{{$contact.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
let $recipient_input = $('[name="recipient"]');
|
||||
|
||||
let acl = new Bloodhound({
|
||||
local: {{$contacts|@json_encode nofilter}},
|
||||
identify: function(obj) { return obj.id.toString(); },
|
||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']),
|
||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||
sorter: function (itemA, itemB) {
|
||||
if (itemA.name === itemB.name) {
|
||||
return 0;
|
||||
} else if (itemA.name > itemB.name) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
});
|
||||
acl.initialize();
|
||||
|
||||
let suggestionTemplate = function (item) {
|
||||
return '<div><img src="' + item.micro + '" alt="" style="float: left; width: auto; height: 2.8em; margin-right: 0.5em;"><p style="margin-left: 3.3em;"><strong>' + item.name + '</strong><br /><em>' + item.addr + '</em></p></div>';
|
||||
};
|
||||
|
||||
$recipient_input.tagsinput({
|
||||
confirmKeys: [13, 44],
|
||||
freeInput: false,
|
||||
tagClass: 'label label-info',
|
||||
itemValue: function (item) { return item.id.toString(); },
|
||||
itemText: 'name',
|
||||
itemThumb: 'micro',
|
||||
itemTitle: function(item) {
|
||||
return item.addr;
|
||||
},
|
||||
typeaheadjs: {
|
||||
name: 'contacts',
|
||||
displayKey: 'name',
|
||||
templates: {
|
||||
suggestion: suggestionTemplate
|
||||
},
|
||||
source: acl.ttAdapter()
|
||||
}
|
||||
});
|
||||
|
||||
// Import existing ACL into the tags input fields.
|
||||
$recipient_input.tagsinput('add', acl.get({{$selected}})[0]);
|
||||
});
|
||||
</script>
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#recip").name_autocomplete(baseurl + '/search/acl', 'm', false, function(data) {
|
||||
$("#recip-complete").val(data.id);
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -3228,9 +3228,6 @@ div.jGrowl div.info {
|
|||
width:100px;
|
||||
}
|
||||
|
||||
#recip {
|
||||
|
||||
}
|
||||
.autocomplete-w1 { background: #ffffff no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; }
|
||||
.autocomplete { color:#000; border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px; _margin:0; _overflow-x:hidden; }
|
||||
.autocomplete .selected { background:#F0F0F0; }
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
|
||||
|
||||
<h3>{{$header}}</h3>
|
||||
|
||||
<div id="prvmail-wrapper" >
|
||||
<form id="prvmail-form" action="message" method="post" >
|
||||
|
||||
{{$parent nofilter}}
|
||||
|
||||
<div id="prvmail-to-label">{{$to}}</div>
|
||||
|
||||
{{if $showinputs}}
|
||||
<input type="text" id="recip" name="messagerecip" value="{{$prefill}}" maxlength="255" size="64" tabindex="10" />
|
||||
<input type="hidden" id="recip-complete" name="messageto" value="{{$preid}}">
|
||||
{{else}}
|
||||
{{$select nofilter}}
|
||||
{{/if}}
|
||||
|
||||
<div id="prvmail-subject-label">{{$subject}}</div>
|
||||
<input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" {{$readonly}} tabindex="11" />
|
||||
|
||||
<div id="prvmail-message-label">{{$yourmessage}}</div>
|
||||
<textarea rows="8" cols="72" class="prvmail-text" id="prvmail-text" name="body" tabindex="12">{{$text}}</textarea>
|
||||
|
||||
|
||||
<div id="prvmail-submit-wrapper" >
|
||||
<input type="submit" id="prvmail-submit" name="submit" value="{{$submit}}" tabindex="13" />
|
||||
<div id="prvmail-upload-wrapper" >
|
||||
<div id="prvmail-upload" class="icon border camera" title="{{$upload}}" ></div>
|
||||
</div>
|
||||
<div id="prvmail-link-wrapper" >
|
||||
<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();" ></div>
|
||||
</div>
|
||||
<div id="prvmail-rotator-wrapper" >
|
||||
<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="prvmail-end"></div>
|
||||
</form>
|
||||
</div>
|
|
@ -2,21 +2,12 @@
|
|||
<div id="prvmail-wrapper">
|
||||
<form id="prvmail-form" action="message" method="post" >
|
||||
|
||||
{{* Disable the header. We will see if we will need it
|
||||
<h3>{{$header}}</h3>
|
||||
*}}
|
||||
|
||||
{{$parent nofilter}}
|
||||
|
||||
{{* The To: form-group which contains the message recipient *}}
|
||||
<div id="prvmail-to-label" class="form-group">
|
||||
<label for="recip">{{$to}}</label><br>
|
||||
{{if $showinputs}}
|
||||
<input type="text" id="recip" class="form-control" name="messagerecip" value="{{$prefill}}" tabindex="10" {{if $prefill}}disabled{{else}}aria-required="true"{{/if}} />
|
||||
<input type="hidden" id="recip-complete" name="messageto" value="{{$preid}}">
|
||||
{{else}}
|
||||
<label for="recipient">{{$to}}</label><br>
|
||||
{{$select nofilter}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{* The subject input field *}}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<h3>{{$header}}</h3>
|
||||
|
||||
<div id="prvmail-wrapper" >
|
||||
<form id="prvmail-form" action="message" method="post" >
|
||||
|
||||
{{$parent nofilter}}
|
||||
|
||||
<div id="prvmail-to-label">{{$to}}</div>
|
||||
{{if $showinputs}}
|
||||
<input type="text" id="recip" name="messagerecip" value="{{$prefill}}" maxlength="255" size="64" tabindex="10" />
|
||||
<input type="hidden" id="recip-complete" name="messageto" value="{{$preid}}">
|
||||
{{else}}
|
||||
{{$select nofilter}}
|
||||
{{/if}}
|
||||
|
||||
<div id="prvmail-subject-label">{{$subject}}</div>
|
||||
<input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" {{$readonly}} tabindex="11" />
|
||||
|
||||
<div id="prvmail-message-label">{{$yourmessage}}</div>
|
||||
<textarea rows="20" cols="72" class="prvmail-text" id="prvmail-text" name="body" tabindex="12">{{$text}}</textarea>
|
||||
|
||||
|
||||
<div id="prvmail-submit-wrapper" >
|
||||
<input type="submit" id="prvmail-submit" name="submit" value="{{$submit}}" tabindex="13" />
|
||||
<div id="prvmail-upload-wrapper" >
|
||||
<div id="prvmail-upload" class="icon border camera" title="{{$upload}}" ></div>
|
||||
</div>
|
||||
<div id="prvmail-link-wrapper" >
|
||||
<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();" ></div>
|
||||
</div>
|
||||
<div id="prvmail-rotator-wrapper" >
|
||||
<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="prvmail-end"></div>
|
||||
</form>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue