Commit 2fb9f80de342d719fd9d8d6ca724de288a1159cb
- Diff rendering mode:
- inline
- side by side
swtr/static/js/swtmaker.js
(5 / 4)
  | |||
175 | 175 | var AppView = Backbone.View.extend({ | |
176 | 176 | el: $('#swt-maker'), | |
177 | 177 | events: { | |
178 | 'click #img-url-load': 'setImage', | ||
178 | 179 | 'click #img-url-submit': 'setImage', | |
179 | 180 | 'click #sweet': 'sweet', | |
180 | 181 | 'click #signin-credentials': 'getSignInCredentials', | |
… | … | ||
191 | 191 | anno.hideAnnotations();}); | |
192 | 192 | anno.addHandler('onSelectionCompleted', function(annotation) { | |
193 | 193 | anno.showAnnotations(); }); | |
194 | |||
195 | |||
194 | |||
195 | |||
196 | 196 | this.$overlay = $('#app-overlay'); | |
197 | 197 | this.$img = $('#annotatable-img'); | |
198 | 198 | this.imgURL = this.$img.attr('src'); | |
… | … | ||
244 | 244 | }, | |
245 | 245 | error: function(jqxhr, error, statusText) { | |
246 | 246 | if(jqxhr.status === 404) { //annotations don't exist for this image | |
247 | //console.log('annotations don\'t exist for this image. Create one!'); | ||
247 | console.log('annotations don\'t exist for this image. Create one!'); | ||
248 | 248 | } | |
249 | 249 | swtr.appView.$overlay.hide(); | |
250 | 250 | swtr.appView.helpview.step(2); | |
… | … | ||
285 | 285 | $("p").toggle(); | |
286 | 286 | $('.annotorious-item-unfocus').css("opacity", "0"); | |
287 | 287 | } | |
288 | |||
288 | |||
289 | 289 | }, | |
290 | 290 | getSignInCredentials: function(event) { | |
291 | 291 | event.preventDefault(); |
swtr/templates/index.html
(14 / 9)
  | |||
15 | 15 | <body> | |
16 | 16 | ||
17 | 17 | <div id="swt-maker" class="container"> | |
18 | <div id="helpview" class="alert alert-info"></div> | ||
18 | <div id="helpview" class="alert alert-info col-md-8"></div> | ||
19 | 19 | <div class="row" id="signinview"> | |
20 | 20 | <form class="form-inline" role="form"> | |
21 | 21 | <span id="signin-msg">You are not signed in. </span> | |
… | … | ||
24 | 24 | </button> | |
25 | 25 | </form> | |
26 | 26 | </div> | |
27 | <div id="img-input"> | ||
28 | <div class="form-group"> | ||
27 | <div id="img-input" class="row"> | ||
28 | <div class="form-group col-md-8"> | ||
29 | 29 | <input type="text" placeholder="Enter URL of the image" | |
30 | id="img-url-input" class="form-control"> | ||
30 | id="img-url-input" class="form-control"> | ||
31 | 31 | </div> | |
32 | <button class="btn btn-default" id="img-url-submit">GO</button> | ||
32 | <div class="col-md-2"> | ||
33 | <button class="btn btn-default" id="img-url-submit">GO</button> | ||
34 | </div> | ||
35 | <div class="col-md-8"> | ||
36 | <button class="btn btn-default" id="img-url-load">Annotate</button> | ||
33 | 37 | <button class="btn btn-default" id="sweet">Sweet</button> | |
34 | 38 | <input id="setbox" type="checkbox"/ > <label | |
35 | id="setcontrol"><p>Show Box</p><p style="display: none">Hide | ||
36 | Box</p></label> | ||
39 | id="setcontrol"><p>Show annotated areas</p><p style="display: none">Hide | ||
40 | annotated areas</p></label> | ||
41 | </div> | ||
37 | 42 | </div> | |
38 | 43 | <div id="img-annotation-wrapper" class="col-md-12 col-xs-12 col-lg-12 col-sm-12 well"> | |
39 | 44 | {% if url %} | |
… | … | ||
82 | 82 | </li> | |
83 | 83 | </script> | |
84 | 84 | <script type="text/template" id="signin-credentials-template"> | |
85 | <div class="form-group"> | ||
85 | <div class="form-inline col-md-3"> | ||
86 | 86 | <label class="sr-only" for="username">Username</label> | |
87 | 87 | <input type="text" class="form-control" id="username" placeholder="Enter username"> | |
88 | 88 | </div> | |
89 | <div class="form-group"> | ||
89 | <div class="form-inline col-md-3"> | ||
90 | 90 | <label class="sr-only" for="password">Password</label> | |
91 | 91 | <input type="password" class="form-control" id="password" placeholder="Password"> | |
92 | 92 | </div> |