Skip to content

Commit

Permalink
Merge pull request apidoc#94 from CodersBrothers/master
Browse files Browse the repository at this point in the history
Support http and https google font with JS.
  • Loading branch information
rottmann committed Aug 11, 2014
2 parents e99ff04 + c7a27bf commit 1c35a0a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var _ = require("underscore");
var path = require("path");
var semver = require("semver");
var findFiles = require("./utils/find_files");
var path = require("path");
var PackageInfo = require("./package_info");
var Parser = require("./parser");
var Worker = require("./worker");
Expand Down
2 changes: 0 additions & 2 deletions lib/package_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ var app = {};

function PackageInfo(_app)
{
var self = this;

// Global Variables
app = _app;

Expand Down
1 change: 0 additions & 1 deletion template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<title>Loading...</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="//fonts.googleapis.com/css?family=Source+Code+Pro|Source+Sans+Pro:400,600,700" rel="stylesheet" type="text/css">
<link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="vendor/prettify.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet" media="screen, print">
Expand Down
16 changes: 16 additions & 0 deletions template/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ require.config({
waitSeconds: 15
});

function loadGoogleFontCss($){
var host = document.location.hostname.toLowerCase();
var googleCss = '//fonts.googleapis.com/css?family=Source+Code+Pro|Source+Sans+Pro:400,600,700';
if (host == "localhost" || !host.length){
googleCss = 'http:' + googleCss;
}
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: googleCss
}).appendTo("head");
}

require([
"jquery",
"lodash",
Expand All @@ -42,6 +55,9 @@ require([
"bootstrap"
], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint) {

loadGoogleFontCss($);


var api = apiData.api;

/**
Expand Down

0 comments on commit 1c35a0a

Please sign in to comment.