Skip to content

Commit fb95072

Browse files
authored
Merge pull request #98 from bkraul/develop-1.3.x
Image picker and minimal corrections.
2 parents 505b5ac + 5ce2ed8 commit fb95072

File tree

10 files changed

+377
-156
lines changed

10 files changed

+377
-156
lines changed

BBCodePlus/BBCodePlus.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function register() {
2121
$this->name = plugin_lang_get( 'title' );
2222
$this->description = plugin_lang_get( 'description' );
2323
$this->page = 'config';
24-
$this->version = '1.3.15';
24+
$this->version = '1.3.17';
2525

2626
$this->requires['MantisCore'] = '1.3.0';
2727
# this plugin can coexist with MantisCoreFormatting.
@@ -42,6 +42,7 @@ function hooks() {
4242
$hooks = parent::hooks();
4343

4444
# add in our plugin's hooks.
45+
$hooks['EVENT_LAYOUT_CONTENT_BEGIN'] = 'content_begin';
4546
$hooks['EVENT_LAYOUT_RESOURCES'] = 'resources';
4647
$hooks['EVENT_LAYOUT_PAGE_FOOTER'] = 'footer';
4748
$hooks['EVENT_CORE_HEADERS'] = 'csp_headers';
@@ -69,6 +70,25 @@ function init() {
6970
}
7071
}
7172
//-------------------------------------------------------------------
73+
/**
74+
* Event fired on content begin (at top of page). Useful for notices.
75+
*
76+
* @return void
77+
*/
78+
function content_begin() {
79+
# add image picker modal.
80+
$output = '<div id="bbcodeplus-image-picker" class="bbcodeplus modal">';
81+
$output .= '<div class="bbcodeplus modal-content table-container">';
82+
$output .= '<table>';
83+
$output .= '<tr><th class="category">Images attached to issue</th><th class="category" width="1" ><a href="#" id="bbcodeplus-image-picker-close" class="bbcodeplus modal-close">&times;</a></th></tr>';
84+
$output .= '</table>';
85+
$output .= '<div id="bbcodeplus-image-picker-body" class="bbcodeplus modal-body"></div>';
86+
$output .= '</div>';
87+
$output .= '</div>';
88+
89+
return $output;
90+
}
91+
//-------------------------------------------------------------------
7292
/**
7393
* Event fired on printing page footer.
7494
*

BBCodePlus/files/bbcodeplus.css

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,95 @@
3333
border-radius: 4px;
3434
margin: 0px !important;
3535
}
36+
37+
.bbcodeplus.modal {
38+
display: none;
39+
position: fixed;
40+
z-index: 1030;
41+
padding-top: 100px;
42+
left: 0;
43+
top: 0;
44+
width: 100%;
45+
height: 100%;
46+
overflow: auto;
47+
background-color: rgb(0,0,0);
48+
background-color: rgba(0,0,0,0.4);
49+
}
50+
51+
.bbcodeplus.modal-close {
52+
color: black;
53+
}
54+
55+
.bbcodeplus.modal-close:hover,
56+
.bbcodeplus.modal-close:focus {
57+
color: red;
58+
text-decoration: none;
59+
cursor: pointer;
60+
}
61+
62+
.bbcodeplus.modal-content {
63+
position: relative;
64+
background-color: #fefefe;
65+
margin: auto;
66+
padding: 0;
67+
padding-bottom: 10px;
68+
border: 1px solid #888;
69+
width: 50%;
70+
max-height: 50%;
71+
overflow: hidden;
72+
z-index: 1031;
73+
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
74+
animation-name: animatetop;
75+
animation-duration: 0.4s
76+
}
77+
78+
.bbcodeplus.modal-body {
79+
padding: 10px;
80+
}
81+
82+
.bbcodeplus.image-picker {
83+
margin: 1em 0;
84+
padding: 0;
85+
list-style: none;
86+
display: grid;
87+
grid: auto-flow / repeat(auto-fill, minmax(110px, 1fr));
88+
align-items: baseline;
89+
grid-gap: 10px;
90+
gap: 10px;
91+
}
92+
93+
.bbcodeplus.image-picker li {
94+
width: 100px;
95+
height: 100px;
96+
min-height: 100px;
97+
display: -moz-inline-stack;
98+
display: inline-block;
99+
vertical-align: middle;
100+
margin: 5px;
101+
zoom: 1;
102+
*display: inline;
103+
}
104+
105+
.bbcodeplus.image-picker li img {
106+
width: 100%;
107+
padding: 5px;
108+
border: 1px solid rgba(221,221,221,1);
109+
border-radius: 5px;
110+
max-width: 100%;
111+
}
112+
113+
.bbcodeplus.image-picker li img:hover {
114+
filter: brightness(80%);
115+
background-color: rgba(221,221,221,1);
116+
}
117+
118+
/* Add Animation */
119+
@-webkit-keyframes animatetop {
120+
from {top:-300px; opacity:0}
121+
to {top:0; opacity:1}
122+
}
123+
124+
@keyframes animatetop {
125+
from {top:-300px; opacity:0}
126+
to {top:0; opacity:1}
127+
}
Loading

0 commit comments

Comments
 (0)