Add an indicator to show the HTTP status of the site. (#483)

This commit is contained in:
Teromene 2017-03-18 19:02:18 +00:00 committed by GitHub
parent 155c0ac6f0
commit 59025d96bc
6 changed files with 29 additions and 4 deletions

View file

@ -3,7 +3,7 @@ class ABCTabsBridge extends BridgeAbstract {
const MAINTAINER = 'kranack'; const MAINTAINER = 'kranack';
const NAME = 'ABC Tabs Bridge'; const NAME = 'ABC Tabs Bridge';
const URI = 'http://www.abc-tabs.com/'; const URI = 'https://www.abc-tabs.com/';
const DESCRIPTION = 'Returns 22 newest tabs'; const DESCRIPTION = 'Returns 22 newest tabs';
public function collectData(){ public function collectData(){

View file

@ -3,7 +3,7 @@ class AskfmBridge extends BridgeAbstract {
const MAINTAINER = 'az5he6ch'; const MAINTAINER = 'az5he6ch';
const NAME = 'Ask.fm Answers'; const NAME = 'Ask.fm Answers';
const URI = 'http://ask.fm/'; const URI = 'https://ask.fm/';
const CACHE_TIMEOUT = 300; //5 min const CACHE_TIMEOUT = 300; //5 min
const DESCRIPTION = 'Returns answers from an Ask.fm user'; const DESCRIPTION = 'Returns answers from an Ask.fm user';
const PARAMETERS = array( const PARAMETERS = array(

View file

@ -3,7 +3,7 @@ class BandcampBridge extends BridgeAbstract {
const MAINTAINER = 'sebsauvage'; const MAINTAINER = 'sebsauvage';
const NAME = 'Bandcamp Tag'; const NAME = 'Bandcamp Tag';
const URI = 'http://bandcamp.com/'; const URI = 'https://bandcamp.com/';
const CACHE_TIMEOUT = 600; // 10min const CACHE_TIMEOUT = 600; // 10min
const DESCRIPTION = 'New bandcamp release by tag'; const DESCRIPTION = 'New bandcamp release by tag';
const PARAMETERS = array( array( const PARAMETERS = array( array(

View file

@ -3,7 +3,7 @@ class DansTonChatBridge extends BridgeAbstract {
const MAINTAINER = 'Astalaseven'; const MAINTAINER = 'Astalaseven';
const NAME = 'DansTonChat Bridge'; const NAME = 'DansTonChat Bridge';
const URI = 'http://danstonchat.com/'; const URI = 'https://danstonchat.com/';
const CACHE_TIMEOUT = 21600; //6h const CACHE_TIMEOUT = 21600; //6h
const DESCRIPTION = 'Returns latest quotes from DansTonChat.'; const DESCRIPTION = 'Returns latest quotes from DansTonChat.';

View file

@ -144,6 +144,21 @@ form {
} }
.secure-warning {
background-color: #ffc600;
color: #5f5f5f;
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
border-radius: 2px;
border: 1px solid transparent;
width: 80%;
margin: auto;
margin-bottom: 6px;
}
input[type="text"] { input[type="text"] {
background-color: white; background-color: white;

View file

@ -28,6 +28,14 @@ EOD;
if($bridge == false) if($bridge == false)
return ""; return "";
$HTTPSWarning = '';
if(strpos($bridge->getURI(), 'https') !== 0) {
$HTTPSWarning = '<div class="secure-warning">Warning :
This bridge is not fetching its content through a secure connection</div>';
}
$name = '<a href="' . $bridge->getURI() . '">' . $bridge->getName() . '</a>'; $name = '<a href="' . $bridge->getURI() . '">' . $bridge->getName() . '</a>';
$description = $bridge->getDescription(); $description = $bridge->getDescription();
@ -45,6 +53,7 @@ CARD;
if(count($bridge->getParameters()) == 0){ if(count($bridge->getParameters()) == 0){
$card .= $getFormHeader($bridgeName); $card .= $getFormHeader($bridgeName);
$card .= $HTTPSWarning;
if($isActive){ if($isActive){
if(defined('PROXY_URL') && PROXY_BYBRIDGE){ if(defined('PROXY_URL') && PROXY_BYBRIDGE){
@ -93,6 +102,7 @@ CARD;
$card .= '<h5>' . $parameterName . '</h5>' . PHP_EOL; $card .= '<h5>' . $parameterName . '</h5>' . PHP_EOL;
$card .= $getFormHeader($bridgeName); $card .= $getFormHeader($bridgeName);
$card .= $HTTPSWarning;
foreach($parameter as $id => $inputEntry){ foreach($parameter as $id => $inputEntry){
$additionalInfoString = ''; $additionalInfoString = '';