Skip to content

Commit

Permalink
fix(versioning): load package.json relative to app.html and only when…
Browse files Browse the repository at this point in the history
… dialogue is opened
  • Loading branch information
edsilv committed Feb 15, 2017
1 parent dcebad6 commit 0b9500f
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/uv-2.0.0/lib/app.js

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions dist/uv-2.0.0/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "universalviewer",
"version": "2.0.0",
"description": "The Universal Viewer is an open source project to enable cultural heritage institutions to present their digital artifacts in an IIIF-compliant and highly customisable user interface.",
"repository": {
"type": "git",
"url": "git+https://github.com/universalviewer/universalviewer.git"
},
"keywords": [
"IIIF",
"viewer"
],
"author": "Edward Silverton <ed@edsilv.com> (http://edsilv.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/universalviewer/universalviewer/issues"
},
"scripts": {
"publish": "standard-version"
},
"homepage": "https://github.com/universalviewer/universalviewer",
"devDependencies": {
"async": "^0.9.0",
"base-component": "viewdir/base-component#v1.0.8",
"chalk": "^0.5.1",
"cucumber": "^0.4.5",
"eventemitter2": "^1.0.3",
"exjs": "BSick7/exjs",
"extensions": "edsilv/extensions",
"glob": "^4.3.5",
"glob-array": "^0.1.2",
"grunt": "^0.4.5",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-compress": "~0.5.2",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "~0.8.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-uglify": "^1.0.1",
"grunt-exec": "~0.4.2",
"grunt-protractor-runner": "^1.1.4",
"grunt-sync": "^0.2.3",
"grunt-text-replace": "~0.3.7",
"grunt-typescript": "^0.8.0",
"hooker": "^0.2.3",
"http-status-codes": "edsilv/http-status-codes",
"iiif-gallery-component": "viewdir/iiif-gallery-component#v1.0.6",
"iiif-metadata-component": "viewdir/iiif-metadata-component#v1.0.10",
"iiif-tree-component": "viewdir/iiif-tree-component#v1.0.7",
"jquery-plugins": "edsilv/jquery-plugins",
"jquery-tiny-pubsub": "edsilv/jquery-tiny-pubsub",
"json-schema-generator": "krg7880/json-schema-generator",
"key-codes": "edsilv/key-codes",
"less": "^2.4.0",
"lodash": "^3.1.0",
"manifold": "viewdir/manifold#v1.1.11",
"ncp": "^2.0.0",
"openseadragon": "^2.2.1",
"protractor": "1.3.1",
"requirejs": "2.2.0",
"standard-version": "^4.0.0",
"three.js": "^0.73.0",
"units": "edsilv/Units",
"utils": "edsilv/utils",
"virtex3d": "^0.2.6"
}
}
11 changes: 11 additions & 0 deletions src/lib/bundle.min.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/modules/uv-dialogues-module/SettingsDialogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,14 @@ class SettingsDialogue extends Dialogue {
this.$locale.append(this.$localeDropDown);

// initialise ui.
this.$title.text(this.content.title);

var pjsonUrl: string = window.location.href.split('?')[0] + "/../package.json";
var $version: JQuery = this.$version;
$.getJSON(pjsonUrl, (pjson: any) => {
$version.text("v" + pjson.version);
});
this.$title.text(this.content.title);

this.$website.html(this.content.website);
this.$website.targetBlank();

var locales: any[] = this.extension.getLocales();

for (var i = 0; i < locales.length; i++){
for (var i = 0; i < locales.length; i++) {
var locale = locales[i];
this.$localeDropDown.append('<option value="' + locale.name + '">' + locale.label + '</option>');
}
Expand Down Expand Up @@ -100,6 +94,12 @@ class SettingsDialogue extends Dialogue {

open(): void {
super.open();

if (!window.DEBUG) {
$.getJSON("package.json", (pjson: any) => {
this.$version.text("v" + pjson.version);
});
}
}

resize(): void {
Expand Down

0 comments on commit 0b9500f

Please sign in to comment.