Skip to content

Instantly share code, notes, and snippets.

@minikomi
Last active November 11, 2021 10:16
Show Gist options
  • Star 98 You must be signed in to star a gist
  • Fork 32 You must be signed in to fork a gist
  • Save minikomi/4672169 to your computer and use it in GitHub Desktop.
Save minikomi/4672169 to your computer and use it in GitHub Desktop.
my editor
data:text/html,
<style type="text/css">
#e {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
font-size:16px;
}
</style>
<div id="e"></div>
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script>
var myKey="SecretKeyz";
$(document).ready(function(){
var e;
var url = "http://api.openkeyval.org/"+myKey;
$.ajax({
url: url,
dataType: "jsonp",
success: function(data){
e = ace.edit("e");
e.setTheme("ace/theme/tomorrow_night_eighties");
e.getSession().setMode("ace/mode/markdown");
e.setValue(data);
}
});
$("#e").on("keydown", function (b) {
if (b.ctrlKey && 83 == b.which) {
b.preventDefault();
var data = myKey+"="+encodeURIComponent(e.getValue());
$.ajax({
data: data,
url: "http://api.openkeyval.org/store/",
dataType: "jsonp",
success: function(data){
alert("Saved.");
}
});
}
});
});
</script>
@DOXuxi
Copy link

DOXuxi commented Feb 4, 2013

NNNN!!!!!!

@inmyfree
Copy link

inmyfree commented Feb 5, 2013

cool

@ekd123
Copy link

ekd123 commented Feb 5, 2013

善哉!

@bingwen
Copy link

bingwen commented Feb 15, 2013

cool

@bingwen
Copy link

bingwen commented Feb 15, 2013

cool

@houtf
Copy link

houtf commented Feb 17, 2013

牛B

@lioneltsai
Copy link

拉轰!!

@wg19891116
Copy link

nice

@tylerlong
Copy link

Now we have Slim Text

Slim Text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment