File:  [LON-CAPA] / loncom / html / adm / LC_math_editor / build.sh
Revision 1.1: download - view: text, annotated - select for diffs
Wed Sep 24 18:14:31 2014 UTC (9 years, 11 months ago) by damieng
Branches: MAIN
CVS tags: HEAD
added new LON-CAPA math editor for mathresponse and formularesponse to replace the DragMath applet

#!/bin/bash

# this builds dist/LC_math_editor.min.js using google closure compiler with compressjs.
# It must be run in the math_editor directory.

cd "$(dirname "$0")"
mkdir -p dist
tmp=$(mktemp)
cat <<% >$tmp
"use strict";
var LCMATH = function () {
%
cat src/*.js >>$tmp
cat <<% >>$tmp
    return({
        "Definitions": Definitions,
        "ENode": ENode,
        "Operator": Operator,
        "ParseException": ParseException,
        "Parser": Parser,
        "initEditors": initEditors
    });
}();
%

NEWFILE="c`date +"%d%m%y"`.js"
/bin/sh ../../../build/compressjs.sh -strict $tmp
mv "$NEWFILE" ./dist/LC_math_editor.min.js
rm -f $tmp

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>