Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Update doc and test fixtures to support IE11 #319

Merged
merged 1 commit into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const config = Object.assign(commonConfig(), {
},
devServer: {
contentBase: './test',
disableHostCheck: true,
host: '0.0.0.0',
inline: true
}
});
Expand Down
23 changes: 12 additions & 11 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" href='./styles.css' />
<link rel="stylesheet" href='https://cdn01.boxcdn.net/platform/preview/1.60.0/en-US/preview.css' />
<link rel="stylesheet" href='https://unpkg.com/box-annotations/lib/annotations.css' />
Expand All @@ -16,28 +17,28 @@
<input id='token-set' placeholder='Enter token' />
<button onClick="setProperty('token')">Set new token</button>
</div>

<div class='container' id='file'>
<div> File ID: <span id='fileid-display'></span></div>
<input id='fileid-set' placeholder='Enter file ID' />
<button onClick="setProperty('fileid')">Set new file ID</button>
</div>
</div>
</div>

<div class='preview-container'> </div>
<script>
function setProperty(selector) {
// Get new value, fallback to local storage
const inputValue = document.querySelector('#' + selector + '-set')
var inputValue = document.querySelector('#' + selector + '-set')
value = inputValue && inputValue.value || localStorage.getItem(selector);


if (!value) {
return;
}

// Set it for display purposes
displayElement = document.querySelector('#' + selector + '-display');
var displayElement = document.querySelector('#' + selector + '-display');
displayElement.textContent = value;

// Cache it in local storage
Expand All @@ -48,15 +49,15 @@
}

function loadPreview() {
const token = localStorage.getItem('token');
const fileid = localStorage.getItem('fileid');
var token = localStorage.getItem('token');
var fileid = localStorage.getItem('fileid');

if ( !token || !fileid) {
return;
}

// Load Preview + Annotations with the passed in file ID
const options = {
var options = {
Image: {
enabledTypes: ["point"]
},
Expand All @@ -69,7 +70,7 @@
};

/* global BoxAnnotations */
const annotations = new BoxAnnotations(options);
var annotations = new BoxAnnotations(options);

/* global Box */
var preview = new Box.Preview();
Expand All @@ -85,4 +86,4 @@
setProperty('fileid');
</script>
</body>
</html>
</html>
13 changes: 7 additions & 6 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" href='./styles.css' />
<link rel="stylesheet" href='https://cdn01.boxcdn.net/platform/preview/1.60.0/en-US/preview.css' />
<link rel="stylesheet" href='./annotations.css' />
Expand Down Expand Up @@ -28,7 +29,7 @@
<script>
function setProperty(selector) {
// Get new value, fallback to local storage
const inputValue = document.querySelector('#' + selector + '-set')
var inputValue = document.querySelector('#' + selector + '-set')
value = inputValue && inputValue.value || localStorage.getItem(selector);


Expand All @@ -37,7 +38,7 @@
}

// Set it for display purposes
displayElement = document.querySelector('#' + selector + '-display');
var displayElement = document.querySelector('#' + selector + '-display');
displayElement.textContent = value;

// Cache it in local storage
Expand All @@ -48,15 +49,15 @@
}

function loadPreview() {
const token = localStorage.getItem('token');
const fileid = localStorage.getItem('fileid');
var token = localStorage.getItem('token');
var fileid = localStorage.getItem('fileid');

if ( !token || !fileid) {
return;
}

// Load Preview + Annotations with the passed in file ID
const options = {
var options = {
Image: {
enabledTypes: ["point"]
},
Expand All @@ -69,7 +70,7 @@
};

/* global BoxAnnotations */
const annotations = new BoxAnnotations(options);
var annotations = new BoxAnnotations(options);

/* global Box */
var preview = new Box.Preview();
Expand Down