Changeset 17739 for trunk


Ignore:
Timestamp:
04/30/14 13:23:53 (11 years ago)
Author:
tbretz
Message:
Use Codemirror colorized for code snippets in the help text; rearranged the javascript links
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/viewer/index.html

    r17738 r17739  
    55    <script src="jquery-2.1.0.min.js"></script>
    66    <script src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script>
    7     <!--<link rel="stylesheet" href="jquery-ui-1.10.4/css/ui-lightness/jquery-ui-1.10.4.min.css"-->
    8     <!--<script src="zoomooz-1.1.9/jquery.zoomooz.min.js"></script>-->
    9     <script src="codemirror-4.1/lib/codemirror.js"></script>
     7   
    108    <link rel="stylesheet" href="codemirror-4.1/lib/codemirror.css"/>
    11     <link rel="stylesheet" href="codemirror-4.1/theme/myblackboard.css"/>
    12     <!--<link rel="stylesheet" href="codemirror-4.1/theme/blackboard.css">-->
     9    <!--<link rel="stylesheet" href="codemirror-4.1/theme/myblackboard.css"/>-->
     10    <link rel="stylesheet" href="codemirror-4.1/theme/blackboard.css">
    1311    <!--<link rel="stylesheet" href="codemirror-4.1/theme/3024-night.css">-->
    1412    <link rel="stylesheet" href="codemirror-4.1/addon/display/fullscreen.css"/>
    1513    <link rel="stylesheet" href="codemirror-4.1/addon/dialog/dialog.css"/>
    1614    <link rel="stylesheet" href="codemirror-4.1/addon/fold/foldgutter.css"/>
     15    <link rel="stylesheet" href="codemirror-4.1/addon/lint/lint.css"/>
     16    <script src="codemirror-4.1.min.js"></script>
     17    <!--
     18    <script src="codemirror-4.1/lib/codemirror.js"></script>
     19    <script src="codemirror-4.1/mode/javascript/javascript.js"></script>
    1720    <script src="codemirror-4.1/addon/selection/active-line.js"></script>
     21    <script src="codemirror-4.1/addon/fold/brace-fold.js"></script>
     22    <script src="codemirror-4.1/addon/runmode/colorize.js"></script>
     23    <script src="codemirror-4.1/addon/fold/comment-fold.js"></script>
     24    <script src="codemirror-4.1/addon/dialog/dialog.js"></script>
     25    <script src="codemirror-4.1/addon/fold/foldcode.js"></script>
     26    <script src="codemirror-4.1/addon/fold/foldgutter.js"></script>
    1827    <script src="codemirror-4.1/addon/display/fullscreen.js"></script>
     28    <script src="codemirror-4.1/addon/hint/javascript-hint.js"></script>
     29    <script src="codemirror-4.1/addon/lint/lint.js"></script>
     30    <script src="codemirror-4.1/addon/lint/javascript-lint.js"></script>
     31    <script src="codemirror-4.1/addon/search/match-highlighter.js"></script>
    1932    <script src="codemirror-4.1/addon/edit/matchbrackets.js"></script>
     33    <script src="codemirror-4.1/addon/runmode/runmode.js"></script>
    2034    <script src="codemirror-4.1/addon/search/search.js"></script>
    2135    <script src="codemirror-4.1/addon/search/searchcursor.js"></script>
    22     <script src="codemirror-4.1/addon/dialog/dialog.js"></script>
    2336    <script src="codemirror-4.1/addon/hint/show-hint.js"></script>
    24     <script src="codemirror-4.1/addon/hint/javascript-hint.js"></script>
    25     <script src="codemirror-4.1/addon/fold/foldcode.js"></script>
    26     <script src="codemirror-4.1/addon/fold/foldgutter.js"></script>
    27     <script src="codemirror-4.1/addon/fold/brace-fold.js"></script>
    28     <script src="codemirror-4.1/addon/fold/comment-fold.js"></script>
    29     <script src="codemirror-4.1/mode/javascript/javascript.js"></script>
     37    -->
    3038    <script src="flot-0.8.3/jquery.flot.min.js"></script>
    31 <!--    <script src="flot-0.8.3/jquery.flot.navigate.js"></script>-->
    3239    <script src="flot-0.8.3/jquery.flot.selection.min.js"></script>
    3340    <script src="flot-0.8.3/jquery.flot.symbol.min.js"></script>
    3441    <script src="flot-0.8.3/jquery.flot.resize.js"></script>
    35 <!--    <script type="text/javascript" src="jqplot-1.0.8/jquery.min.js"></script>
    36     <script type="text/javascript" src="jqplot-1.0.8/jquery.jqplot.min.js"></script>
    37     <script type="text/javascript" src="jqplot-1.0.8/plugins/jqplot.canvasTextRenderer.min.js"></script>
    38     <script type="text/javascript" src="jqplot-1.0.8/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
    39     <script type="text/javascript" src="jqplot-1.0.8/plugins/jqplot.highlighter.min.js"></script>
    40     <script type="text/javascript" src="jqplot-1.0.8/plugins/jqplot.cursor.min.js"></script>
    41     <script type="text/javascript" src="jqplot-1.0.8/plugins/jqplot.dateAxisRenderer.min.js"></script>
    42     <link rel="stylesheet" type="text/css" href="jqplot-1.0.8/jquery.jqplot.css" />-->
     42
     43    <script src="jshint.js"></script>
    4344    <script src="index.js"></script>
     45
    4446    <link rel="stylesheet" href="index.css"/>
    4547</head>
     
    9092    {
    9193        // spike suppression
    92         var h = ($.data[p][s]-$.data[p][s-1]) + ($.data[p][s]-$.data[p][s+1])
     94        var h = ($.data[p][s]-$.data[p][s-1]) + ($.data[p][s]-$.data[p][s+1]);
    9395
    9496        if ($.data[p][s]>max && h<20)
     
    342344is copied. For example, the following code snippet does not return 2
    343345as you might expect but 7!
    344 <pre><!--<textarea id="code0" style="height:auto;overflow-x:auto;overflow-y:hidden;">-->
     346<pre>
    345347var arr = [ 0, 1, 2, 3 ];
    346348var cpy = arr;
    347349cpy[2] = 7;
    348350print(arr[2]);
    349 </pre><!--</textarea>-->
     351</pre>
    350352To avoid that, the global namespace implements a clone function.
    351353For exmaple, the following code snippet will return the expected output:
    352 <pre><!--<textarea id="code1">-->
     354<pre>
    353355var arr = [ 0, 1, 2, 3 ];
    354356var cpy = $.clone(arr);
    355357cpy[2] = 7;
    356358print(arr[2]);
    357 </pre><!--</textarea>-->
     359</pre>
    358360
    359361<H3>Javascript arrays</H3>
Note: See TracChangeset for help on using the changeset viewer.