Merge pull request #946 from c9developer/master
Minor updates to ACE site
This commit is contained in:
commit
7a7d0f2855
5 changed files with 74 additions and 59 deletions
|
|
@ -1,22 +1,17 @@
|
||||||
function setupDisqus() {
|
function setupDisqus(href) {
|
||||||
var disqus_shortname = 'aceapi';
|
var disqus_shortname = 'aceapi';
|
||||||
var dsqId = "disqusScript";
|
|
||||||
|
|
||||||
//var paths = window.location.pathname.split("/");
|
//var paths = window.location.pathname.split("/");
|
||||||
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
|
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
|
||||||
|
|
||||||
//var disqus_identifier = fileName;
|
//var disqus_identifier = fileName;
|
||||||
|
var disqus_identifier = href.substring(2);
|
||||||
var lochash = location.hash.substr(1);
|
|
||||||
var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html";
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
if (document.getElementById(dsqId))
|
if (document.getElementById("disqusScript") === null) {
|
||||||
(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 = 'http://' + disqus_shortname + '.disqus.com/embed.js';
|
||||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||||
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
|
}
|
||||||
dsq.id="disqusScript";
|
|
||||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
@ -1,22 +1,17 @@
|
||||||
function setupDisqus() {
|
function setupDisqus(href) {
|
||||||
var disqus_shortname = 'aceapi';
|
var disqus_shortname = 'aceapi';
|
||||||
var dsqId = "disqusScript";
|
|
||||||
|
|
||||||
//var paths = window.location.pathname.split("/");
|
//var paths = window.location.pathname.split("/");
|
||||||
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
|
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
|
||||||
|
|
||||||
//var disqus_identifier = fileName;
|
//var disqus_identifier = fileName;
|
||||||
|
var disqus_identifier = href.substring(2);
|
||||||
var lochash = location.hash.substr(1);
|
|
||||||
var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html";
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
if (document.getElementById(dsqId))
|
if (document.getElementById("disqusScript") === null) {
|
||||||
(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 = 'http://' + disqus_shortname + '.disqus.com/embed.js';
|
||||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||||
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
|
}
|
||||||
dsq.id="disqusScript";
|
|
||||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ $(function() {
|
||||||
console.log($(this).find("a"));
|
console.log($(this).find("a"));
|
||||||
window.location = $(this).find("a").attr("href");
|
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();
|
var anchor = $(e.target).siblings();
|
||||||
window.location = anchor.attr("href");
|
window.location = anchor.attr("href");
|
||||||
}
|
}
|
||||||
|
|
@ -23,34 +23,12 @@ $(function() {
|
||||||
// used when page is access directly
|
// used when page is access directly
|
||||||
function magicClickInterceptor(e) {
|
function magicClickInterceptor(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var state = {};
|
|
||||||
state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5);
|
|
||||||
$.bbq.pushState(state);
|
|
||||||
|
|
||||||
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
|
||||||
$("#apiHolder").load($(this).attr("href") + " #documentation", function(){
|
|
||||||
ux();
|
|
||||||
setupClicker();
|
|
||||||
|
|
||||||
// handles dropping in from new link
|
|
||||||
var section = $.bbq.getState("section");
|
|
||||||
if (section) {
|
|
||||||
$("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click');
|
|
||||||
}
|
|
||||||
|
|
||||||
setupDisqus();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.menu-item a').click(magicClickInterceptor);
|
|
||||||
$('a.argument').click(function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var state = {};
|
var state = {};
|
||||||
state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5);
|
state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5);
|
||||||
$.bbq.pushState(state);
|
$.bbq.pushState(state);
|
||||||
|
|
||||||
|
var _self = $(this);
|
||||||
$("#apiHolder").load($(this).attr("href") + " #documentation", function(){
|
$("#apiHolder").load($(this).attr("href") + " #documentation", function(){
|
||||||
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
||||||
ux();
|
ux();
|
||||||
|
|
@ -62,9 +40,12 @@ $(function() {
|
||||||
$("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click');
|
$("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click');
|
||||||
}
|
}
|
||||||
|
|
||||||
setupDisqus();
|
//setupDisqus(_self.attr("href"));
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
$('.menu-item a').click(magicClickInterceptor);
|
||||||
|
$('a.argument').click(magicClickInterceptor);
|
||||||
|
|
||||||
var tabs = $("#tabnav"),
|
var tabs = $("#tabnav"),
|
||||||
tab_a_selector = "a";
|
tab_a_selector = "a";
|
||||||
|
|
|
||||||
|
|
@ -462,4 +462,12 @@ p.highlight_note a {
|
||||||
.apiIntro {
|
.apiIntro {
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prod_no_image {
|
||||||
|
position: relative; left: -10px; top: -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebarContainer {
|
||||||
|
margin: 0 20px 0 0;
|
||||||
}
|
}
|
||||||
52
index.html
52
index.html
|
|
@ -163,7 +163,7 @@ console.log(addResult);</div>
|
||||||
return x;
|
return x;
|
||||||
}</div>
|
}</div>
|
||||||
|
|
||||||
<script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
<script src="https://s3.amazonaws.com/ajaxorg/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script>
|
<script>
|
||||||
var editor = ace.edit("editor");
|
var editor = ace.edit("editor");
|
||||||
editor.setTheme("ace/theme/twilight");
|
editor.setTheme("ace/theme/twilight");
|
||||||
|
|
@ -189,13 +189,11 @@ console.log(addResult);</div>
|
||||||
<p>Themes are loaded on demand; all you have to do is pass the string name:</p>
|
<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>
|
<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>
|
<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>
|
<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"><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;
|
<pre><code class="javascript">var javascriptMode = require("ace/mode/javascript").Mode;
|
||||||
editor.getSession().setMode(new javascriptMode());</pre></code>
|
editor.getSession().setMode(new javascriptMode());</pre></code>
|
||||||
|
|
||||||
|
|
@ -212,7 +210,7 @@ var css = new EditSession(["some", "css", "code here"]);
|
||||||
editor.setSession(js);</code></pre>
|
editor.setSession(js);</code></pre>
|
||||||
|
|
||||||
<h2>Common Operations</h2>
|
<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
|
<pre><code class="javascript">editor.setValue("the new text here"); // or session.setValue
|
||||||
editor.getValue(); // or session.getValue</code></pre>
|
editor.getValue(); // or session.getValue</code></pre>
|
||||||
|
|
@ -470,60 +468,98 @@ tests for the highlighting.</p>
|
||||||
style="position: relative; left: 19px; top: 2px;" />
|
style="position: relative; left: 19px; top: 2px;" />
|
||||||
<a href="http://rstudio.org/">RStudio</a>
|
<a href="http://rstudio.org/">RStudio</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="https://github.com/Gozala/sky-edit">Sky Edit</a></li>
|
|
||||||
<li>
|
<li>
|
||||||
<img src="doc/site/images/empty-logo.png"
|
<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>
|
<a href="http://www.wavemaker.com/">WaveMaker</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://www.playmycode.com/">Play My Code</a>
|
<a href="http://www.playmycode.com/">Play My Code</a>
|
||||||
</li>
|
</li>
|
||||||
<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>
|
<a href="http://demo.qooxdoo.org/devel/playground/#">Qooxdoo playground</a>
|
||||||
</li>
|
</li>
|
||||||
<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>
|
<a href="http://ext.radiantcms.org/extensions/264-ace">Radiant CMS</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://developercompanion.com/">Developer Companion</a>
|
<a href="http://developercompanion.com/">Developer Companion</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://www.pythonanywhere.com/">PythonAnywhere</a>
|
<a href="http://www.pythonanywhere.com/">PythonAnywhere</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://shiftedit.net/">shiftEdit</a>
|
<a href="http://shiftedit.net/">shiftEdit</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://www.akshell.com/">Akshell</a>
|
<a href="http://www.akshell.com/">Akshell</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://beanstalkapp.com/">beanstalk</a>
|
<a href="http://beanstalkapp.com/">beanstalk</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://neutronide.com/">Neutron IDE</a>
|
<a href="http://neutronide.com/">Neutron IDE</a>
|
||||||
</li>
|
</li>
|
||||||
<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>
|
<a href="https://addons.mozilla.org/en-US/firefox/addon/acebug/">Acebug</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://www.weecod.com">Weecod</a>
|
<a href="http://www.weecod.com">Weecod</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href='http://rubymonk.com'>RubyMonk</a></li>
|
<a href='http://rubymonk.com'>RubyMonk</a></li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href='http://rocktronica.github.com/tmpltr/'>tmpltr</a>
|
<a href='http://rocktronica.github.com/tmpltr/'>tmpltr</a>
|
||||||
</li>
|
</li>
|
||||||
<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>
|
<a href='http://dev.cmsmadesimple.org/projects/aceeditor'>CMS Made Simple</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href='http://tryjasmine.com/'>Try Jasmine</a>
|
<a href='http://tryjasmine.com/'>Try Jasmine</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="http://codebender.cc/">Codebender</a>
|
<a href="http://codebender.cc/">Codebender</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<img src="doc/site/images/empty-logo.png"
|
||||||
|
class="prod_no_image" />
|
||||||
<a href="https://www.sharelatex.com">ShareLaTeX</a>
|
<a href="https://www.sharelatex.com">ShareLaTeX</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="add_your_site">
|
<li id="add_your_site">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue