<commit_before>'use strict';
/* global angular */

var controllersModule = require('./_index');
var PhotoSwipe = require('photoswipe');
var PhotoSwipeUI_Default = require('../components/photoswipe-ui-default');
var moment = require('moment');
/**
 * @ngInject
 */
function WallDisplay($scope, $stateParams, $interval, $timeout, $location, $http, $window, AppSettings, SearchService, StatisticsService, Fullscreen) {

    var vm, flag, allStatuses, nextStatuses, term, count, searchParams;
    vm = this;
    //var ongoingRequest = false;
    null;
    vm.wallOptions = JSON.parse(decodeURI($location.search().data));
    //$scope.newWallOptions = vm.wallOptions;
    var init = function() {
        flag = false;
        vm.showEmpty = false;
        allStatuses = [];
        nextStatuses = [];
        vm.statuses = [];
        searchParams = {};
        vm.displaySearch = true;

    }
    var maxStatusCount = 0;
    if (vm.wallOptions.layoutStyle == '1')
        maxStatusCount = 10; //linear
    else if (vm.wallOptions.layoutStyle == '2')
        maxStatusCount = 9; //masonry
    else if (vm.wallOptions.layoutStyle == '3')
        maxStatusCount = 1; //single
    else if (vm.wallOptions.layoutStyle == '4')
        maxStatusCount = 10; //map
    console.log(vm.wallOptions.layoutStyle);
    count = 0;
    init();
    //calculate term
    function calculateTerm(argument) {
        term = "";
        if(vm.wallOptions.mainHashtag)
            term = vm.wallOptions.mainHashtag;
        if (vm.wallOptions.layoutStyle == '4'){
            if(term=="")
                term = "/location";
            else
                term = term + " /location";
        }
        for (var i = 0; i < vm.wallOptions.allWords.length; i++) {
            term = term + ' ' + vm.wallOptions.allWords[i].text;
        };
        for (var i = 0; i < vm.wallOptions.anyWords.length; i++) {
            term = term + ' ' + vm.wallOptions.anyWords[i].text;
        };
        for (var i = 0; i < vm.wallOptions.noWords.length; i++) {
            term = term + ' -' + vm.wallOptions.noWords[i].text;
        };
        for (var i = 0; i < vm.wallOptions.allHashtags.length; i++) {
            term = term + ' #' + vm.wallOptions.allHashtags[i].text;
        };
        for (var i = 0; i < vm.wallOptions.from.length; i++) {
            term = term + ' from:' + vm.wallOptions.from[i].text;
        };
        for (var i = 0; i < vm.wallOptions.to.length; i++) {
            term = term + ' @' + vm.wallOptions.to[i].text;
        };
        for (var i = 0; i < vm.wallOptions.mentioning.length; i++) {
            term = term + ' @' + vm.wallOptions.mentioning[i].text;
        };
        if (vm.wallOptions.images) {
            if (vm.wallOptions.images == "only") {
                term = term + ' /image';
            } else if (vm.wallOptions.images == "none") {
                term = term + ' -/image';
            }
        }
        if (vm.wallOptions.videos) {
            if (vm.wallOptions.videos == "only") {
                term = term + ' /video';
            } else if (vm.wallOptions.videos == "none") {
                term = term + ' -/video';
            }
        }
        if (vm.wallOptions.audio) {
            if (vm.wallOptions.audio == "only") {
                term = term + ' /audio';
            } else if (vm.wallOptions.audio == "none") {
                term = term + ' -/audio';
            }
        }
        if (vm.wallOptions.sinceDate) {
            term = term + ' since:' + moment(vm.wallOptions.sinceDate).format('YYYY-MM-DD_HH:mm');
        }
        if (vm.wallOptions.untilDate) {
            term = term + ' until:' + moment(vm.wallOptions.untilDate).format('YYYY-MM-DD_HH:mm');
        }

        searchParams.q = term;
        searchParams.count = maxStatusCount;
    }

    calculateTerm();


    vm.histogramOptions = {
        //scaleBeginAtZero: true
        responsive: true<commit_msg>Solves #305<commit_after>'use strict';
/* global angular */

var controllersModule = require('./_index');
var PhotoSwipe = require('photoswipe');
var PhotoSwipeUI_Default = require('../components/photoswipe-ui-default');
var moment = require('moment');
/**
 * @ngInject
 */
function WallDisplay($scope, $stateParams, $interval, $timeout, $location, $http, $window, AppSettings, SearchService, StatisticsService, Fullscreen) {

    var vm, flag, allStatuses, nextStatuses, term, count, searchParams;
    vm = this;
    //var ongoingRequest = false;
    null;
    vm.wallOptions = JSON.parse(decodeURI($location.search().data));
    //$scope.newWallOptions = vm.wallOptions;
    var init = function() {
        flag = false;
        vm.showEmpty = false;
        allStatuses = [];
        nextStatuses = [];
        vm.statuses = [];
        searchParams = {};
        vm.displaySearch = true;

    }
    var maxStatusCount = 0;
    if (vm.wallOptions.layoutStyle == '1')
        maxStatusCount = 10; //linear
    else if (vm.wallOptions.layoutStyle == '2')
        maxStatusCount = 9; //masonry
    else if (vm.wallOptions.layoutStyle == '3')
        maxStatusCount = 1; //single
    else if (vm.wallOptions.layoutStyle == '4')
        maxStatusCount = 10; //map
    console.log(vm.wallOptions.layoutStyle);
    count = 0;
    init();
    //calculate term
    function calculateTerm(argument) {
        term = "";
        if(vm.wallOptions.mainHashtag)
            term = vm.wallOptions.mainHashtag;
        if (vm.wallOptions.layoutStyle == '4'){
            if(term=="")
                term = "/location";
            else
                term = term + " /location";
        }
        for (var i = 0; i < vm.wallOptions.allWords.length; i++) {
            term = term + ' ' + vm.wallOptions.allWords[i].text;
        };
        for (var i = 0; i < vm.wallOptions.anyWords.length; i++) {
            term = term + ' OR ' + vm.wallOptions.anyWords[i].text;
        };
        for (var i = 0; i < vm.wallOptions.noWords.length; i++) {
            term = term + ' -' + vm.wallOptions.noWords[i].text;
        };
        for (var i = 0; i < vm.wallOptions.allHashtags.length; i++) {
            term = term + ' OR #' + vm.wallOptions.allHashtags[i].text;
        };
        for (var i = 0; i < vm.wallOptions.from.length; i++) {
            term = term + ' OR from:' + vm.wallOptions.from[i].text;
        };
        for (var i = 0; i < vm.wallOptions.to.length; i++) {
            term = term + ' OR @' + vm.wallOptions.to[i].text;
        };
        for (var i = 0; i < vm.wallOptions.mentioning.length; i++) {
            term = term + ' OR @' + vm.wallOptions.mentioning[i].text;
        };
        if (vm.wallOptions.images) {
            if (vm.wallOptions.images == "only") {
                term = term + ' /image';
            } else if (vm.wallOptions.images == "none") {
                term = term + ' -/image';
            }
        }
        if (vm.wallOptions.videos) {
            if (vm.wallOptions.videos == "only") {
                term = term + ' /video';
            } else if (vm.wallOptions.videos == "none") {
                term = term + ' -/video';
            }
        }
        if (vm.wallOptions.audio) {
            if (vm.wallOptions.audio == "only") {
                term = term + ' /audio';
            } else if (vm.wallOptions.audio == "none") {
                term = term + ' -/audio';
            }
        }
        if (vm.wallOptions.sinceDate) {
            term = term + ' since:' + moment(vm.wallOptions.sinceDate).format('YYYY-MM-DD_HH:mm');
        }
        if (vm.wallOptions.untilDate) {
            term = term + ' until:' + moment(vm.wallOptions.untilDate).format('YYYY-MM-DD_HH:mm');
        }
        console.log(term);
        searchParams.q = term;
        searchParams.count = maxStatusCount;
    }

    calculateTerm();


    vm.histogramOptions = {
        //scaleBeginAtZero: true
        responsive: true
{'fraction_non_alphanumeric': 0.15325136265686398, 'fraction_numerical': 0.005450627455951325, 'mean_word_length': 1.8463203463203464, 'pattern_counts': {'":': 0, '<': 17, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4990316', 'n_tokens_mistral': 2496, 'n_tokens_neox': 2414, 'n_words': 506}