Skip to content

Commit

Permalink
fix(load): Fix url for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonny committed Feb 1, 2015
1 parent 28a5dcc commit 4a8b694
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions hubpress/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5040,6 +5040,7 @@ var _ = require("underscore");
var Q = require("q");
var AppActionServerCreators = _interopRequire(require("../actions/AppActionServerCreators"));

var SettingsStore = require("../stores/SettingsStore");



Expand All @@ -5055,10 +5056,12 @@ function _getConfig() {
return deferred.promise;
}

function _loadActiveTheme(name) {
function _loadActiveTheme(name, meta) {
var deferred = Q.defer();
var promises = [];
jquery.get("/themes/" + name + "/theme.json", function (theme) {
var siteUrl = SettingsStore.getSiteUrl(meta);
console.log("Site url", siteUrl);
jquery.get("" + siteUrl + "/themes/" + name + "/theme.json", function (theme) {
var version = theme.version;
var files = _.pairs(theme.files);

Expand All @@ -5072,7 +5075,7 @@ function _loadActiveTheme(name) {
paginationLoaded = paginationLoaded || file[0] === "pagination";
navigationLoaded = navigationLoaded || file[0] === "nav";

jquery.get("/themes/" + name + "/" + file[1], function (content) {
jquery.get("" + siteUrl + "/themes/" + name + "/" + file[1], function (content) {
deferredFile.resolve({
name: file[0],
path: file[1],
Expand All @@ -5087,7 +5090,7 @@ function _loadActiveTheme(name) {
(function () {
var deferredPagination = Q.defer();
promises.push(deferredPagination.promise);
jquery.get("/hubpress/scripts/helpers/tpl/pagination.hbs", function (content) {
jquery.get("" + siteUrl + "/hubpress/scripts/helpers/tpl/pagination.hbs", function (content) {
deferredPagination.resolve({
name: "pagination",
path: "partials/pagination",
Expand All @@ -5103,7 +5106,7 @@ function _loadActiveTheme(name) {
(function () {
var deferredNav = Q.defer();
promises.push(deferredNav.promise);
jquery.get("/hubpress/scripts/helpers/tpl/nav.hbs", function (content) {
jquery.get("" + siteUrl + "//hubpress/scripts/helpers/tpl/nav.hbs", function (content) {
deferredNav.resolve({
name: "nav",
path: "partials/nav",
Expand Down Expand Up @@ -5136,7 +5139,7 @@ HpWebApiUtils.prototype.getConfig = function () {

_getConfig().then(function (config) {
_config = config;
return _loadActiveTheme(config.theme.name);
return _loadActiveTheme(config.theme.name, config.meta);
}).then(function (themeInfos) {
var data = {
config: _config,
Expand All @@ -5156,7 +5159,7 @@ HpWebApiUtils.prototype.getConfig = function () {
module.exports = new HpWebApiUtils();

}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/app/scripts/utils/HpWebApiUtils.js","/app/scripts/utils")
},{"../actions/AppActionServerCreators":"/Users/anthonny/00-Development/test-react-hubpress/app/scripts/actions/AppActionServerCreators.js","_process":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/browserify/node_modules/process/browser.js","buffer":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/browserify/node_modules/buffer/index.js","q":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/q/q.js","underscore":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/underscore/underscore.js"}],"/Users/anthonny/00-Development/test-react-hubpress/app/scripts/utils/asciidoctor.js":[function(require,module,exports){
},{"../actions/AppActionServerCreators":"/Users/anthonny/00-Development/test-react-hubpress/app/scripts/actions/AppActionServerCreators.js","../stores/SettingsStore":"/Users/anthonny/00-Development/test-react-hubpress/app/scripts/stores/SettingsStore.js","_process":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/browserify/node_modules/process/browser.js","buffer":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/browserify/node_modules/buffer/index.js","q":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/q/q.js","underscore":"/Users/anthonny/00-Development/test-react-hubpress/node_modules/underscore/underscore.js"}],"/Users/anthonny/00-Development/test-react-hubpress/app/scripts/utils/asciidoctor.js":[function(require,module,exports){
(function (process,global,Buffer,__argument0,__argument1,__argument2,__argument3,__filename,__dirname){
"use strict";

Expand Down

0 comments on commit 4a8b694

Please sign in to comment.