Add language detection
This commit is contained in:
@ -6,7 +6,8 @@
|
||||
#wikiFrame {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
padding-top: 30px;
|
||||
top:0;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
@ -129,8 +130,6 @@
|
||||
border-color: darkgreen;
|
||||
}
|
||||
|
||||
wiki
|
||||
|
||||
.wiki-aside-action-item {
|
||||
display: flex;
|
||||
/* main axis */
|
||||
|
@ -382,8 +382,11 @@ $(document).ready(function() {
|
||||
|
||||
function showWiki() {
|
||||
if (!main.isWikiAsideLoad) {
|
||||
var lang = window.location.toString().match(/\/\w{2}\//);
|
||||
lang = (lang) ? lang[0] : '/en/';
|
||||
var wikiURL = 'http://freecodecamp.github.io/wiki' + lang;
|
||||
var wikiAside = $('<iframe>');
|
||||
wikiAside.attr('src', 'http://freecodecamp.github.io/wiki'); /* <----------------------------------------- here */
|
||||
wikiAside.attr('src', wikiURL);
|
||||
$('.wiki-aside').append(wikiAside);
|
||||
main.isWikiAsideLoad = true;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
"target": "_blank"
|
||||
},{
|
||||
"content": "Wiki",
|
||||
"link": "https://github.com/freecodecamp/freecodecamp/wiki/",
|
||||
"link": "/wiki",
|
||||
"target": "_blank"
|
||||
},{
|
||||
"content": "Jobs",
|
||||
|
@ -1,5 +1,6 @@
|
||||
module.exports = function(app) {
|
||||
var router = app.loopback.Router();
|
||||
router.get('/wiki/*', showWiki);
|
||||
router.get('/wiki', showWiki);
|
||||
|
||||
app.use(router);
|
||||
|
@ -66,8 +66,7 @@ export default function csp() {
|
||||
'*.twitter.com',
|
||||
'*.ghbtns.com',
|
||||
'*.freecatphotoapp.com',
|
||||
'freecodecamp.github.io',
|
||||
'localhost:8000'
|
||||
'freecodecamp.github.io'
|
||||
].concat(trusted)
|
||||
},
|
||||
// set to true if you only want to report errors
|
||||
|
@ -20,7 +20,7 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
|
||||
li.hidden-xs
|
||||
a#nav-wiki-btn(href='#' onclick='return false') Wiki
|
||||
li.visible-xs
|
||||
a(href='//github.com/FreeCodeCamp/freecodecamp/wiki/Home', target='_blank') Wiki
|
||||
a(href='/wiki', target='_blank') Wiki
|
||||
li
|
||||
a(href='/jobs') Jobs
|
||||
li
|
||||
|
@ -1,3 +1,7 @@
|
||||
extends ../layout-wide
|
||||
block content
|
||||
iframe#wikiFrame(frameborder='no', src='http://freecodecamp.github.io/wiki')
|
||||
iframe#wikiFrame(frameborder='no')
|
||||
script.
|
||||
var lang = window.location.toString().match(/\/\w{2}\//);
|
||||
lang = (lang) ? lang[0] : '/en/';
|
||||
$('#wikiFrame').attr('src','http://freecodecamp.github.io/wiki' + lang);
|
||||
|
Reference in New Issue
Block a user