mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Merged in AD-756-branding-for-sluiceascribeio-brow (pull request #92)
Ad 756 branding for sluiceascribeio browser
This commit is contained in:
commit
68a6c70931
24
index.html
24
index.html
@ -2,30 +2,6 @@
|
|||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-57x57.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-60x60.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="72x72" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-72x72.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="76x76" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-76x76.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="114x114" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-114x114.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="120x120" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-120x120.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="144x144" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-144x144.png">
|
|
||||||
<link rel="apple-touch-icon" sizes="152x152" href="<%= BASE_URL %>static/img/hq-favicons/apple-touch-icon-152x152.png">
|
|
||||||
<link rel="icon" type="image/png" href="<%= BASE_URL %>static/img/hq-favicons/favicon-32x32.png" sizes="32x32">
|
|
||||||
<link rel="icon" type="image/png" href="<%= BASE_URL %>static/img/hq-favicons/favicon-96x96.png" sizes="96x96">
|
|
||||||
<link rel="icon" type="image/png" href="<%= BASE_URL %>static/img/hq-favicons/favicon-16x16.png" sizes="16x16">
|
|
||||||
<link rel="manifest" href="<%= BASE_URL %>static/img/hq-favicons/manifest.json">
|
|
||||||
<link rel="shortcut icon" href="<%= BASE_URL %>static/img/hq-favicons/favicon.ico">
|
|
||||||
<meta name="msapplication-TileColor" content="#00aba9">
|
|
||||||
<meta name="msapplication-TileImage" content="<%= BASE_URL %>static/img/hq-favicons/mstile-144x144.png">
|
|
||||||
<meta name="msapplication-config" content="<%= BASE_URL %>static/img/hq-favicons/browserconfig.xml">
|
|
||||||
<meta name="theme-color" content="#ffffff">
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="theme-color" content="#48DACB">
|
|
||||||
|
|
||||||
<title>ascribe</title>
|
<title>ascribe</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="<%= BASE_URL %>static/css/main.css">
|
<link rel="stylesheet" href="<%= BASE_URL %>static/css/main.css">
|
||||||
|
@ -29,6 +29,8 @@ import NavRoutesLinks from './nav_routes_links';
|
|||||||
import { mergeOptions } from '../utils/general_utils';
|
import { mergeOptions } from '../utils/general_utils';
|
||||||
import { getLangText } from '../utils/lang_utils';
|
import { getLangText } from '../utils/lang_utils';
|
||||||
|
|
||||||
|
import {constructHead} from '../utils/head_setter';
|
||||||
|
|
||||||
|
|
||||||
let Header = React.createClass({
|
let Header = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
@ -61,11 +63,17 @@ let Header = React.createClass({
|
|||||||
WhitelabelStore.unlisten(this.onChange);
|
WhitelabelStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
getLogo(){
|
getLogo() {
|
||||||
let { whitelabel } = this.state;
|
let { whitelabel } = this.state;
|
||||||
|
|
||||||
|
if (whitelabel.head) {
|
||||||
|
constructHead(whitelabel.head);
|
||||||
|
}
|
||||||
|
|
||||||
if (whitelabel.subdomain && whitelabel.subdomain !== 'www' && whitelabel.logo){
|
if (whitelabel.subdomain && whitelabel.subdomain !== 'www' && whitelabel.logo){
|
||||||
return (<img className="img-brand" src={whitelabel.logo}/>);
|
return (<img className="img-brand" src={whitelabel.logo}/>);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
<span className="icon-ascribe-logo"></span>
|
<span className="icon-ascribe-logo"></span>
|
||||||
|
37
js/utils/head_setter.js
Normal file
37
js/utils/head_setter.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
// elementType: string, is the type of the element, such as link, meta, etc.
|
||||||
|
// elementId id of the element
|
||||||
|
// elementAttributes: hash table containing the attributes of the relevant element
|
||||||
|
|
||||||
|
function constructHeadElement(elementType, elementId, elementAttributes) {
|
||||||
|
let head = (document.head || document.getElementsByTagName('head')[0]);
|
||||||
|
let element = document.createElement(elementType);
|
||||||
|
let oldElement = document.getElementById(elementId);
|
||||||
|
element.setAttribute('id', elementId);
|
||||||
|
for (let k in elementAttributes){
|
||||||
|
try {
|
||||||
|
element.setAttribute(k, elementAttributes[k]);
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
console.warn(e.message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (oldElement) {
|
||||||
|
head.removeChild(oldElement);
|
||||||
|
}
|
||||||
|
head.appendChild(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Accepts a dictionary of dictionaries which comprises a part or all of html head part
|
||||||
|
// {link : {id1: {rel: ... }}}
|
||||||
|
// traverses a tree of depth 3 (no backtracking)
|
||||||
|
export function constructHead(headObject){
|
||||||
|
for (let k in headObject){
|
||||||
|
let favicons = headObject[k];
|
||||||
|
for (let f in favicons){
|
||||||
|
constructHeadElement(k, f, favicons[f]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user