first commit
BIN
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/images/ace.png
Executable file
After Width: | Height: | Size: 24 KiB |
BIN
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/images/background.png
Executable file
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.9 KiB |
BIN
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/images/bottombar.png
Executable file
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 18 KiB |
BIN
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/images/logo.png
Executable file
After Width: | Height: | Size: 51 KiB |
BIN
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/images/logo_half.png
Executable file
After Width: | Height: | Size: 20 KiB |
120
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/index.html
Executable file
@@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<link href="style.css" rel="stylesheet" type="text/css">
|
||||
<title>Ace Bookmarklet Builder</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<div class="content" style="width: 950px">
|
||||
<div class="column1" style="margin-top: 47px">
|
||||
<textarea id="textarea" style="width:300px; height:300px">
|
||||
/**
|
||||
* This is Ace injected using a bookmarklet.
|
||||
*/
|
||||
function foo() {
|
||||
var bar = true;
|
||||
}</textarea><br>
|
||||
SourceUrl: <br>
|
||||
<input id="srcURL" style="width:300px" value="https://ajaxorg.github.io/ace-builds/src-noconflict"></input><br>
|
||||
<br>
|
||||
<a href="#" onmouseover="buildBookmarklet()" onmousedown="buildBookmarklet()" class="bookmarkletLink">Ace Bookmarklet Link</a>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://github.com/ajaxorg/ace/">
|
||||
<div class="fork_on_github"></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="column2">
|
||||
<h1>Ace Bookmarklet Builder</h1>
|
||||
|
||||
<p id="first">
|
||||
</p>
|
||||
|
||||
<h2>How to use it:</h2>
|
||||
<ul>
|
||||
<li>Select the options as you want them to be by default.</li>
|
||||
<li>Enter the "SourceUrl". This has to be the URL pointing to a folder containing ace.js (you can leave the default to load the scripts from GitHub).</li>
|
||||
<li>Drag the <a href="#" onmouseover="buildBookmarklet()" onmousedown="buildBookmarklet()" class="bookmarkletLink">"Ace Bookmarklet Link"</a> link to your toolbar or store it somewhere else.</li>
|
||||
<li>Click the bookmarklet.</li>
|
||||
<li>Click three times on a textarea you want to replace - Ace will replace it.</li>
|
||||
<li>To change settings, use <strong>Ctrl-,</strong> shortcut. (<strong>Cmd-,</strong> on mac).</li>
|
||||
</ul>
|
||||
<textarea cols="80">Test bookmarklet here!</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
function inject(options, callback) {
|
||||
var load = function(path, callback) {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var s = document.createElement('script');
|
||||
|
||||
s.src = options.baseUrl + "/" + path;
|
||||
head.appendChild(s);
|
||||
|
||||
s.onload = s.onreadystatechange = function(_, isAbort) {
|
||||
if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
|
||||
s = s.onload = s.onreadystatechange = null;
|
||||
if (!isAbort)
|
||||
callback();
|
||||
}
|
||||
};
|
||||
};
|
||||
var pending = [];
|
||||
var transform = function(el) { pending.push(el) };
|
||||
load("ace.js", function() {
|
||||
ace.config.loadModule("ace/ext/textarea", function(m) {
|
||||
transform = function(el) {
|
||||
if (!el.ace)
|
||||
el.ace = m.transformTextarea(el, options.ace);
|
||||
};
|
||||
pending = pending.forEach(transform);
|
||||
callback && setTimeout(callback);
|
||||
});
|
||||
});
|
||||
if (options.target)
|
||||
return transform(options.target);
|
||||
window.addEventListener("click", function(e) {
|
||||
if (e.detail == 3 && e.target.localName == "textarea")
|
||||
transform(e.target);
|
||||
});
|
||||
}
|
||||
|
||||
// Call the inject function to load the ace files.
|
||||
var textAce;
|
||||
inject({
|
||||
baseUrl: "../../src-noconflict",
|
||||
target: document.querySelector("textarea")
|
||||
}, function () {
|
||||
// Transform the textarea on the page into an ace editor.
|
||||
textAce = document.querySelector("textarea").ace;
|
||||
textAce.setDisplaySettings(true);
|
||||
buildBookmarklet();
|
||||
});
|
||||
|
||||
|
||||
function buildBookmarklet() {
|
||||
var injectSrc = inject.toString().split("\n").join("");
|
||||
injectSrc = injectSrc.replace(/\s+/g, " ");
|
||||
Function("", injectSrc); // check if injectSrc is still valid js
|
||||
|
||||
var options = textAce.getOptions();
|
||||
options.baseUrl = document.getElementById("srcURL").value;
|
||||
|
||||
var els = document.querySelectorAll(".bookmarkletLink");
|
||||
for (var i = 0; i < els.length; i++)
|
||||
els[i].href = "javascript:(" + injectSrc + ")(" + JSON.stringify(options) + ")";
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
226
api/jquery/plugins/ace/ace-builds-master/demo/bookmarklet/style.css
Executable file
@@ -0,0 +1,226 @@
|
||||
body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
background-color:#e6f5fc;
|
||||
|
||||
}
|
||||
|
||||
H2, H3, H4 {
|
||||
font-family:Trebuchet MS;
|
||||
font-weight:bold;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
H2 {
|
||||
font-size:28px;
|
||||
color:#263842;
|
||||
padding-bottom:6px;
|
||||
}
|
||||
|
||||
H3 {
|
||||
font-family:Trebuchet MS;
|
||||
font-weight:bold;
|
||||
font-size:22px;
|
||||
color:#253741;
|
||||
margin-top:43px;
|
||||
margin-bottom:8px;
|
||||
}
|
||||
|
||||
H4 {
|
||||
font-family:Trebuchet MS;
|
||||
font-weight:bold;
|
||||
font-size:21px;
|
||||
color:#222222;
|
||||
margin-bottom:4px;
|
||||
}
|
||||
|
||||
P {
|
||||
padding:13px 0;
|
||||
margin:0;
|
||||
line-height:22px;
|
||||
}
|
||||
|
||||
UL{
|
||||
line-height : 22px;
|
||||
}
|
||||
|
||||
PRE{
|
||||
background : #333;
|
||||
color : white;
|
||||
padding : 10px;
|
||||
}
|
||||
|
||||
#header {
|
||||
height : 227px;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
background: url(images/background.png) repeat-x 0 0;
|
||||
border-bottom:1px solid #c9e8fa;
|
||||
}
|
||||
|
||||
#header .content .signature {
|
||||
font-family:Trebuchet MS;
|
||||
font-size:11px;
|
||||
color:#ebe4d6;
|
||||
position:absolute;
|
||||
bottom:5px;
|
||||
right:42px;
|
||||
letter-spacing : 1px;
|
||||
}
|
||||
|
||||
.content {
|
||||
width:970px;
|
||||
position:relative;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
#header .content {
|
||||
height:184px;
|
||||
margin-top:22px;
|
||||
}
|
||||
|
||||
#header .content .logo {
|
||||
width : 282px;
|
||||
height : 184px;
|
||||
background:url(images/logo.png) no-repeat 0 0;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
}
|
||||
|
||||
#header .content .title {
|
||||
width : 605px;
|
||||
height : 58px;
|
||||
background:url(images/ace.png) no-repeat 0 0;
|
||||
position:absolute;
|
||||
top:98px;
|
||||
left:329px;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
background:url(images/body_background.png) repeat-x 0 0;
|
||||
min-height:250px;
|
||||
}
|
||||
|
||||
#wrapper .content {
|
||||
font-family:Arial;
|
||||
font-size:14px;
|
||||
color:#222222;
|
||||
width:1000px;
|
||||
}
|
||||
|
||||
#wrapper .content .column1 {
|
||||
position:relative;
|
||||
float:left;
|
||||
width:315px;
|
||||
margin-right:31px;
|
||||
}
|
||||
|
||||
#wrapper .content .column2 {
|
||||
position:relative;
|
||||
float:left;
|
||||
width:600px;
|
||||
padding-top:47px;
|
||||
}
|
||||
|
||||
.fork_on_github {
|
||||
width:310px;
|
||||
height:80px;
|
||||
background:url(images/fork_on_github.png) no-repeat 0 0;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.fork_on_github:hover {
|
||||
background-position:0 -80px;
|
||||
}
|
||||
|
||||
.divider {
|
||||
height:3px;
|
||||
background-color:#bedaea;
|
||||
margin-bottom:3px;
|
||||
}
|
||||
|
||||
.menu {
|
||||
padding:23px 0 0 24px;
|
||||
}
|
||||
|
||||
UL.content-list {
|
||||
padding:15px;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
UL.menu-list {
|
||||
padding:0;
|
||||
margin:0 0 20px 0;
|
||||
list-style-type:none;
|
||||
line-height : 16px;
|
||||
}
|
||||
|
||||
UL.menu-list LI {
|
||||
color:#2557b4;
|
||||
font-family:Trebuchet MS;
|
||||
font-size:14px;
|
||||
padding:7px 0;
|
||||
border-bottom:1px dotted #d6e2e7;
|
||||
}
|
||||
|
||||
UL.menu-list LI:last-child {
|
||||
border-bottom:0;
|
||||
}
|
||||
|
||||
A {
|
||||
color:#2557b4;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
A:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
P#first{
|
||||
background : rgba(255,255,255,0.5);
|
||||
padding : 20px;
|
||||
font-size : 16px;
|
||||
line-height : 24px;
|
||||
margin : 0 0 20px 0;
|
||||
}
|
||||
|
||||
#footer {
|
||||
height:40px;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
background:url(images/bottombar.png) repeat-x 0 0;
|
||||
position:relative;
|
||||
margin-top:40px;
|
||||
}
|
||||
|
||||
UL.menu-footer {
|
||||
padding:0;
|
||||
margin:8px 11px 0 0;
|
||||
list-style-type:none;
|
||||
float:right;
|
||||
}
|
||||
|
||||
UL.menu-footer LI {
|
||||
color:white;
|
||||
font-family:Arial;
|
||||
font-size:12px;
|
||||
display:inline-block;
|
||||
margin:0 1px;
|
||||
}
|
||||
|
||||
UL.menu-footer LI A {
|
||||
color:#8dd0ff;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
UL.menu-footer LI A:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|