Sha256: 22dfeafb3b633990ec7c61c578b192651aa50fb30ab5cd86f8cca39e9b7b55d6

Contents?: true

Size: 649 Bytes

Versions: 103

Compression:

Stored size: 649 Bytes

Contents

$(function() {
  var updateView = function() {
    $.ajax({
      url: '/onebox',
      type: 'GET',
      data: {
        url: input.val()
      }
    }).done(function(data) {
      $('.onebox-container').empty().append(data.onebox).append(data.placeholder);
      $('#oneboxed-url').empty().text(data.url);
      $('#onebox-engine').empty().text(data.engine);
      $('#preview-html').empty().text(data.onebox);
      $('#placeholder-html').empty().text(data.placeholder);
    });
  };

  var input = $('#onebox-url').keyup(function(e) {
    // ENTER key
    if (e.keyCode === 13) { updateView(); }
  }).focus();
  $('#go').click(updateView);
});

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
onebox-1.5.64 web/assets/javascripts/main.js
onebox-1.5.63 web/assets/javascripts/main.js
onebox-1.5.62 web/assets/javascripts/main.js
onebox-1.5.61 web/assets/javascripts/main.js
onebox-1.5.60 web/assets/javascripts/main.js
onebox-1.5.50 web/assets/javascripts/main.js
onebox-1.5.49 web/assets/javascripts/main.js
onebox-1.5.48 web/assets/javascripts/main.js
onebox-1.5.47 web/assets/javascripts/main.js
onebox-1.5.45 web/assets/javascripts/main.js
onebox-1.5.44 web/assets/javascripts/main.js
onebox-1.5.43 web/assets/javascripts/main.js
onebox-1.5.42 web/assets/javascripts/main.js
onebox-1.5.41 web/assets/javascripts/main.js
onebox-1.5.40 web/assets/javascripts/main.js
onebox-1.5.39 web/assets/javascripts/main.js
onebox-1.5.38 web/assets/javascripts/main.js
onebox-1.5.37 web/assets/javascripts/main.js
onebox-1.5.36 web/assets/javascripts/main.js
onebox-1.5.35 web/assets/javascripts/main.js