<commit_before>define([
    "dojo/_base/array",
    "dojo/dom",
    "dojo/dom-class",
    "dojo/dom-geometry",
    "dojo/dom-style",
    "dojo/query",
    "dojo/touch",
    "dojo/_base/lang",
    "dojo/_base/connect",
    "dojo/window",
    "dojo/has",
    "dojo/sniff",
    "dijit/registry",
    "dojox/mvc/at",
    "dojo/store/Memory",
    "dojox/mvc/getStateful",
    "anno/common/DBUtil",
    "anno/common/Util",
    "anno/common/OAuthUtil",
    "anno/anno/AnnoDataHandler"
],
    function (arrayUtil, dom, domClass, domGeom, domStyle, query, touch, lang, connect, win, has, sniff, registry, at, Memory, getStateful, DBUtil, annoUtil, OAuthUtil, AnnoDataHandler)
    {
        var _connectResults = []; // events connect results
        var eventsModel = null;
        var app = null;
        var listScrollTop = 0;
        var loadingData = false, firstListLoaded = false,
            offset = 0, limit=15, searchOffset = 0;
        var hasMoreData = false,
            hasMoreSearchData = false,
            inSearchMode = false,
            selectedAppName = "",
            searchDone = false;
        var SEARCH_ORDER = {
            RECENT: "recent",
            ACTIVE: "active",
            POPULAR: "popular"
        };
        var searchOrder = SEARCH_ORDER.RECENT, originalData = null, appNameList = null;
        var topBarHeight=48,
            bottomBarHeight = 50,
            appNameDialogGap = 80,
            searchAppNameContainerHeight = 26,
            searchSortsBarHeight = 26;
        var firstLaunch = true;
        var emptyAnno = {
            "id": 0,
            "annoText": "0",
            "app": "0",
            "appVersion":"",
            "author": "0",
            "screenshot":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",
            circleX: 0,
            circleY:0,
            level:1,
            deviceInfo:" ",
            created: "",
            comments:[{
                author:'',
                comment:''
            }]
        };
        var timingLabels = {
            loading_list_done: 'loading_list_done'
        };

        var sdTitleHeight = 100,
            sdBottom = 90;
        var viewPoint, initialized = false;
        var startPull = false, pullStartY= 0, touchStartY = 0, doRefreshing = false;

        /**
         * This function is used by native webview to reload list data after
         * creating a new anno
         */
        var reloadListData = window.reloadListData = function() {
            loadListData(null, null, null, true);
            if (typeof loadMyAnnos !== "undefined") loadMyAnnos(false, true);
        };

        var loadListData = function (search, poffset, order, clearData)
        {
            loadingData = true;
            search = search == null ? false : search;
            clearData = clearData == null ? false : clearData;

            var arg = {
                outcome : 'cursor,has_more,anno_list',
                limit : limit,
                is_plugin : annoUtil.isPlugin
            };

            if (search)
            {
                arg.order_type = order || SEARCH_ORDER.RECENT;
                arg.search_string = dom.byId("txtSearchAnno").value;
                arg.only_my_apps = registry.byId("chkLimitToMyApps").checked ? true : false;

                if (selectedAppName)
                {
                    arg.app_name = selectedAppName;
                }
            }

            if (poffset)
            {
                if (search)
                {
                    arg.offset = poffset;
                }
                else
                {
                    arg.cursor = poffset;
                }
            }

            console.log("anno "+(search?"search":"list")+"ing, args:"+JSON.stringify(arg));

            if (search) {
                annoUtil.actionGATracking(annoUtil.analytics.category.search, 'submit search query', JSON.stringify(arg));
            }

            var APIConfig = {
                name: annoUtil.API.anno,
                method: search?"anno.anno.search":"anno.anno.list",
                parameter: arg,
                success: function(data)
                {
                    drawAnnoList(data, search, order, clearData);
                    if (firstLaunch) {
                        window.setTimeout(function() {
                            AnnoDataHandler.startBackgroundSync();
                            annoUtil.getTopTags(100);

                            if (!annoUtil.isPlugin) {
                                initPushService();
                                annoUtil.loadUserCommunities(true, function(data) {
                                    var inviteList = data.inviteList || [];
                                    for (var i = 0; i < inviteList.length; i++) {
                                        acceptInvitation(inviteList[i]);
                                    }<commit_msg>[Client] Not showing loading indicator on updating anno list after creating an anno<commit_after>define([
    "dojo/_base/array",
    "dojo/dom",
    "dojo/dom-class",
    "dojo/dom-geometry",
    "dojo/dom-style",
    "dojo/query",
    "dojo/touch",
    "dojo/_base/lang",
    "dojo/_base/connect",
    "dojo/window",
    "dojo/has",
    "dojo/sniff",
    "dijit/registry",
    "dojox/mvc/at",
    "dojo/store/Memory",
    "dojox/mvc/getStateful",
    "anno/common/DBUtil",
    "anno/common/Util",
    "anno/common/OAuthUtil",
    "anno/anno/AnnoDataHandler"
],
    function (arrayUtil, dom, domClass, domGeom, domStyle, query, touch, lang, connect, win, has, sniff, registry, at, Memory, getStateful, DBUtil, annoUtil, OAuthUtil, AnnoDataHandler)
    {
        var _connectResults = []; // events connect results
        var eventsModel = null;
        var app = null;
        var listScrollTop = 0;
        var loadingData = false, firstListLoaded = false,
            offset = 0, limit=15, searchOffset = 0;
        var hasMoreData = false,
            hasMoreSearchData = false,
            inSearchMode = false,
            selectedAppName = "",
            searchDone = false;
        var SEARCH_ORDER = {
            RECENT: "recent",
            ACTIVE: "active",
            POPULAR: "popular"
        };
        var searchOrder = SEARCH_ORDER.RECENT, originalData = null, appNameList = null;
        var topBarHeight=48,
            bottomBarHeight = 50,
            appNameDialogGap = 80,
            searchAppNameContainerHeight = 26,
            searchSortsBarHeight = 26;
        var firstLaunch = true;
        var emptyAnno = {
            "id": 0,
            "annoText": "0",
            "app": "0",
            "appVersion":"",
            "author": "0",
            "screenshot":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",
            circleX: 0,
            circleY:0,
            level:1,
            deviceInfo:" ",
            created: "",
            comments:[{
                author:'',
                comment:''
            }]
        };
        var timingLabels = {
            loading_list_done: 'loading_list_done'
        };

        var sdTitleHeight = 100,
            sdBottom = 90;
        var viewPoint, initialized = false;
        var startPull = false, pullStartY= 0, touchStartY = 0, doRefreshing = false;

        /**
         * This function is used by native webview to reload list data after
         * creating a new anno
         */
        var reloadListData = window.reloadListData = function() {
            loadListData(null, null, null, true, false);
            if (typeof loadMyAnnos !== "undefined") loadMyAnnos(false, true);
        };

        var loadListData = function (search, poffset, order, clearData, showLoadingSpinner)
        {
            loadingData = true;
            search = search == null ? false : search;
            clearData = clearData == null ? false : clearData;

            var arg = {
                outcome : 'cursor,has_more,anno_list',
                limit : limit,
                is_plugin : annoUtil.isPlugin
            };

            if (search)
            {
                arg.order_type = order || SEARCH_ORDER.RECENT;
                arg.search_string = dom.byId("txtSearchAnno").value;
                arg.only_my_apps = registry.byId("chkLimitToMyApps").checked ? true : false;

                if (selectedAppName)
                {
                    arg.app_name = selectedAppName;
                }
            }

            if (poffset)
            {
                if (search)
                {
                    arg.offset = poffset;
                }
                else
                {
                    arg.cursor = poffset;
                }
            }

            console.log("anno "+(search?"search":"list")+"ing, args:"+JSON.stringify(arg));

            if (search) {
                annoUtil.actionGATracking(annoUtil.analytics.category.search, 'submit search query', JSON.stringify(arg));
            }

            var APIConfig = {
                name: annoUtil.API.anno,
                method: search?"anno.anno.search":"anno.anno.list",
                parameter: arg,
                showLoadingSpinner: showLoadingSpinner,
                success: function(data)
                {
                    drawAnnoList(data, search, order, clearData);
                    if (firstLaunch) {
                        window.setTimeout(function() {
                            AnnoDataHandler.startBackgroundSync();
                            annoUtil.getTopTags(100);

                            if (!annoUtil.isPlugin) {
                                initPushService();
                                annoUtil.loadUserCommunities(true, function(data) {
                                    var inviteList = data.inviteList || [];
                                    for (var i = 0; i < inviteList.length; i++) {
                                        acceptInvitation(inviteList[i]);
                                    }
{'fraction_non_alphanumeric': 0.10431690210411933, 'fraction_numerical': 0.008100365504297146, 'mean_word_length': 1.4202725316758307, 'pattern_counts': {'":': 16, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '927374', 'n_tokens_mistral': 2915, 'n_tokens_neox': 2727, 'n_words': 562}