PageSourceSearch

http://wikigenomes.org/static/wiki/js/app/mutant-forms/mutant-single-form.component.js

js wikigenomes.org collected 2026-09-25 23:43:21 UTC 3,548 bytes, 118 lines download raw bytes

1angular
2    .module('mutantForm')
3    .component('mutantForm', {
4        bindings: {
5            data: '<'
6        },
7
8        controller: function (pubMedData, $location, $routeParams, sendToView) {
9            var ctrl = this;
10            ctrl.$onInit = function () {
11                ctrl.mutantAnnotation = {
12                    taxid: $routeParams.taxid,
13                    locusTag: $routeParams.locusTag
14                };
15                ctrl.pageCount = 0;
16                ctrl.alerts = {
17                    'success': false,
18                    'error': false
19                };
20            };
21
22
23            //controls for navigating form
24            ctrl.nextClick = function () {
25                ctrl.pageCount += 1;
26            };
27            ctrl.backClick = function () {
28                ctrl.pageCount -= 1;
29            };
30
31            ctrl.seq_ontology_map = [
32                {
33                    alias: 'SYNONYMOUS',
34                    name: 'synonymous',
35                    id: 'SO:0001814'
36                },
37                {
38                    alias: 'Non-neutral',
39                    name: 'non-synonymous',
40                    id: 'SO:0001816'
41                },
42                {
43                    alias: 'NON-CODING',
44                    name: 'non_transcribed_region',
45                    id: 'SO:0000183'
46                },
47                {
48                    alias: 'Neutral',
49                    name: 'silent_mutation',
50                    id: 'SO:0001017'
51                },
52                {
53                    alias: 'NONSENSE',
54                    name: 'stop_gained',
55                    id: 'SO:0001017'
56                }
57
58            ];
59
60            ctrl.mutant_type_map = [
61                {
62                    alias: 'chemical mutagenesis',
63                    name: 'chemically induced mutation',
64                    id:'EFO_0000370'
65                },
66                {
67                    alias: 'transposon mutagenesis',
68                    name: 'tbd',
69                    id: 'tbd'
70                }
71            ];
72
73
74            ctrl.getPMID = function (val) {
75                return pubMedData.getPMID(val).then(
76                    function (data) {
77
78                        var resultData = [data.data.result[val]];
79                        return resultData.map(function (item) {
80                            return item;
81                        });
82                    }
83                );
84            };
85
86            ctrl.selectPub = function ($item, $model, $label) {
87                ctrl.mutantAnnotation.pub = $item;
88                ctrl.pubValue = ''
89            };
90
91            ctrl.resetForm = function () {
92                ctrl.$onInit();
93            };
94
95            //send form data to server to edit wikidata
96            ctrl.sendData = function (formData) {
97                ctrl.loading = true;
98                formData.action = 'annotate';
99                var url_suf = $location.path() + '/wd_mutant_edit';
100                console.log(url_suf);
101                sendToView.sendToView(url_suf, formData).then(function (data) {
102                    if (data.data.write_success === true) {
103                        ctrl.alerts.success = true;
104                    }
105                    else {
106                        ctrl.alerts.error = true;
107                    }
108                }).finally(function () {
109                    ctrl.loading = false;
110                });
111
112            };
113
114
115        },
116        templateUrl: '/static/wiki/js/angular_templates/mutant-form.html'
117    });
118

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.