<commit_before>﻿<!DOCTYPE html>
<html ng-app="folderPlugin">
<head lang="en">
    <title>widget</title>
    <meta charset="UTF-8">

    <!-- CSS -->
    <link href="../../../scripts/owlCarousel/owlCarousel.css" rel="stylesheet"/>
    <link rel="stylesheet" href="../../../styles/helper.css">
    <link rel="stylesheet" href="../../../styles/siteIcons.css">
    <link rel="stylesheet" href="assets/css/style.css">

    <!-- JS -->
    <script src="../../../scripts/angular/angular.min.js"></script>
    <script src="../../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="../../../scripts/buildfire.js"></script>
    <script type="text/javascript" src="../../../scripts/owlCarousel/owlCarousel.js"></script>
    <script src="../../../scripts/buildfire/components/carousel/carousel.js"></script>
    <script src="../../../scripts/buildfire/components/pluginInstance/sortableList.js"></script>
  <script src="assets/js/angular-lazy-img.js"></script>

</head>
<body ng-cloak class="gridLayout" ng-controller="folderPluginCtrl">
<style>
  /* body.gridLayout {
          background-color: {{}} !important;
          background-image: url({{backgroundImage}}) !important;
          background-size:cover !important;
    }*/
    div.text-holder p {
        color: {{data.design.colorType === 'C' && data.design.colors.bodyText}} !important;
    }

    .icon, .glyphicon, .icon:hover {
        color: {{data.design.colorType === 'C' && data.design.colors.icons}} !important;
    }
</style>
<div class="overlay background" ng-if="data.design.selectedLayout !== 7 && backgroundImage">
    <img lazy-img="{{backgroundImage}}" style="position: absolute;">
</div>
<div class="holder padding-zero">
    <div class="launcher-plugin layout7" ng-if="data.design.selectedLayout == 7">
        <div class="menu-links">
            <a class="menu-item clearfix" ng-repeat="plugin in data.plugins" ng-click="navigateToPlugin(plugin)">
                <img ng-src="{{ cropImage(plugin.iconUrl, {width: 100, height: 100}) }}" ng-if="plugin.iconUrl" class="pull-left">
                <span class="main-icon pull-left {{ plugin.iconClassName }}" ng-if="plugin.iconClassName"></span>
                <span class="main-icon pull-left icon icon-puzzle" ng-if="!plugin.iconUrl && !plugin.iconClassName"></span>
                <p class="ellipsis pull-left">{{ plugin.title }}</p>
                <span class="icon right-arrow pull-right icon-chevron-right"></span>
            </a>
        </div>
    </div>
    <div class="launcher-plugin layout{{ layoutClass[data.design.selectedLayout - 1] }}" ng-if="data.design.selectedLayout != 7">
        <div class="main-logo" ng-if="data.design.logoImage && ([5, 6, 7].indexOf(data.design.selectedLayout) == -1)">
            <div class="logo-holder">
                <table width="100%" cellspacing="0" cellpadding="0" height="100%">
                    <tbody>
                    <tr>
                        <td align="center" valign="center">
                            <div class="logo-media">
                                <img ng-src="{{ resizeImage(data.design.logoImage, {width: 400}) }}">
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

        <div ng-class="{ 'hidden': data.content.carouselImages.length == 0 }" class="plugin-banner clearfix">
            <div id="carousel" class="no-background"></div>
        </div>

        <div id="launcherSlider" class="launcher-slider text-center"></div>
    </div>
</div>
<script>

    /* Shared functionality */
    var folderPluginShared = folderPluginShared || {};

    folderPluginShared.getPluginDetails = function (pluginsInfo, pluginIds) {
        var returnPlugins = [];
        var tempPlugin = null;
        for (var id = 0; id < pluginIds.length; id++) {

            tempPlugin = {};

            for (var i = 0; i < pluginsInfo.length; i++) {
                if (pluginsInfo[i].data) {
                    if (pluginIds[id] == pluginsInfo[i].data.instanceId) {

                        tempPlugin.instanceId = pluginsInfo[i].data.instanceId;
                        tempPlugin.iconUrl = pluginsInfo[i].data.iconUrl;
                        tempPlugin.title = pluginsInfo[i].data.title;
                        tempPlugin.pluginTypeId = pluginsInfo[i].data.pluginType.token;
                        tempPlugin.folderName = pluginsInfo[i].data.pluginType.folderName;
                        tempPlugin.iconClassName = pluginsInfo[i].data.iconClassName;
                        returnPlugins.push(tempPlugin);
                    }
                } else if (pluginIds[id] == pluginsInfo[i].instanceId) {
                    tempPlugin = pluginsInfo[i];
                    if (!tempPlugin.title) {
                        tempPlugin.title = "No title";
                    }
                    returnPlugins.push(tempPlugin);
                }
            }

            tempPlugin = null;

        }
        return returnPlugins;
    };

    folderPluginShared.getDefaultScopeData = function () {
        return {
            _buildfire: {
                plugins: {
                    dataType: "pluginInstance",
                    data: []
                }
            },
            content: {
                carouselImages: []
            },
            design: {
                backgroundImage: null,
                selectedLayout: 1,
                backgroundblur: 0,
                colors: {
                    "backgroundColor": "",
                    "bodyText": "",
                    "icons": ""
                }
            }
        };
    };

    folderPluginShared.save = function (newObj) {
        buildfire.datastore.save(newObj, function (err, result) {
            if (err || !result) {
                console.error('Error saving the widget details: ', err);
            }
            else {
                console.info('Widget details saved');
            }
        });
    };

    folderPluginShared.digest = function ($scope) {
        if (!$scope.$$phase && !$scope.$root.$$phase) {
            $scope.$apply();
        }
    };
    /* End shared functionality */

    folderPluginShared.getLayoutsPageSize = function () {
        return [3, 4, 6, 8, 9, 12];
    };

    folderPluginShared.getLayoutsClass = function () {
        return [4, 2, 3, 1, 5, 6, 7];
    };

    var folderPluginApp = angular.module('folderPlugin', ['angularLazyImg']);

   /* folderPluginApp.directive("loadImage", [function () {
        return {
            restrict: 'A',
            link: function (scope, element, attrs) {

                var elem = $("<img>");
                elem[0].onload = function () {
                    element.attr("src", attrs.finalSrc);
                    elem.remove();
                };
                elem.attr("src", attrs.finalSrc);
            }
        };
    }])*/

    folderPluginApp.config(['lazyImgConfigProvider', function(lazyImgConfigProvider){
       // var scrollable = document.querySelector('#scrollable');
        lazyImgConfigProvider.setOptions({
            offset: 100 // how early you want to load image (default = 100)
        });
    }])

    folderPluginApp.controller('folderPluginCtrl', ['$scope', '$sce', function ($scope, $sce) {
        var view = null;
        var pagesCount = 0;
        var loadingData = true;
        var deviceHeight = undefined;
        var deviceWidth = undefined;
        var matchedBackgroundName = undefined;

        $scope.data = folderPluginShared.getDefaultScopeData();
        $scope.pageSize = folderPluginShared.getLayoutsPageSize();
        $scope.layoutClass = folderPluginShared.getLayoutsClass();

        function initDeviceSize(callback) {<commit_msg>lazy loading time 0 set<commit_after>﻿<!DOCTYPE html>
<html ng-app="folderPlugin">
<head lang="en">
    <title>widget</title>
    <meta charset="UTF-8">

    <!-- CSS -->
    <link href="../../../scripts/owlCarousel/owlCarousel.css" rel="stylesheet"/>
    <link rel="stylesheet" href="../../../styles/helper.css">
    <link rel="stylesheet" href="../../../styles/siteIcons.css">
    <link rel="stylesheet" href="assets/css/style.css">

    <!-- JS -->
    <script src="../../../scripts/angular/angular.min.js"></script>
    <script src="../../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="../../../scripts/buildfire.js"></script>
    <script type="text/javascript" src="../../../scripts/owlCarousel/owlCarousel.js"></script>
    <script src="../../../scripts/buildfire/components/carousel/carousel.js"></script>
    <script src="../../../scripts/buildfire/components/pluginInstance/sortableList.js"></script>
  <script src="assets/js/angular-lazy-img.js"></script>

</head>
<body ng-cloak class="gridLayout" ng-controller="folderPluginCtrl">
<style>
  /* body.gridLayout {
          background-color: {{}} !important;
          background-image: url({{backgroundImage}}) !important;
          background-size:cover !important;
    }*/
    div.text-holder p {
        color: {{data.design.colorType === 'C' && data.design.colors.bodyText}} !important;
    }

    .icon, .glyphicon, .icon:hover {
        color: {{data.design.colorType === 'C' && data.design.colors.icons}} !important;
    }
</style>
<div class="overlay background" ng-if="data.design.selectedLayout !== 7 && backgroundImage">
    <img lazy-img="{{backgroundImage}}" style="position: absolute;">
</div>
<div class="holder padding-zero">
    <div class="launcher-plugin layout7" ng-if="data.design.selectedLayout == 7">
        <div class="menu-links">
            <a class="menu-item clearfix" ng-repeat="plugin in data.plugins" ng-click="navigateToPlugin(plugin)">
                <img ng-src="{{ cropImage(plugin.iconUrl, {width: 100, height: 100}) }}" ng-if="plugin.iconUrl" class="pull-left">
                <span class="main-icon pull-left {{ plugin.iconClassName }}" ng-if="plugin.iconClassName"></span>
                <span class="main-icon pull-left icon icon-puzzle" ng-if="!plugin.iconUrl && !plugin.iconClassName"></span>
                <p class="ellipsis pull-left">{{ plugin.title }}</p>
                <span class="icon right-arrow pull-right icon-chevron-right"></span>
            </a>
        </div>
    </div>
    <div class="launcher-plugin layout{{ layoutClass[data.design.selectedLayout - 1] }}" ng-if="data.design.selectedLayout != 7">
        <div class="main-logo" ng-if="data.design.logoImage && ([5, 6, 7].indexOf(data.design.selectedLayout) == -1)">
            <div class="logo-holder">
                <table width="100%" cellspacing="0" cellpadding="0" height="100%">
                    <tbody>
                    <tr>
                        <td align="center" valign="center">
                            <div class="logo-media">
                                <img ng-src="{{ resizeImage(data.design.logoImage, {width: 400}) }}">
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

        <div ng-class="{ 'hidden': data.content.carouselImages.length == 0 }" class="plugin-banner clearfix">
            <div id="carousel" class="no-background"></div>
        </div>

        <div id="launcherSlider" class="launcher-slider text-center"></div>
    </div>
</div>
<script>

    /* Shared functionality */
    var folderPluginShared = folderPluginShared || {};

    folderPluginShared.getPluginDetails = function (pluginsInfo, pluginIds) {
        var returnPlugins = [];
        var tempPlugin = null;
        for (var id = 0; id < pluginIds.length; id++) {

            tempPlugin = {};

            for (var i = 0; i < pluginsInfo.length; i++) {
                if (pluginsInfo[i].data) {
                    if (pluginIds[id] == pluginsInfo[i].data.instanceId) {

                        tempPlugin.instanceId = pluginsInfo[i].data.instanceId;
                        tempPlugin.iconUrl = pluginsInfo[i].data.iconUrl;
                        tempPlugin.title = pluginsInfo[i].data.title;
                        tempPlugin.pluginTypeId = pluginsInfo[i].data.pluginType.token;
                        tempPlugin.folderName = pluginsInfo[i].data.pluginType.folderName;
                        tempPlugin.iconClassName = pluginsInfo[i].data.iconClassName;
                        returnPlugins.push(tempPlugin);
                    }
                } else if (pluginIds[id] == pluginsInfo[i].instanceId) {
                    tempPlugin = pluginsInfo[i];
                    if (!tempPlugin.title) {
                        tempPlugin.title = "No title";
                    }
                    returnPlugins.push(tempPlugin);
                }
            }

            tempPlugin = null;

        }
        return returnPlugins;
    };

    folderPluginShared.getDefaultScopeData = function () {
        return {
            _buildfire: {
                plugins: {
                    dataType: "pluginInstance",
                    data: []
                }
            },
            content: {
                carouselImages: []
            },
            design: {
                backgroundImage: null,
                selectedLayout: 1,
                backgroundblur: 0,
                colors: {
                    "backgroundColor": "",
                    "bodyText": "",
                    "icons": ""
                }
            }
        };
    };

    folderPluginShared.save = function (newObj) {
        buildfire.datastore.save(newObj, function (err, result) {
            if (err || !result) {
                console.error('Error saving the widget details: ', err);
            }
            else {
                console.info('Widget details saved');
            }
        });
    };

    folderPluginShared.digest = function ($scope) {
        if (!$scope.$$phase && !$scope.$root.$$phase) {
            $scope.$apply();
        }
    };
    /* End shared functionality */

    folderPluginShared.getLayoutsPageSize = function () {
        return [3, 4, 6, 8, 9, 12];
    };

    folderPluginShared.getLayoutsClass = function () {
        return [4, 2, 3, 1, 5, 6, 7];
    };

    var folderPluginApp = angular.module('folderPlugin', ['angularLazyImg']);

   /* folderPluginApp.directive("loadImage", [function () {
        return {
            restrict: 'A',
            link: function (scope, element, attrs) {

                var elem = $("<img>");
                elem[0].onload = function () {
                    element.attr("src", attrs.finalSrc);
                    elem.remove();
                };
                elem.attr("src", attrs.finalSrc);
            }
        };
    }])*/

    folderPluginApp.config(['lazyImgConfigProvider', function(lazyImgConfigProvider){
       // var scrollable = document.querySelector('#scrollable');
        lazyImgConfigProvider.setOptions({
            offset: 0 // how early you want to load image (default = 100)
        });
    }])

    folderPluginApp.controller('folderPluginCtrl', ['$scope', '$sce', function ($scope, $sce) {
        var view = null;
        var pagesCount = 0;
        var loadingData = true;
        var deviceHeight = undefined;
        var deviceWidth = undefined;
        var matchedBackgroundName = undefined;

        $scope.data = folderPluginShared.getDefaultScopeData();
        $scope.pageSize = folderPluginShared.getLayoutsPageSize();
        $scope.layoutClass = folderPluginShared.getLayoutsClass();

        function initDeviceSize(callback) {
{'fraction_non_alphanumeric': 0.1548864506251595, 'fraction_numerical': 0.0073360551161010465, 'mean_word_length': 1.8571168215782758, 'pattern_counts': {'":': 6, '<': 157, '<?xml version=': 0, '>': 153, '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': '1257630', 'n_tokens_mistral': 4445, 'n_tokens_neox': 4147, 'n_words': 794}