proxy: Added support for long addresses. "vier": New style "Plus"

This commit is contained in:
Michael Vogel 2014-08-16 01:40:38 +02:00
parent de75d8ca7f
commit 271a184e1e
7 changed files with 176 additions and 14 deletions

View File

@ -47,7 +47,7 @@ function proxy_init() {
$direct_cache = (is_dir($_SERVER["DOCUMENT_ROOT"]."/proxy") AND is_writable($_SERVER["DOCUMENT_ROOT"]."/proxy"));
// Look for filename in the arguments
if (isset($a->argv[1]) OR isset($a->argv[2]) OR isset($a->argv[3])) {
if ((isset($a->argv[1]) OR isset($a->argv[2]) OR isset($a->argv[3])) AND !isset($_REQUEST["url"])) {
if (isset($a->argv[3]))
$url = $a->argv[3];
elseif (isset($a->argv[2]))
@ -78,7 +78,8 @@ function proxy_init() {
if ($url)
$_REQUEST['url'] = $url;
}
} else
$direct_cache = false;
if (!$direct_cache) {
$urlhash = 'pic:' . sha1($_REQUEST['url']);
@ -210,12 +211,17 @@ function proxy_init() {
function proxy_url($url, $writemode = false) {
global $_SERVER;
// Only continue if it isn't a local image and the isn't deactivated
if (get_config("system", "proxy_disabled") OR proxy_is_local_image($url))
return($url);
$a = get_app();
// Only continue if it isn't a local image and the isn't deactivated
if (proxy_is_local_image($url)) {
$url = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $url);
return($url);
}
if (get_config("system", "proxy_disabled"))
return($url);
// Creating a sub directory to reduce the amount of files in the cache directory
$basepath = $_SERVER["DOCUMENT_ROOT"]."/proxy";
@ -246,8 +252,11 @@ function proxy_url($url, $writemode = false) {
$proxypath = $a->get_baseurl()."/proxy/".$path;
// Too long files aren't supported by Apache
if (strlen($proxypath) > 250)
return ($url);
// Writemode in combination with long files shouldn't be possible
if ((strlen($proxypath) > 250) AND $writemode)
return (hash("md5", $url));
elseif (strlen($proxypath) > 250)
return ($a->get_baseurl()."/proxy/".hash("md5", $url)."?url=".urlencode($url));
elseif ($writemode)
return ($path);
else
@ -303,5 +312,8 @@ function proxy_img_cb($matches) {
}
function proxy_parse_html($html) {
$a = get_app();
$html = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $html);
return preg_replace_callback("/(<img [^>]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html);
}

View File

@ -44,7 +44,8 @@ function vier_form(&$a, $style){
"shadow"=>"Shadow",
"flat"=>"Flat",
"netcolour"=>"Coloured Networks",
"breathe"=>"Breathe"
"breathe"=>"Breathe",
"plus"=>"Plus"
);
$t = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, array(

View File

@ -140,7 +140,8 @@ li.icon.icon-large:before {
.icon-bookmark:before { content: "\f02e"; }
.icon-print:before { content: "\f02f"; }
.icon.camera:before { content: "\f030"; }
.icon-camera:before { content: "\f030"; }
.icon.camera:before { content: "\f03e"; }
.icon-font:before { content: "\f031"; }
.icon-bold:before { content: "\f032"; }
.icon-italic:before { content: "\f033"; }
@ -198,7 +199,7 @@ li.icon.icon-large:before {
.icon.add:before { content: "\f067"; }
.icon-minus:before { content: "\f068"; }
.icon-asterisk:before { content: "\f069"; }
.icon.notify:before { content: "\f06a"; }
.icon.exclamation:before { content: "\f06a"; }
.icon-gift:before { content: "\f06b"; }
.icon-leaf:before { content: "\f06c"; }
.icon-fire:before { content: "\f06d"; }
@ -254,7 +255,7 @@ li.icon.icon-large:before {
.icon-hdd:before { content: "\f0a0"; }
.icon-bullhorn:before { content: "\f0a1"; }
.icon-bell:before { content: "\f0a2"; }
.icon.notify:before { content: "\f0a2"; }
.icon-certificate:before { content: "\f0a3"; }
.icon-hand-right:before { content: "\f0a4"; }
.icon-hand-left:before { content: "\f0a5"; }

141
view/theme/vier/plus.css Normal file
View File

@ -0,0 +1,141 @@
nav {
background: #fff;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.15);
padding-top: 6px;
padding-bottom: 6px;
}
nav a:active,
nav a:link,
nav a:visited,
nav a {
color: #737373;
}
nav a:hover,
#nav-messages-see-all a:hover {
color: #000;
}
nav .nav-notify {
/* background-color: #427FED; */
background-color: #CB4437;
top: -3px;
right: -4px;
font: bold 11px/16px Arial;
padding: 1px;
border-radius: 10px;
}
nav .nav-menu-icon .nav-notify {
top: 0px;
}
nav .nav-menu.selected a {
color: #000;
/* font-weight: bold; */
}
nav .nav-menu:hover,
nav .nav-menu.selected {
border-bottom: 2px solid #427FED;
}
nav .nav-menu {
height: 23px;
font-size: 14px;
font-weight: initial;
}
#nav-site-menu,
#nav-notifications-menu,
#nav-user-menu {
top: 35px;
}
#nav-messages-menu {
top: 32px;
}
#nav-messages-see-all a {
color: #737373;
}
ul.tabs li .active, span.pager_current a {
border-bottom: 2px solid #427FED;
}
span.pager_current, span.pager_n a:hover,
span.pager_first a:hover, span.pager_last a:hover,
span.pager_prev a:hover, span.pager_next a:hover,
ul.tabs a:hover {
border-bottom: 2px solid #427FED;
}
nav #nav-notifications-linkmenu.on .icon.s22.notify, nav #nav-notifications-linkmenu.selected .icon.s22.notify {
color: #737373;
}
nav #nav-messages-linkmenu.selected,
nav #nav-user-linklabel.selected,
nav #nav-apps-link.selected {
background-color: #fff;
border-bottom-style: none;
}
div.jGrowl div.info {
background: #fff url("../../../images/icons/48/info.png") no-repeat 5px center;
}
nav .nav-menu-icon.selected {
background-color: #fff;
}
#jot #jot-tools li:hover {
background-color: #fff;
}
nav .icon {
color: #737373;
}
nav a:hover .icon {
color: #000;
}
ul.menu-popup {
border: 0px solid #FFF;
margin-top: 0px;
}
header #banner a, header #banner a:active, header #banner a:visited, header #banner a:link, header #banner a:hover {
color: #737373;
}
header {
left: 10px;
}
header #banner {
margin-top: 6px;
}
#banner #logo-text {
margin-left: 5px;
}
aside {
top: 44px;
height: calc(100% - 54px);
}
section {
top: 44px;
}
nav #search-box #search-text {
background-color: initial;
border-style: solid;
border-width: 1px;
border-color: rgba(0, 0, 0, 0.15);
}

View File

@ -1987,6 +1987,7 @@ ul.tabs li .active, span.pager_current a {
.comment-edit-bb a {
color: #888;
padding: 0px 5px 1px 5px;
cursor: pointer;
}
.comment-edit-bb a:hover {

View File

@ -36,13 +36,13 @@
<div class="comment-edit-bb">
<a title="{{$edimg}}" onclick="insertFormatting('{{$comment}}','img',{{$id}});"><i class="icon-picture"></i></a>
<a title="{{$edurl}}" onclick="insertFormatting('{{$comment}}','url',{{$id}});"><i class="icon-bookmark"></i></a>
<a title="{{$edurl}}" onclick="insertFormatting('{{$comment}}','url',{{$id}});"><i class="icon-link"></i></a>
<a title="{{$edvideo}}" onclick="insertFormatting('{{$comment}}','video',{{$id}});"><i class="icon-film"></i></a>
<a title="{{$eduline}}" onclick="insertFormatting('{{$comment}}','u',{{$id}});"><i class="icon-underline"></i></a>
<a title="{{$editalic}}" onclick="insertFormatting('{{$comment}}','i',{{$id}});"><i class="icon-italic"></i></a>
<a title="{{$edbold}}" onclick="insertFormatting('{{$comment}}','b',{{$id}});"><i class="icon-bold"></i></a>
<a title="{{$edquote}}" onclick="insertFormatting('{{$comment}}','quote',{{$id}});"><i class="icon-comments"></i></a>
<a title="{{$edquote}}" onclick="insertFormatting('{{$comment}}','quote',{{$id}});"><i class="icon-quote-left"></i></a>
</div>
<input type="submit" onclick="post_comment({{$id}}); return false;" id="comment-edit-submit-{{$id}}" class="comment-edit-submit" name="submit" value="{{$submit}}" />

View File

@ -26,11 +26,17 @@ else if ($style == "netcolour")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/netcolour.css" type="text/css" media="screen"/>'."\n";
else if ($style == "breathe")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/breathe.css" type="text/css" media="screen"/>'."\n";
else if ($style == "plus")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/plus.css" type="text/css" media="screen"/>'."\n";
$a->page['htmlhead'] .= <<< EOT
<script type="text/javascript" src="$baseurl/view/theme/vier/js/jquery.divgrow-1.3.1.f1.min.js"></script>
<script>
function showHideASide(e) {
var mouse_pos(e);
}
function collapseHeight(elems) {
var elemName = '.wall-item-body:not(.divmore)';
if(typeof elems != 'undefined') {