aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/routes/package
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-19 11:22:21 +1000
committerYuchen Pei <hi@ypei.me>2022-09-19 11:22:21 +1000
commitef1b927861f9a949aed20341144ffb5bfd42f038 (patch)
tree48bd4688928546bedc6504aad76bf6e0327fcef9 /javascript/app/routes/package
parent117850d8f659517cb818a857dc04c8f5157795c4 (diff)
Removing the web client
Diffstat (limited to 'javascript/app/routes/package')
-rw-r--r--javascript/app/routes/package/index.js7
-rw-r--r--javascript/app/routes/package/search.js36
-rw-r--r--javascript/app/routes/package/show/file.js27
-rw-r--r--javascript/app/routes/package/show/index.js7
4 files changed, 0 insertions, 77 deletions
diff --git a/javascript/app/routes/package/index.js b/javascript/app/routes/package/index.js
deleted file mode 100644
index 15ff8a5..0000000
--- a/javascript/app/routes/package/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Ember from 'ember';
-
-export default Ember.Route.extend({
- afterModel : function (model,transition) {
- transition.send("fileOpened",null);
- }
-});
diff --git a/javascript/app/routes/package/search.js b/javascript/app/routes/package/search.js
deleted file mode 100644
index 058f9ec..0000000
--- a/javascript/app/routes/package/search.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import Ember from 'ember';
-import {urls} from '../../utils/api-urls';
-import {goToDefinition} from '../../utils/go-to-definition';
-
-export default Ember.Route.extend({
- store : Ember.inject.service('store'),
- model (params) {
- return {
- query: params.query,
- url: urls.identifierSearchUrl(this.modelFor('package').id,params.query)+"?per_page=20"
- };
- },
- afterModel () {
- const onmouseup = (event) => {
- // This makes links in documentation clickable
- if(event.target.dataset.location) {
- let location;
- try {
- location = JSON.parse(event.target.dataset.location);
- } catch (e) {
- console.log(e);
- }
- if(location) {
- goToDefinition(this.get('store'),location,event.which);
- }
- }
- };
- this._onmouseup = onmouseup;
- document.addEventListener('mouseup',onmouseup);
- },
- deactivate() {
- if(this._onmouseup) {
- document.removeEventListener('mouseup',this._onmouseup);
- }
- }
-});
diff --git a/javascript/app/routes/package/show/file.js b/javascript/app/routes/package/show/file.js
deleted file mode 100644
index 568d288..0000000
--- a/javascript/app/routes/package/show/file.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import Ember from 'ember';
-
-export default Ember.Route.extend({
- store : Ember.inject.service(),
- model : function (params) {
- const packageInfo = this.modelFor('package');
- if(packageInfo.modules[params.filePath]) {
- return this.get('store').loadHaskellModule(packageInfo.id,params.filePath)
- .catch((e) => {console.log(e);this.transitionTo("/not-found");});
- } else {
- return this.get('store').loadFile(packageInfo.id,params.filePath)
- .then((result) => {
- document.title = packageInfo.id;
- return result;
- })
- .catch((e) => {console.log(e);this.transitionTo("/not-found");});
- }
- },
- afterModel (model) {
- document.title = model.id + " - " + this.modelFor('package').id;
- },
- actions : {
- didTransition : function () {
- this.send("fileOpened",this.currentModel.id);
- }
- }
-});
diff --git a/javascript/app/routes/package/show/index.js b/javascript/app/routes/package/show/index.js
deleted file mode 100644
index 15ff8a5..0000000
--- a/javascript/app/routes/package/show/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Ember from 'ember';
-
-export default Ember.Route.extend({
- afterModel : function (model,transition) {
- transition.send("fileOpened",null);
- }
-});