Version Description
- Add text to show scoping of custom CSS.
Download this release
Release Info
Developer | rpetersen29 |
Plugin | Simple Banner |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.1.0
- readme.txt +8 -2
- simple-banner.css +11 -8
- simple-banner.js +3 -3
- simple-banner.php +125 -115
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: cta, banner, banners, announcement, announcements, notification, bar, bars, free, hello bar, hellobar
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.9.4
|
7 |
-
Stable tag: 1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -45,6 +45,9 @@ Yes.
|
|
45 |
|
46 |
== Changelog ==
|
47 |
|
|
|
|
|
|
|
48 |
= 1.0.5 =
|
49 |
* Tested on recent Wordpress versions
|
50 |
|
@@ -65,8 +68,11 @@ Yes.
|
|
65 |
|
66 |
== Upgrade Notice ==
|
67 |
|
|
|
|
|
|
|
68 |
= 1.0.5 =
|
69 |
-
No code changes
|
70 |
|
71 |
= 1.0.4 =
|
72 |
Now showing on mobile for most popular themes.
|
4 |
Tags: cta, banner, banners, announcement, announcements, notification, bar, bars, free, hello bar, hellobar
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 4.9.4
|
7 |
+
Stable tag: 1.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
45 |
|
46 |
== Changelog ==
|
47 |
|
48 |
+
= 1.1.0 =
|
49 |
+
* Add text to show scoping of custom CSS.
|
50 |
+
|
51 |
= 1.0.5 =
|
52 |
* Tested on recent Wordpress versions
|
53 |
|
68 |
|
69 |
== Upgrade Notice ==
|
70 |
|
71 |
+
= 1.1.0 =
|
72 |
+
Added ".simple-banner { }" around Simple Banner Custom CSS to show that custom CSS is scoped to the banner and hopefully eliminate some support issues about custom CSS. No functionality changes.
|
73 |
+
|
74 |
= 1.0.5 =
|
75 |
+
No code changes.
|
76 |
|
77 |
= 1.0.4 =
|
78 |
Now showing on mobile for most popular themes.
|
simple-banner.css
CHANGED
@@ -4,11 +4,14 @@
|
|
4 |
text-align: center;
|
5 |
z-index: 200000;
|
6 |
position: relative;
|
7 |
-
display: block;
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
4 |
text-align: center;
|
5 |
z-index: 200000;
|
6 |
position: relative;
|
7 |
+
display: block;
|
8 |
+
}
|
9 |
+
.simple-banner .simple-banner-text {
|
10 |
+
color: #ffffff;
|
11 |
+
font-size: 1.1em;
|
12 |
+
font-weight: 700;
|
13 |
+
padding: 10px;
|
14 |
+
}
|
15 |
+
.simple-banner .simple-banner-text a {
|
16 |
+
color: #f16521;
|
17 |
+
}
|
simple-banner.js
CHANGED
@@ -6,9 +6,9 @@ jQuery(document).ready(function($){
|
|
6 |
var bodyPaddingRight = $('body').css('padding-right')
|
7 |
|
8 |
if (bodyPaddingLeft != "0px"){
|
9 |
-
|
10 |
}
|
11 |
if (bodyPaddingRight != "0px"){
|
12 |
-
|
13 |
}
|
14 |
-
});
|
6 |
var bodyPaddingRight = $('body').css('padding-right')
|
7 |
|
8 |
if (bodyPaddingLeft != "0px"){
|
9 |
+
$('head').append('<style type="text/css" media="screen">.simple-banner{margin-left:-'+bodyPaddingLeft+';padding-left:'+bodyPaddingLeft+';}</style>');
|
10 |
}
|
11 |
if (bodyPaddingRight != "0px"){
|
12 |
+
$('head').append('<style type="text/css" media="screen">.simple-banner{margin-right:-'+bodyPaddingRight+';padding-right:'+bodyPaddingRight+';}</style>');
|
13 |
}
|
14 |
+
});
|
simple-banner.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
* Plugin Name: Simple Banner
|
4 |
* Plugin URI: https://github.com/rpetersen29/simple-banner
|
5 |
* Description: Display a simple banner at the top of your website.
|
6 |
-
* Version: 1.0
|
7 |
* Author: Ryan Petersen
|
8 |
* Author URI: http://rpetersen29.github.io/
|
9 |
* License: GPL2
|
10 |
*
|
11 |
* @package Simple Banner
|
12 |
-
* @version 1.0
|
13 |
-
* @author Ryan Petersen <rpetersen@
|
14 |
*/
|
15 |
|
16 |
add_action( 'wp_enqueue_scripts', 'simple_banner' );
|
@@ -60,124 +60,134 @@ function simple_banner_custom_text()
|
|
60 |
|
61 |
add_action('admin_menu', 'simple_banner_menu');
|
62 |
function simple_banner_menu() {
|
63 |
-
add_menu_page('Simple Banner Settings', 'Simple Banner', 'administrator', 'simple-banner-settings', 'simple_banner_settings_page', 'dashicons-admin-generic');
|
64 |
}
|
65 |
|
66 |
add_action( 'admin_init', 'simple_banner_settings' );
|
67 |
function simple_banner_settings() {
|
68 |
-
register_setting( 'simple-banner-settings-group', 'simple_banner_color' );
|
69 |
-
register_setting( 'simple-banner-settings-group', 'simple_banner_text_color' );
|
70 |
-
register_setting( 'simple-banner-settings-group', 'simple_banner_link_color' );
|
71 |
-
register_setting( 'simple-banner-settings-group', 'simple_banner_text' );
|
72 |
-
register_setting( 'simple-banner-settings-group', 'simple_banner_custom_css' );
|
73 |
}
|
74 |
|
75 |
function simple_banner_settings_page() {
|
76 |
-
?>
|
77 |
-
|
78 |
-
<div class="wrap">
|
79 |
-
<h2>Simple Banner Settings</h2>
|
80 |
-
<p>Use Hex color values for the color fields.</p>
|
81 |
-
<p>Links in the banner text must be typed in with HTML <code><a></code> tags with single quoted links.
|
82 |
-
<br />e.g. <code><a href='http://www.wordpress.com'>Link to Wordpress</a></code>.</p>
|
83 |
-
|
84 |
-
<!-- Preview Banner -->
|
85 |
-
<div id="preview_banner" class="simple-banner" style="width: 100%;background: <?php echo ((get_option('simple_banner_color') == '') ? '#024985' : esc_attr( get_option('simple_banner_color') )); ?>;text-align: center;">
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
</div>
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
</
|
111 |
-
|
112 |
-
<tr valign="top">
|
113 |
-
<th scope="row">Simple Banner Text Color<br><span style="font-weight:400;">(Leaving this blank sets the color to the default value white)</span></th>
|
114 |
-
<td style="vertical-align:top;">
|
115 |
-
<input type="text" id="simple_banner_text_color" name="simple_banner_text_color" placeholder="Hex value"
|
116 |
-
value="<?php echo esc_attr( get_option('simple_banner_text_color') ); ?>"
|
117 |
-
onchange="javascript:(document.getElementById('simple_banner_text_color').value == '') ? document.getElementById('simple_banner_text_color_show').value = '#ffffff' : document.getElementById('simple_banner_text_color_show').value = document.getElementById('simple_banner_text_color').value;
|
118 |
-
document.getElementById('preview_banner_text').style.color = ((document.getElementById('simple_banner_text_color').value == '') ? '#ffffff' : document.getElementById('simple_banner_text_color').value);" />
|
119 |
-
<input style="height: 30px;width: 100px;" type="color" id="simple_banner_text_color_show"
|
120 |
-
value="<?php echo ((get_option('simple_banner_text_color') == '') ? '#ffffff' : esc_attr( get_option('simple_banner_text_color') )); ?>"
|
121 |
-
onchange="javascript:document.getElementById('simple_banner_text_color').value = document.getElementById('simple_banner_text_color_show').value;
|
122 |
-
document.getElementById('preview_banner_text').style.color = document.getElementById('simple_banner_text_color_show').value;">
|
123 |
-
</td>
|
124 |
-
</tr>
|
125 |
-
<!-- Link Color-->
|
126 |
-
<tr valign="top">
|
127 |
-
<th scope="row">Simple Banner Link Color<br><span style="font-weight:400;">(Leaving this blank sets the color to the default value #f16521)</span></th>
|
128 |
-
<td style="vertical-align:top;">
|
129 |
-
<input type="text" id="simple_banner_link_color" name="simple_banner_link_color" placeholder="Hex value"
|
130 |
-
value="<?php echo esc_attr( get_option('simple_banner_link_color') ); ?>"
|
131 |
-
onchange="javascript:(document.getElementById('simple_banner_link_color').value == '') ? document.getElementById('simple_banner_link_color_show').value = '#f16521' : document.getElementById('simple_banner_link_color_show').value = document.getElementById('simple_banner_link_color').value;
|
132 |
-
document.getElementById('preview_banner_link').style.color = document.getElementById('simple_banner_link_color').value;
|
133 |
-
document.getElementById('preview_banner_link').style.color = ((document.getElementById('simple_banner_link_color').value == '') ? '#f16521' : document.getElementById('simple_banner_link_color').value);" />
|
134 |
-
<input style="height: 30px;width: 100px;" type="color" id="simple_banner_link_color_show"
|
135 |
-
value="<?php echo ((get_option('simple_banner_link_color') == '') ? '#f16521' : esc_attr( get_option('simple_banner_link_color') )); ?>"
|
136 |
-
onchange="javascript:document.getElementById('simple_banner_link_color').value = document.getElementById('simple_banner_link_color_show').value;
|
137 |
-
document.getElementById('preview_banner_link').style.color = document.getElementById('simple_banner_link_color_show').value;">
|
138 |
-
</td>
|
139 |
-
</tr>
|
140 |
-
<!-- Text Contents -->
|
141 |
-
<tr valign="top">
|
142 |
-
<th scope="row">Simple Banner Text<br><span style="font-weight:400;">(Leaving this blank removes the banner)</span></th>
|
143 |
-
<td><textarea style="height: 150px;width: 265px;resize: none;" name="simple_banner_text"><?php echo get_option('simple_banner_text'); ?></textarea></td>
|
144 |
-
<td style="color:blue;">Remember to only use single quotes with the href links.</td>
|
145 |
-
</tr>
|
146 |
-
<!-- Custom CSS -->
|
147 |
-
<tr valign="top">
|
148 |
-
<th scope="row">Simple Banner Custom CSS
|
149 |
-
<br><span style="font-weight:400;">Styles will be applied directly to the <code>simple-banner</code> class.</span>
|
150 |
-
<br><span style="font-weight:400;color:red;">Be very careful, bad CSS can break the banner.</span></th>
|
151 |
-
<td><textarea id="simple_banner_custom_css" style="height: 150px;width: 265px;resize: none;" name="simple_banner_custom_css"><?php echo get_option('simple_banner_custom_css'); ?></textarea>
|
152 |
-
</td>
|
153 |
-
</tr>
|
154 |
-
</table>
|
155 |
-
|
156 |
-
<!-- Save Changes Button -->
|
157 |
-
<?php submit_button(); ?>
|
158 |
-
</form>
|
159 |
-
</div>
|
160 |
-
|
161 |
-
<script type="text/javascript">
|
162 |
-
var style = document.createElement('style');
|
163 |
-
var style_dynamic = null;
|
164 |
-
|
165 |
-
style.type = 'text/css';
|
166 |
-
style.id = 'preview_banner_custom_stylesheet'
|
167 |
-
style.appendChild(document.createTextNode('.simple-banner{'+document.getElementById('simple_banner_custom_css').value+'}'));
|
168 |
-
document.getElementsByTagName('head')[0].appendChild(style);
|
169 |
-
|
170 |
-
document.getElementById('simple_banner_custom_css').onblur=function(){
|
171 |
-
var child = document.getElementById('preview_banner_custom_stylesheet');
|
172 |
-
if (child){child.innerText = "";child.id='';}
|
173 |
-
|
174 |
-
var style_dynamic = document.createElement('style');
|
175 |
-
style_dynamic.type = 'text/css';
|
176 |
-
style_dynamic.id = 'preview_banner_custom_stylesheet';
|
177 |
-
style_dynamic.appendChild(document.createTextNode('.simple-banner{'+document.getElementById('simple_banner_custom_css').value+'}'));
|
178 |
-
document.getElementsByTagName('head')[0].appendChild(style_dynamic);
|
179 |
-
};
|
180 |
-
</script>
|
181 |
-
<?php
|
182 |
}
|
183 |
-
?>
|
3 |
* Plugin Name: Simple Banner
|
4 |
* Plugin URI: https://github.com/rpetersen29/simple-banner
|
5 |
* Description: Display a simple banner at the top of your website.
|
6 |
+
* Version: 1.1.0
|
7 |
* Author: Ryan Petersen
|
8 |
* Author URI: http://rpetersen29.github.io/
|
9 |
* License: GPL2
|
10 |
*
|
11 |
* @package Simple Banner
|
12 |
+
* @version 1.1.0
|
13 |
+
* @author Ryan Petersen <rpetersen.dev@gmail.com>
|
14 |
*/
|
15 |
|
16 |
add_action( 'wp_enqueue_scripts', 'simple_banner' );
|
60 |
|
61 |
add_action('admin_menu', 'simple_banner_menu');
|
62 |
function simple_banner_menu() {
|
63 |
+
add_menu_page('Simple Banner Settings', 'Simple Banner', 'administrator', 'simple-banner-settings', 'simple_banner_settings_page', 'dashicons-admin-generic');
|
64 |
}
|
65 |
|
66 |
add_action( 'admin_init', 'simple_banner_settings' );
|
67 |
function simple_banner_settings() {
|
68 |
+
register_setting( 'simple-banner-settings-group', 'simple_banner_color' );
|
69 |
+
register_setting( 'simple-banner-settings-group', 'simple_banner_text_color' );
|
70 |
+
register_setting( 'simple-banner-settings-group', 'simple_banner_link_color' );
|
71 |
+
register_setting( 'simple-banner-settings-group', 'simple_banner_text' );
|
72 |
+
register_setting( 'simple-banner-settings-group', 'simple_banner_custom_css' );
|
73 |
}
|
74 |
|
75 |
function simple_banner_settings_page() {
|
76 |
+
?>
|
77 |
+
|
78 |
+
<div class="wrap">
|
79 |
+
<h2>Simple Banner Settings</h2>
|
80 |
+
<p>Use Hex color values for the color fields.</p>
|
81 |
+
<p>Links in the banner text must be typed in with HTML <code><a></code> tags with single quoted links.
|
82 |
+
<br />e.g. <code><a href='http://www.wordpress.com'>Link to Wordpress</a></code>.</p>
|
83 |
+
|
84 |
+
<!-- Preview Banner -->
|
85 |
+
<div id="preview_banner" class="simple-banner" style="width: 100%;background: <?php echo ((get_option('simple_banner_color') == '') ? '#024985' : esc_attr( get_option('simple_banner_color') )); ?>;text-align: center;">
|
86 |
+
<div id="preview_banner_text" class="simple-banner-text" style="color: <?php echo ((get_option('simple_banner_text_color') == '') ? '#ffffff' : esc_attr( get_option('simple_banner_text_color') )); ?>;font-size: 1.1em;font-weight: 700;padding: 10px; }">
|
87 |
+
<span>This is what your banner will look like with a <a id="preview_banner_link" style="color:<?php echo ((get_option('simple_banner_link_color') == '') ? '#f16521' : esc_attr( get_option('simple_banner_link_color') )); ?>;" href="/">link</a>.*</span>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
<br>
|
91 |
+
<span><b>*Note: Font and text styles subject to change based on chosen theme CSS.</b></span>
|
92 |
+
|
93 |
+
<!-- Settings Form -->
|
94 |
+
<form method="post" action="options.php">
|
95 |
+
<?php settings_fields( 'simple-banner-settings-group' ); ?>
|
96 |
+
<?php do_settings_sections( 'simple-banner-settings-group' ); ?>
|
97 |
+
<table class="form-table">
|
98 |
+
<!-- Background Color -->
|
99 |
+
<tr valign="top">
|
100 |
+
<th scope="row">Simple Banner Background Color<br><span style="font-weight:400;">(Leaving this blank sets the color to the default value #024985)</span></th>
|
101 |
+
<td style="vertical-align:top;">
|
102 |
+
<input type="text" id="simple_banner_color" name="simple_banner_color" placeholder="Hex value"
|
103 |
+
value="<?php echo esc_attr( get_option('simple_banner_color') ); ?>"
|
104 |
+
onchange="(document.getElementById('simple_banner_color').value == '') ? document.getElementById('simple_banner_color_show').value = '#024985' : document.getElementById('simple_banner_color_show').value = document.getElementById('simple_banner_color').value;
|
105 |
+
document.getElementById('preview_banner').style.background = ((document.getElementById('simple_banner_color').value == '') ? '#024985' : document.getElementById('simple_banner_color').value);" />
|
106 |
+
<input style="height: 30px;width: 100px;" type="color" id="simple_banner_color_show"
|
107 |
+
value="<?php echo ((get_option('simple_banner_color') == '') ? '#024985' : esc_attr( get_option('simple_banner_color') )); ?>"
|
108 |
+
onchange="javascript:document.getElementById('simple_banner_color').value = document.getElementById('simple_banner_color_show').value;
|
109 |
+
document.getElementById('preview_banner').style.background = document.getElementById('simple_banner_color_show').value;">
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
<!-- Text Color -->
|
113 |
+
<tr valign="top">
|
114 |
+
<th scope="row">Simple Banner Text Color<br><span style="font-weight:400;">(Leaving this blank sets the color to the default value white)</span></th>
|
115 |
+
<td style="vertical-align:top;">
|
116 |
+
<input type="text" id="simple_banner_text_color" name="simple_banner_text_color" placeholder="Hex value"
|
117 |
+
value="<?php echo esc_attr( get_option('simple_banner_text_color') ); ?>"
|
118 |
+
onchange="javascript:(document.getElementById('simple_banner_text_color').value == '') ? document.getElementById('simple_banner_text_color_show').value = '#ffffff' : document.getElementById('simple_banner_text_color_show').value = document.getElementById('simple_banner_text_color').value;
|
119 |
+
document.getElementById('preview_banner_text').style.color = ((document.getElementById('simple_banner_text_color').value == '') ? '#ffffff' : document.getElementById('simple_banner_text_color').value);" />
|
120 |
+
<input style="height: 30px;width: 100px;" type="color" id="simple_banner_text_color_show"
|
121 |
+
value="<?php echo ((get_option('simple_banner_text_color') == '') ? '#ffffff' : esc_attr( get_option('simple_banner_text_color') )); ?>"
|
122 |
+
onchange="javascript:document.getElementById('simple_banner_text_color').value = document.getElementById('simple_banner_text_color_show').value;
|
123 |
+
document.getElementById('preview_banner_text').style.color = document.getElementById('simple_banner_text_color_show').value;">
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
<!-- Link Color-->
|
127 |
+
<tr valign="top">
|
128 |
+
<th scope="row">Simple Banner Link Color<br><span style="font-weight:400;">(Leaving this blank sets the color to the default value #f16521)</span></th>
|
129 |
+
<td style="vertical-align:top;">
|
130 |
+
<input type="text" id="simple_banner_link_color" name="simple_banner_link_color" placeholder="Hex value"
|
131 |
+
value="<?php echo esc_attr( get_option('simple_banner_link_color') ); ?>"
|
132 |
+
onchange="javascript:(document.getElementById('simple_banner_link_color').value == '') ? document.getElementById('simple_banner_link_color_show').value = '#f16521' : document.getElementById('simple_banner_link_color_show').value = document.getElementById('simple_banner_link_color').value;
|
133 |
+
document.getElementById('preview_banner_link').style.color = document.getElementById('simple_banner_link_color').value;
|
134 |
+
document.getElementById('preview_banner_link').style.color = ((document.getElementById('simple_banner_link_color').value == '') ? '#f16521' : document.getElementById('simple_banner_link_color').value);" />
|
135 |
+
<input style="height: 30px;width: 100px;" type="color" id="simple_banner_link_color_show"
|
136 |
+
value="<?php echo ((get_option('simple_banner_link_color') == '') ? '#f16521' : esc_attr( get_option('simple_banner_link_color') )); ?>"
|
137 |
+
onchange="javascript:document.getElementById('simple_banner_link_color').value = document.getElementById('simple_banner_link_color_show').value;
|
138 |
+
document.getElementById('preview_banner_link').style.color = document.getElementById('simple_banner_link_color_show').value;">
|
139 |
+
</td>
|
140 |
+
</tr>
|
141 |
+
<!-- Text Contents -->
|
142 |
+
<tr valign="top">
|
143 |
+
<th scope="row">Simple Banner Text<br><span style="font-weight:400;">(Leaving this blank removes the banner)</span></th>
|
144 |
+
<td>
|
145 |
+
<textarea style="height: 150px;width: 265px;resize: none;" name="simple_banner_text"><?php echo get_option('simple_banner_text'); ?></textarea>
|
146 |
+
</td>
|
147 |
+
<td style="color:blue;">Remember to only use single quotes with the href links.</td>
|
148 |
+
</tr>
|
149 |
+
<!-- Custom CSS -->
|
150 |
+
<tr valign="top">
|
151 |
+
<th scope="row">
|
152 |
+
Simple Banner Custom CSS
|
153 |
+
<br><span style="font-weight:400;">CSS will be applied directly to the <code>simple-banner</code> class.</span>
|
154 |
+
<br><span style="font-weight:400;color:red;">Be very careful, bad CSS can break the banner.</span>
|
155 |
+
</th>
|
156 |
+
<td>
|
157 |
+
<div>.simple-banner {</div>
|
158 |
+
<textarea id="simple_banner_custom_css" style="height: 150px;width: 265px;resize: none;" name="simple_banner_custom_css"><?php echo get_option('simple_banner_custom_css'); ?></textarea>
|
159 |
+
<div>}</div>
|
160 |
+
</td>
|
161 |
+
</tr>
|
162 |
+
</table>
|
163 |
+
|
164 |
+
|
165 |
+
<!-- Save Changes Button -->
|
166 |
+
<?php submit_button(); ?>
|
167 |
+
</form>
|
168 |
</div>
|
169 |
+
|
170 |
+
<!-- Script to apply styles to Preview Banner -->
|
171 |
+
<script type="text/javascript">
|
172 |
+
var style = document.createElement('style');
|
173 |
+
var style_dynamic = null;
|
174 |
+
|
175 |
+
style.type = 'text/css';
|
176 |
+
style.id = 'preview_banner_custom_stylesheet'
|
177 |
+
style.appendChild(document.createTextNode('.simple-banner{'+document.getElementById('simple_banner_custom_css').value+'}'));
|
178 |
+
document.getElementsByTagName('head')[0].appendChild(style);
|
179 |
+
|
180 |
+
document.getElementById('simple_banner_custom_css').onblur=function(){
|
181 |
+
var child = document.getElementById('preview_banner_custom_stylesheet');
|
182 |
+
if (child){child.innerText = "";child.id='';}
|
183 |
+
|
184 |
+
var style_dynamic = document.createElement('style');
|
185 |
+
style_dynamic.type = 'text/css';
|
186 |
+
style_dynamic.id = 'preview_banner_custom_stylesheet';
|
187 |
+
style_dynamic.appendChild(document.createTextNode('.simple-banner{'+document.getElementById('simple_banner_custom_css').value+'}'));
|
188 |
+
document.getElementsByTagName('head')[0].appendChild(style_dynamic);
|
189 |
+
};
|
190 |
+
</script>
|
191 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
+
?>
|