]> git.mxchange.org Git - friendica.git/blob - view/theme/frio/js/mod_photos.js
Merge pull request #10116 from mexon/mat/addon-console-command
[friendica.git] / view / theme / frio / js / mod_photos.js
1 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
2
3 $(document).ready(function () {
4         $("#contact_allow, #contact_deny, #group_allow, #group_deny")
5                 .change(function () {
6                         var selstr;
7                         $(
8                                 "#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected",
9                         ).each(function () {
10                                 selstr = $(this).html();
11                                 $("#jot-perms-icon").removeClass("unlock").addClass("lock");
12                                 $("#jot-public").hide();
13                         });
14                         if (selstr == null) {
15                                 $("#jot-perms-icon").removeClass("lock").addClass("unlock");
16                                 $("#jot-public").show();
17                         }
18                 })
19                 .trigger("change");
20
21         // Click event listener for the album edit link/button.
22         $("body").on("click", "#album-edit-link", function () {
23                 var modalUrl = $(this).attr("data-modal-url");
24
25                 if (typeof modalUrl !== "undefined") {
26                         addToModal(modalUrl, "photo-album-edit-wrapper");
27                 }
28         });
29
30         // Click event listener for the album drop link/button.
31         $("body").on("click", "#album-drop-link", function () {
32                 var modalUrl = $(this).attr("data-modal-url");
33
34                 if (typeof modalUrl !== "undefined") {
35                         addToModal(modalUrl);
36                 }
37         });
38 });
39
40 $(window).load(function () {
41         // Get picture dimensions
42         var pheight = $("#photo-photo img").height();
43         var pwidth = $("#photo-photo img").width();
44
45         // Append the diminsons of the picture to the css of the photo-photo div
46         // we do this to make it possible to have overlay navigation buttons for the photo
47         $("#photo-photo").css({
48                 width: pwidth,
49                 height: pheight,
50         });
51 });
52 // @license-end