HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/zaklada/html/node_modules/browser-sync-ui/lib/plugins/sync-options/sync-options.client.js
(function (angular) {

    const SECTION_NAME = "sync-options";

    angular
        .module("BrowserSync")
        .controller("SyncOptionsController", [
            "Socket",
            "options",
            "pagesConfig",
            SyncOptionsController
        ]);

    /**
     * @param Socket
     * @param options
     * @param pagesConfig
     * @constructor
     */
    function SyncOptionsController(Socket, options, pagesConfig) {

        var ctrl = this;
        ctrl.options = options.bs;
        ctrl.section = pagesConfig[SECTION_NAME];

        ctrl.setMany = function (value) {
            Socket.uiEvent({
                namespace: SECTION_NAME,
                event: "setMany",
                data: {
                    value: value
                }
            });
            ctrl.syncItems = ctrl.syncItems.map(function (item) {
                item.value = value;
                return item;
            });
        };

        /**
         * Toggle Options
         * @param item
         */
        ctrl.toggleSyncItem = function (item) {
            Socket.uiEvent({
                namespace: SECTION_NAME,
                event: "set",
                data: {
                    path:  item.path,
                    value: item.value
                }
            });
        };

        ctrl.syncItems = [];

        var taglines = {
            clicks:  "Mirror clicks across devices",
            scroll:  "Mirror scroll position across devices",
            "ghostMode.submit":  "Form Submissions will be synced",
            "ghostMode.inputs":  "Text inputs (including text-areas) will be synced",
            "ghostMode.toggles": "Radio + Checkboxes changes will be synced",
            codeSync:            "Reload or Inject files they change"
        };

        // If watching files, add the code-sync toggle
        ctrl.syncItems.push(addItem("codeSync", ["codeSync"], ctrl.options.codeSync, taglines["codeSync"]));

        Object.keys(ctrl.options.ghostMode).forEach(function (item) {
            if (item !== "forms" && item !== "location") {
                ctrl.syncItems.push(addItem(item, ["ghostMode", item], ctrl.options.ghostMode[item], taglines[item]));
            }
        });

        Object.keys(ctrl.options.ghostMode.forms).forEach(function (item) {
            ctrl.syncItems.push(addItem("Forms: " + item, ["ghostMode", "forms", item], ctrl.options.ghostMode["forms"][item], taglines["ghostMode." + item]));
        });

        function addItem (item, path, value, tagline) {
            return {
                value: value,
                name: item,
                path: path,
                title: ucfirst(item),
                tagline: tagline
            };
        }
    }

    function ucfirst (string) {
        return string.charAt(0).toUpperCase() + string.slice(1);
    }

})(angular);