PHP Classes
elePHPant
Icontem

File: src/Cabin/Bridge/public/csp.js

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  CMS Airship  >  src/Cabin/Bridge/public/csp.js  >  Download  
File: src/Cabin/Bridge/public/csp.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CMS Airship
Content management system with security features
Author: By
Last change:
Date: 2 years ago
Size: 1,213 bytes
 

Contents

Class file image Download
$(document).ready(function() {
    $(".csp_add_btn").click(function () {
        var key = $(this).data('key');
        if (key === 'plugin-types') {
            var placeholder = 'application/javascript';
        } else {
            var placeholder = 'example.com';
        }
        $("#csp_" + key + "_whitelist").append(
            "<li><input \n" +
            "        class=\"full-width\"\n" +
            "        title=\"Whitelist\"\n" +
            "        type=\"text\"\n" +
            "        placeholder=\"" + placeholder + "\"\n" +
            "        name=\"content_security_policy[" + key + "][allow][]\"\n" +
            "    /></li>"
        );
    });

    $('.csp_disable_all').each(function () {
        var key = $(this).data('key');
        if ($(this).is(':checked')) {
            $("#csp_" + key + "_inner").hide('fast');
        } else {
            $("#csp_" + key + "_inner").show('fast');
        }
    });

    $('.csp_disable_all').click(function () {
        var key = $(this).data('key');
        if ($(this).is(':checked')) {
            $("#csp_" + key + "_inner").hide('fast');
        } else {
            $("#csp_" + key + "_inner").show('fast');
        }
    });
});