<commit_before>var sdk_dev_scrpipts = [
    "../../../../sdkjs/common/AllFonts.js",
    "../../../../sdkjs/common/browser.js",
    "../../../../sdkjs/common/commonDefines.js",
    "../../../../sdkjs/common/downloaderfiles.js",
    "../../../../sdkjs/common/docscoapicommon.js",
    "../../../../sdkjs/common/docscoapi.js",
    "../../../../sdkjs/common/spellcheckapi.js",
    "../../../../sdkjs/common/apiCommon.js",
    "../../../../sdkjs/common/SerializeCommonWordExcel.js",
    "../../../../sdkjs/common/editorscommon.js",
	"../../../../sdkjs/common/HistoryCommon.js",
	"../../../../sdkjs/common/TableId.js",
	"../../../../sdkjs/common/TableIdChanges.js",
	"../../../../sdkjs/common/macros.js",
	"../../../../sdkjs/common/NumFormat.js",
    "../../../../sdkjs/common/SerializeChart.js",
    "../../../../sdkjs/common/AdvancedOptions.js",
	"../../../../sdkjs/common/libfont/loader.js",
	"../../../../sdkjs/common/libfont/manager.js",
    "../../../../sdkjs/common/libfont/map.js",
	"../../../../sdkjs/common/libfont/rasterheap.js",
	"../../../../sdkjs/common/libfont/glyphstring.js",
	"../../../../sdkjs/common/libfont/classification.js",
	"../../../../sdkjs/common/libfont/character.js",
    "../../../../sdkjs/common/Drawings/Metafile.js",
    "../../../../sdkjs/common/libfont/textmeasurer.js",
    "../../../../sdkjs/common/Drawings/WorkEvents.js",
    "../../../../sdkjs/word/Editor/History.js",
    "../../../../sdkjs/common/Shapes/EditorSettings.js",
    "../../../../sdkjs/common/Shapes/Serialize.js",
    "../../../../sdkjs/common/Shapes/SerializeWriter.js",
    "../../../../sdkjs/common/Drawings/Hit.js",
    "../../../../sdkjs/common/Drawings/ArcTo.js",
    "../../../../sdkjs/common/Drawings/ColorArray.js",
    "../../../../sdkjs/common/Drawings/CommonController.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/DrawingStates.js",
	"../../../../sdkjs/common/Drawings/DrawingsChanges.js",
    "../../../../sdkjs/common/Drawings/Format/CreateGeometry.js",
    "../../../../sdkjs/common/Drawings/Format/Geometry.js",
    "../../../../sdkjs/common/Drawings/Format/Format.js",
    "../../../../sdkjs/common/Drawings/Format/GraphicObjectBase.js",
    "../../../../sdkjs/common/Drawings/Format/Shape.js",
	"../../../../sdkjs/common/Drawings/Format/CnxShape.js",
    "../../../../sdkjs/common/Drawings/Format/Path.js",
    "../../../../sdkjs/common/Drawings/Format/Image.js",
    "../../../../sdkjs/common/Drawings/Format/GroupShape.js",
    "../../../../sdkjs/common/Drawings/Format/ChartSpace.js",
    "../../../../sdkjs/common/Drawings/Format/ChartFormat.js",
    "../../../../sdkjs/common/Drawings/Format/TextBody.js",
    "../../../../sdkjs/common/Drawings/Format/GraphicFrame.js",
    "../../../../sdkjs/common/Charts/charts.js",
    "../../../../sdkjs/common/Charts/DrawingObjects.js",
    "../../../../sdkjs/common/Charts/3DTransformation.js",
    "../../../../sdkjs/common/Charts/ChartsDrawer.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/Spline.js",
	"../../../../sdkjs/common/Drawings/TrackObjects/ConnectorTrack.js",
    "../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js",
    "../../../../sdkjs/common/Drawings/TextDrawer.js",
    "../../../../sdkjs/common/Drawings/Externals.js",
    "../../../../sdkjs/common/GlobalLoaders.js",
    "../../../../sdkjs/common/CollaborativeEditingBase.js",
    "../../../../sdkjs/common/Controls.js",
    "../../../../sdkjs/common/Overlay.js",
    "../../../../sdkjs/common/Drawings/HatchPattern.js",
    "../../../../sdkjs/common/scroll.js",
    "../../../../sdkjs/vendor/iscroll.js",
	"../../../../sdkjs/common/Scrolls/mobileTouchManagerBase.js",
    "../../../../sdkjs/common/wordcopypaste.js",
	"../../../../sdkjs/common/intervalTree.js",
    "../../../../sdkjs/word/apiDefines.js",
    "../../../../sdkjs/cell/utils/utils.js",
    "../../../../sdkjs/cell/model/WorkbookElems.js",
    "../../../../sdkjs/cell/model/Workbook.js",
    "../../../../sdkjs/cell/model/Serialize.js",
    "../../../../sdkjs/cell/model/CellInfo.js",
    "../../../../sdkjs/word/Drawing/translations.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/ShapePrototype.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/ImagePrototype.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/GroupPrototype.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/ChartSpacePrototype.js",
    "../../../../sdkjs/common/Drawings/Format/LockedCanvas.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/GraphicObjects.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/GraphicPage.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js",
    "../../../../sdkjs/word/Editor/CollaborativeEditing.js",
	"../../../../sdkjs/word/Editor/DocumentContentElementBase.js",
	"../../../../sdkjs/word/Editor/ParagraphContentBase.js",
    "../../../../sdkjs/word/Editor/Comments.js",
	"../../../../sdkjs/word/Editor/CommentsChanges.js",
	"../../../../sdkjs/word/Editor/Bookmarks.js",
    "../../../../sdkjs/word/Editor/Styles.js",
	"../../../../sdkjs/word/Editor/StylesChanges.js",
	"../../../../sdkjs/word/Editor/RevisionsChange.js",
    "../../../../sdkjs/word/Editor/ParagraphContent.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaTextPr.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaDrawing.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js",
	"../../../../sdkjs/word/Editor/Paragraph/ComplexFieldInstruction.js",
	"../../../../sdkjs/word/Editor/Paragraph/ComplexField.js",
	"../../../../sdkjs/word/Editor/Paragraph/FormulaParser.js",
    "../../../../sdkjs/word/Editor/Paragraph/ParaRevisionMove.js",
    "../../../../sdkjs/word/Editor/Paragraph.js",
	"../../../../sdkjs/word/Editor/ParagraphChanges.js",
    "../../../../sdkjs/word/Editor/DocumentContentBase.js",
    "../../../../sdkjs/word/Editor/Document.js",
	"../../../../sdkjs/word/Editor/DocumentOutline.js",
	"../../../../sdkjs/word/Editor/DocumentChanges.js",
    "../../../../sdkjs/word/Editor/DocumentContent.js",
	"../../../../sdkjs/word/Editor/DocumentContentChanges.js",
	"../../../../sdkjs/word/Editor/DocumentControllerBase.js",
	"../../../../sdkjs/word/Editor/LogicDocumentController.js",
	"../../../../sdkjs/word/Editor/DrawingsController.js",
	"../../../../sdkjs/word/Editor/HeaderFooterController.js",
    "../../../../sdkjs/word/Editor/FlowObjects.js",
    "../../../../sdkjs/word/Editor/Hyperlink.js",
	"../../../../sdkjs/word/Editor/HyperlinkChanges.js",
    "../../../../sdkjs/word/Editor/Field.js",
	"../../../../sdkjs/word/Editor/FieldChanges.js",
    "../../../../sdkjs/word/Editor/Run.js",
    "../../../../sdkjs/word/Editor/PresentationField.js",
	"../../../../sdkjs/word/Editor/RunChanges.js",
    "../../../../sdkjs/word/Editor/Math.js",
	"../../../../sdkjs/word/Editor/MathChanges.js",
    "../../../../sdkjs/word/Editor/Paragraph_Recalculate.js",
    "../../../../sdkjs/word/Editor/Sections.js",
	"../../../../sdkjs/word/Editor/SectionsChanges.js",
    "../../../../sdkjs/word/Editor/HeaderFooter.js",
    "../../../../sdkjs/word/Editor/Common.js",
    "../../../../sdkjs/word/Editor/Numbering/NumberingCommon.js",
	"../../../../sdkjs/word/Editor/Numbering/NumberingLvl.js",
	"../../../../sdkjs/word/Editor/Numbering/AbstractNum.js",
	"../../../../sdkjs/word/Editor/Numbering/AbstractNumChanges.js",
	"../../../../sdkjs/word/Editor/Numbering/Num.js",
	"../../../../sdkjs/word/Editor/Numbering/NumChanges.js",
	"../../../../sdkjs/word/Editor/Numbering/PresentationNumbering.js",
	"../../../../sdkjs/word/Editor/Numbering/Numbering.js",
    "../../../../sdkjs/word/Editor/Table.js",
	"../../../../sdkjs/word/Editor/Table/TableChanges.js",
    "../../../../sdkjs/word/Editor/Table/TableRecalculate.js",
    "../../../../sdkjs/word/Editor/Table/TableDraw.js",
    "../../../../sdkjs/word/Editor/Table/TableRow.js",
	"../../../../sdkjs/word/Editor/Table/TableRowChanges.js",
    "../../../../sdkjs/word/Editor/Table/TableCell.js",
	"../../../../sdkjs/word/Editor/Table/TableCellChanges.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/BlockLevel.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/InlineLevel.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/SdtPr.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/SdtPrChanges.js",
    "../../../../sdkjs/word/Editor/Serialize2.js",
    "../../../../sdkjs/word/Editor/Search.js",
    "../../../../sdkjs/word/Editor/Spelling.js",
	"../../../../sdkjs/word/Editor/Footnotes.js",
	"../../../../sdkjs/word/Editor/FootnotesChanges.js",
	"../../../../sdkjs/word/Editor/FootEndNote.js",
    "../../../../sdkjs/word/Drawing/Graphics.js",
    "../../../../sdkjs/word/Drawing/ShapeDrawer.js",
    "../../../../sdkjs/word/Drawing/DrawingDocument.js",
    "../../../../sdkjs/word/Drawing/GraphicsEvents.js",
    "../../../../sdkjs/word/Drawing/Rulers.js",
    "../../../../sdkjs/word/Drawing/HtmlPage.js",
    "../../../../sdkjs/word/Drawing/documentrenderer.js",
	"../../../../sdkjs/word/Drawing/mobileTouchManager.js",
    "../../../../sdkjs/word/apiCommon.js",
    "../../../../sdkjs/common/apiBase.js",
    "../../../../sdkjs/word/api.js",
    "../../../../sdkjs/word/document/empty.js",
    "../../../../sdkjs/word/Editor/CollaborativeEditing.js",
    "../../../../sdkjs/word/Math/mathTypes.js",
    "../../../../sdkjs/word/Math/mathText.js",
    "../../../../sdkjs/word/Math/mathContent.js",
    "../../../../sdkjs/word/Math/base.js",
    "../../../../sdkjs/word/Math/fraction.js",
    "../../../../sdkjs/word/Math/degree.js",
    "../../../../sdkjs/word/Math/matrix.js",
    "../../../../sdkjs/word/Math/limit.js",
    "../../../../sdkjs/word/Math/nary.js",
    "../../../../sdkjs/word/Math/radical.js",
    "../../../../sdkjs/word/Math/operators.js",
    "../../../../sdkjs/word/Math/accent.js",
    "../../../../sdkjs/word/Math/borderBox.js",
    "../../../../sdkjs/common/Private/Locks.js",
    "../../../../sdkjs/common/Private/license.js",
    "../../../../sdkjs/common/Private/versionHistory.js",
    "../../../../sdkjs/word/Private/StyleManager.js",
    "../../../../sdkjs/word/Private/MailMerge.js",
    "../../../../sdkjs/word/Private/TrackRevisions.js",
    "../../../../sdkjs/common/applyDocumentChanges.js",
    "../../../../sdkjs/common/Drawings/Format/OleObject.js",
    "../../../../sdkjs/common/Drawings/Format/DrawingContent.js",
    "../../../../sdkjs/common/clipboard_base.js",
    "../../../../sdkjs/common/plugins.js",
	"../../../../sdkjs/word/apiBuilder.js",
	"../../../../sdkjs/common/text_input.js"
];<commit_msg>[DE] Delete<commit_after>var sdk_dev_scrpipts = [
    "../../../../sdkjs/common/AllFonts.js",
    "../../../../sdkjs/common/browser.js",
    "../../../../sdkjs/common/commonDefines.js",
    "../../../../sdkjs/common/downloaderfiles.js",
    "../../../../sdkjs/common/docscoapicommon.js",
    "../../../../sdkjs/common/docscoapi.js",
    "../../../../sdkjs/common/spellcheckapi.js",
    "../../../../sdkjs/common/apiCommon.js",
    "../../../../sdkjs/common/SerializeCommonWordExcel.js",
    "../../../../sdkjs/common/editorscommon.js",
	"../../../../sdkjs/common/HistoryCommon.js",
	"../../../../sdkjs/common/TableId.js",
	"../../../../sdkjs/common/TableIdChanges.js",
	"../../../../sdkjs/common/macros.js",
	"../../../../sdkjs/common/NumFormat.js",
    "../../../../sdkjs/common/SerializeChart.js",
    "../../../../sdkjs/common/AdvancedOptions.js",
	"../../../../sdkjs/common/libfont/loader.js",
	"../../../../sdkjs/common/libfont/manager.js",
    "../../../../sdkjs/common/libfont/map.js",
	"../../../../sdkjs/common/libfont/rasterheap.js",
	"../../../../sdkjs/common/libfont/glyphstring.js",
	"../../../../sdkjs/common/libfont/classification.js",
	"../../../../sdkjs/common/libfont/character.js",
    "../../../../sdkjs/common/Drawings/Metafile.js",
    "../../../../sdkjs/common/libfont/textmeasurer.js",
    "../../../../sdkjs/common/Drawings/WorkEvents.js",
    "../../../../sdkjs/word/Editor/History.js",
    "../../../../sdkjs/common/Shapes/EditorSettings.js",
    "../../../../sdkjs/common/Shapes/Serialize.js",
    "../../../../sdkjs/common/Shapes/SerializeWriter.js",
    "../../../../sdkjs/common/Drawings/Hit.js",
    "../../../../sdkjs/common/Drawings/ArcTo.js",
    "../../../../sdkjs/common/Drawings/ColorArray.js",
    "../../../../sdkjs/common/Drawings/CommonController.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/DrawingStates.js",
	"../../../../sdkjs/common/Drawings/DrawingsChanges.js",
    "../../../../sdkjs/common/Drawings/Format/CreateGeometry.js",
    "../../../../sdkjs/common/Drawings/Format/Geometry.js",
    "../../../../sdkjs/common/Drawings/Format/Format.js",
    "../../../../sdkjs/common/Drawings/Format/GraphicObjectBase.js",
    "../../../../sdkjs/common/Drawings/Format/Shape.js",
	"../../../../sdkjs/common/Drawings/Format/CnxShape.js",
    "../../../../sdkjs/common/Drawings/Format/Path.js",
    "../../../../sdkjs/common/Drawings/Format/Image.js",
    "../../../../sdkjs/common/Drawings/Format/GroupShape.js",
    "../../../../sdkjs/common/Drawings/Format/ChartSpace.js",
    "../../../../sdkjs/common/Drawings/Format/ChartFormat.js",
    "../../../../sdkjs/common/Drawings/Format/TextBody.js",
    "../../../../sdkjs/common/Drawings/Format/GraphicFrame.js",
    "../../../../sdkjs/common/Charts/charts.js",
    "../../../../sdkjs/common/Charts/DrawingObjects.js",
    "../../../../sdkjs/common/Charts/3DTransformation.js",
    "../../../../sdkjs/common/Charts/ChartsDrawer.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js",
    "../../../../sdkjs/common/Drawings/TrackObjects/Spline.js",
	"../../../../sdkjs/common/Drawings/TrackObjects/ConnectorTrack.js",
    "../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js",
    "../../../../sdkjs/common/Drawings/TextDrawer.js",
    "../../../../sdkjs/common/Drawings/Externals.js",
    "../../../../sdkjs/common/GlobalLoaders.js",
    "../../../../sdkjs/common/CollaborativeEditingBase.js",
    "../../../../sdkjs/common/Controls.js",
    "../../../../sdkjs/common/Overlay.js",
    "../../../../sdkjs/common/Drawings/HatchPattern.js",
    "../../../../sdkjs/common/scroll.js",
    "../../../../sdkjs/vendor/iscroll.js",
	"../../../../sdkjs/common/Scrolls/mobileTouchManagerBase.js",
    "../../../../sdkjs/common/wordcopypaste.js",
	"../../../../sdkjs/common/intervalTree.js",
    "../../../../sdkjs/word/apiDefines.js",
    "../../../../sdkjs/cell/utils/utils.js",
    "../../../../sdkjs/cell/model/WorkbookElems.js",
    "../../../../sdkjs/cell/model/Workbook.js",
    "../../../../sdkjs/cell/model/Serialize.js",
    "../../../../sdkjs/cell/model/CellInfo.js",
    "../../../../sdkjs/word/Drawing/translations.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/ShapePrototype.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/ImagePrototype.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/GroupPrototype.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/Format/ChartSpacePrototype.js",
    "../../../../sdkjs/common/Drawings/Format/LockedCanvas.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/GraphicObjects.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/GraphicPage.js",
    "../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js",
    "../../../../sdkjs/word/Editor/CollaborativeEditing.js",
	"../../../../sdkjs/word/Editor/DocumentContentElementBase.js",
	"../../../../sdkjs/word/Editor/ParagraphContentBase.js",
    "../../../../sdkjs/word/Editor/Comments.js",
	"../../../../sdkjs/word/Editor/CommentsChanges.js",
	"../../../../sdkjs/word/Editor/Bookmarks.js",
    "../../../../sdkjs/word/Editor/Styles.js",
	"../../../../sdkjs/word/Editor/StylesChanges.js",
	"../../../../sdkjs/word/Editor/RevisionsChange.js",
    "../../../../sdkjs/word/Editor/ParagraphContent.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaTextPr.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaTextPrChanges.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaDrawing.js",
	"../../../../sdkjs/word/Editor/Paragraph/ParaDrawingChanges.js",
	"../../../../sdkjs/word/Editor/Paragraph/ComplexFieldInstruction.js",
	"../../../../sdkjs/word/Editor/Paragraph/ComplexField.js",
	"../../../../sdkjs/word/Editor/Paragraph/FormulaParser.js",
    "../../../../sdkjs/word/Editor/Paragraph/ParaRevisionMove.js",
    "../../../../sdkjs/word/Editor/Paragraph.js",
	"../../../../sdkjs/word/Editor/ParagraphChanges.js",
    "../../../../sdkjs/word/Editor/DocumentContentBase.js",
    "../../../../sdkjs/word/Editor/Document.js",
	"../../../../sdkjs/word/Editor/DocumentOutline.js",
	"../../../../sdkjs/word/Editor/DocumentChanges.js",
    "../../../../sdkjs/word/Editor/DocumentContent.js",
	"../../../../sdkjs/word/Editor/DocumentContentChanges.js",
	"../../../../sdkjs/word/Editor/DocumentControllerBase.js",
	"../../../../sdkjs/word/Editor/LogicDocumentController.js",
	"../../../../sdkjs/word/Editor/DrawingsController.js",
	"../../../../sdkjs/word/Editor/HeaderFooterController.js",
    "../../../../sdkjs/word/Editor/FlowObjects.js",
    "../../../../sdkjs/word/Editor/Hyperlink.js",
	"../../../../sdkjs/word/Editor/HyperlinkChanges.js",
    "../../../../sdkjs/word/Editor/Field.js",
	"../../../../sdkjs/word/Editor/FieldChanges.js",
    "../../../../sdkjs/word/Editor/Run.js",
    "../../../../sdkjs/word/Editor/PresentationField.js",
	"../../../../sdkjs/word/Editor/RunChanges.js",
    "../../../../sdkjs/word/Editor/Math.js",
	"../../../../sdkjs/word/Editor/MathChanges.js",
    "../../../../sdkjs/word/Editor/Paragraph_Recalculate.js",
    "../../../../sdkjs/word/Editor/Sections.js",
	"../../../../sdkjs/word/Editor/SectionsChanges.js",
    "../../../../sdkjs/word/Editor/HeaderFooter.js",
    "../../../../sdkjs/word/Editor/Common.js",
    "../../../../sdkjs/word/Editor/Numbering/NumberingCommon.js",
	"../../../../sdkjs/word/Editor/Numbering/NumberingLvl.js",
	"../../../../sdkjs/word/Editor/Numbering/AbstractNum.js",
	"../../../../sdkjs/word/Editor/Numbering/AbstractNumChanges.js",
	"../../../../sdkjs/word/Editor/Numbering/Num.js",
	"../../../../sdkjs/word/Editor/Numbering/NumChanges.js",
	"../../../../sdkjs/word/Editor/Numbering/PresentationNumbering.js",
	"../../../../sdkjs/word/Editor/Numbering/Numbering.js",
    "../../../../sdkjs/word/Editor/Table.js",
	"../../../../sdkjs/word/Editor/Table/TableChanges.js",
    "../../../../sdkjs/word/Editor/Table/TableRecalculate.js",
    "../../../../sdkjs/word/Editor/Table/TableDraw.js",
    "../../../../sdkjs/word/Editor/Table/TableRow.js",
	"../../../../sdkjs/word/Editor/Table/TableRowChanges.js",
    "../../../../sdkjs/word/Editor/Table/TableCell.js",
	"../../../../sdkjs/word/Editor/Table/TableCellChanges.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/BlockLevel.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/InlineLevel.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/SdtPr.js",
	"../../../../sdkjs/word/Editor/StructuredDocumentTags/SdtPrChanges.js",
    "../../../../sdkjs/word/Editor/Serialize2.js",
    "../../../../sdkjs/word/Editor/Search.js",
    "../../../../sdkjs/word/Editor/Spelling.js",
	"../../../../sdkjs/word/Editor/Footnotes.js",
	"../../../../sdkjs/word/Editor/FootnotesChanges.js",
	"../../../../sdkjs/word/Editor/FootEndNote.js",
    "../../../../sdkjs/word/Drawing/Graphics.js",
    "../../../../sdkjs/word/Drawing/ShapeDrawer.js",
    "../../../../sdkjs/word/Drawing/DrawingDocument.js",
    "../../../../sdkjs/word/Drawing/GraphicsEvents.js",
    "../../../../sdkjs/word/Drawing/Rulers.js",
    "../../../../sdkjs/word/Drawing/HtmlPage.js",
    "../../../../sdkjs/word/Drawing/documentrenderer.js",
	"../../../../sdkjs/word/Drawing/mobileTouchManager.js",
    "../../../../sdkjs/word/apiCommon.js",
    "../../../../sdkjs/common/apiBase.js",
    "../../../../sdkjs/word/api.js",
    "../../../../sdkjs/word/document/empty.js",
    "../../../../sdkjs/word/Editor/CollaborativeEditing.js",
    "../../../../sdkjs/word/Math/mathTypes.js",
    "../../../../sdkjs/word/Math/mathText.js",
    "../../../../sdkjs/word/Math/mathContent.js",
    "../../../../sdkjs/word/Math/base.js",
    "../../../../sdkjs/word/Math/fraction.js",
    "../../../../sdkjs/word/Math/degree.js",
    "../../../../sdkjs/word/Math/matrix.js",
    "../../../../sdkjs/word/Math/limit.js",
    "../../../../sdkjs/word/Math/nary.js",
    "../../../../sdkjs/word/Math/radical.js",
    "../../../../sdkjs/word/Math/operators.js",
    "../../../../sdkjs/word/Math/accent.js",
    "../../../../sdkjs/word/Math/borderBox.js",
    "../../../../sdkjs/common/Private/Locks.js",
    "../../../../sdkjs/common/Private/license.js",
    "../../../../sdkjs/common/Private/versionHistory.js",
    "../../../../sdkjs/word/Private/StyleManager.js",
    "../../../../sdkjs/word/Private/TrackRevisions.js",
    "../../../../sdkjs/common/applyDocumentChanges.js",
    "../../../../sdkjs/common/Drawings/Format/OleObject.js",
    "../../../../sdkjs/common/Drawings/Format/DrawingContent.js",
    "../../../../sdkjs/common/clipboard_base.js",
    "../../../../sdkjs/common/plugins.js",
	"../../../../sdkjs/word/apiBuilder.js",
	"../../../../sdkjs/common/text_input.js"
];<|endoftext|>


<commit_before>/**
 * Created by Sam on 6/7/2015.
 */
(function() {
    var app = angular.module('app.services');

    var notifications = function() {
        var success = function(msg) {
            toastr.success(msg);
        };

        var info = function(msg) {
          toastr.info(msg);
        };

        var warning = function(msg) {
            toastr.warning(msg);
        }

        var error = function(msg) {
            toastr.error(msg);
        };

        return {
            success: success,
            info: info,
            warning: warning,
            error: error
        };
    };

    app.factory('notifications', notifications);
})();<commit_msg>new service name<commit_after>/**
 * Created by Sam on 6/7/2015.
 */
(function() {
    var app = angular.module('brewApp.services');

    var notifications = function() {
        var success = function(msg) {
            toastr.success(msg);
        };

        var info = function(msg) {
          toastr.info(msg);
        };

        var warning = function(msg) {
            toastr.warning(msg);
        }

        var error = function(msg) {
            toastr.error(msg);
        };

        return {
            success: success,
            info: info,
            warning: warning,
            error: error
        };
    };

    app.factory('notifications', notifications);
})();<|endoftext|>


<commit_before>/************************************************
 * AUTHOR:         Alexandre Cazala             *
 * CREATION_DATE:  22/11/16                      *
 * EMAIL:          alexandre.cazala@gmail.com   *
 * LICENSE:        Apache 2.0                   *
 ***********************************************/
'use strict';

var app = angular.module('facilitation');

app.controller('qrcodeCtrl', function ($scope, $routeParams, $location) {
    // Scope vars
    $scope.feedbackLink = location.protocol+"//"+location.host+"/#/feedback/"+$routeParams.idInstance;
    console.log($scope.feedbackLink);
});

<commit_msg>[HEROKU] test qrcode link<commit_after>/************************************************
 * AUTHOR:         Alexandre Cazala             *
 * CREATION_DATE:  22/11/16                      *
 * EMAIL:          alexandre.cazala@gmail.com   *
 * LICENSE:        Apache 2.0                   *
 ***********************************************/
'use strict';

var app = angular.module('facilitation');

app.controller('qrcodeCtrl', function ($scope, $routeParams, $location) {
    // Scope vars
    $scope.feedbackLink = location.protocol+"//"+location.host+"/feedback/"+$routeParams.idInstance;
    console.log($scope.feedbackLink);
});

<|endoftext|>


<commit_before>$(document).ready(function () {

    if ($('a[data-type=zoom]').size() > 0) {
        // Deepzoom image & viewer
        var zoomImg = $('a[data-type=zoom]').attr('href'), viewer;
        Seadragon.Config.imagePath = "/assets/common/javascripts/seadragon/img/";
        Seadragon.Config.autoHideControls = false;
        viewer = new Seadragon.Viewer("zoom-viewer");
        viewer.openDzi({
            "url":zoomImg,
            "width":1800,
            "height":1400,
            "tileSize":256,
            "tileOverlap":0,
            "tileFormat":"jpg"});
    }

    var mltEndpoint = '/organizations/' + Thing.orgId + '/api/search?id=' + Thing.hubId + '&format=json&mlt=true';

    $.get(mltEndpoint, function (data) {
        var rItems = data.result.relatedItems.item, html = '', tmp, org, owner, id, uri;
        if (rItems) {
            html = '
' + jsLabels.relatedItems + '

';
            $.each(rItems, function (i, item) {
                tmp = item.fields['delving_hubId'].split('_');
                org = tmp[0];
                owner = tmp[1];
                id = tmp[2];
                uri = "/" + org + "/thing/" + owner + "/" + id + "?mlt=true";
                html += '
';
                html += '
';
            });
            html += "
";
            $('.related-items').html(html);
        }
    });

});<commit_msg>link to external landing page get's .pill class for more prominence<commit_after>$(document).ready(function () {

    if ($('a[data-type=zoom]').size() > 0) {
        // Deepzoom image & viewer
        var zoomImg = $('a[data-type=zoom]').attr('href'), viewer;
        Seadragon.Config.imagePath = "/assets/common/javascripts/seadragon/img/";
        Seadragon.Config.autoHideControls = false;
        viewer = new Seadragon.Viewer("zoom-viewer");
        viewer.openDzi({
            "url":zoomImg,
            "width":1800,
            "height":1400,
            "tileSize":256,
            "tileOverlap":0,
            "tileFormat":"jpg"});
    }

    var mltEndpoint = '/organizations/' + Thing.orgId + '/api/search?id=' + Thing.hubId + '&format=json&mlt=true';

    $.get(mltEndpoint, function (data) {
        var rItems = data.result.relatedItems.item, html = '', tmp, org, owner, id, uri;
        if (rItems) {
            html = '
' + jsLabels.relatedItems + '

';
            $.each(rItems, function (i, item) {
                tmp = item.fields['delving_hubId'].split('_');
                org = tmp[0];
                owner = tmp[1];
                id = tmp[2];
                uri = "/" + org + "/thing/" + owner + "/" + id + "?mlt=true";
                html += '
';
                html += '
';
            });
            html += "
";
            $('.related-items').html(html);
        }
    });

    // give the page a few milliseconds
    setTimeout('$("div#context-link p a.external").addClass("pill pull-right");', 100);

});<|endoftext|>


<commit_before>$(document).ready(function() {

  var enableNav = function() {
    $('#editable-elements .nav a').click(function(e) {
      var index = parseInt($(this).attr('href').match(/block-(.+)/)[1]);

      $('#editable-elements .wrapper ul li.block').hide();
      $('#block-' + index).show();

      $(this).parent().find('.on').removeClass('on');
      $(this).addClass('on');

      e.preventDefault();
    });
  }

  enableNav();

  $.subscribe('form.saved.success', function(event, data) {
    if (data.editable_elements != '') {
      $('#editable-elements').replaceWith(data.editable_elements);
      enableNav();
    }
  }, []);

  $('textarea.html').tinymce(TinyMceDefaultSettings);

});
<commit_msg>turn any html textarea into a WYSIWYG when saving a page in ajax<commit_after>$(document).ready(function() {

  var enableNav = function() {
    $('#editable-elements .nav a').click(function(e) {
      var index = parseInt($(this).attr('href').match(/block-(.+)/)[1]);

      $('#editable-elements .wrapper ul li.block').hide();
      $('#block-' + index).show();

      $(this).parent().find('.on').removeClass('on');
      $(this).addClass('on');

      e.preventDefault();
    });
  }

  enableNav();

  $.subscribe('form.saved.success', function(event, data) {
    if (data.editable_elements != '') {
      $('#editable-elements').replaceWith(data.editable_elements);
      enableNav();

      $('textarea.html').tinymce(TinyMceDefaultSettings);
    }
  }, []);

  $('textarea.html').tinymce(TinyMceDefaultSettings);

});
<|endoftext|>


<commit_before>function parseMessages(messages, users, callback) {
  var allWords = {};
  console.log('parseMessages.js - messages', messages);
  console.log('parseMessages.js (start) - users', users);

  for(var i = 0; i < messages.length; i++) {
    var author = users[messages[i].from.name];
    var split = messages[i].message.split(' ');
    for(var j = 0; j < split.length; j++) {
      var word = split[j];
      if(!author.words[word]) {
        author.words[word] = 1;
      } else {
        author.words[word]++;
      }
      if(!allWords[word]) {
        allWords[word] = 1; // populate allWords obj
      } else {
        allWords[word]++;
      }
    }
  }
  console.log('parseMessages.js (end) - users', users);
  console.log('parseMessages.js (end) - allWords', allWords);
  window.users = users;
  window.allWords = allWords;
  callback(users, allWords);
}
<commit_msg>Check if message exists<commit_after>function parseMessages(messages, users, callback) {
  var allWords = {};
  console.log('parseMessages.js - messages', messages);
  console.log('parseMessages.js (start) - users', users);

  for(var i = 0; i < messages.length; i++) {
    var author = users[messages[i].from.name];
    if(messages[i].message) {
      var split = messages[i].message.split(' ');
      for(var j = 0; j < split.length; j++) {
        var word = split[j];
        if(!author.words[word]) {
          author.words[word] = 1;
        } else {
          author.words[word]++;
        }
        if(!allWords[word]) {
          allWords[word] = 1; // populate allWords obj
        } else {
          allWords[word]++;
        }
      }
    }
  }
  console.log('parseMessages.js (end) - users', users);
  console.log('parseMessages.js (end) - allWords', allWords);
  window.users = users;
  window.allWords = allWords;
  callback(users, allWords);
}
<|endoftext|>


<commit_before>var ContentLoader = Class.create({

  initialize: function() {

    this.canvasContent;
    this.visibleList;
    this.loadingInterval;

    var thisClass = this;

    Pattern.context = meterCanvas.getContext("2d");
    Pattern.loadPattern([
      {name: "meterBackground", path: "../images/sidebar-meter-background.png"},
      {name: "meterForeground", path: "../images/sidebar-meter-foreground.png"},
      {name: "meterPointer", path: "../images/sidebar-meter-pointer.png"}
    ]);

    Pattern.onload = function() {
      sidebarController = new SidebarController();

      thisClass.loadContent(window.location.pathname);
    };

    this.setInitialScreen();

  },

  loadContent: function(path, setPath) {

    this.parseResponse({responseJSON: {mode: "load"}});

    if (path == "/about" || path == "/imprint" || path == "/contact") {

      parseResponse({responseJSON: {mode: path.substr(1)}}, setPath);
      return;

    }

    var thisClass = this;

    new Ajax.Request(path, {
      method: 'get',
      requestHeaders: {Accept: 'application/json'},

      onSuccess: function(transport) {
        thisClass.parseResponse.call(thisClass, transport, setPath);
      },
      onFailure: function(transport) {
        thisClass.parseResponse.call(thisClass, transport, false);
      }
    });

  },

  parseResponse: function(jsonContent, setPath) {

    this.loadingInterval && clearInterval(this.loadingInterval);

    if (typeof(setPath) == "undefined") {
      setPath = true;
    }

    var content = jsonContent.responseJSON;
    var path;

    this.visibleList = [];

    if (this.canvasContent) {
      this.canvasContent.destroy();
      this.canvasContent = null;
    }

    switch(content.mode) {

      case "build":
        this.createBuildMode(content);
        path = "/tracks/new";
      break;

      case "show":
        this.createShowMode(content);
        path = "/tracks/" + content.track.id;
      break;

      case "overview":
        this.createOverviewMode(content);
        path = "/tracks";
      break;

      case "about":
      case "imprint":
      case "contact":
        this.visibleList = [content.mode + "Page"];
        path = "/" + content.mode
      break;

      case "load":
        console.log("Loading");
        this.visibleList = ["loadingPage"];
        this.loadingInterval = setInterval(function() {
          $("loadingPage").toggleClassName("blink");
        }, 500);
      break;

      case "failure":
        this.visibleList = ["errorPage"];
        $("errorMessage").update(content.message.toUpperCase());
      break;

    }

    setToggleElementsVisibility(this.visibleList);

    setPath && this.pushURL(path, jsonContent);

  },

  createBuildMode: function(content, visibleList) {

    setBuildTweetButton();
    setSwitchMode("build");

    this.canvasContent = new Editor(staticCanvas, dynamicCanvas, bufferCanvas, imageCanvas);
    this.canvasContent.x = editorPosition.left;
    this.canvasContent.y = editorPosition.top;

    this.canvasContent.startRender();

    $('editor').setStyle({height: "560px"});

    this.visibleList = [
      "editorControlsTop", "editorControlsBottom",
      "editorToolboxTop", "editorToolboxBottom",
      "staticCanvas", "dynamicCanvas"
    ];

  },

  createShowMode: function(content) {

    setTrackTweetButton(content.track.id);
    setSwitchMode("view");
    currentTrack = content.track.id;

    if (!localTracks[content.track.id]) {
        localTracks[content.track.id] = content.track;
    }

    this.canvasContent = new Showroom(staticCanvas, dynamicCanvas, bufferCanvas);
    this.canvasContent.x = editorPosition.left;
    this.canvasContent.y = editorPosition.top;

    this.canvasContent.parseTrack(content.track);
    this.canvasContent.trackID = content.track.id;

    this.canvasContent.initializeHTMLInterface();
    this.canvasContent.startRender();

    var trackDate = new Date(0);

    trackDate.setFullYear(content.track.created_at.substr(0, 4));
    trackDate.setMonth(parseInt(content.track.created_at.substr(5, 2), 10) - 1);
    trackDate.setDate(content.track.created_at.substr(9, 2));
    trackDate.setHours(content.track.created_at.substr(11, 2));
    trackDate.setMinutes(content.track.created_at.substr(14, 2));

    $('tableTrack').update(content.track.trackname.toUpperCase());
    $('tableBuilder').update(content.track.username.toUpperCase());
    $('tableLength').update((parseInt(content.track.length * 10, 10)) / 10 + " METER");
    $('tableDate').update(trackDate.getDate() + ". " + trackDate.getMonthName().toUpperCase() + " " + trackDate.getFullYear());
    $('tableTime').update(trackDate.getFormatHours() + ":" + trackDate.getFormatMinutes() + " " + trackDate.getDayTime());
    $('tableLikes').update(content.track.likes);

    $('editor').setStyle({height: "520px"});

    this.visibleList = ["showroomControlsTop", "showroomControlsBottom", "showroomDetail", "staticCanvas", "dynamicCanvas"];

  },

  createOverviewMode: function(content, visibleList) {

    setSwitchMode("view");

    var htmlString = "
";

    for (var i = 0; i < content.tracks.length; i++) {

      if (!localTracks[content.tracks[i].id]) {
        localTracks[content.tracks[i].id] = content.tracks[i];
      }

      var listString = "
";

      listString += '';
      listString += '
'
      listString += '
' + content.tracks[i].trackname + '
'
      listString += '
' + content.tracks[i].username + '
'
      listString += '
' + Math.round(content.tracks[i].length * 10) / 10 + ' Meter | LIKES ' + content.tracks[i].likes + '
'
      listString += '
'

      listString += "
";

      htmlString += listString;
    }

    htmlString += "
";

    $('overviewGrid').update(htmlString);

    this.visibleList = ["overviewControls", "overviewGrid"];

  },

  pushURL: function(path, content) {

    if (history && history.pushState) {

      history.pushState(content, "", path);

    }

  },

  onPopState: function(event) {

    this.parseResponse(event.state, false);

  },

  setInitialScreen: function() {

    if (!Cookie.get("isFirstVisit")) {

      $('firstVisitContainer').setStyle({visibility: "visible"});
      $('firstVisitText').setStyle({visibility: "visible"});
      $('firstVisitCloseButton').setStyle({visibility: "visible"});

      $('firstVisitCloseButton').observe('click', function(event) {
        $('firstVisitContainer').setStyle({visibility: "hidden"});
        $('firstVisitText').setStyle({visibility: "hidden"});
        $('firstVisitCloseButton').setStyle({visibility: "hidden"});
      });

    } else {

      $('firstVisitContainer').setStyle({visibility: "hidden"});
      $('firstVisitText').setStyle({visibility: "hidden"});
      $('firstVisitCloseButton').setStyle({visibility: "hidden"});
    }

    Cookie.set("isFirstVisit", true, {maxAge: 60 * 60 * 24 * 30 * 2});

    Cookie.likedTracks = JSON.parse(Cookie.get('likes')) || [];
    Cookie.flagedTracks = JSON.parse(Cookie.get('flags')) || [];

  }

});<commit_msg>Bug fix<commit_after>var ContentLoader = Class.create({

  initialize: function() {

    this.canvasContent;
    this.visibleList;
    this.loadingInterval;

    var thisClass = this;

    Pattern.context = meterCanvas.getContext("2d");
    Pattern.loadPattern([
      {name: "meterBackground", path: "../images/sidebar-meter-background.png"},
      {name: "meterForeground", path: "../images/sidebar-meter-foreground.png"},
      {name: "meterPointer", path: "../images/sidebar-meter-pointer.png"}
    ]);

    Pattern.onload = function() {
      sidebarController = new SidebarController();

      thisClass.loadContent(window.location.pathname);
    };

    this.setInitialScreen();

  },

  loadContent: function(path, setPath) {

    this.parseResponse({responseJSON: {mode: "load"}});

    if (path == "/about" || path == "/imprint" || path == "/contact") {

      parseResponse({responseJSON: {mode: path.substr(1)}}, setPath);
      return;

    }

    var thisClass = this;

    new Ajax.Request(path, {
      method: 'get',
      requestHeaders: {Accept: 'application/json'},

      onSuccess: function(transport) {
        thisClass.parseResponse.call(thisClass, transport, setPath);
      },
      onFailure: function(transport) {
        thisClass.parseResponse.call(thisClass, transport, false);
      }
    });

  },

  parseResponse: function(jsonContent, setPath) {

    this.loadingInterval && clearInterval(this.loadingInterval);

    if (typeof(setPath) == "undefined") {
      setPath = true;
    }

    var content = jsonContent.responseJSON;
    var path;

    this.visibleList = [];

    if (this.canvasContent) {
      this.canvasContent.destroy();
      this.canvasContent = null;
    }

    switch(content.mode) {

      case "build":
        this.createBuildMode(content);
        path = "/tracks/new";
      break;

      case "show":
        this.createShowMode(content);
        path = "/tracks/" + content.track.id;
      break;

      case "overview":
        this.createOverviewMode(content);
        path = "/tracks";
      break;

      case "about":
      case "imprint":
      case "contact":
        this.visibleList = [content.mode + "Page"];
        path = "/" + content.mode
      break;

      case "load":
        setPath = false;
        this.visibleList = ["loadingPage"];
        this.loadingInterval = setInterval(function() {
          $("loadingPage").toggleClassName("blink");
        }, 500);
      break;

      case "failure":
        this.visibleList = ["errorPage"];
        $("errorMessage").update(content.message.toUpperCase());
      break;

    }

    setToggleElementsVisibility(this.visibleList);

    setPath && this.pushURL(path, jsonContent);

  },

  createBuildMode: function(content, visibleList) {

    setBuildTweetButton();
    setSwitchMode("build");

    this.canvasContent = new Editor(staticCanvas, dynamicCanvas, bufferCanvas, imageCanvas);
    this.canvasContent.x = editorPosition.left;
    this.canvasContent.y = editorPosition.top;

    this.canvasContent.startRender();

    $('editor').setStyle({height: "560px"});

    this.visibleList = [
      "editorControlsTop", "editorControlsBottom",
      "editorToolboxTop", "editorToolboxBottom",
      "staticCanvas", "dynamicCanvas"
    ];

  },

  createShowMode: function(content) {

    setTrackTweetButton(content.track.id);
    setSwitchMode("view");
    currentTrack = content.track.id;

    if (!localTracks[content.track.id]) {
        localTracks[content.track.id] = content.track;
    }

    this.canvasContent = new Showroom(staticCanvas, dynamicCanvas, bufferCanvas);
    this.canvasContent.x = editorPosition.left;
    this.canvasContent.y = editorPosition.top;

    this.canvasContent.parseTrack(content.track);
    this.canvasContent.trackID = content.track.id;

    this.canvasContent.initializeHTMLInterface();
    this.canvasContent.startRender();

    var trackDate = new Date(0);

    trackDate.setFullYear(content.track.created_at.substr(0, 4));
    trackDate.setMonth(parseInt(content.track.created_at.substr(5, 2), 10) - 1);
    trackDate.setDate(content.track.created_at.substr(9, 2));
    trackDate.setHours(content.track.created_at.substr(11, 2));
    trackDate.setMinutes(content.track.created_at.substr(14, 2));

    $('tableTrack').update(content.track.trackname.toUpperCase());
    $('tableBuilder').update(content.track.username.toUpperCase());
    $('tableLength').update((parseInt(content.track.length * 10, 10)) / 10 + " METER");
    $('tableDate').update(trackDate.getDate() + ". " + trackDate.getMonthName().toUpperCase() + " " + trackDate.getFullYear());
    $('tableTime').update(trackDate.getFormatHours() + ":" + trackDate.getFormatMinutes() + " " + trackDate.getDayTime());
    $('tableLikes').update(content.track.likes);

    $('editor').setStyle({height: "520px"});

    this.visibleList = ["showroomControlsTop", "showroomControlsBottom", "showroomDetail", "staticCanvas", "dynamicCanvas"];

  },

  createOverviewMode: function(content, visibleList) {

    setSwitchMode("view");

    var htmlString = "
";

    for (var i = 0; i < content.tracks.length; i++) {

      if (!localTracks[content.tracks[i].id]) {
        localTracks[content.tracks[i].id] = content.tracks[i];
      }

      var listString = "
";

      listString += '';
      listString += '
'
      listString += '
' + content.tracks[i].trackname + '
'
      listString += '
' + content.tracks[i].username + '
'
      listString += '
' + Math.round(content.tracks[i].length * 10) / 10 + ' Meter | LIKES ' + content.tracks[i].likes + '
'
      listString += '
'

      listString += "
";

      htmlString += listString;
    }

    htmlString += "
";

    $('overviewGrid').update(htmlString);

    this.visibleList = ["overviewControls", "overviewGrid"];

  },

  pushURL: function(path, content) {

    if (history && history.pushState) {

      history.pushState(content, "", path);

    }

  },

  onPopState: function(event) {

    this.parseResponse(event.state, false);

  },

  setInitialScreen: function() {

    if (!Cookie.get("isFirstVisit")) {

      $('firstVisitContainer').setStyle({visibility: "visible"});
      $('firstVisitText').setStyle({visibility: "visible"});
      $('firstVisitCloseButton').setStyle({visibility: "visible"});

      $('firstVisitCloseButton').observe('click', function(event) {
        $('firstVisitContainer').setStyle({visibility: "hidden"});
        $('firstVisitText').setStyle({visibility: "hidden"});
        $('firstVisitCloseButton').setStyle({visibility: "hidden"});
      });

    } else {

      $('firstVisitContainer').setStyle({visibility: "hidden"});
      $('firstVisitText').setStyle({visibility: "hidden"});
      $('firstVisitCloseButton').setStyle({visibility: "hidden"});
    }

    Cookie.set("isFirstVisit", true, {maxAge: 60 * 60 * 24 * 30 * 2});

    Cookie.likedTracks = JSON.parse(Cookie.get('likes')) || [];
    Cookie.flagedTracks = JSON.parse(Cookie.get('flags')) || [];

  }

});<|endoftext|>


<commit_before>var projectOwner = null;
var projectSlug = null;
var alreadyStarred = false;

var KEY_TAB = 9;

$(function() {
    // setup star button
    var increment = alreadyStarred ? -1 : 1;
    $('.btn-star').click(function() {
        var starred = $(this).find('.starred');
        starred.html(' ' + (parseInt(starred.text()) + increment).toString());
        $.ajax('/' + projectOwner + '/' + projectSlug + '/star/' + (increment > 0));

        var icon = $('#icon-star');
        if (increment > 0) {
            icon.removeClass('fa-star-o').addClass('fa-star');
        } else {
            icon.removeClass('fa-star').addClass('fa-star-o');
        }

        increment *= -1;
    });

    $('body').keydown(function(event) {
        var target = $(event.target);
        if (target.is('body')) {
            switch (event.keyCode) {
                case KEY_TAB:
                    event.preventDefault();
                    var navBar = $('.project-navbar');
                    var activeTab = navBar.find('li.active');
                    var nextTab = activeTab.next();
                    var nextId = nextTab.attr('id');
                    if (nextTab.is('li') && nextId !== 'issues' && nextId !== 'source') {
                        window.location = nextTab.find('a').attr('href');
                    } else {
                        window.location = navBar.find('li:first').find('a').attr('href');
                    }
                    break;
                default:
                    break;
            }
        }
    });
});
<commit_msg>Change tab navigation to shift + tab<commit_after>var projectOwner = null;
var projectSlug = null;
var alreadyStarred = false;

var KEY_TAB = 9;
var KEY_SHIFT = 16;

$(function() {
    // setup star button
    var increment = alreadyStarred ? -1 : 1;
    $('.btn-star').click(function() {
        var starred = $(this).find('.starred');
        starred.html(' ' + (parseInt(starred.text()) + increment).toString());
        $.ajax('/' + projectOwner + '/' + projectSlug + '/star/' + (increment > 0));

        var icon = $('#icon-star');
        if (increment > 0) {
            icon.removeClass('fa-star-o').addClass('fa-star');
        } else {
            icon.removeClass('fa-star').addClass('fa-star-o');
        }

        increment *= -1;
    });

    var shiftDown = false;
    var body = $('body');
    body.keydown(function(event) {
        var target = $(event.target);
        if (target.is('body')) {
            switch (event.keyCode) {
                case KEY_SHIFT:
                    shiftDown = true;
                    break;
                case KEY_TAB:
                    if (!shiftDown) return;
                    event.preventDefault();
                    var navBar = $('.project-navbar');
                    var activeTab = navBar.find('li.active');
                    var nextTab = activeTab.next();
                    var nextId = nextTab.attr('id');
                    if (nextTab.is('li') && nextId !== 'issues' && nextId !== 'source') {
                        window.location = nextTab.find('a').attr('href');
                    } else {
                        window.location = navBar.find('li:first').find('a').attr('href');
                    }
                    break;
                default:
                    break;
            }
        }
    });

    body.keyup(function(event) {
        var target = $(event.target);
        if (target.is('body')) {
            switch (event.keyCode) {
                case KEY_SHIFT:
                    shiftDown = false;
                    break;
                default:
                    break;
            }
        }
    });
});
<|endoftext|>


<commit_before>import React from 'react';
import UserList from './userList';
import socketHandler from './../../app/socketHandler';

import {
  GET_ALL_USER_REQUEST,
  GET_ALL_USER_REQUEST_SUCCESS
} from './../../../../app/shared/userActionTypes'

var UserListContainer = React.createClass({
  getInitialState() {
    return {
      users: []
    }
  },

  componentDidMount() {
    socketHandler.emit(GET_ALL_USER_REQUEST);
    socketHandler.on(GET_ALL_USER_REQUEST_SUCCESS, (response) => {
      this.setState({users: response});
    });
  },

  render() {
    return (<UserList users={this.state.users}/>);
  }
});

export default UserListContainer;
<commit_msg>fix a bug which cause to trial updating unmounted component<commit_after>import React from 'react';
import UserList from './userList';
import socketHandler from './../../app/socketHandler';

import {
  GET_ALL_USER_REQUEST,
  GET_ALL_USER_REQUEST_SUCCESS
} from './../../../../app/shared/userActionTypes'

var UserListContainer = React.createClass({
  getInitialState() {
    return {
      users: []
    }
  },

  componentDidMount() {
    socketHandler.emit(GET_ALL_USER_REQUEST);
    socketHandler.on(GET_ALL_USER_REQUEST_SUCCESS, this._getAllUserRequestHandler);
  },

  componentWillUnmount() {
    socketHandler.removeListener(GET_ALL_USER_REQUEST_SUCCESS, this._getAllUserRequestHandler);
  },

  _getAllUserRequestHandler(response) {
    this.setState({users: response});
  },

  render() {
    return (<UserList users={this.state.users}/>);
  }
});

export default UserListContainer;
<|endoftext|>


<commit_before>Splunk.Module.Heatwave = $.klass(Splunk.Module.DispatchingModule, {

    plot: function(jString){

        if (jString.length === 0){
            return;
        } else if (jString[0].count === 0){
            return;
        }

        const durationTime = 500, size= 10, xoff= 100, padding= 50, colorOffset=1;

        var HeatMapPlot= this,
            data= this.parseData(jString),
            join= this.heatMap.selectAll("g.col").data(data, HeatMapPlot.getMetaData),
            span= data[0]._span;

        if (span === undefined) {
            console.log("Span is undefined!");
            return;
        }

        var svgW= parseInt(this.svg.style("width")),
            svgH= parseInt(this.svg.style("height")),
            heatMapWidth= svgW-xoff*2,
            xDom= d3.extent(data, HeatMapPlot.getTime);

        if (HeatMapPlot.xScale === undefined){ //special case on first call
            var tmp= HeatMapPlot.calcTimeLowerBound(xDom[0], heatMapWidth, size, span);
            HeatMapPlot.xScale= this.calculateXScale([tmp, xDom[0]], heatMapWidth);
        }

        var timeLowerBound= HeatMapPlot.calcTimeLowerBound(xDom[1], heatMapWidth, size, span),
            xScale= this.calculateXScale([timeLowerBound, xDom[1]], heatMapWidth);

        var newColumns= addColumns(join);

        var xAxis= d3.svg.axis()
            .scale(xScale)
            .orient("bottom")
            .ticks(3)
            .tickSubdivide(10)
            .tickSize(6,3,3);

        var bucketSpan= data[0]._bucketSpan,
            currentCols= this.heatMap
                .selectAll("g.col")
                .filter(inRange)
                .filter(same),
            allData= currentCols.data(),
            yDom= this.calculateYDomain(allData),
            nBuckets= (yDom[1]-yDom[0])/d3.max(allData, function (d) { return d._bucketSpan; }),
            heatMapHeight= svgH-padding,
            wishBucketHeigth= heatMapHeight / nBuckets,
            bucketHeight= wishBucketHeigth,//d3.min([d3.max([wishBucketHeigth,2]),50]),
            colorDom= [d3.min(allData, function (d) { return d._extent[0]; }) + colorOffset,
                d3.max(allData, function (d){ return d._extent[1]; }) + colorOffset],
            color= d3.scale.log().domain(colorDom).range(["white","#CC0000"]),
            yScale= this.calculateYScale(yDom, heatMapHeight);

        console.log("yDomain", yDom, heatMapHeight)
        console.log("Splunks data", data)

        var yAxis= d3.svg.axis()
            .scale(yScale)
            .orient("left")
            .ticks(Math.min(nBuckets,10))
            .tickSubdivide(0)
            .tickSize(6,3,3);

        this.heatMap.transition().duration(durationTime).ease("linear")
            .attr("transform", "translate(" + xoff + "," + (svgH - heatMapHeight - padding + 5) + ")");

        this.heatMap.select("g.axis.y").transition().duration(durationTime).ease("linear")
            .call(yAxis);

        this.heatMap.select("g.axis.x").transition().duration(durationTime).ease("linear")
            .attr("transform", "translate(0," + (heatMapHeight + 1) + ")")
            .call(xAxis);

        currentCols.each(updateRects)
            .call(move);

        this.heatMap.selectAll("g.cols")
            .filter(function (d) { return !inRange(d) || !same(d); })
            .transition().duration(durationTime)
            .attr("opacity", 0)
            .remove();

        function addColumns(d3set) {
            return d3set.enter().insert("g","g.axis").attr("class", "col")
                .call(moveIn);
        }

        function updateRects(colData) {
            var rect= d3.select(this).selectAll("rect"),
                join= rect.data(colData, HeatMapPlot.getBucketStr);

            join.enter().insert("rect")
                .on("click", function(d) { console.log(d3.select(this).select("title").text()); } )
                .call(place)
                .call(shape)
                .append("title")
                .call(title, colData);

            join.transition().duration(durationTime).ease("linear")
                .style("fill", toColor)
                .call(place)
                .call(shape)
                .select("title")
                .call(title, colData);

            join.exit().remove();
        }

        function title(selection, colData) {
            selection
                .text(function(d) {return colData._time + ":" + d;})
        }

        function toColor(d) {
            return color(HeatMapPlot.getValue(d) + colorOffset);
        }

        function inRange(d) {
            return d._time > timeLowerBound && d._time < xDom[1];
        }

        function same(d) {
            return d._span === span && d._bucketSpan === bucketSpan;
        }

        function move(selection) {
            selection
                .transition().duration(durationTime).ease("linear")
                .attr("transform", function (d) { return "translate(" + xScale(d._time) + ",0)"; })
                .attr("opacity", 1);
        }

        function moveIn(selection) {
            selection
                .attr("opacity", 0)
                .attr("transform", function (d) { return "translate(" + HeatMapPlot.xScale(d._time) + ",0)"; });
        }

        function shape(selection) {
            selection
                .attr("width", size)
                .attr("height", bucketHeight)
                .style("fill", toColor);
            //.style("stroke", toColor)
            //.style("stroke-width",1)
        }

        function place(selection) {
            selection
                .attr("y", function(d) {
                    return yScale(HeatMapPlot.getBucket(d)[0]) - bucketHeight;
                });
        }

        HeatMapPlot.xScale= xScale;
    },

    calculateYDomain: function(data){
        var that= this;
        return [d3.min(data, function (colData) { return that.getBucket(colData[0])[0]; }), //selectAll rect?
            d3.max(data, function (colData) { return that.getBucket(colData[colData.length-1])[1]; })];
    },

    calculateYScale: function(domain, height){
        return d3.scale.linear().domain(domain).range([height, 0]);
    },

    updateXScale: function(domain, width) {

    },

    calculateXScale: function(domain, width) {
        return d3.time.scale().domain(domain).range([0, width]);
    },

    calcTimeLowerBound: function(time, length, size, span) {
        return new Date(time.getTime() - (length / size) * span * 1000)
    },

    getTime: function (d) {
        return d._time;
    },

    getMetaData: function (d) {
        return d._time + "," + d._span;
    },

    getMetaMouseClick: function (d) {
        console.log(d._time, d._span)
        return d._time + "," + d._span;
    },

    toTime: function (t){
        var st= t.indexOf("=");
        return new Date(t.substring(st+1))
    },

    getBucket: function (d){
        var a= d.indexOf("-"),
            b= d.indexOf("=");
        return [parseFloat(d.substring(0,a)), parseFloat(d.substring(a+1,b))];
    },

    getBucketStr: function (d) {
        return d.substring(0,d.indexOf("="))
    },

    getValue: function (d){
        var st= d.indexOf("=");
        return eval(d.substring(st+1));
    },

    parseData: function(jString) {

        var data= [];
        //sort data according to bucket values
        for(var col=0; col<jString.length; col++){
            var tmp= [];
            for(var bucket in jString[col]){
                if(jString[col].hasOwnProperty(bucket) && bucket[0] !== "_"){
                    tmp.push(bucket + "=" + jString[col][bucket]);
                }
            }
            tmp.sort(function(a, b) { return parseFloat(a) - parseFloat(b); });
            tmp._time= new Date(jString[col]._time);
            tmp._span= eval(jString[col]._span);
            tmp._extent= d3.extent(tmp, this.getValue);
            var firstBucket= this.getBucket(tmp[0]);
            tmp._bucketSpan= firstBucket[1]-firstBucket[0];
            data.push(tmp);
        }

        //console.log(data)
        return data;
    },

    //############################################################
    // MAIN WAVE RENDERING
    //############################################################

	initialize: function($super, container) {
		//console.log("I GOT TO initialize");
        //console.log($super,container);

        this.svg= d3.select("svg"); // d3.select(this.container).select("svg")
        this.heatMap= this.svg.append("g")
                .attr("class","heatMap");

        this.heatMap.append("g")
            .attr("class", "axis x");

        this.heatMap.append("g")
            .attr("class", "axis y");

		$super(container);

        // if set to 'foo', the drilldown keys coming out of getModifiedContext() will look like "$
        this.drilldownPrefix = this.getParam("drilldownPrefix");

        //Context flow gates
        this.doneUpstream = false;
        this.gettingResults = false;

    },

	onBeforeJobDispatched: function(search) {
		search.setMinimumStatusBuckets(1);
		search.setRequiredFields(["*"]);
	},

	onJobProgress: function(event) {
		console.log("I GOT TO onJobProgress");
        var context = this.getContext();
        var search = context.get("search");

        //console.log("This is the search url: " + search.getUrl("events"));
		//console.log("This.getResults() " + this.getResults());
		this.getResults();
    	},

    onJobDone: function(){
        this.getResults();
    },

    onContextChange: function() {
        var context = this.getContext();
        if (context.get("search").job.isDone()) {
            this.getResults();
        } else {
            this.doneUpstream = false;
        }
    },

	// override
	getResultURL: function(params) {
		//console.log("I GOT TO getResultsURL");
		var context = this.getContext();
		var search = context.get("search");
		//console.log("Search ID in getResultsURL: " + search.job.getSearchId());
		var searchJobId = search.job.getSearchId();
		var uri = Splunk.util.make_url("splunkd/search/jobs/" + searchJobId + "/results_preview?output_mode=json");
		//console.log("This is the uri in getResultURL " + uri);
		return uri;

	},

    getResults: function($super) {
        this.doneUpstream = true;
        this.gettingResults = true;
        return $super();
    },

	getResultParams: function($super) {
		var params = $super(); //Chartjs
        	var context = this.getContext();
        	var search = context.get("search");
        	var sid = search.job.getSearchId();

       	 	if (!sid) this.logger.error(this.moduleType, "Assertion Failed.");

        	params.sid = sid;
        	return params;

	},

    getModifiedContext: function() {
        console.log("I GOT TO getModifiedContext")
        var context = this.getContext();

        if (true) {
            var search = context.get("search");
            console.log("SEARCH : " + search);

            var searchRange  = new Splunk.TimeRange('02/19/2013:11:51:00', '02/19/2013:11:50:00');//search.getTimeRange();
            console.log("searchRange : " + searchRange);

            search.setTimeRange(searchRange);
            context.set("search", search);
        }
        return context;
    },

    /**
     * override isReadyForContextPush to stop the pushes downstream
     * when we have no selected state
     */
    isReadyForContextPush: function($super) {
        //Note that here we gate any pushing of context until the main plot has
        //completed its render.
        if (!(this.doneUpstream)) {
            return Splunk.Module.DEFER;
        }
        if (this.gettingResults) {
            return Splunk.Module.DEFER;
        }
        return $super();
    },

	renderResults: function($super, jString) {
		if (!jString) {
		 	return;
		}

        var resultDict;
        if (jString.results === undefined){
			resultsDict = eval(jString);
		}else{
			resultsDict = jString.results;
		}

        var that= this;
		$("document").ready(function() {
            that.plot(resultsDict);
        });
	}
});
<commit_msg>Added removal of old columns<commit_after>Splunk.Module.Heatwave = $.klass(Splunk.Module.DispatchingModule, {

    plot: function(jString){

        if (jString.length === 0){
            return;
        } else if (jString[0].count === 0){
            return;
        }

        const durationTime = 500, size= 10, xoff= 100, padding= 50, colorOffset=1;

        var HeatMapPlot= this,
            data= this.parseData(jString),
            join= this.heatMap.selectAll("g.col").data(data, HeatMapPlot.getMetaData),
            span= data[0]._span;

        // Remove already existing columns (duplicates)
        join.exit().remove();

        if (span === undefined) {
            console.log("Span is undefined!");
            return;
        }

        var svgW= parseInt(this.svg.style("width")),
            svgH= parseInt(this.svg.style("height")),
            heatMapWidth= svgW-xoff*2,
            xDom= d3.extent(data, HeatMapPlot.getTime);

        if (HeatMapPlot.xScale === undefined){ //special case on first call
            var tmp= HeatMapPlot.calcTimeLowerBound(xDom[0], heatMapWidth, size, span);
            HeatMapPlot.xScale= this.calculateXScale([tmp, xDom[0]], heatMapWidth);
        }

        var timeLowerBound= HeatMapPlot.calcTimeLowerBound(xDom[1], heatMapWidth, size, span),
            xScale= this.calculateXScale([timeLowerBound, xDom[1]], heatMapWidth);

        var newColumns= addColumns(join);

        var xAxis= d3.svg.axis()
            .scale(xScale)
            .orient("bottom")
            .ticks(3)
            .tickSubdivide(10)
            .tickSize(6,3,3);

        var bucketSpan= data[0]._bucketSpan,
            currentCols= this.heatMap
                .selectAll("g.col")
                .filter(inRange)
                .filter(same),
            allData= currentCols.data(),
            yDom= this.calculateYDomain(allData),
            nBuckets= (yDom[1]-yDom[0])/d3.max(allData, function (d) { return d._bucketSpan; }),
            heatMapHeight= svgH-padding,
            wishBucketHeigth= heatMapHeight / nBuckets,
            bucketHeight= wishBucketHeigth,//d3.min([d3.max([wishBucketHeigth,2]),50]),
            colorDom= [d3.min(allData, function (d) { return d._extent[0]; }) + colorOffset,
                d3.max(allData, function (d){ return d._extent[1]; }) + colorOffset],
            color= d3.scale.log().domain(colorDom).range(["white","#CC0000"]),
            yScale= this.calculateYScale(yDom, heatMapHeight);

        console.log("yDomain", yDom, heatMapHeight)
        console.log("Splunks data", data)

        var yAxis= d3.svg.axis()
            .scale(yScale)
            .orient("left")
            .ticks(Math.min(nBuckets,10))
            .tickSubdivide(0)
            .tickSize(6,3,3);

        this.heatMap.transition().duration(durationTime).ease("linear")
            .attr("transform", "translate(" + xoff + "," + (svgH - heatMapHeight - padding + 5) + ")");

        this.heatMap.select("g.axis.y").transition().duration(durationTime).ease("linear")
            .call(yAxis);

        this.heatMap.select("g.axis.x").transition().duration(durationTime).ease("linear")
            .attr("transform", "translate(0," + (heatMapHeight + 1) + ")")
            .call(xAxis);

        currentCols.each(updateRects)
            .call(move);

        this.heatMap.selectAll("g.cols")
            .filter(function (d) { return !inRange(d) || !same(d); })
            .transition().duration(durationTime)
            .attr("opacity", 0)
            .remove();

        function addColumns(d3set) {
            return d3set.enter().insert("g","g.axis").attr("class", "col")
                .call(moveIn);
        }

        function updateRects(colData) {
            var rect= d3.select(this).selectAll("rect"),
                join= rect.data(colData, HeatMapPlot.getBucketStr);

            join.enter().insert("rect")
                .on("click", function(d) { console.log(d3.select(this).select("title").text()); } )
                .call(place)
                .call(shape)
                .append("title")
                .call(title, colData);

            join.transition().duration(durationTime).ease("linear")
                .style("fill", toColor)
                .call(place)
                .call(shape)
                .select("title")
                .call(title, colData);

            join.exit().remove();
        }

        function title(selection, colData) {
            selection
                .text(function(d) {return colData._time + ":" + d;})
        }

        function toColor(d) {
            return color(HeatMapPlot.getValue(d) + colorOffset);
        }

        function inRange(d) {
            return d._time > timeLowerBound && d._time < xDom[1];
        }

        function same(d) {
            return d._span === span && d._bucketSpan === bucketSpan;
        }

        function move(selection) {
            selection
                .transition().duration(durationTime).ease("linear")
                .attr("transform", function (d) { return "translate(" + xScale(d._time) + ",0)"; })
                .attr("opacity", 1);
        }

        function moveIn(selection) {
            selection
                .attr("opacity", 0)
                .attr("transform", function (d) { return "translate(" + HeatMapPlot.xScale(d._time) + ",0)"; });
        }

        function shape(selection) {
            selection
                .attr("width", size)
                .attr("height", bucketHeight)
                .style("fill", toColor);
            //.style("stroke", toColor)
            //.style("stroke-width",1)
        }

        function place(selection) {
            selection
                .attr("y", function(d) {
                    return yScale(HeatMapPlot.getBucket(d)[0]) - bucketHeight;
                });
        }

        HeatMapPlot.xScale= xScale;
    },

    calculateYDomain: function(data){
        var that= this;
        return [d3.min(data, function (colData) { return that.getBucket(colData[0])[0]; }), //selectAll rect?
            d3.max(data, function (colData) { return that.getBucket(colData[colData.length-1])[1]; })];
    },

    calculateYScale: function(domain, height){
        return d3.scale.linear().domain(domain).range([height, 0]);
    },

    updateXScale: function(domain, width) {

    },

    calculateXScale: function(domain, width) {
        return d3.time.scale().domain(domain).range([0, width]);
    },

    calcTimeLowerBound: function(time, length, size, span) {
        return new Date(time.getTime() - (length / size) * span * 1000)
    },

    getTime: function (d) {
        return d._time;
    },

    getMetaData: function (d) {
        return d._time + "," + d._span;
    },

    getMetaMouseClick: function (d) {
        console.log(d._time, d._span)
        return d._time + "," + d._span;
    },

    toTime: function (t){
        var st= t.indexOf("=");
        return new Date(t.substring(st+1))
    },

    getBucket: function (d){
        var a= d.indexOf("-"),
            b= d.indexOf("=");
        return [parseFloat(d.substring(0,a)), parseFloat(d.substring(a+1,b))];
    },

    getBucketStr: function (d) {
        return d.substring(0,d.indexOf("="))
    },

    getValue: function (d){
        var st= d.indexOf("=");
        return eval(d.substring(st+1));
    },

    parseData: function(jString) {

        var data= [];
        //sort data according to bucket values
        for(var col=0; col<jString.length; col++){
            var tmp= [];
            for(var bucket in jString[col]){
                if(jString[col].hasOwnProperty(bucket) && bucket[0] !== "_"){
                    tmp.push(bucket + "=" + jString[col][bucket]);
                }
            }
            tmp.sort(function(a, b) { return parseFloat(a) - parseFloat(b); });
            tmp._time= new Date(jString[col]._time);
            tmp._span= eval(jString[col]._span);
            tmp._extent= d3.extent(tmp, this.getValue);
            var firstBucket= this.getBucket(tmp[0]);
            tmp._bucketSpan= firstBucket[1]-firstBucket[0];
            data.push(tmp);
        }

        //console.log(data)
        return data;
    },

    //############################################################
    // MAIN WAVE RENDERING
    //############################################################

	initialize: function($super, container) {
		//console.log("I GOT TO initialize");
        //console.log($super,container);

        this.svg= d3.select("svg"); // d3.select(this.container).select("svg")
        this.heatMap= this.svg.append("g")
                .attr("class","heatMap");

        this.heatMap.append("g")
            .attr("class", "axis x");

        this.heatMap.append("g")
            .attr("class", "axis y");

		$super(container);

        // if set to 'foo', the drilldown keys coming out of getModifiedContext() will look like "$
        this.drilldownPrefix = this.getParam("drilldownPrefix");

        //Context flow gates
        this.doneUpstream = false;
        this.gettingResults = false;

    },

	onBeforeJobDispatched: function(search) {
		search.setMinimumStatusBuckets(1);
		search.setRequiredFields(["*"]);
	},

	onJobProgress: function(event) {
		console.log("I GOT TO onJobProgress");
        var context = this.getContext();
        var search = context.get("search");

        //console.log("This is the search url: " + search.getUrl("events"));
		//console.log("This.getResults() " + this.getResults());
		this.getResults();
    	},

    onJobDone: function(){
        this.getResults();
    },

    onContextChange: function() {
        var context = this.getContext();
        if (context.get("search").job.isDone()) {
            this.getResults();
        } else {
            this.doneUpstream = false;
        }
    },

	// override
	getResultURL: function(params) {
		//console.log("I GOT TO getResultsURL");
		var context = this.getContext();
		var search = context.get("search");
		//console.log("Search ID in getResultsURL: " + search.job.getSearchId());
		var searchJobId = search.job.getSearchId();
		var uri = Splunk.util.make_url("splunkd/search/jobs/" + searchJobId + "/results_preview?output_mode=json");
		//console.log("This is the uri in getResultURL " + uri);
		return uri;

	},

    getResults: function($super) {
        this.doneUpstream = true;
        this.gettingResults = true;
        return $super();
    },

	getResultParams: function($super) {
		var params = $super(); //Chartjs
        	var context = this.getContext();
        	var search = context.get("search");
        	var sid = search.job.getSearchId();

       	 	if (!sid) this.logger.error(this.moduleType, "Assertion Failed.");

        	params.sid = sid;
        	return params;

	},

    getModifiedContext: function() {
        console.log("I GOT TO getModifiedContext")
        var context = this.getContext();

        if (true) {
            var search = context.get("search");
            console.log("SEARCH : " + search);

            var searchRange  = new Splunk.TimeRange('02/19/2013:11:51:00', '02/19/2013:11:50:00');//search.getTimeRange();
            console.log("searchRange : " + searchRange);

            search.setTimeRange(searchRange);
            context.set("search", search);
        }
        return context;
    },

    /**
     * override isReadyForContextPush to stop the pushes downstream
     * when we have no selected state
     */
    isReadyForContextPush: function($super) {
        //Note that here we gate any pushing of context until the main plot has
        //completed its render.
        if (!(this.doneUpstream)) {
            return Splunk.Module.DEFER;
        }
        if (this.gettingResults) {
            return Splunk.Module.DEFER;
        }
        return $super();
    },

	renderResults: function($super, jString) {
		if (!jString) {
		 	return;
		}

        var resultDict;
        if (jString.results === undefined){
			resultsDict = eval(jString);
		}else{
			resultsDict = jString.results;
		}

        var that= this;
		$("document").ready(function() {
            that.plot(resultsDict);
        });
	}
});
<|endoftext|>


<commit_before>'use strict';

define(['angular'], function(angular) {

    var app = angular.module('bugattiApp.route.task.taskModule', []);

    app.config(['$stateProvider', function($stateProvider) {
        //task create
        $stateProvider.state('task.create',{
            url: "/create",
            views:{
                "@":{
                    templateUrl: "partials/task/task-new.html",
                    controller: "TaskCreateCtrl"
                }
            }

        });

        $stateProvider.state('task.shortcut',{
            url: "/shortcut?operateId&preTaskId",
            views:{
                "@":{
                    templateUrl:"partials/task/task-new.html",
                    controller: "TaskCreateCtrl"
                }
            }
        });

        $stateProvider.state('task.log',{
            url: "/log/:taskId",
            views:{
                "@":{
                    templateUrl:"partials/task/task-logs-index.html",
                    controller:"TaskLogCtrl"
                }
            }
        });

        $stateProvider.state('task.info',{
            url: "/task/info/:taskId",
            views:{
                "@":{
                    templateUrl: "partials/task/task-info.html",
                    controller: "TaskInfoCtrl"
                }
            }
        });

        $stateProvider.state('task.queue',{
            url: "/queue?envId&projectId",
            views:{
                "@":{
                    templateUrl: "partials/task/task-queue.html",
                    controller: "TaskQueueCtrl"
                }
            }
        });

    }]);

});<commit_msg>code: task-route的index页面找不到<commit_after>'use strict';

define(['angular'], function(angular) {

    var app = angular.module('bugattiApp.route.task.taskModule', []);

    app.config(['$stateProvider', function($stateProvider) {
        //task create
        $stateProvider.state('task.create',{
            url: "/create",
            views:{
                "@":{
                    templateUrl: "partials/task/task-new.html",
                    controller: "TaskCreateCtrl"
                }
            }

        });

        $stateProvider.state('task.shortcut',{
            url: "/shortcut?operateId&preTaskId",
            views:{
                "@":{
                    templateUrl:"partials/task/task-new.html",
                    controller: "TaskCreateCtrl"
                }
            }
        });

        $stateProvider.state('task.log',{
            url: "/log/:taskId",
            views:{
                "@":{
                    templateUrl:"partials/task/task-logs.html",
                    controller:"TaskLogCtrl"
                }
            }
        });

        $stateProvider.state('task.info',{
            url: "/task/info/:taskId",
            views:{
                "@":{
                    templateUrl: "partials/task/task-info.html",
                    controller: "TaskInfoCtrl"
                }
            }
        });

        $stateProvider.state('task.queue',{
            url: "/queue?envId&projectId",
            views:{
                "@":{
                    templateUrl: "partials/task/task-queue.html",
                    controller: "TaskQueueCtrl"
                }
            }
        });

    }]);

});<|endoftext|>


<commit_before>$(document).ready(function(){

  $.each($(':checked'), function( index, value ) {
    $(value).parent().addClass('black inverted active');
  });

  $('.ui.button').on('click', function(){
    // if($(this).is('#dog_search_submit')) {
      // console.log("HEEEEE");
      $(this).toggleClass('black inverted active');
      var $this_checkbox = $(this).children();
      if ($this_checkbox.is(':checked')){
        $this_checkbox.prop('checked', false);
      } else {
        $this_checkbox.prop('checked', true);
      }
    // }
  });

  $('.check').not( "#dog_search_submit" ).on('click', function(){
    $(this).parent().toggleClass('black inverted active');
  });

});<commit_msg>dog photos on heroku<commit_after>$(document).ready(function(){

  $.each($(':checked'), function( index, value ) {
    $(value).parent().addClass('black inverted active');
  });

  $('.ui.button').on('click', function(){
      $(this).toggleClass('black inverted active');
      var $this_checkbox = $(this).children();
      if ($this_checkbox.is(':checked')){
        $this_checkbox.prop('checked', false);
      } else {
        $this_checkbox.prop('checked', true);
      }
    // }
  });

  $('.check').not( "#dog_search_submit" ).on('click', function(){
    $(this).parent().toggleClass('black inverted active');
  });

});<|endoftext|>


<commit_before>// ==UserScript==
// @name         CSGO New Price Reminder in C5Game
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Auto Refresh page if no new price in the page. When new price appears, there will be Desktop notification as well as info banner for reminding.
// @author       Han Li
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @include      https://www.c5game.com/csgo/item/index.html*
// @grant GM_addStyle
// @grant GM_notification
// ==/UserScript==

/* jshint ignore:start */
var inline_src = (<><![CDATA[
/* jshint ignore:end */
/* jshint esnext: true */

// Your code here...

	GM_addStyle('#refresh-button {width: 100px; color: #FFF; border-radius: 6px;}');
	GM_addStyle('#info-banner {position: fixed; top: 0; height: 40px; width: 100%;  background-color: yellow; color: black; border-radius: 6px; font-size: 2em!important; text-align:center; z-index: 403;}');
    //we are only interested in purchase page.
    let isPurchasePage = document.URL.includes('&type=P');
    if(isPurchasePage){
    	const CHECK_INTERVAL = 1;
    	let waitData = setInterval(() => {
    	  if($('.sale-item-table tbody:nth-child(2) tr:first td.item-name').length){
    	  	clearInterval(waitData);

    	  	let pageTitle = $(document).find("title").text();
			let curPrice = parseFloat($('.sale-item-table tbody:nth-child(2) tr:first td:nth-child(4) span').text().substring(1));
			let previousPrice = parseFloat(sessionStorage.getItem(pageTitle));
			//set new price to session storage so even when item count descrease, we still get covered on next refresh.
			sessionStorage.setItem(pageTitle, curPrice);

			const refreshKey = pageTitle + '-refresh';
			let refreshing = JSON.parse(sessionStorage.getItem(refreshKey));
			console.log(`page loaded: prev: '${previousPrice}' current: '${curPrice}'. time: ${new Date()}`);

			if (refreshing && curPrice !== previousPrice) {
			    refreshing = false;
			    sessionStorage.setItem(refreshKey, refreshing);
			    sessionStorage.setItem(pageTitle, curPrice);
			    const msg = `Top pirce changed from ${previousPrice} to '${curPrice}.' `;
			    var notificationDetails = {
			        text: msg,
			        title: 'Refresh Stopped, press the Button to resume refresh',
			        timeout: 10000,
			        onclick: function() {
			            console.log("Notice clicked.");
			            window.focus();
			        }
			    };
			    GM_notification(notificationDetails);
			    let infoBanner = $(`<div id='info-banner'><h1>${msg}</h1></div>`);
			    $('body').prepend(infoBanner);
			}

			let buttonText = getNextButtonState(refreshing);
			let buttonBgColor = getNextButtonBg(refreshing);
			let refreshButton = $(`<input type="button" style="background-color: ${buttonBgColor}" id="refresh-button" value="${buttonText}"/>`);

			refreshButton.on('click', () => {
			    refreshing = !refreshing;
			    sessionStorage.setItem(refreshKey, refreshing);
			    if (refreshing) {
			        location.reload();
			    }else{
			    	let button = $('#refresh-button');
			   		button.prop('value', getNextButtonState(refreshing));
			   		button.css("background-color", getNextButtonBg(refreshing));
			    }
			    console.log(`after button click: ${refreshing}`);

			});

			if (refreshing) {
			    setTimeout(() => {
			            let shouldRefresh = JSON.parse(sessionStorage.getItem(refreshKey));
			            console.log('in setTimeout: ' + shouldRefresh);
			            if (shouldRefresh) {
			                location.reload();
			            }
			        },
			        61 * 1000
			    );
			}

			//$('body').append(refreshButton);
			$('.sale-item-table tbody:nth-child(2) tr:first td:nth-child(3) span').replaceWith(refreshButton);

			function getNextButtonState(refreshing) {
			    return refreshing ? '停止刷新' : '开始刷新';
			}
			function getNextButtonBg(refreshing) {
			    return refreshing ? '#55E' : '#268829';
			}
    	  }else{
    	  	console.log(`Wait for another ${CHECK_INTERVAL} second[s] to load data`);
    	  }
    	},CHECK_INTERVAL * 1000);
	}

/* jshint ignore:start */
]]></>).toString();
var c = babel.transform(inline_src);
eval(c.code);
/* jshint ignore:end */
<commit_msg>increase z-index to show the top banner in c5game site<commit_after>// ==UserScript==
// @name         CSGO New Price Reminder in C5Game
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Auto Refresh page if no new price in the page. When new price appears, there will be Desktop notification as well as info banner for reminding.
// @author       Han Li
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @include      https://www.c5game.com/csgo/item/index.html*
// @grant GM_addStyle
// @grant GM_notification
// ==/UserScript==

/* jshint ignore:start */
var inline_src = (<><![CDATA[
/* jshint ignore:end */
/* jshint esnext: true */

// Your code here...

	GM_addStyle('#refresh-button {width: 100px; color: #FFF; border-radius: 6px;}');
	GM_addStyle('#info-banner {position: fixed; top: 0; height: 40px; width: 100%;  background-color: yellow; color: black; border-radius: 6px; font-size: 2em!important; text-align:center; z-index: 1000;}');
    //we are only interested in purchase page.
    let isPurchasePage = document.URL.includes('&type=P');
    if(isPurchasePage){
    	const CHECK_INTERVAL = 1;
    	let waitData = setInterval(() => {
    	  if($('.sale-item-table tbody:nth-child(2) tr:first td.item-name').length){
    	  	clearInterval(waitData);

    	  	let pageTitle = $(document).find("title").text();
			let curPrice = parseFloat($('.sale-item-table tbody:nth-child(2) tr:first td:nth-child(4) span').text().substring(1));
			let previousPrice = parseFloat(sessionStorage.getItem(pageTitle));
			//set new price to session storage so even when item count descrease, we still get covered on next refresh.
			sessionStorage.setItem(pageTitle, curPrice);

			const refreshKey = pageTitle + '-refresh';
			let refreshing = JSON.parse(sessionStorage.getItem(refreshKey));
			console.log(`page loaded: prev: '${previousPrice}' current: '${curPrice}'. time: ${new Date()}`);

			if (refreshing && curPrice !== previousPrice) {
			    refreshing = false;
			    sessionStorage.setItem(refreshKey, refreshing);
			    sessionStorage.setItem(pageTitle, curPrice);
			    const msg = `Top pirce changed from ${previousPrice} to '${curPrice}.' `;
			    var notificationDetails = {
			        text: msg,
			        title: 'Refresh Stopped, press the Button to resume refresh',
			        timeout: 10000,
			        onclick: function() {
			            console.log("Notice clicked.");
			            window.focus();
			        }
			    };
			    GM_notification(notificationDetails);
			    let infoBanner = $(`<div id='info-banner'><p>${msg}</p></div>`);
			    $('body').prepend(infoBanner);
			}

			let buttonText = getNextButtonState(refreshing);
			let buttonBgColor = getNextButtonBg(refreshing);
			let refreshButton = $(`<input type="button" style="background-color: ${buttonBgColor}" id="refresh-button" value="${buttonText}"/>`);

			refreshButton.on('click', () => {
			    refreshing = !refreshing;
			    sessionStorage.setItem(refreshKey, refreshing);
			    if (refreshing) {
			        location.reload();
			    }else{
			    	let button = $('#refresh-button');
			   		button.prop('value', getNextButtonState(refreshing));
			   		button.css("background-color", getNextButtonBg(refreshing));
			    }
			    console.log(`after button click: ${refreshing}`);

			});

			if (refreshing) {
			    setTimeout(() => {
			            let shouldRefresh = JSON.parse(sessionStorage.getItem(refreshKey));
			            console.log('in setTimeout: ' + shouldRefresh);
			            if (shouldRefresh) {
			                location.reload();
			            }
			        },
			        61 * 1000
			    );
			}

			//$('body').append(refreshButton);
			$('.sale-item-table tbody:nth-child(2) tr:first td:nth-child(3) span').replaceWith(refreshButton);

			function getNextButtonState(refreshing) {
			    return refreshing ? '停止刷新' : '开始刷新';
			}
			function getNextButtonBg(refreshing) {
			    return refreshing ? '#55E' : '#268829';
			}
    	  }else{
    	  	console.log(`Wait for another ${CHECK_INTERVAL} second[s] to load data`);
    	  }
    	},CHECK_INTERVAL * 1000);
	}

/* jshint ignore:start */
]]></>).toString();
var c = babel.transform(inline_src);
eval(c.code);
/* jshint ignore:end */
<|endoftext|>


<commit_before>var Anima = Anima || {};

var centerOffset = 0;
var spectrumBuffer = (function() {
  var xDivisions = 40;
  var yDivisions = 25;
  var strokeColor = [255,255,255];

  var spectrumBuffer = new Array(xDivisions);
  for (var i = 0; i < xDivisions; ++i) {
    spectrumBuffer[i] = [];
    for (var j = 0; j < yDivisions; ++j) {
      spectrumBuffer[i][j] = 0;
    }
  }

  spectrumBuffer.sampleFromBuffer = function sampleFromBuffer(buffer) {
    var groupedAverages = groupedAveragesFromBuffer(buffer, yDivisions);
    var momentSpectrum = new Array(yDivisions);

    for (var i = 0; i < yDivisions; i++) {
      momentSpectrum[i] = groupedAverages[i];
    }
    spectrumBuffer.shift();
    spectrumBuffer.push( momentSpectrum );
  };

  spectrumBuffer.setStrokeColor = function setStrokeOpacity(color) {
    strokeColor = color;
  };

  spectrumBuffer.draw = function draw(processing) {
    var width = window.innerWidth / xDivisions;
    var height = window.innerHeight / 2 / yDivisions;
    for(i = 0; i < xDivisions; ++i) {
      for(j = 0; j < yDivisions; ++j) {
        var x = width * i;
        var y = height * j;
        processing.fill(255, spectrumBuffer[i][j]);
        var opacity = spectrumBuffer[i][j];

        processing.stroke.apply(processing, strokeColor.concat(opacity));

        processing.rect(x, y, width, height);
        processing.rect(x, window.innerHeight - y - height, width, height);
      }
    }
  };

  return spectrumBuffer;
}) ();

function groupedAveragesFromBuffer(buffer, numGroups) {
  var averages = [];
  var groupSize = Math.ceil(buffer.length / numGroups);
  for (var i = 0; i < numGroups; i++) {
    var group = buffer.subarray(groupSize * i, groupSize * (i + 1));
    averages[i] = Math.average(group);
  }
  return averages;
}

var historyBuffer = (function() {
  var historyBuffer = new Array(1024);
  var strokeOptions = [];

  for (var i = 0; i < historyBuffer.length; ++i) {
    historyBuffer[i] = 0;
  }

  historyBuffer.sampleFromBuffer = function sampleFromBuffer(buffer) {
    var sum = 0;
    var length = buffer.length;
    for(var i = 0; i < length; ++i) { sum += buffer[i]; }

    var moment = sum / (255 * buffer.length) * 500;
    historyBuffer.shift();
    historyBuffer.push(moment);
  };

  historyBuffer.setStroke = function setStroke(options) {
    strokeOptions = options;
  };

  historyBuffer.draw = function draw(processing) {
    var waves_frame_origin = window.innerHeight / 2 + centerOffset;
    var x, y;
    var previous_x = 0;
    var previous_y = historyBuffer[0];
    var length = historyBuffer.length;

    processing.stroke.apply(processing, strokeOptions);

    for(i = 0; i < length; ++i) {
      x = window.innerWidth * i / length;
      y = historyBuffer[i];

      // TODO : what if we could just pass this entire array to processing? should be more efficient, nay?
      Anima.processing.line(previous_x, waves_frame_origin - previous_y - centerOffset/2,
                            x, waves_frame_origin - y - centerOffset/2
      );

      Anima.processing.line(previous_x, waves_frame_origin + previous_y - centerOffset/2,
                            x, waves_frame_origin + y - centerOffset/2
      );

      previous_x = x;
      previous_y = y;
    }
  };

  return historyBuffer;
}) ();

Anima.sample_microphone = (function() {
  var buffer = new Uint8Array(512);

  return function sampleAudio() {
    Anima.sampler.getByteFrequencyData(buffer);

    var avg = Math.average(buffer);
    var strokeColor = Anima.color_for_hour();

    Anima.processing.background(0, 0, 0, 0);

    spectrumBuffer.setStrokeColor([strokeColor]);
    spectrumBuffer.sampleFromBuffer(buffer);
    spectrumBuffer.draw(Anima.processing);

    historyBuffer.setStroke([strokeColor, avg / 75 * 200 + 55]); //alpha
    historyBuffer.sampleFromBuffer(buffer);
    historyBuffer.draw(Anima.processing);

    TWEEN.update();
    window.requestAnimationFrame(Anima.sample_microphone);
  };
})();

Anima.enable_real_audio = function(context, media_stream) {
  Anima.sampler = context.createAnalyser();
  Anima.sampler.fftSize = 1024;
  Anima.sampler.smoothingTimeConstant = 0.95;

  var microphone = context.createMediaStreamSource(media_stream);
  microphone.connect(Anima.sampler);

  window.requestAnimationFrame(Anima.sample_microphone);
};

Math.average = function(array) {
  var sum = 0;
  var length = array.length;
  for(var i = 0; i < length; ++i) { sum += array[i]; }
  return Math.round(sum / length * 100) / 100;
};
<commit_msg>spectrum uses non-hardcoded fill color<commit_after>var Anima = Anima || {};

var centerOffset = 0;
var spectrumBuffer = (function() {
  var xDivisions = 40;
  var yDivisions = 25;
  var strokeColor = [255,255,255];
  var fillColor = [255,255,255];

  var spectrumBuffer = new Array(xDivisions);
  for (var i = 0; i < xDivisions; ++i) {
    spectrumBuffer[i] = [];
    for (var j = 0; j < yDivisions; ++j) {
      spectrumBuffer[i][j] = 0;
    }
  }

  spectrumBuffer.sampleFromBuffer = function sampleFromBuffer(buffer) {
    var groupedAverages = groupedAveragesFromBuffer(buffer, yDivisions);
    var momentSpectrum = new Array(yDivisions);

    for (var i = 0; i < yDivisions; i++) {
      momentSpectrum[i] = groupedAverages[i];
    }
    spectrumBuffer.shift();
    spectrumBuffer.push( momentSpectrum );
  };

  spectrumBuffer.setStrokeColor = function setStrokeOpacity(color) {
    strokeColor = color;
  };

  spectrumBuffer.draw = function draw(processing) {
    var width = window.innerWidth / xDivisions;
    var height = window.innerHeight / 2 / yDivisions;
    for(i = 0; i < xDivisions; ++i) {
      for(j = 0; j < yDivisions; ++j) {
        var x = width * i;
        var y = height * j;

        var opacity = spectrumBuffer[i][j];

        processing.fill.apply(processing, fillColor.concat(opacity));
        processing.stroke.apply(processing, strokeColor.concat(opacity));

        processing.rect(x, y, width, height);
        processing.rect(x, window.innerHeight - y - height, width, height);
      }
    }
  };

  return spectrumBuffer;
}) ();

function groupedAveragesFromBuffer(buffer, numGroups) {
  var averages = [];
  var groupSize = Math.ceil(buffer.length / numGroups);
  for (var i = 0; i < numGroups; i++) {
    var group = buffer.subarray(groupSize * i, groupSize * (i + 1));
    averages[i] = Math.average(group);
  }
  return averages;
}

var historyBuffer = (function() {
  var historyBuffer = new Array(1024);
  var strokeOptions = [];

  for (var i = 0; i < historyBuffer.length; ++i) {
    historyBuffer[i] = 0;
  }

  historyBuffer.sampleFromBuffer = function sampleFromBuffer(buffer) {
    var sum = 0;
    var length = buffer.length;
    for(var i = 0; i < length; ++i) { sum += buffer[i]; }

    var moment = sum / (255 * buffer.length) * 500;
    historyBuffer.shift();
    historyBuffer.push(moment);
  };

  historyBuffer.setStroke = function setStroke(options) {
    strokeOptions = options;
  };

  historyBuffer.draw = function draw(processing) {
    var waves_frame_origin = window.innerHeight / 2 + centerOffset;
    var x, y;
    var previous_x = 0;
    var previous_y = historyBuffer[0];
    var length = historyBuffer.length;

    processing.stroke.apply(processing, strokeOptions);

    for(i = 0; i < length; ++i) {
      x = window.innerWidth * i / length;
      y = historyBuffer[i];

      // TODO : what if we could just pass this entire array to processing? should be more efficient, nay?
      Anima.processing.line(previous_x, waves_frame_origin - previous_y - centerOffset/2,
                            x, waves_frame_origin - y - centerOffset/2
      );

      Anima.processing.line(previous_x, waves_frame_origin + previous_y - centerOffset/2,
                            x, waves_frame_origin + y - centerOffset/2
      );

      previous_x = x;
      previous_y = y;
    }
  };

  return historyBuffer;
}) ();

Anima.sample_microphone = (function() {
  var buffer = new Uint8Array(512);

  return function sampleAudio() {
    Anima.sampler.getByteFrequencyData(buffer);

    var avg = Math.average(buffer);
    var strokeColor = Anima.color_for_hour();

    Anima.processing.background(0, 0, 0, 0);

    spectrumBuffer.setStrokeColor([strokeColor]);
    spectrumBuffer.sampleFromBuffer(buffer);
    spectrumBuffer.draw(Anima.processing);

    historyBuffer.setStroke([strokeColor, avg / 75 * 200 + 55]); //alpha
    historyBuffer.sampleFromBuffer(buffer);
    historyBuffer.draw(Anima.processing);

    TWEEN.update();
    window.requestAnimationFrame(Anima.sample_microphone);
  };
})();

Anima.enable_real_audio = function(context, media_stream) {
  Anima.sampler = context.createAnalyser();
  Anima.sampler.fftSize = 1024;
  Anima.sampler.smoothingTimeConstant = 0.95;

  var microphone = context.createMediaStreamSource(media_stream);
  microphone.connect(Anima.sampler);

  window.requestAnimationFrame(Anima.sample_microphone);
};

Math.average = function(array) {
  var sum = 0;
  var length = array.length;
  for(var i = 0; i < length; ++i) { sum += array[i]; }
  return Math.round(sum / length * 100) / 100;
};
<|endoftext|>