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 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);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ $(function() {
|
|||
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");
|
||||
}
|
||||
|
|
@ -23,34 +23,12 @@ $(function() {
|
|||
// used when page is access directly
|
||||
function magicClickInterceptor(e) {
|
||||
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 = {};
|
||||
state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5);
|
||||
$.bbq.pushState(state);
|
||||
|
||||
var _self = $(this);
|
||||
$("#apiHolder").load($(this).attr("href") + " #documentation", function(){
|
||||
$("#apiHolder").removeClass("apiIntro").removeClass("span8");
|
||||
ux();
|
||||
|
|
@ -62,9 +40,12 @@ $(function() {
|
|||
$("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"),
|
||||
tab_a_selector = "a";
|
||||
|
|
|
|||
|
|
@ -462,4 +462,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;
|
||||
}
|
||||
52
index.html
52
index.html
|
|
@ -163,7 +163,7 @@ console.log(addResult);</div>
|
|||
return x;
|
||||
}</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>
|
||||
var editor = ace.edit("editor");
|
||||
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>
|
||||
|
||||
<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"><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>
|
||||
|
||||
|
|
@ -212,7 +210,7 @@ var css = new EditSession(["some", "css", "code here"]);
|
|||
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 +468,98 @@ 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://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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue