src_js/iconolab-bundle/src/main.js
author Alexandre Segura <mex.zktk@gmail.com>
Mon, 22 May 2017 16:17:36 +0200
changeset 520 d1e231a045ac
parent 418 a04c55054afe
child 539 08e2513dbc2f
permissions -rw-r--r--
Make the whole row clickable with JS.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
146
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     1
import 'expose?Vue!vue/dist/vue'
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     2
import "expose?jQuery!jquery"
148
5d2cd51c6951 fixing js build
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 146
diff changeset
     3
import "expose?$!jquery"
146
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     4
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     5
import VueResource from 'vue-resource'
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     6
import Typeahead from './components/typeahead/Typeahead.vue'
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     7
import Cutout from './components/cutout'
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     8
import Zoomview from './components/zoomview/Zoomview.vue'
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
     9
import MergeTool from './components/mergetool/MergeTool.vue'
212
1c7cce196665 Added complete_description attribute to Collection for homepage #12 + Vue.js components to handle display and sart to harmonize javascript
durandn
parents: 156
diff changeset
    10
import CollectionSelector from './components/collectionselector/CollectionSelector.vue'
153
9ed54b10ce16 iconolab js updated
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 148
diff changeset
    11
import DiffViewer from './components/diffviewer/diffviewer.vue'
9ed54b10ce16 iconolab js updated
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 148
diff changeset
    12
import jsondiffpatch from 'jsondiffpatch'
320
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    13
import Editor from './components/editor'
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    14
import ColorButtons from './components/tagform/ColorButtons.vue'
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    15
import TagList from './components/tagform/TagList.vue'
153
9ed54b10ce16 iconolab js updated
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 148
diff changeset
    16
9ed54b10ce16 iconolab js updated
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 148
diff changeset
    17
const Diff = require('diff')
156
e1e14766f608 adding diffviewer to merging view
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents: 153
diff changeset
    18
Vue.config.ignoredElements = ["mask"];
146
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
    19
var iconolab = {
299
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    20
    Cutout : Cutout,
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    21
    JsDiff: Diff,
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    22
    JsonDiff: jsondiffpatch,
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    23
    CollectionSelector: CollectionSelector,
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    24
    VueComponents : {
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    25
        Typeahead: Typeahead,
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    26
        MergeTool: MergeTool,
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    27
        Zoomview: Zoomview,
320
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    28
        DiffViewer: DiffViewer,
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    29
        Editor: Editor,
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    30
        ColorButtons: ColorButtons,
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    31
        TagList: TagList
299
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    32
    }
146
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
    33
};
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
    34
320
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    35
Vue.component('color-buttons', ColorButtons);
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    36
Vue.component('image-annotator', Editor.Canvas);
323
55c024fc7c60 Roughly implement annotation navigator.
Alexandre Segura <mex.zktk@gmail.com>
parents: 321
diff changeset
    37
Vue.component('annotation-form', Editor.AnnotationForm);
418
a04c55054afe Introduce display of all annotations at the same time.
Alexandre Segura <mex.zktk@gmail.com>
parents: 323
diff changeset
    38
Vue.component('annotation-list', Editor.AnnotationList);
323
55c024fc7c60 Roughly implement annotation navigator.
Alexandre Segura <mex.zktk@gmail.com>
parents: 321
diff changeset
    39
Vue.component('comment-list', Editor.CommentList);
320
81945eedc63f Introduce refactored components using Vue.js.
Alexandre Segura <mex.zktk@gmail.com>
parents: 299
diff changeset
    40
520
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    41
$('.table-clickable').each(function() {
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    42
    var selector = $(this).data('selector');
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    43
    $(this).find('tr').on('click', function(e) {
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    44
        var href = $(this).find(selector).attr('href');
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    45
        window.location.replace(href);
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    46
    });
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    47
})
d1e231a045ac Make the whole row clickable with JS.
Alexandre Segura <mex.zktk@gmail.com>
parents: 418
diff changeset
    48
146
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
    49
if (!window.iconolab) {
299
fb07469bfb55 correct js compilation
ymh <ymh.work@gmail.com>
parents: 212
diff changeset
    50
    window.iconolab = iconolab;
146
f912b591e1c1 new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff changeset
    51
}