This commit has been accessed 560 times via Git panel.
commit 6d5ad0f90542989234c6baddfb696e6d1556d299
tree 649dfbe553a8a2267549d1422c77db2a8e56a5d6
parent b295f19209dde018078fc35394a8745284423521
author Psylocke Antonio <psylocke@majcms.org> 1296030616 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1296030616 +0800
Add blur distance option for global box-shadow
diff --git a/css.php b/css.php
index d3ffd87..c287705 100644
--- a/css.php
+++ b/css.php
@@ -42,6 +42,13 @@ else {
$maj_border_radius = "5px";
}
+if (file_exists("data/shadow.txt")) {
+ $maj_blur_distance = file_get_contents("data/shadow.txt") . "px";
+}
+else {
+ $maj_blur_distance = "2px";
+}
+
?>
<style>
@@ -229,10 +236,10 @@ a.status:link,a.status:visited,a.status:active,a.status:hover {
}
if (file_exists("data/shadow.txt")) {
- echo "\n\t-moz-box-shadow: 0 0 2px #ddd;";
- echo "\n\t-webkit-box-shadow: 0 0 2px #ddd;";
- echo "\n\t-khtml-box-shadow: 0 0 2px #ddd;";
- echo "\n\tbox-shadow: 0 0 2px #ddd;";
+ echo "\n\t-moz-box-shadow: 0 0 $maj_blur_distance #ddd;";
+ echo "\n\t-webkit-box-shadow: 0 0 $maj_blur_distance #ddd;";
+ echo "\n\t-khtml-box-shadow: 0 0 $maj_blur_distance #ddd;";
+ echo "\n\tbox-shadow: 0 0 $maj_blur_distance #ddd;";
}
?>
diff --git a/settings.php b/settings.php
index 743e384..60b9250 100644
--- a/settings.php
+++ b/settings.php
@@ -269,8 +269,26 @@ if (!isset($_POST['xucomment']) or empty($_POST['xucomment'])) {
}
}
-if (isset($_POST['shadow']) and !empty($_POST['shadow']) and ($_POST['shadow'] == "on") and !file_exists("data/shadow.txt")) {
- touch("data/shadow.txt");
+if (isset($_POST['shadow']) and !empty($_POST['shadow']) and ($_POST['shadow'] == "on")) {
+
+ if (!file_exists("data/shadow.txt")) {
+ $fp_shadow_txt = fopen("data/shadow.txt","w");
+ fwrite($fp_shadow_txt,"2");
+ fclose($fp_shadow_txt);
+ }
+
+ if (isset($_POST['blur']) and is_numeric($_POST['blur']) and (file_get_contents("data/shadow.txt") != $_POST['blur'])) {
+
+ if ($_POST['blur'] > 0) {
+ $shadow_write_content = number_format($_POST['blur'],0,'.','');
+ $fp_shadow_txt = fopen("data/shadow.txt","w");
+ fwrite($fp_shadow_txt,$shadow_write_content);
+ fclose($fp_shadow_txt);
+ }
+ else {
+ unlink("data/shadow.txt");
+ }
+ }
}
if (!isset($_POST['shadow']) or empty($_POST['shadow'])) {
@@ -1246,6 +1264,12 @@ else {
<tr><td><input type="checkbox" name="round" <?php if (file_exists("data/round.txt")) { echo checked; } ?>> Display rounded corners on progressive browsers.</td></tr>
+<?php if (file_exists("data/shadow.txt")) { ?>
+
+<tr><td>shadow blur distance</td><td><input autocomplete="off" class="input" type="text" name="blur" value="<?php readfile('data/shadow.txt'); ?>" maxlength="2"></td></tr>
+
+<?php } ?>
+
<?php if (file_exists("data/round.txt")) { ?>
<tr><td>panel border radius</td><td><input autocomplete="off" class="input" type="text" name="radius" value="<?php readfile('data/round.txt'); ?>" maxlength="2"></td></tr>
tree 649dfbe553a8a2267549d1422c77db2a8e56a5d6
parent b295f19209dde018078fc35394a8745284423521
author Psylocke Antonio <psylocke@majcms.org> 1296030616 +0800
committer Psylocke Antonio <psylocke@majcms.org> 1296030616 +0800
Add blur distance option for global box-shadow
diff --git a/css.php b/css.php
index d3ffd87..c287705 100644
--- a/css.php
+++ b/css.php
@@ -42,6 +42,13 @@ else {
$maj_border_radius = "5px";
}
+if (file_exists("data/shadow.txt")) {
+ $maj_blur_distance = file_get_contents("data/shadow.txt") . "px";
+}
+else {
+ $maj_blur_distance = "2px";
+}
+
?>
<style>
@@ -229,10 +236,10 @@ a.status:link,a.status:visited,a.status:active,a.status:hover {
}
if (file_exists("data/shadow.txt")) {
- echo "\n\t-moz-box-shadow: 0 0 2px #ddd;";
- echo "\n\t-webkit-box-shadow: 0 0 2px #ddd;";
- echo "\n\t-khtml-box-shadow: 0 0 2px #ddd;";
- echo "\n\tbox-shadow: 0 0 2px #ddd;";
+ echo "\n\t-moz-box-shadow: 0 0 $maj_blur_distance #ddd;";
+ echo "\n\t-webkit-box-shadow: 0 0 $maj_blur_distance #ddd;";
+ echo "\n\t-khtml-box-shadow: 0 0 $maj_blur_distance #ddd;";
+ echo "\n\tbox-shadow: 0 0 $maj_blur_distance #ddd;";
}
?>
diff --git a/settings.php b/settings.php
index 743e384..60b9250 100644
--- a/settings.php
+++ b/settings.php
@@ -269,8 +269,26 @@ if (!isset($_POST['xucomment']) or empty($_POST['xucomment'])) {
}
}
-if (isset($_POST['shadow']) and !empty($_POST['shadow']) and ($_POST['shadow'] == "on") and !file_exists("data/shadow.txt")) {
- touch("data/shadow.txt");
+if (isset($_POST['shadow']) and !empty($_POST['shadow']) and ($_POST['shadow'] == "on")) {
+
+ if (!file_exists("data/shadow.txt")) {
+ $fp_shadow_txt = fopen("data/shadow.txt","w");
+ fwrite($fp_shadow_txt,"2");
+ fclose($fp_shadow_txt);
+ }
+
+ if (isset($_POST['blur']) and is_numeric($_POST['blur']) and (file_get_contents("data/shadow.txt") != $_POST['blur'])) {
+
+ if ($_POST['blur'] > 0) {
+ $shadow_write_content = number_format($_POST['blur'],0,'.','');
+ $fp_shadow_txt = fopen("data/shadow.txt","w");
+ fwrite($fp_shadow_txt,$shadow_write_content);
+ fclose($fp_shadow_txt);
+ }
+ else {
+ unlink("data/shadow.txt");
+ }
+ }
}
if (!isset($_POST['shadow']) or empty($_POST['shadow'])) {
@@ -1246,6 +1264,12 @@ else {
<tr><td><input type="checkbox" name="round" <?php if (file_exists("data/round.txt")) { echo checked; } ?>> Display rounded corners on progressive browsers.</td></tr>
+<?php if (file_exists("data/shadow.txt")) { ?>
+
+<tr><td>shadow blur distance</td><td><input autocomplete="off" class="input" type="text" name="blur" value="<?php readfile('data/shadow.txt'); ?>" maxlength="2"></td></tr>
+
+<?php } ?>
+
<?php if (file_exists("data/round.txt")) { ?>
<tr><td>panel border radius</td><td><input autocomplete="off" class="input" type="text" name="radius" value="<?php readfile('data/round.txt'); ?>" maxlength="2"></td></tr>