1
0
Fork 0

Merge pull request #8530 from MrPetovan/task/8498-move-poke-to-src

Move poke module to src/
This commit is contained in:
Michael Vogel 2020-04-21 05:56:59 +02:00 committed by GitHub
commit ee098277b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 212 additions and 273 deletions

View file

@ -406,22 +406,6 @@ a {
.selected-identity img {
border: 2px solid #ff0000;
}
/* poke */
#poke-desc {
margin: 5px 0 10px;
}
#poke-wrapper {
padding: 10px 0 0px;
}
#poke-recipient, #poke-action, #poke-privacy-settings {
margin: 10px 0 30px;
}
#poke-recip-label, #poke-action-label, #prvmail-message-label {
margin: 10px 0 10px;
}
.version-match {
font-weight: bold;
color: #00a700;

View file

@ -0,0 +1,11 @@
<h2 class="heading">{{$title}}</h2>
<p>{{$desc nofilter}}</p>
<form id="poke-wrapper" action="contact/{{$id}}/poke" method="post">
{{include file="field_select.tpl" field=$verb}}
{{include file="field_checkbox.tpl" field=$private}}
<p class="text-right">
<button type="submit" class="btn btn-primary" name="submit" value="{{$submit}}" data-loading-text="{{$loading}}">{{$submit}}</button>
</p>
</form>

View file

@ -1,35 +0,0 @@
<h3>{{$title}}</h3>
<div id="poke-desc">{{$desc nofilter}}</div>
<div id="poke-wrapper">
<form action="poke" method="get">
<div id="poke-recipient">
<div id="poke-recip-label">{{$clabel}}</div>
<input id="poke-recip" type="text" size="64" maxlength="255" value="{{$name}}" name="pokename" autocomplete="off" />
<input id="poke-recip-complete" type="hidden" value="{{$id}}" name="cid" />
<input id="poke-parent" type="hidden" value="{{$parent}}" name="parent" />
</div>
<div id="poke-action">
<div id="poke-action-label">{{$choice}}</div>
<select name="verb" id="poke-verb-select" >
{{foreach $verbs as $v}}
<option value="{{$v.0}}">{{$v.1}}</option>
{{/foreach}}
</select>
</div>
<div id="poke-privacy-settings">
<div id="poke-private-desc">{{$prv_desc}}</div>
<input type="checkbox" name="private" {{if $parent}}disabled="disabled"{{/if}} value="1" />
</div>
<input type="submit" name="submit" value="{{$submit}}" />
</form>
</div>

View file

@ -1,8 +0,0 @@
<script>
$(document).ready(function() {
$("#poke-recip").name_autocomplete(baseurl + '/search/acl', 'a', true, function(data) {
$("#poke-recip-complete").val(data.id);
});
});
</script>

View file

@ -2273,7 +2273,7 @@ ul.dropdown-menu li:hover {
* PAGES
*********/
.generic-page-wrapper, .videos-content-wrapper,
.generic-page-wrapper, .contact-content-wrapper, .videos-content-wrapper,
.suggest-content-wrapper, .common-content-wrapper, .help-content-wrapper,
.allfriends-content-wrapper, .match-content-wrapper, .dirfind-content-wrapper,
.delegation-content-wrapper, .notes-content-wrapper,
@ -2609,14 +2609,6 @@ ul li:hover .contact-wrapper .contact-action-link:hover {
.photo-album-actions .photos-order-link {
float: right;
}
/* poke */
#poke-desc {
margin: 5px 0 30px;
}
#poke-wrapper-end {
clear: both;
}
/* Events page */
.fc .fc-month-view .fc-content .fc-title .item-desc:hover {

View file

@ -89,7 +89,7 @@ $(document).ready(function(){
let $body = $('body');
// show bulk deletion button at network page if checkbox is checked
$("body").change("input.item-select", function(){
$body.change("input.item-select", function(){
var checked = false;
// We need to get all checked items, so it would close the delete button
@ -230,7 +230,7 @@ $(document).ready(function(){
// Dropdown menus with the class "dropdown-head" will display the active tab
// as button text
$("body").on('click', '.dropdown-head .dropdown-menu li a, .dropdown-head .dropdown-menu li button', function(){
$body.on('click', '.dropdown-head .dropdown-menu li a, .dropdown-head .dropdown-menu li button', function(){
toggleDropdownText(this);
});
@ -264,7 +264,7 @@ $(document).ready(function(){
// to the input element where the padding value would be at least the width
// of the button. Otherwise long user input would be invisible because it is
// behind the button.
$("body").on('click', '.form-group-search > input', function() {
$body.on('click', '.form-group-search > input', function() {
// Get the width of the button (if the button isn't available
// buttonWidth will be null
var buttonWidth = $(this).next('.form-button-search').outerWidth();
@ -351,14 +351,14 @@ $(document).ready(function(){
*/
$("aside")
.on("shown.bs.offcanvas", function() {
$("body").addClass("aside-out");
$body.addClass("aside-out");
})
.on("hidden.bs.offcanvas", function() {
$("body").removeClass("aside-out");
$body.removeClass("aside-out");
});
// Event listener for 'Show & hide event map' button in the network stream.
$("body").on("click", ".event-map-btn", function() {
$body.on("click", ".event-map-btn", function() {
showHideEventMap(this);
});
@ -400,6 +400,27 @@ $(document).ready(function(){
.always(function() {
$commentSubmit.button('reset');
});
});
$body.on('submit', '.modal-body #poke-wrapper', function(e) {
e.preventDefault();
let $form = $(this);
let $pokeSubmit = $form.find('button[type=submit]').button('loading');
$.post(
$form.attr('action'),
$form.serialize(),
'json'
)
.then(function(data) {
if (data.success) {
$('#modal').modal('hide');
}
})
.always(function() {
$pokeSubmit.button('reset');
});
})
});

View file

@ -117,7 +117,7 @@ function frio_item_photo_links(App $a, &$body_info)
function frio_item_photo_menu(App $a, &$arr)
{
foreach ($arr['menu'] as $k => $v) {
if (strpos($v, 'poke?c=') === 0 || strpos($v, 'message/new/') === 0) {
if (strpos($v, '/poke') === 0 || strpos($v, 'message/new/') === 0) {
$v = 'javascript:addToModal(\'' . $v . '\'); return false;';
$arr['menu'][$k] = $v;
}
@ -171,7 +171,7 @@ function frio_contact_photo_menu(App $a, &$args)
// Add to pm and poke links a new key with the value 'modal'.
// Later we can make conditions in the corresponing templates (e.g.
// contact_template.tpl)
if (strpos($pokelink, 'poke?c=' . $cid) !== false) {
if (strpos($pokelink, $cid . '/poke') !== false) {
$args['menu']['poke'][3] = 'modal';
}