ckportfolio.com - Author: JavaScript

Author: JavaScript

Events

$(document).on("mouseup", "#editor", highlight);
$(document).on("mouseup", "#send", submit);

Application Functions

function highlight() // javascript
{

  var value = window.getSelection().toString();
  $("#sample").val(value);

}

function suggest(data){

  $("#suggestion").text(data);

}

function submit() // javascript
{

  var value = $("#sample").val();

  if (value != "") {

    $("#suggestion").text("Loading ...");

    var path = "chris.k/author/main.py";
    var text = value;

    $.ajax({
      url: "https://ocadu.goodcodeclub.com/author/?path=" + path + "&text=" + value,
      success: suggest

    })

  }

}
Fin