online/src/js/samples.js
function samples () {
  form.samples.url.link.on("click", function (event) {
    event.preventDefault();
    form.url.val(samples.url);
  });

  form.samples.text.link.on("click", function (event) {
    event.preventDefault();
    form.textBox.setValue(samples.text, -1);
    form.samples.text.container.hide();
    form.textBox.focus();
  });

  form.textBox.on("input", function () {
    if (form.textBox.session.getValue().length === 0) {
      form.samples.text.container.show();
    }
    else {
      form.samples.text.container.hide();
    }
  });
}
function samples () {
  form.samples.url.link.on("click", function (event) {
    event.preventDefault();
    form.url.val(samples.url);
  });

  form.samples.text.link.on("click", function (event) {
    event.preventDefault();
    form.textBox.setValue(samples.text, -1);
    form.samples.text.container.hide();
    form.textBox.focus();
  });

  form.textBox.on("input", function () {
    if (form.textBox.session.getValue().length === 0) {
      form.samples.text.container.show();
    }
    else {
      form.samples.text.container.hide();
    }
  });
}
function samples ( ) { form . samples . url . link . on ( "click" , function ( event ) { event . preventDefault ( ) ; form . url . val ( samples . url ) ; } ) ; form . samples . text . link . on ( "click" , function ( event ) { event . preventDefault ( ) ; form . textBox . setValue ( samples . text , - 1 ) ; form . samples . text . container . hide ( ) ; form . textBox . focus ( ) ; } ) ; form . textBox . on ( "input" , function ( ) { if ( form . textBox . session . getValue ( ) . length === 0 ) { form . samples . text . container . show ( ) ; } else { form . samples . text . container . hide ( ) ; } } ) ; }
Allows the user to use a sample URL or sample API text
Allows the user to use a sample URL or sample API text