Commit 2fb9f80de342d719fd9d8d6ca724de288a1159cb

  • avatar
  • arvind
  • Tue Apr 08 20:22:26 IST 2014
Changing load behaviour of the image.  User should hit annotate to start
annotating the image. This is a hack, this should be fixed.
Changing the layout of the interface of the app.  Sign In comes on the
top right of the screen, and helpview has become shorter.
  • Diff rendering mode:
  • inline
  • side by side

swtr/static/js/swtmaker.js

175 var AppView = Backbone.View.extend({175 var AppView = Backbone.View.extend({
176 el: $('#swt-maker'),176 el: $('#swt-maker'),
177 events: {177 events: {
178 'click #img-url-load': 'setImage',
178 'click #img-url-submit': 'setImage',179 'click #img-url-submit': 'setImage',
179 'click #sweet': 'sweet',180 'click #sweet': 'sweet',
180 'click #signin-credentials': 'getSignInCredentials',181 'click #signin-credentials': 'getSignInCredentials',
191 anno.hideAnnotations();});191 anno.hideAnnotations();});
192 anno.addHandler('onSelectionCompleted', function(annotation) {192 anno.addHandler('onSelectionCompleted', function(annotation) {
193 anno.showAnnotations(); });193 anno.showAnnotations(); });
194
195
194
195
196 this.$overlay = $('#app-overlay');196 this.$overlay = $('#app-overlay');
197 this.$img = $('#annotatable-img');197 this.$img = $('#annotatable-img');
198 this.imgURL = this.$img.attr('src');198 this.imgURL = this.$img.attr('src');
244 },244 },
245 error: function(jqxhr, error, statusText) {245 error: function(jqxhr, error, statusText) {
246 if(jqxhr.status === 404) { //annotations don't exist for this image246 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 swtr.appView.$overlay.hide();249 swtr.appView.$overlay.hide();
250 swtr.appView.helpview.step(2);250 swtr.appView.helpview.step(2);
285 $("p").toggle();285 $("p").toggle();
286 $('.annotorious-item-unfocus').css("opacity", "0");286 $('.annotorious-item-unfocus').css("opacity", "0");
287 }287 }
288
288
289 },289 },
290 getSignInCredentials: function(event) {290 getSignInCredentials: function(event) {
291 event.preventDefault();291 event.preventDefault();

swtr/templates/index.html

15 <body>15 <body>
1616
17 <div id="swt-maker" class="container">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 <div class="row" id="signinview">19 <div class="row" id="signinview">
20 <form class="form-inline" role="form">20 <form class="form-inline" role="form">
21 <span id="signin-msg">You are not signed in. </span>21 <span id="signin-msg">You are not signed in. </span>
24 </button>24 </button>
25 </form>25 </form>
26 </div>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 <input type="text" placeholder="Enter URL of the image"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 </div>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 <button class="btn btn-default" id="sweet">Sweet</button>37 <button class="btn btn-default" id="sweet">Sweet</button>
34 <input id="setbox" type="checkbox"/ > <label38 <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 </div>42 </div>
38 <div id="img-annotation-wrapper" class="col-md-12 col-xs-12 col-lg-12 col-sm-12 well">43 <div id="img-annotation-wrapper" class="col-md-12 col-xs-12 col-lg-12 col-sm-12 well">
39 {% if url %}44 {% if url %}
82 </li>82 </li>
83 </script>83 </script>
84 <script type="text/template" id="signin-credentials-template">84 <script type="text/template" id="signin-credentials-template">
85 <div class="form-group">
85 <div class="form-inline col-md-3">
86 <label class="sr-only" for="username">Username</label>86 <label class="sr-only" for="username">Username</label>
87 <input type="text" class="form-control" id="username" placeholder="Enter username">87 <input type="text" class="form-control" id="username" placeholder="Enter username">
88 </div>88 </div>
89 <div class="form-group">
89 <div class="form-inline col-md-3">
90 <label class="sr-only" for="password">Password</label>90 <label class="sr-only" for="password">Password</label>
91 <input type="password" class="form-control" id="password" placeholder="Password">91 <input type="password" class="form-control" id="password" placeholder="Password">
92 </div>92 </div>