Viewing File: /usr/local/cpanel/base/frontend/jupiter/site-monitor/directives/whatsShowingDirective.js

/*
# site-monitor/directives/whatsShowingDirective.js                   Copyright(c) 2021 cPanel, L.L.C.
#                                                                                All rights reserved.
# copyright@cpanel.net                                                           http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
*/

/* global define: false */

/** @namespace cpanel.siteMonitor.directive.whatsShowing */

define(
    [
        "angular",
        "cjt/util/locale",
        "cjt/core"
    ],
    function(angular, LOCALE, CJT) {

        "use strict";

        var module = angular.module("cpanel.siteMonitor.whatsShowingDirective", []);

        module.directive("whatsShowing", function factory() {

            /**
             * Directive to render the "Showing 1 - 4 of 10"
             *
             * @module whats-showing
             *
             * @param  {Number} start first number in range ([1]-4)
             * @param  {Number} limit second number in range (1-[4])
             * @param  {Number} total total number of items (10)
             *
             * @example
             * <whats-showing start="1" limit="4" total="10"></whats-showing>
             *
             */

            var TEMPLATE_PATH = "directives/whatsShowingDirective.phtml";
            var RELATIVE_PATH = "site-monitor/" + TEMPLATE_PATH;

            return {
                templateUrl: CJT.config.debug ? CJT.buildFullPath(RELATIVE_PATH) : TEMPLATE_PATH,
                restrict: "EA",
                scope: {
                    start: "=",
                    limit: "=",
                    total: "="
                },
                transclude: true,
                controller: ["$scope", function($scope) {
                    $scope.LOCALE = LOCALE;
                }]
            };

        });
    }
);
Back to Directory File Manager