From c3cbc0dbabde40c79a64d63252652445b0f9c1a0 Mon Sep 17 00:00:00 2001 From: Bronco Date: Fri, 21 Jun 2013 09:24:00 +0200 Subject: [PATCH] =?UTF-8?q?premi=C3=A8res=20retouches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit some changes: css more responsive html structure without echo Next step, appli Timo's enhancements & add some features --- design/style.css | 6 +- index.php | 189 ++++++++++++++++++++++------------------------- 2 files changed, 93 insertions(+), 102 deletions(-) diff --git a/design/style.css b/design/style.css index d2670cc..79953d6 100644 --- a/design/style.css +++ b/design/style.css @@ -2,6 +2,7 @@ body { background:url(paper.png) #efe; width: 100%; + min-width:320px; margin:0;padding:0; font-family: Georgia, Serif;font-size : 16px; color: #050; } @@ -28,12 +29,15 @@ header{ background-image: -o-linear-gradient( top, #555, #333); background-image: -webkit-gradient(linear, center top, center bottom, from(#555), to(#333)); background-image: -webkit-linear-gradient( top, #555, #333); background-image: linear-gradient( top, #555, #333); } header nav{display:inline-block; vertical-align: top;} + header nav p{color:lightgreen;text-shadow: 0 1px 1px black;font-size:20px;} aside{height:100%;padding-bottom : 70px;text-align:center;} aside ul{padding:0;} aside li{margin:5px;list-style:none;vertical-align:middle;border-radius:3px;} aside .public li{background:rgba(100,255,100,0.2);} aside .private li{background:rgba(255,100,100,0.2);} +aside .public {background:rgba(100,255,100,0.2);} +aside .private {background:rgba(255,100,100,0.2);} aside li em {font-size:10px ; color:#484;} aside li img {vertical-align:bottom;margin:1px;width:16px;height:16px;} aside li a.suppr, aside li a.origine{opacity:0.5;width:16px;height:16px;display:inline-block;background:url(actions.png) no-repeat 0 -159px ;} @@ -42,7 +46,7 @@ aside li a.suppr:hover,aside li a.origine:hover{opacity:1;} aside li a.toprivate,aside li a.topublic{float:right;margin-right:5px;opacity:0.5;} aside li a.toprivate:hover,aside li a.topublic:hover{opacity:1;} -aside .public,.private{text-align:left;vertical-align:top; margin-top:25px;padding:10px; border-radius:5px; border:1px dashed;display:inline-block;width:45%;} +aside .public,.private{min-width:300px;text-align:left;vertical-align:top; margin-top:25px;padding:10px; border-radius:5px; border:1px dashed;display:inline-block;} aside .public{border-color:green;} aside .private{border-color:red;} footer {text-align: right; color:#F80;text-shadow: 0 1px 1px black; position:fixed;bottom:0;left:0;right:0;height:auto;min-height:20px;padding : 5px ; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border-top:1px solid #888;-moz-box-shadow: 0 0px 9px #000; -webkit-box-shadow: 0 0px 9px #000; box-shadow: 0 0px 9px #000; -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=135, Color='#000')"; filter: progid:DXImageTransform.Microsoft.Shadow(Strength=9, Direction=135, Color='#000'); filter: progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #555, endColorstr = #333); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr = #555, endColorstr = #333)"; background-image: -moz-linear-gradient( top, #555, #333); background-image: -ms-linear-gradient( top, #555, #333); background-image: -o-linear-gradient( top, #555, #333); background-image: -webkit-gradient(linear, center top, center bottom, from(#555), to(#333)); background-image: -webkit-linear-gradient( top, #555, #333); background-image: linear-gradient( top, #555, #333); } diff --git a/index.php b/index.php index 58af406..e40b680 100644 --- a/index.php +++ b/index.php @@ -31,8 +31,10 @@ $GLOBALS['public_data_folder'] = $GLOBALS['data_folder'].'/public'; $GLOBALS['default_data_folder'] = $GLOBALS['public_data_folder']; $GLOBAL['version']='1.0'; $GLOBALS['message'] = 'Votre webliothèque perso'; +$GLOBALS['public_title'] = 'Voici la webliothèque publique de Bronco'; $bookmarklet='Bookmarklet'; -if ($public){$bookmarklet='';} +$column_width='width:47%'; +if ($public){$bookmarklet='';$column_width='width:97%';} if (!creer_dossier($GLOBALS['data_folder'], TRUE)) { die('Cant create '.$GLOBALS['data_folder'].' folder.'); } if (!creer_dossier($GLOBALS['private_data_folder'], TRUE)) { die('Cant create '.$GLOBALS['private_data_folder'].' folder.'); } if (!creer_dossier($GLOBALS['public_data_folder'], TRUE)) { die('Cant create '.$GLOBALS['public_data_folder'].' folder.'); } @@ -429,29 +431,19 @@ function add_table_and_replace(&$data, $retrievable, &$match1, $match, $url_p, $ // the files in CSS are relative to the CSS ! if (preg_match('#^https?://#', $match)) { // url $url_fichier = $match; - //echo "u "; } elseif (preg_match('#^//#', $match)) { // absolute path w/o HTTP $url_fichier = $url_p['s'].':'.$match; - //echo "h "; } elseif (preg_match('#^/#', $match)) { // absolute local path $url_fichier = $url_p['s'].'://'.$url_p['h'].$match; - //echo "l "; } else { // relative local path - //echo "r "; -// echo '
';print_r($url_p);
 		$uuu = (strlen($url_p['file']) == 0 or preg_match('#/$#', $url_p['pat'])) ? $GLOBALS['url'] : substr($GLOBALS['url'], 0, -strlen($url_p['file'])) ;
-
-//		echo '
'; echo $uuu;
 		$url_fichier = $uuu . substr($match, 0, -strlen($nom_fichier)).$nom_fichier;
 	}
 
 	$url_fichier = html_entity_decode(urldecode($url_fichier));
-	//echo $url_fichier."
\n"; - - // new rand name, for local storage. $nouveau_nom = rand_new_name($nom_fichier); if ($type == 'css') { @@ -478,7 +470,6 @@ function add_table_and_replace(&$data, $retrievable, &$match1, $match, $url_p, $ 'type' => $type ); } - // replace the URL with the new filename in the &data. $new_match = str_replace($match, $nouveau_nom, $match1); $data = str_replace($match1, $new_match, $data); @@ -486,114 +477,77 @@ function add_table_and_replace(&$data, $retrievable, &$match1, $match, $url_p, $ return $retrievable; } - - -function rand_new_name($name) { -// return 'f_'.str_shuffle('abcd').mt_rand(100, 999).'--'.''.$name; - return 'f_'.str_shuffle('abcd').mt_rand(100, 999).'--'.preg_replace('#[^\w.]#', '_', $name); -} - - +function rand_new_name($name) {return 'f_'.str_shuffle('abcd').mt_rand(100, 999).'--'.preg_replace('#[^\w.]#', '_', $name);} if ($GLOBALS['done']['d'] !== FALSE) { switch($GLOBALS['done']['d']) { - case 'ajout' : header('Location: index.php?done='.$GLOBALS['done']['d'].'&lien='.urlencode($GLOBALS['url']).'&loclink='.urlencode($GLOBALS['done']['lien'])); break; - case 'remove' : header('Location: index.php?done='.$GLOBALS['done']['d']); break; } echo ''."\n"; - - } /* * Displays main form (page to retrieve) * */ +?> + + + + + Respawn – a PHP WebPage Saver + + + + + + +
+ +
+ + + +