From 2b00bfeb4f9d4f5a60bc861b30f1466ac6e142f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 14 Oct 2015 17:41:44 +0200 Subject: [PATCH] Revert "Merge remote-tracking branch 'remotes/origin/AD-756-branding-for-sluiceascribeio-brow' into AD-1080-restyle-webapp-with-new-corporate-identity" Remove AD-756 from PR This reverts commit 097e158e5064fbe58e73bc561a492ec961740cfb, reversing changes made to 617577550309d3190a85f99bbbbd364feec5af46. Conflicts: js/components/header.js --- index.html | 16 ++++++++++++++++ js/components/header.js | 13 +------------ js/utils/head_setter.js | 42 ----------------------------------------- 3 files changed, 17 insertions(+), 54 deletions(-) delete mode 100644 js/utils/head_setter.js diff --git a/index.html b/index.html index af35ab55..3e0d2f4b 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,23 @@ + + + + + + + + + + + + + + + + diff --git a/js/components/header.js b/js/components/header.js index c8ce868a..5cb0ab72 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -29,7 +29,6 @@ import NavRoutesLinks from './nav_routes_links'; import { mergeOptions } from '../utils/general_utils'; import { getLangText } from '../utils/lang_utils'; -import { constructHead, setTitle } from '../utils/head_setter'; let Header = React.createClass({ propTypes: { @@ -66,17 +65,7 @@ let Header = React.createClass({ getLogo(){ let { whitelabel } = this.state; - if (whitelabel.title && whitelabel.head) { - setTitle(whitelabel.title); - constructHead(whitelabel.head); - } - else{ - setTitle('ascribe'); - } - - if (whitelabel.subdomain && - whitelabel.subdomain !== 'www' - && whitelabel.logo){ + if (whitelabel.subdomain && whitelabel.subdomain !== 'www' && whitelabel.logo){ return (); } return ( diff --git a/js/utils/head_setter.js b/js/utils/head_setter.js deleted file mode 100644 index f80e8945..00000000 --- a/js/utils/head_setter.js +++ /dev/null @@ -1,42 +0,0 @@ -'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.log(e.message); - console.log(elementAttributes); - 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]); - } - } -} - -export function setTitle(titleString){ - document.title = titleString; -}