<commit_before>'use strict';

(function (angular) {
    angular
        .module('wooCommercePluginWidget')
        .controller('WidgetHomeCtrl', ['$scope', 'DataStore', 'WooCommerceSDK', 'TAG_NAMES', '$sce', 'LAYOUTS', '$rootScope', 'PAGINATION', 'Buildfire', 'ViewStack',
            function ($scope, DataStore, WooCommerceSDK, TAG_NAMES, $sce, LAYOUTS, $rootScope, PAGINATION, Buildfire, ViewStack) {
                var WidgetHome = this;
                WidgetHome.data = null;
                WidgetHome.sections = [];
                WidgetHome.busy = true;
                WidgetHome.pageNumber = 1;
                //create new instance of buildfire carousel viewer
                WidgetHome.view = null;
                WidgetHome.safeHtml = function (html) {
                    if (html) {
                        var $html = $('<div />', {html: html});
                        $html.find('iframe').each(function (index, element) {
                            var src = element.src;
                            console.log('element is: ', src, src.indexOf('http'));
                            src = src && src.indexOf('file://') != -1 ? src.replace('file://', 'http://') : src;
                            element.src = src && src.indexOf('http') != -1 ? src : 'http:' + src;
                        });
                        return $sce.trustAsHtml($html.html());
                    }
                };

                WidgetHome.showDescription = function (description) {
                    return !((description == '<p>&nbsp;<br></p>') || (description == '<p><br data-mce-bogus="1"></p>'));
                };
                $rootScope.deviceHeight = window.innerHeight;
                $rootScope.deviceWidth = window.innerWidth;
                $rootScope.backgroundImage = "";
                WidgetHome.loadMore = function () {
                    console.log('>>>>>>>>>>>>>> inside load more widget home controller');
                    if (WidgetHome.busy) return;
                    WidgetHome.busy = true;
                    if (WidgetHome.data.content.storeURL && WidgetHome.data.content.consumerKey && WidgetHome.data.content.consumerSecret)
                        getSections(WidgetHome.data.content.storeURL, WidgetHome.data.content.consumerKey, WidgetHome.data.content.consumerSecret);
                    else
                        WidgetHome.sections = [];
                };

                WidgetHome.showItems = function (slug) {
                    if (WidgetHome.data.design.itemListLayout)
                        ViewStack.push({
                            template: WidgetHome.data.design.itemListLayout,
                            params: {
                                slug: slug,
                                controller: "WidgetItemsCtrl as WidgetItems",
                                shouldUpdateTemplate : true
                            }
                        });
                };

                WidgetHome.goToCart = function () {<commit_msg>Removed the Empty Space showing for WYSIWYG<commit_after>'use strict';

(function (angular) {
    angular
        .module('wooCommercePluginWidget')
        .controller('WidgetHomeCtrl', ['$scope', 'DataStore', 'WooCommerceSDK', 'TAG_NAMES', '$sce', 'LAYOUTS', '$rootScope', 'PAGINATION', 'Buildfire', 'ViewStack',
            function ($scope, DataStore, WooCommerceSDK, TAG_NAMES, $sce, LAYOUTS, $rootScope, PAGINATION, Buildfire, ViewStack) {
                var WidgetHome = this;
                WidgetHome.data = null;
                WidgetHome.sections = [];
                WidgetHome.busy = true;
                WidgetHome.pageNumber = 1;
                //create new instance of buildfire carousel viewer
                WidgetHome.view = null;
                WidgetHome.safeHtml = function (html) {
                    if (html) {
                        var $html = $('<div />', {html: html});
                        $html.find('iframe').each(function (index, element) {
                            var src = element.src;
                            console.log('element is: ', src, src.indexOf('http'));
                            src = src && src.indexOf('file://') != -1 ? src.replace('file://', 'http://') : src;
                            element.src = src && src.indexOf('http') != -1 ? src : 'http:' + src;
                        });
                        return $sce.trustAsHtml($html.html());
                    }
                };

                WidgetHome.showDescription = function (description) {
                    return !((description == '<p>&nbsp;<br></p>') || (description == '<p><br data-mce-bogus="1"></p>') || (description == ''));
                };
                $rootScope.deviceHeight = window.innerHeight;
                $rootScope.deviceWidth = window.innerWidth;
                $rootScope.backgroundImage = "";
                WidgetHome.loadMore = function () {
                    console.log('>>>>>>>>>>>>>> inside load more widget home controller');
                    if (WidgetHome.busy) return;
                    WidgetHome.busy = true;
                    if (WidgetHome.data.content.storeURL && WidgetHome.data.content.consumerKey && WidgetHome.data.content.consumerSecret)
                        getSections(WidgetHome.data.content.storeURL, WidgetHome.data.content.consumerKey, WidgetHome.data.content.consumerSecret);
                    else
                        WidgetHome.sections = [];
                };

                WidgetHome.showItems = function (slug) {
                    if (WidgetHome.data.design.itemListLayout)
                        ViewStack.push({
                            template: WidgetHome.data.design.itemListLayout,
                            params: {
                                slug: slug,
                                controller: "WidgetItemsCtrl as WidgetItems",
                                shouldUpdateTemplate : true
                            }
                        });
                };

                WidgetHome.goToCart = function () {
{'fraction_non_alphanumeric': 0.1243642329778507, 'fraction_numerical': 0.0013125512715340443, 'mean_word_length': 1.3821805392731537, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2549188', 'n_tokens_mistral': 1542, 'n_tokens_neox': 1440, 'n_words': 285}