Merge master for site tweaks
This commit is contained in:
commit
f66b365f35
7 changed files with 98 additions and 73 deletions
|
|
@ -1,20 +1,17 @@
|
|||
function setupDisqus() {
|
||||
function setupDisqus(href) {
|
||||
var disqus_shortname = 'aceapi';
|
||||
var dsqId = "disqusScript";
|
||||
|
||||
//var paths = window.location.pathname.split("/");
|
||||
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
|
||||
|
||||
//var disqus_identifier = fileName;
|
||||
|
||||
var lochash = location.hash.substr(1);
|
||||
var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html";
|
||||
var disqus_identifier = href.substring(2);
|
||||
|
||||
(function() {
|
||||
if (document.getElementById(dsqId) === null) {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
if (document.getElementById("disqusScript") === null) {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
|
@ -1,22 +1,17 @@
|
|||
function setupDisqus() {
|
||||
function setupDisqus(href) {
|
||||
var disqus_shortname = 'aceapi';
|
||||
var dsqId = "disqusScript";
|
||||
|
||||
//var paths = window.location.pathname.split("/");
|
||||
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
|
||||
|
||||
//var disqus_identifier = fileName;
|
||||
|
||||
var lochash = location.hash.substr(1);
|
||||
var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html";
|
||||
var disqus_identifier = href.substring(2);
|
||||
|
||||
(function() {
|
||||
if (document.getElementById(dsqId))
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(document.getElementById(dsqId));
|
||||
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
|
||||
dsq.id="disqusScript";
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
if (document.getElementById("disqusScript") === null) {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
|
@ -4,17 +4,16 @@ $(function() {
|
|||
hljs.initHighlighting();
|
||||
editor = ace.edit("ace_editor_demo");
|
||||
embedded_editor = ace.edit("embedded_ace_code");
|
||||
var javascriptMode = require("ace/mode/javascript").Mode;
|
||||
var htmlMode = require("ace/mode/html").Mode;
|
||||
editor.getSession().setMode(new javascriptMode());
|
||||
embedded_editor.getSession().setMode(new htmlMode());
|
||||
editor.getSession().setMode("ace/mode/javascript");
|
||||
editor.getSession().setMode("ace/mode/javascript");
|
||||
embedded_editor.getSession().setMode("ace/mode/html");
|
||||
|
||||
$("ul.menu-list li").click(function(e) {
|
||||
if (e.target.tagName === "LI") {
|
||||
console.log($(this).find("a"));
|
||||
window.location = $(this).find("a").attr("href");
|
||||
}
|
||||
else if (e.target.tagName === "P") {
|
||||
else if (e.target.tagName === "P" || e.target.tagName === "IMG") {
|
||||
var anchor = $(e.target).siblings();
|
||||
window.location = anchor.attr("href");
|
||||
}
|
||||
|
|
@ -28,8 +27,9 @@ $(function() {
|
|||
state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5);
|
||||
$.bbq.pushState(state);
|
||||
|
||||
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
||||
var _self = $(this);
|
||||
$("#apiHolder").load($(this).attr("href") + " #documentation", function(){
|
||||
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
||||
ux();
|
||||
setupClicker();
|
||||
|
||||
|
|
@ -39,32 +39,12 @@ $(function() {
|
|||
$("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click');
|
||||
}
|
||||
|
||||
// setupDisqus();
|
||||
//setupDisqus(_self.attr("href"));
|
||||
});
|
||||
}
|
||||
|
||||
$('.menu-item a').click(magicClickInterceptor);
|
||||
$('a.argument').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var state = {};
|
||||
state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5);
|
||||
$.bbq.pushState(state);
|
||||
|
||||
$("#apiHolder").load($(this).attr("href") + " #documentation", function(){
|
||||
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
||||
ux();
|
||||
setupClicker();
|
||||
|
||||
// handles dropping in from new link
|
||||
var section = $.bbq.getState("section");
|
||||
if (section) {
|
||||
$("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click');
|
||||
}
|
||||
|
||||
setupDisqus();
|
||||
});
|
||||
});
|
||||
$('a.argument').click(magicClickInterceptor);
|
||||
|
||||
$('a.external').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
|
@ -79,8 +59,10 @@ $(function() {
|
|||
e.preventDefault();
|
||||
embedded_editor.resize();
|
||||
editor.resize();
|
||||
if ($(this).attr("href") === "/")
|
||||
if ($(this).attr("href") === "/") {
|
||||
window.location = "http://ace.ajax.org";
|
||||
return;
|
||||
}
|
||||
if ($(this).attr("href").indexOf("#api") === 0) {
|
||||
$("#top_container").addClass("collapse");
|
||||
scrollIntoPosition(null, 0);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ body {
|
|||
font-family: Helvetica, Arial;
|
||||
}
|
||||
|
||||
#embed_ace_wrapper {
|
||||
height: 525px;
|
||||
}
|
||||
|
||||
.ace_editor_wrapper {
|
||||
height: 275px;
|
||||
position: relative;
|
||||
|
|
@ -463,4 +467,12 @@ p.highlight_note a {
|
|||
.apiIntro {
|
||||
padding-left: 15px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.prod_no_image {
|
||||
position: relative; left: -10px; top: -12px;
|
||||
}
|
||||
|
||||
#sidebarContainer {
|
||||
margin: 0 20px 0 0;
|
||||
}
|
||||
76
index.html
76
index.html
|
|
@ -7,9 +7,7 @@
|
|||
<script src="./doc/resources/ace/skeleton/javascripts/bbq.js"></script>
|
||||
<script src="./api/resources/javascripts/bootstrap-tab.js"></script>
|
||||
<script src="./api/resources/javascripts/bootstrap-dropdown.js"></script>
|
||||
<script src="https://raw.github.com/ajaxorg/ace-builds/master/src-min/ace.js"></script>
|
||||
<script src="https://raw.github.com/ajaxorg/ace-builds/master/src-min/mode-javascript.js"></script>
|
||||
<script src="https://raw.github.com/ajaxorg/ace-builds/master/src-min/mode-html.js"></script>
|
||||
<script src="https://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
|
||||
<script src="https://yandex.st/highlightjs/7.2/highlight.min.js"></script>
|
||||
<script src="doc/site/js/main.js"></script>
|
||||
<link rel="stylesheet" href="https://yandex.st/highlightjs/7.0/styles/default.min.css">
|
||||
|
|
@ -17,8 +15,6 @@
|
|||
<link href="doc/site/style.css" rel="stylesheet" type="text/css" />
|
||||
<link href="api/resources/csses/ace_api.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" href="./api/resources/csses/font-awesome.css">
|
||||
<link rel="stylesheet" media="all and (max-device-width: 480px)" href="doc/site/iphone.css">
|
||||
<link rel="stylesheet" media="all and (min-device-width: 481px) and (max-device-width: 1024px)" href="doc/site/iphone.css">
|
||||
<link href="./doc/resources/ace/skeleton/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -32,7 +28,7 @@
|
|||
<div id="top_container" class="collapse">
|
||||
<h1>The high performance code editor for the web.</h1>
|
||||
<div id="page_logo">
|
||||
<img src="doc/site/images/logo.png" />
|
||||
<img src="./doc/site/images/logo.png" />
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
|
|
@ -141,7 +137,7 @@ console.log(addResult);</div>
|
|||
<h1>Embedding ACE in Your Site</h1>
|
||||
<p>ACE can be easily embedded into a web page:</p>
|
||||
|
||||
<div class="ace_editor_wrapper">
|
||||
<div id="embed_ace_wrapper" class="ace_editor_wrapper">
|
||||
<div id="embedded_ace_code"><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
@ -163,10 +159,10 @@ console.log(addResult);</div>
|
|||
return x;
|
||||
}</div>
|
||||
|
||||
<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/twilight");
|
||||
editor.setTheme("ace/theme/monokai");
|
||||
editor.getSession().setMode("ace/mode/javascript");
|
||||
</script>
|
||||
</body>
|
||||
|
|
@ -189,17 +185,14 @@ console.log(addResult);</div>
|
|||
<p>Themes are loaded on demand; all you have to do is pass the string name:</p>
|
||||
|
||||
<pre><code class="javascript">editor.setTheme("ace/theme/twilight");</code></pre>
|
||||
<p><span class="expand_arrow">></span> (See all themes)</p>
|
||||
<p><span class="expand_arrow">></span> <a href="https://github.com/ajaxorg/ace/tree/master/lib/ace/theme"
|
||||
target="_blank">See all themes</a></p>
|
||||
|
||||
<h2>Setting the Programming Language Mode</h2>
|
||||
<p>By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:</p>
|
||||
<pre><code class="javascript">editor.getSession().setMode("ace/mode/javascript");</pre></code>
|
||||
|
||||
<pre><code class="javascript"><script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script></code></pre>
|
||||
<p>The mode can then be used like this:</p>
|
||||
<pre><code class="javascript">var javascriptMode = require("ace/mode/javascript").Mode;
|
||||
editor.getSession().setMode(new javascriptMode());</pre></code>
|
||||
|
||||
<h2>One Editor, Multiple Sessions</h2>
|
||||
<!--h2>One Editor, Multiple Sessions</h2>
|
||||
<p>ACE keeps everything about the state of the editor (selection, scroll position, etc.)
|
||||
in <code class="javascript">editor.session</code>. This means you can grab the
|
||||
session, store it in a var, and set the editor to another session (e.g. a tabbed editor).</p>
|
||||
|
|
@ -209,10 +202,10 @@ editor.getSession().setMode(new javascriptMode());</pre></code>
|
|||
var js = new EditSession("some js code");
|
||||
var css = new EditSession(["some", "css", "code here"]);
|
||||
// and then to load document into editor, just call
|
||||
editor.setSession(js);</code></pre>
|
||||
editor.setSession(js);</code></pre-->
|
||||
|
||||
<h2>Common Operations</h2>
|
||||
<p>Set and get content:`</p>
|
||||
<p>Set and get content:</p>
|
||||
|
||||
<pre><code class="javascript">editor.setValue("the new text here"); // or session.setValue
|
||||
editor.getValue(); // or session.getValue</code></pre>
|
||||
|
|
@ -470,60 +463,103 @@ tests for the highlighting.</p>
|
|||
style="position: relative; left: 19px; top: 2px;" />
|
||||
<a href="http://rstudio.org/">RStudio</a>
|
||||
</li>
|
||||
<li><a href="https://github.com/Gozala/sky-edit">Sky Edit</a></li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
style="position: relative; left: -10px; top: -12px;" />
|
||||
class="prod_no_image" />
|
||||
<a href="https://github.com/Gozala/sky-edit">Sky Edit</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://www.wavemaker.com/">WaveMaker</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://www.playmycode.com/">Play My Code</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://demo.qooxdoo.org/devel/playground/#">Qooxdoo playground</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://ext.radiantcms.org/extensions/264-ace">Radiant CMS</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://developercompanion.com/">Developer Companion</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://www.pythonanywhere.com/">PythonAnywhere</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://www.applicationcraft.com/">Application Craft</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://shiftedit.net/">shiftEdit</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://www.akshell.com/">Akshell</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://beanstalkapp.com/">beanstalk</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://neutronide.com/">Neutron IDE</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/acebug/">Acebug</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://www.weecod.com">Weecod</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href='http://rubymonk.com'>RubyMonk</a></li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href='http://rocktronica.github.com/tmpltr/'>tmpltr</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href='http://dev.cmsmadesimple.org/projects/aceeditor'>CMS Made Simple</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href='http://tryjasmine.com/'>Try Jasmine</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="http://codebender.cc/">Codebender</a>
|
||||
</li>
|
||||
<li>
|
||||
<img src="doc/site/images/empty-logo.png"
|
||||
class="prod_no_image" />
|
||||
<a href="https://www.sharelatex.com">ShareLaTeX</a>
|
||||
</li>
|
||||
<li id="add_your_site">
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@
|
|||
}
|
||||
|
||||
.ace-monokai .ace_marker-layer .ace_active_line {
|
||||
background: #49483E;
|
||||
background: #202020;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_gutter_active_line {
|
||||
background-color: #191916;
|
||||
background-color: #272727;
|
||||
}
|
||||
|
||||
.ace-monokai .ace_marker-layer .ace_selected_word {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
"no use strict";
|
||||
|
||||
var console = {
|
||||
log: function(msg) {
|
||||
postMessage({type: "log", data: msg});
|
||||
log: function(msgs) {
|
||||
postMessage({type: "log", data: arguments.join(" ")});
|
||||
}
|
||||
};
|
||||
var window = {
|
||||
|
|
@ -30,6 +30,9 @@ var normalizeModule = function(parentId, moduleName) {
|
|||
};
|
||||
|
||||
var require = function(parentId, id) {
|
||||
if (!id.charAt)
|
||||
throw new Error("worker.js require() accepts only (parentId, id) as arguments");
|
||||
|
||||
var id = normalizeModule(parentId, id);
|
||||
|
||||
var module = require.modules[id];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue