This repository homes a web application to filter and display the different online resources provided by Specialist Library Support.
npm install
Run: gulp dev
Local development app runs on port 8181
If source file (any file located in <project-path>/src
) is edited, a build is triggered and the development live-server instance will restart
gulp build
to execute build process<project-path>/dist/LIB-MLE-online-resource-v2/index.html
<project-path>/dist/LIB-MLE-online-resource-v2/index.html
The application is built using AngularJS (not to be mistaken with Angular)
It displays online resources determined by a resources.json
file
resources.json
file:[
{
"featured": false,
"title": "Better safe than sorry: proofreading your work",
"description": "This resource explores three vital elements to review when proofreading your work - flow, clarity and accuracy - and gives you a chance to learn about and apply some techniques to ensure that you check your work properly.",
"duration": "15 minutes",
"format": "Online tutorial",
"link": "https://www.escholar.manchester.ac.uk/learning-objects/mle/proofreading/",
"tags": [
"assignments",
"writing"
]
},
{
"featured": false,
"title": "Podcast: 12 tips for successful revision",
"description": "",
"duration": "7 mins",
"format": "Audio",
"link": "https://w.soundcloud.com/player/?url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F294406254&auto_play=false&show_artwork=true&visual=true&origin=twitter",
"tags": [
"exam extra",
"planning",
"revising",
"study strategies"
]
}
]
Things to note:
resources.json
https://w.soundcloud.com/player/
link (example in JSON above). You can find this link by visiting any soundcloud track, viewing the page source and finding the element:<meta property="twitter:player" content="https://w.soundcloud.com/player/?url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F294406254&auto_play=false&show_artwork=true&visual=true&origin=twitter">
A three-pronged approach has been taken to ensure that resources are available for the application at when it is loaded:
src/default-resources.js
file which is placed inline in the built html. Is generated from resources.json
.src/config.js
.var config = {
resourcesJsonUrl: "https://raw.githubusercontent.com/UoMLibrary/mle-online-resources/master/resources.json"
};
http://localhost:8181/?resourcesSource=<url-encoded-resources-source>
If multiple resources are available (e.g. the app is able to load external resources. The order of precedence is: external URI > config URI > embedded resources.
😃