mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Replace appHref with publicHref.
This commit is contained in:
parent
05547c2685
commit
4db158e8d9
7 changed files with 9 additions and 29 deletions
|
@ -146,7 +146,7 @@ class Setup {
|
|||
public function to_jsono($as_admin = false) {
|
||||
|
||||
$keys = [
|
||||
'APP_HREF',
|
||||
'PUBLIC_HREF',
|
||||
'ROOT_HREF',
|
||||
'VERSION'
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
modulejs.define('core/resource', ['_', 'config', 'core/settings'], function (_, config, settings) {
|
||||
|
||||
var imagesHref = settings.appHref + 'public/images/';
|
||||
var imagesHref = settings.publicHref + 'images/';
|
||||
var uiHref = imagesHref + 'ui/';
|
||||
var themesHref = imagesHref + 'themes/';
|
||||
var defaultThemeHref = themesHref + 'default/';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
modulejs.define('core/settings', ['_', 'config'], function (_, config) {
|
||||
|
||||
return _.extend({}, config.options, {
|
||||
appHref: config.setup.APP_HREF,
|
||||
publicHref: config.setup.PUBLIC_HREF,
|
||||
rootHref: config.setup.ROOT_HREF,
|
||||
version: config.setup.VERSION
|
||||
});
|
||||
|
|
|
@ -179,11 +179,6 @@ modulejs.define('model/item', ['_', 'core/event', 'core/location', 'core/server'
|
|||
return this.absHref === settings.rootHref;
|
||||
},
|
||||
|
||||
isH5ai: function () {
|
||||
|
||||
return this.absHref === settings.appHref;
|
||||
},
|
||||
|
||||
isEmpty: function () {
|
||||
|
||||
return _.keys(this.content).length === 0;
|
||||
|
|
|
@ -16,7 +16,7 @@ describe('module \'' + ID + '\'', function () {
|
|||
b: 'myTheme/b.jpg'
|
||||
}
|
||||
};
|
||||
this.xSettings = {appHref: util.uniqPath('/appHref/')};
|
||||
this.xSettings = {publicHref: util.uniqPath('/publicHref/')};
|
||||
this.applyFn = function () {
|
||||
|
||||
return this.definition.fn(_, this.xConfig, this.xSettings);
|
||||
|
@ -77,7 +77,7 @@ describe('module \'' + ID + '\'', function () {
|
|||
it('works', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
var ui = this.xSettings.appHref + 'public/images/ui/';
|
||||
var ui = this.xSettings.publicHref + 'images/ui/';
|
||||
|
||||
assert.strictEqual(instance.image(), ui + 'undefined.svg');
|
||||
assert.strictEqual(instance.image(1), ui + '1.svg');
|
||||
|
@ -97,7 +97,7 @@ describe('module \'' + ID + '\'', function () {
|
|||
it('works', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
var themes = this.xSettings.appHref + 'public/images/themes/';
|
||||
var themes = this.xSettings.publicHref + 'images/themes/';
|
||||
|
||||
assert.strictEqual(instance.icon(''), themes + 'default/file.svg');
|
||||
assert.strictEqual(instance.icon('a'), themes + 'myTheme/a.svg');
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('module \'' + ID + '\'', function () {
|
|||
more: util.uniqObj()
|
||||
},
|
||||
setup: {
|
||||
APP_HREF: util.uniqId(),
|
||||
PUBLIC_HREF: util.uniqId(),
|
||||
ROOT_HREF: util.uniqId(),
|
||||
VERSION: util.uniqId()
|
||||
}
|
||||
|
@ -83,12 +83,12 @@ describe('module \'' + ID + '\'', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('.appHref', function () {
|
||||
describe('.publicHref', function () {
|
||||
|
||||
it('set correct', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
assert.strictEqual(instance.appHref, this.xConfig.setup.APP_HREF);
|
||||
assert.strictEqual(instance.publicHref, this.xConfig.setup.PUBLIC_HREF);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -183,11 +183,6 @@ describe('module \'' + ID + '\'', function () {
|
|||
assert.isTrue(this.item.isRoot());
|
||||
});
|
||||
|
||||
it('.isH5ai() returns false', function () {
|
||||
|
||||
assert.isFalse(this.item.isH5ai());
|
||||
});
|
||||
|
||||
it('.isEmpty() returns true', function () {
|
||||
|
||||
assert.isTrue(this.item.isEmpty());
|
||||
|
@ -283,11 +278,6 @@ describe('module \'' + ID + '\'', function () {
|
|||
assert.isFalse(this.item.isRoot());
|
||||
});
|
||||
|
||||
it('.isH5ai() returns false', function () {
|
||||
|
||||
assert.isFalse(this.item.isH5ai());
|
||||
});
|
||||
|
||||
it('.isEmpty() returns true', function () {
|
||||
|
||||
assert.isTrue(this.item.isEmpty());
|
||||
|
@ -383,11 +373,6 @@ describe('module \'' + ID + '\'', function () {
|
|||
assert.isFalse(this.item.isRoot());
|
||||
});
|
||||
|
||||
it('.isH5ai() returns false', function () {
|
||||
|
||||
assert.isFalse(this.item.isH5ai());
|
||||
});
|
||||
|
||||
it('.isEmpty() returns true', function () {
|
||||
|
||||
assert.isTrue(this.item.isEmpty());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue