Commit f85f53f4 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Replace Docs.live variable with hidden div.

This way the text of the message can be configured from Rakefile.
Also, the default is now not to show the message - the message is
only added to page in "export" task.
parent 3e12503e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -93,7 +93,13 @@ end
desc "Run JSDuck on ExtJS SDK to create release version of docs app"
task :export do
  load_sdk_vars
  run_jsduck_export([], EXT_DIR)
  run_jsduck_export([
    "--append-html", <<-EOHTML
    <div id="notice-text" style="display: none">
      Use <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a> for up to date documentation and features
    </div>
    EOHTML
  ], EXT_DIR)
end

desc "Run JSDuck on ExtJS SDK to create live docs app"
@@ -102,9 +108,6 @@ task :live_docs do
  run_jsduck_export([
    "--append-html", <<-EOHTML
    <script type="text/javascript">

      Docs.live = true;

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-1396058-10']);
      _gaq.push(['_trackPageview']);
+7 −2
Original line number Diff line number Diff line
@@ -12,7 +12,9 @@ Ext.define('Docs.view.index.Container', {

        var tpl = new Ext.XTemplate(
            '<h1 class="pb">{title}</h1>',
            Docs.live ? '' : '<div class="notice">Use <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a> for up to date documentation and features</div>',
            '<tpl if="notice">',
                '<div class="notice">{notice}</div>',
            '</tpl>',
            '<div class="legend icons">',
                '<h4>Legend</h4>',
                '<ul>',
@@ -71,9 +73,12 @@ Ext.define('Docs.view.index.Container', {
            }
        );

        var notice = Ext.get("notice-text");
        this.html = tpl.apply(Ext.apply({
            // Use the same title as in <title>
            title: document.getElementsByTagName("title")[0].innerHTML
            title: Ext.query("title")[0].innerHTML,
            // If page contains div with notice-text extract the text and show it as notice
            notice: notice && notice.dom.innerHTML
        }, data));

        this.callParent(arguments);