diff --git a/admin/class-no-unsafe-inline-admin.php b/admin/class-no-unsafe-inline-admin.php index 30ab9f0..ab47dfe 100755 --- a/admin/class-no-unsafe-inline-admin.php +++ b/admin/class-no-unsafe-inline-admin.php @@ -154,7 +154,7 @@ public function enqueue_scripts(): void { wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . "js/no-unsafe-inline-admin$suffix.js", - array( 'jquery', 'jquery-ui-accordion', 'jquery-ui-tabs', 'jquery-ui-spinner', 'wp-i18n' ), + array( 'jquery', 'jquery-ui-dialog', 'jquery-ui-accordion', 'jquery-ui-tabs', 'jquery-ui-spinner', 'jquery-ui-tooltip', 'wp-i18n' ), $this->version, false ); @@ -1810,13 +1810,14 @@ public function print_endpoints(): void { // Add a line for each url. foreach ( $endpoints as $index => $endpoint ) { printf( - '
  • - - %s - -
  • ', + '
  • ' . + '' . + '%s' . + '' . + '
  • ', esc_html( $index ), esc_html( $index ), esc_html( $endpoint ), @@ -1908,7 +1909,7 @@ public function print_capture_enabled(): void { $enabled = $value ? 'checked' : ''; printf( - ' ', esc_html( $enabled ), @@ -1929,7 +1930,7 @@ public function print_test_policy(): void { $enabled = $value ? 'checked' : ''; printf( - ' ', esc_html( $enabled ), @@ -1950,7 +1951,7 @@ public function print_enable_protection(): void { $enabled = $value ? 'checked' : ''; printf( - ' ', esc_html( $enabled ), diff --git a/admin/css/no-unsafe-inline-admin.css b/admin/css/no-unsafe-inline-admin.css index dbb1b8e..b60cdef 100755 --- a/admin/css/no-unsafe-inline-admin.css +++ b/admin/css/no-unsafe-inline-admin.css @@ -327,7 +327,7 @@ div.nunil_temp_div { } .rwd-table tr { - border-top: 1px solid #ddd; + border-top: 0px; } .rwd-table th { @@ -386,16 +386,7 @@ div.nunil_temp_div { .rwd-table { background: #01263a; -/* - background: #34495E; -*/ -/* - background: #7796e6; -*/ color: #fff; -/* - color: #122313; -*/ border-radius: .4em; overflow: hidden; } @@ -421,9 +412,6 @@ div.nunil_temp_div { .rwd-table th, .rwd-table td:before { color: #dd5; -/* - color: #e68b77; -*/ } .nunil-tools-wrapper { @@ -460,9 +448,6 @@ div.nunil_temp_div { .nunil-tools-button-wrapper { margin: 5px; -/* - border: 1px solid #3582ca; -*/ border: 0px; text-align: center; @@ -499,18 +484,23 @@ div.nunil_temp_div { padding: 1em !important; border-color: #46637f; border-bottom: 1px dotted; - border-top: 1px solid #ddd; + border-top: 1px dotted; font-size: 1.1em; font-weight: bold; } .nunil_tools_operation_report_container { - height: 340px; + height: 380px; padding: 0px 1em 1em 1em; background: #01263a; + position: relative; + border-radius: .4em; + display: flex; + flex-direction: column; } .nunil_tools_operation_report { - height: 280px; + height: 290px; + max-height: fit-content; overflow: auto; background: #01263a; color: #fff; @@ -521,7 +511,7 @@ div.nunil_temp_div { border: none; border-radius: 4px; color: white; - padding: 4px 9px; + padding: 2px 2px; text-align: center; text-decoration: none; display: inline-block; @@ -595,3 +585,40 @@ div.nunil_temp_div { .nunil-new-endpoint:focus { background-color: LightCyan; } +.nunil-db-sum-tabs-5 { + position: relative; +} +.nunil_tools_operation_report_buttons { + position: absolute; + bottom: 0.5em; + right:1.4em; + display: flex; + flex-direction: row; +} +.nunil_tools_operation_report_button_clipboard { + background-color: white; + color: #99ccff; + border: 2px solid #99ccff; +} +.nunil_tools_operation_report_button_clipboard:hover:enabled { + background-color: #99ccff; + color: white; +} +.nunil_tools_operation_report_button_clear { + background-color: white; + color: #f44336; + border: 2px solid #f44336; +} +.nunil_tools_operation_report_button_clear:hover:enabled { + background-color: #f44336; + color: white; +} +.copy-notification{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); +} +.no-titlebar .ui-dialog-titlebar { + display: none; +} \ No newline at end of file diff --git a/admin/css/no-unsafe-inline-admin.min.css b/admin/css/no-unsafe-inline-admin.min.css index 96151f8..30c334d 100644 --- a/admin/css/no-unsafe-inline-admin.min.css +++ b/admin/css/no-unsafe-inline-admin.min.css @@ -1 +1 @@ -.hljs{display:block;overflow-x:auto;padding:.5em;background:#282b2e}.hljs-keyword,.hljs-literal,.hljs-selector-id,.hljs-selector-tag{color:#93c763}.hljs-number{color:#ffcd22}.hljs{color:#e0e2e4}.hljs-attribute{color:#668bb0}.hljs-class .hljs-title,.hljs-code,.hljs-section{color:#fff}.hljs-link,.hljs-regexp{color:#d39745}.hljs-meta{color:#557182}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-name,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-subst,.hljs-tag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable{color:#8cbbad}.hljs-string,.hljs-symbol{color:#ec7600}.hljs-comment,.hljs-deletion,.hljs-quote{color:#818e96}.hljs-selector-class{color:#a082bd}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title,.hljs-type{font-weight:700}.nunil-spinner-blocks.hidden{display:none}.nunil-spinner-blocks{position:fixed;top:0;left:0;width:100%;height:100vh;background:rgba(0,0,0,.8);z-index:999;opacity:1;transition:all .5s;display:flex;align-items:center;justify-content:center}@keyframes nunil-spinner-tools{0%{background:#a0de59}12.5%{background:#a0de59}12.625%{background:#5f2a62}100%{background:#5f2a62}}.nunil-spinner-box-1{left:38px;top:38px;animation-delay:0s}.nunil-spinner-box-2{left:80px;top:38px;animation-delay:125ms}.nunil-spinner-box-3{left:122px;top:38px;animation-delay:.25s}.nunil-spinner-box-4{left:38px;top:80px;animation-delay:875ms!important}.nunil-spinner-box-5{left:122px;top:80px;animation-delay:375ms}.nunil-spinner-box-6{left:38px;top:122px;animation-delay:.75s}.nunil-spinner-box-7{left:80px;top:122px;animation-delay:625ms}.nunil-spinner-box-8{left:122px;top:122px;animation-delay:.5s}.nunil-spinner-tools div{position:absolute;width:40px;height:40px;background:#5f2a62;animation-name:nunil-spinner-tools;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite}.nunil-spinner-tools{width:120px;height:120px;position:relative;transform:translateZ(0) scale(1);backface-visibility:hidden;transform-origin:0 0}.nunil-spinner-tools div{box-sizing:content-box}input[type=checkbox].nunil-ui-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;width:auto;height:auto;vertical-align:middle;position:relative;border:0;outline:0;cursor:pointer;margin:0 4px;background:0 0;box-shadow:none}input[type=checkbox].nunil-ui-toggle:focus{box-shadow:none}input[type=checkbox].nunil-ui-toggle:after{content:'';font-size:8px;font-weight:400;line-height:18px;text-indent:-14px;color:#fff;width:36px;height:18px;display:inline-block;background-color:#a7aaad;border-radius:72px;box-shadow:0 0 12px rgb(0 0 0 / 15%) inset}input[type=checkbox].nunil-ui-toggle:before{content:'';width:14px;height:14px;display:block;position:absolute;top:2px;left:2px;margin:0;border-radius:50%;background-color:#fff}input[type=checkbox].nunil-ui-toggle:checked:before{left:20px;margin:0;background-color:#fff}input[type=checkbox].nunil-ui-toggle,input[type=checkbox].nunil-ui-toggle:after,input[type=checkbox].nunil-ui-toggle:before,input[type=checkbox].nunil-ui-toggle:checked:after,input[type=checkbox].nunil-ui-toggle:checked:before{transition:ease .15s}input[type=checkbox].nunil-ui-toggle:checked:after{content:'ON';background-color:#2271b1}.nunil-l-radio{margin:8px 0;display:block;cursor:pointer}.nunil-l-radio input{display:none}.nunil-l-radio input+span{line-height:16px;height:16px;padding-left:16px;display:block;position:relative}.nunil-l-radio input+span:not(:empty){padding-left:30px}.nunil-l-radio input+span:after,.nunil-l-radio input+span:before{content:"";width:16px;height:16px;display:block;border-radius:50%;left:0;top:0;position:absolute}.nunil-l-radio input+span:before{background:#d1d7e3;transition:background .2s ease,transform .4s cubic-bezier(.175, .885, .32, 2)}.nunil-l-radio input+span:after{background:#fff;transform:scale(.78);transition:transform .6s cubic-bezier(.175, .885, .32, 1.4)}.nunil-l-radio input:checked+span:before{transform:scale(1.04);background:#2271b1}.nunil-l-radio input:checked+span:after{transform:scale(.4);transition:transform .3s ease}.nunil-l-radio:hover input+span:before{transform:scale(.92)}.nunil-l-radio:hover input+span:after{transform:scale(.74)}.nunil-l-radio:hover input:checked+span:after{transform:scale(.4)}.nunil-radio-div{justify-content:start;display:flex;flex-direction:column;align-items:start;box-sizing:border-box}.nunil-radio-div-horiz{padding-left:10px;justify-content:flex-start;display:flex;flex-direction:row;align-items:baseline;box-sizing:border-box;gap:1.5em}.wp-list-table .column-nunil-ext-directive{width:10%}.wp-list-table .column-nunil-ext-sources{width:30%}.nunil-evh-scripts td.column-cb,.nunil-ext-scripts td.column-cb,.nunil-inl-scripts td.column-cb{width:4%}.nunil-evh-scripts th.column-script,.nunil-inl-scripts th.column-script{width:30%}.nunil-ext-scripts th.column-src_attrib{width:62%}.nunil-ext-scripts th.column-sha256,.nunil-ext-scripts th.column-sha384,.nunil-ext-scripts th.column-sha512{width:5%}td.column-script div.ui-accordion div.ui-accordion-content{padding:0!important}td.column-script div.ui-widget-content{background:unset}.nunil-script-code{margin:1px 0 1px 0}.nunil-evh-scripts th.column-tagid,.nunil-ext-scripts th.column-directive,.nunil-inl-scripts th.column-directive{width:7%}.nunil-evh-scripts th.column-tagname,.nunil-ext-scripts th.column-tagname,.nunil-inl-scripts th.column-tagname{width:7%}.nunil-evh-scripts th.column-event_attribute{width:7%}.nunil-evh-scripts th.column-clustername,.nunil-inl-scripts th.column-clustername{width:7%}.nunil-evh-scripts th.column-whitelist,.nunil-ext-scripts th.column-whitelist,.nunil-inl-scripts th.column-whitelist{width:5%}.nunil-evh-scripts td.column-whitelist p.whitelist,.nunil-ext-scripts td.column-whitelist p.whitelist,.nunil-inl-scripts td.column-whitelist p.whitelist{background-color:#cfffd7;text-align:center;font-weight:700}.nunil-evh-scripts td.column-whitelist p.blacklist,.nunil-ext-scripts td.column-whitelist p.blacklist,.nunil-inl-scripts td.column-whitelist p.blacklist{background-color:#e8b756;text-align:center}.nunil-evh-scripts th.column-pages,.nunil-inl-scripts th.column-pages{width:19%}td.column-pages div.ui-accordion div.ui-accordion-content{padding:0!important}.nunil-pages-code{margin:1px 0 1px 0}.nunil-evh-scripts th.column-lastseen,.nunil-inl-scripts th.column-lastseen{width:7%}.nunil-evh-scripts th.column-occurences,.nunil-inl-scripts th.column-occurences{width:7%}td.column-script div.ui-accordion div.ui-accordion-content{padding:0!important}.nunil-base-rule-container{float:left;margin-right:20px;width:100%}input.nunil-base-rule,label.nunil-base-rule{display:block}input.nunil-base-rule{width:100%}div.nunil_temp_div{border:1px solid;border-radius:5px;padding:10px;margin:10px 0;width:300px}.type1{border-color:#e76f51;background-color:rgba(231,111,81,.1)}.type2{border-color:#2a9d8f;background-color:rgba(42,157,143,.1)}.type3{border-color:#0096c7;background-color:rgba(0,150,199,.1)}.type4{border-color:#00b353;background-color:rgba(0,179,83,.1)}.rwd-table{margin:1em 0;min-width:300px;border-collapse:collapse}.rwd-table tr{border-top:1px solid #ddd}.rwd-table th{display:none}.rwd-table td{display:block}.rwd-table td:first-child{padding-top:.5em}.rwd-table td:last-child{padding-bottom:.5em}.rwd-table td:before{content:attr(data-th) ": ";font-weight:700;width:6.5em;display:inline-block}@media (min-width:480px){.rwd-table td:before{display:none}}.rwd-table td,.rwd-table th{text-align:left}@media (min-width:480px){.rwd-table td,.rwd-table th{display:table-cell;padding:.25em .5em}.rwd-table td:first-child,.rwd-table th:first-child{padding-left:0}.rwd-table td:last-child,.rwd-table th:last-child{padding-right:0}}.rwd-table{background:#01263a;color:#fff;border-radius:.4em;overflow:hidden}.rwd-table tr{border-color:#46637f;border-bottom:1px dotted}.rwd-table td,.rwd-table th{margin:.5em 1em}@media (min-width:480px){.rwd-table td,.rwd-table th{padding:1em!important}}.rwd-table td:before,.rwd-table th{color:#dd5}.nunil-tools-wrapper{display:grid;grid-template-columns:repeat(3,1fr);column-gap:15px;grid-template-rows:1fr;grid-auto-rows:1fr;text-align:center;justify-content:space-between;align-items:start}@media (max-width:480px){.nunil-tools-wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:1fr 1fr 1fr;row-gap:15px}}.nunil-tools-hr{width:100%;text-align:center;margin-left:0}.nunil-tools-box{flex-basis:30%;border:2px solid #3582ca}.nunil-tools-button-wrapper{margin:5px;border:0;text-align:center}.nunil-tools-button-container{padding:5px 5px 0 5px;text-align:center;background-color:#fff}.no-unsafe-inline-tools-button-form>p.submit{text-align:center;margin-top:5px;margin-bottom:5px}.nunil-tools-button-description{padding:0 5px 5px 5px;background-color:#fff;color:#01263a;font-weight:600}.no-unsafe-inline-clean-database,.no-unsafe-inline-clustering,.no-unsafe-inline-prune-database,.no-unsafe-inline-test-classifier{background-color:#fff}.nunil_tools_operation_report_title{color:#dd5;padding:1em!important;border-color:#46637f;border-bottom:1px dotted;border-top:1px solid #ddd;font-size:1.1em;font-weight:700}.nunil_tools_operation_report_container{height:340px;padding:0 1em 1em 1em;background:#01263a}.nunil_tools_operation_report{height:280px;overflow:auto;background:#01263a;color:#fff}.nunil-btn{background-color:#4caf50;border:none;border-radius:4px;color:#fff;padding:4px 9px;text-align:center;text-decoration:none;display:inline-block;font-size:1em;margin:2px 2px;box-sizing:border-box;transition-duration:.4s;cursor:pointer}.nunil-new-endpoint{width:100%;min-width:15em;max-width:19em}.nunil-btn-addnew{background-color:#fff;color:#000;border:2px solid #4caf50;min-width:10em}.nunil-btn-addnew:hover:enabled{background-color:#4caf50;color:#fff}.nunil-btn-del-endpoint{background-color:#fff;color:#f44336;border:2px solid #f44336}.nunil-btn-del-endpoint:hover:enabled{background-color:#f44336;color:#fff}.nunil-endpoint-string{display:inline-block;padding:5px 10px;font-size:1em;margin:2px 2px;min-width:25em;transition-duration:.4s}.txt-active{background-color:#fffff7;color:#000}.txt-inactive{background-color:#a7aaad;color:#fff}.txt-newly{font-style:italic}.nunil-endpoints-list{list-style-type:none;margin:0;padding:0}.nunil-error-input{background-color:#ff9696!important}.nunil-text-group:focus{background-color:#e0ffff}.nunil-text-maxage:focus{background-color:#e0ffff}.nunil-new-endpoint:focus{background-color:#e0ffff} \ No newline at end of file +.hljs{display:block;overflow-x:auto;padding:.5em;background:#282b2e}.hljs-keyword,.hljs-literal,.hljs-selector-id,.hljs-selector-tag{color:#93c763}.hljs-number{color:#ffcd22}.hljs{color:#e0e2e4}.hljs-attribute{color:#668bb0}.hljs-class .hljs-title,.hljs-code,.hljs-section{color:#fff}.hljs-link,.hljs-regexp{color:#d39745}.hljs-meta{color:#557182}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-name,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-subst,.hljs-tag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable{color:#8cbbad}.hljs-string,.hljs-symbol{color:#ec7600}.hljs-comment,.hljs-deletion,.hljs-quote{color:#818e96}.hljs-selector-class{color:#a082bd}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title,.hljs-type{font-weight:700}.nunil-spinner-blocks.hidden{display:none}.nunil-spinner-blocks{position:fixed;top:0;left:0;width:100%;height:100vh;background:rgba(0,0,0,.8);z-index:999;opacity:1;transition:all .5s;display:flex;align-items:center;justify-content:center}@keyframes nunil-spinner-tools{0%{background:#a0de59}12.5%{background:#a0de59}12.625%{background:#5f2a62}100%{background:#5f2a62}}.nunil-spinner-box-1{left:0;top:0;animation-delay:0s}.nunil-spinner-box-2{left:42px;top:0;animation-delay:125ms}.nunil-spinner-box-3{left:84px;top:0;animation-delay:.25s}.nunil-spinner-box-4{left:0;top:42px;animation-delay:875ms!important}.nunil-spinner-box-5{left:84px;top:42px;animation-delay:375ms}.nunil-spinner-box-6{left:0;top:84px;animation-delay:.75s}.nunil-spinner-box-7{left:42px;top:84px;animation-delay:625ms}.nunil-spinner-box-8{left:84px;top:84px;animation-delay:.5s}.nunil-spinner-tools div{position:absolute;width:40px;height:40px;background:#5f2a62;animation-name:nunil-spinner-tools;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite}.nunil-spinner-tools{width:124px;height:124px;position:relative;transform:translateZ(0) scale(1);backface-visibility:hidden;transform-origin:0 0}.nunil-spinner-tools div{box-sizing:content-box}input[type=checkbox].nunil-ui-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;width:auto;height:auto;vertical-align:middle;position:relative;border:0;outline:0;cursor:pointer;margin:0 4px;background:0 0;box-shadow:none}input[type=checkbox].nunil-ui-toggle:focus{box-shadow:none}input[type=checkbox].nunil-ui-toggle:after{content:'';font-size:8px;font-weight:400;line-height:18px;text-indent:-14px;color:#fff;width:36px;height:18px;display:inline-block;background-color:#a7aaad;border-radius:72px;box-shadow:0 0 12px rgb(0 0 0 / 15%) inset}input[type=checkbox].nunil-ui-toggle:before{content:'';width:14px;height:14px;display:block;position:absolute;top:2px;left:2px;margin:0;border-radius:50%;background-color:#fff}input[type=checkbox].nunil-ui-toggle:checked:before{left:20px;margin:0;background-color:#fff}input[type=checkbox].nunil-ui-toggle,input[type=checkbox].nunil-ui-toggle:after,input[type=checkbox].nunil-ui-toggle:before,input[type=checkbox].nunil-ui-toggle:checked:after,input[type=checkbox].nunil-ui-toggle:checked:before{transition:ease .15s}input[type=checkbox].nunil-ui-toggle:checked:after{content:'ON';background-color:#2271b1}.nunil-l-radio{margin:8px 0;display:block;cursor:pointer}.nunil-l-radio input{display:none}.nunil-l-radio input+span{line-height:16px;height:16px;padding-left:16px;display:block;position:relative}.nunil-l-radio input+span:not(:empty){padding-left:30px}.nunil-l-radio input+span:after,.nunil-l-radio input+span:before{content:"";width:16px;height:16px;display:block;border-radius:50%;left:0;top:0;position:absolute}.nunil-l-radio input+span:before{background:#d1d7e3;transition:background .2s ease,transform .4s cubic-bezier(.175, .885, .32, 2)}.nunil-l-radio input+span:after{background:#fff;transform:scale(.78);transition:transform .6s cubic-bezier(.175, .885, .32, 1.4)}.nunil-l-radio input:checked+span:before{transform:scale(1.04);background:#2271b1}.nunil-l-radio input:checked+span:after{transform:scale(.4);transition:transform .3s ease}.nunil-l-radio:hover input+span:before{transform:scale(.92)}.nunil-l-radio:hover input+span:after{transform:scale(.74)}.nunil-l-radio:hover input:checked+span:after{transform:scale(.4)}.nunil-radio-div{justify-content:start;display:flex;flex-direction:column;align-items:start;box-sizing:border-box}.nunil-radio-div-horiz{padding-left:10px;justify-content:flex-start;display:flex;flex-direction:row;align-items:baseline;box-sizing:border-box;gap:1.5em}.wp-list-table .column-nunil-ext-directive{width:10%}.wp-list-table .column-nunil-ext-sources{width:30%}.nunil-evh-scripts td.column-cb,.nunil-ext-scripts td.column-cb,.nunil-inl-scripts td.column-cb{width:4%}.nunil-evh-scripts th.column-script,.nunil-inl-scripts th.column-script{width:30%}.nunil-ext-scripts th.column-src_attrib{width:62%}.nunil-ext-scripts th.column-sha256,.nunil-ext-scripts th.column-sha384,.nunil-ext-scripts th.column-sha512{width:5%}td.column-script div.ui-accordion div.ui-accordion-content{padding:0!important}td.column-script div.ui-widget-content{background:unset}.nunil-script-code{margin:1px 0 1px 0}.nunil-evh-scripts th.column-tagid,.nunil-ext-scripts th.column-directive,.nunil-inl-scripts th.column-directive{width:7%}.nunil-evh-scripts th.column-tagname,.nunil-ext-scripts th.column-tagname,.nunil-inl-scripts th.column-tagname{width:7%}.nunil-evh-scripts th.column-event_attribute{width:7%}.nunil-evh-scripts th.column-clustername,.nunil-inl-scripts th.column-clustername{width:7%}.nunil-evh-scripts th.column-whitelist,.nunil-ext-scripts th.column-whitelist,.nunil-inl-scripts th.column-whitelist{width:5%}.nunil-evh-scripts td.column-whitelist p.whitelist,.nunil-ext-scripts td.column-whitelist p.whitelist,.nunil-inl-scripts td.column-whitelist p.whitelist{background-color:#cfffd7;text-align:center;font-weight:700}.nunil-evh-scripts td.column-whitelist p.blacklist,.nunil-ext-scripts td.column-whitelist p.blacklist,.nunil-inl-scripts td.column-whitelist p.blacklist{background-color:#e8b756;text-align:center}.nunil-evh-scripts th.column-pages,.nunil-inl-scripts th.column-pages{width:19%}td.column-pages div.ui-accordion div.ui-accordion-content{padding:0!important}.nunil-pages-code{margin:1px 0 1px 0}.nunil-evh-scripts th.column-lastseen,.nunil-inl-scripts th.column-lastseen{width:7%}.nunil-evh-scripts th.column-occurences,.nunil-inl-scripts th.column-occurences{width:7%}td.column-script div.ui-accordion div.ui-accordion-content{padding:0!important}.nunil-base-rule-container{float:left;margin-right:20px;width:100%}input.nunil-base-rule,label.nunil-base-rule{display:block}input.nunil-base-rule{width:100%}div.nunil_temp_div{border:1px solid;border-radius:5px;padding:10px;margin:10px 0;width:300px}.type1{border-color:#e76f51;background-color:rgba(231,111,81,.1)}.type2{border-color:#2a9d8f;background-color:rgba(42,157,143,.1)}.type3{border-color:#0096c7;background-color:rgba(0,150,199,.1)}.type4{border-color:#00b353;background-color:rgba(0,179,83,.1)}.rwd-table{margin:1em 0;min-width:300px;border-collapse:collapse}.rwd-table tr{border-top:0}.rwd-table th{display:none}.rwd-table td{display:block}.rwd-table td:first-child{padding-top:.5em}.rwd-table td:last-child{padding-bottom:.5em}.rwd-table td:before{content:attr(data-th) ": ";font-weight:700;width:6.5em;display:inline-block}@media (min-width:480px){.rwd-table td:before{display:none}}.rwd-table td,.rwd-table th{text-align:left}@media (min-width:480px){.rwd-table td,.rwd-table th{display:table-cell;padding:.25em .5em}.rwd-table td:first-child,.rwd-table th:first-child{padding-left:0}.rwd-table td:last-child,.rwd-table th:last-child{padding-right:0}}.rwd-table{background:#01263a;color:#fff;border-radius:.4em;overflow:hidden}.rwd-table tr{border-color:#46637f;border-bottom:1px dotted}.rwd-table td,.rwd-table th{margin:.5em 1em}@media (min-width:480px){.rwd-table td,.rwd-table th{padding:1em!important}}.rwd-table td:before,.rwd-table th{color:#dd5}.nunil-tools-wrapper{display:grid;grid-template-columns:repeat(3,1fr);column-gap:15px;grid-template-rows:1fr;grid-auto-rows:1fr;text-align:center;justify-content:space-between;align-items:start}@media (max-width:480px){.nunil-tools-wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:1fr 1fr 1fr;row-gap:15px}}.nunil-tools-hr{width:100%;text-align:center;margin-left:0}.nunil-tools-box{flex-basis:30%;border:2px solid #3582ca}.nunil-tools-button-wrapper{margin:5px;border:0;text-align:center}.nunil-tools-button-container{padding:5px 5px 0 5px;text-align:center;background-color:#fff}.no-unsafe-inline-tools-button-form>p.submit{text-align:center;margin-top:5px;margin-bottom:5px}.nunil-tools-button-description{padding:0 5px 5px 5px;background-color:#fff;color:#01263a;font-weight:600}.no-unsafe-inline-clean-database,.no-unsafe-inline-clustering,.no-unsafe-inline-prune-database,.no-unsafe-inline-test-classifier{background-color:#fff}.nunil_tools_operation_report_title{color:#dd5;padding:1em!important;border-color:#46637f;border-bottom:1px dotted;border-top:1px dotted;font-size:1.1em;font-weight:700}.nunil_tools_operation_report_container{height:380px;padding:0 1em 1em 1em;background:#01263a;position:relative;border-radius:.4em;display:flex;flex-direction:column}.nunil_tools_operation_report{height:290px;max-height:fit-content;overflow:auto;background:#01263a;color:#fff}.nunil-btn{background-color:#4caf50;border:none;border-radius:4px;color:#fff;padding:2px 2px;text-align:center;text-decoration:none;display:inline-block;font-size:1em;margin:2px 2px;box-sizing:border-box;transition-duration:.4s;cursor:pointer}.nunil-new-endpoint{width:100%;min-width:15em;max-width:19em}.nunil-btn-addnew{background-color:#fff;color:#000;border:2px solid #4caf50;min-width:10em}.nunil-btn-addnew:hover:enabled{background-color:#4caf50;color:#fff}.nunil-btn-del-endpoint{background-color:#fff;color:#f44336;border:2px solid #f44336}.nunil-btn-del-endpoint:hover:enabled{background-color:#f44336;color:#fff}.nunil-endpoint-string{display:inline-block;padding:5px 10px;font-size:1em;margin:2px 2px;min-width:25em;transition-duration:.4s}.txt-active{background-color:#fffff7;color:#000}.txt-inactive{background-color:#a7aaad;color:#fff}.txt-newly{font-style:italic}.nunil-endpoints-list{list-style-type:none;margin:0;padding:0}.nunil-error-input{background-color:#ff9696!important}.nunil-text-group:focus{background-color:#e0ffff}.nunil-text-maxage:focus{background-color:#e0ffff}.nunil-new-endpoint:focus{background-color:#e0ffff}.nunil-db-sum-tabs-5{position:relative}.nunil_tools_operation_report_buttons{position:absolute;bottom:.5em;right:1.4em;display:flex;flex-direction:row}.nunil_tools_operation_report_button_clipboard{background-color:#fff;color:#9cf;border:2px solid #9cf}.nunil_tools_operation_report_button_clipboard:hover:enabled{background-color:#9cf;color:#fff}.nunil_tools_operation_report_button_clear{background-color:#fff;color:#f44336;border:2px solid #f44336}.nunil_tools_operation_report_button_clear:hover:enabled{background-color:#f44336;color:#fff}.copy-notification{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.no-titlebar .ui-dialog-titlebar{display:none} \ No newline at end of file diff --git a/admin/css/no-unsafe-inline-spinner.css b/admin/css/no-unsafe-inline-spinner.css index 4fcf4b3..a85e133 100644 --- a/admin/css/no-unsafe-inline-spinner.css +++ b/admin/css/no-unsafe-inline-spinner.css @@ -24,43 +24,43 @@ } /* moving styles from inline */ .nunil-spinner-box-1 { - left:38px; - top:38px; + left:0px; + top:0px; animation-delay:0s; } .nunil-spinner-box-2 { - left:80px; - top:38px; + left:42px; + top:0px; animation-delay:0.125s; } .nunil-spinner-box-3 { - left:122px; - top:38px; + left:84px; + top:0px; animation-delay:0.25s; } .nunil-spinner-box-4 { - left:38px; - top:80px; + left:0px; + top:42px; animation-delay:0.875s!important;; } .nunil-spinner-box-5 { - left:122px; - top:80px; + left:84px; + top:42px; animation-delay:0.375s; } .nunil-spinner-box-6 { - left:38px; - top:122px; + left:0px; + top:84px; animation-delay:0.75s; } .nunil-spinner-box-7 { - left:80px; - top:122px; + left:42px; + top:84px; animation-delay:0.625s; } .nunil-spinner-box-8 { - left:122px; - top:122px; + left:84px; + top:84px; animation-delay:0.5s; } @@ -75,8 +75,8 @@ animation-iteration-count: infinite; } .nunil-spinner-tools { - width: 120px; - height: 120px; + width: 124px; + height: 124px; position: relative; transform: translateZ(0) scale(1); backface-visibility: hidden; diff --git a/admin/js/no-unsafe-inline-admin.js b/admin/js/no-unsafe-inline-admin.js index 5fd9e4f..efe631f 100755 --- a/admin/js/no-unsafe-inline-admin.js +++ b/admin/js/no-unsafe-inline-admin.js @@ -1,7 +1,7 @@ /*global alert, console, event, nunil_object, jQuery, wp */ -jQuery(document).ready(function ($) { + jQuery(document).ready(function($) { "use strict"; var a; // Used for endpoints list. @@ -10,12 +10,12 @@ jQuery(document).ready(function ($) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split("&"); var sParameterName; - var i; + var i; - for (i = 0; i < sURLVariables.length; i+=1) { + for (i = 0; i < sURLVariables.length; i += 1) { sParameterName = sURLVariables[i].split("="); if (sParameterName[0] === sParam) { - return ( sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]) ); + return (sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1])); } } return false; @@ -24,19 +24,19 @@ jQuery(document).ready(function ($) { var mytab = getUrlParameter("tab"); var tb = $("table.nunil-ext-sources tbody"); - const {__} = wp.i18n; - - $.fn.extend( - { - clearText: function () { - return this.clone() // clone the element - .children() // select all the children - .remove() // remove all the children - .end() // again go back to selected element - .text(); - } + const { + __ + } = wp.i18n; + + $.fn.extend({ + clearText: function() { + return this.clone() // clone the element + .children() // select all the children + .remove() // remove all the children + .end() // again go back to selected element + .text(); } - ); + }); // Used to order strings in base rules function uniqueOrdered(string) { @@ -99,7 +99,7 @@ jQuery(document).ready(function ($) { var now; var multiplier; - if ( performance !== undefined && performance.now) { + if (performance !== undefined && performance.now) { now = (performance.now() + performance.timing.navigationStart) / 1000; multiplier = 1e6; // 1,000,000 for microseconds } else { @@ -119,125 +119,123 @@ jQuery(document).ready(function ($) { } function updateSummaryTablesWorker(once) { - $.ajax( - { - complete: function () { - // Schedule the next request when the current one"s complete - if ($("input[type='checkbox'][name='no-unsafe-inline-tools[capture_enabled]']").prop("checked")) { - if (once === undefined) { - setTimeout(updateSummaryTablesWorker, 25000); - } - } else { - clearTimeout(updateSummaryTablesWorker); + $.ajax({ + complete: function() { + // Schedule the next request when the current one"s complete + if ($("input[type='checkbox'][name='no-unsafe-inline-tools[capture_enabled]']").prop("checked")) { + if (once === undefined) { + setTimeout(updateSummaryTablesWorker, 25000); } - }, - data: { - action: "nunil_update_summary_tables" - }, - dataType: "json", - success: function (res) { - var nunil_db_summary_data = ""; - var nunil_external_table_summary_data = ""; - var nunil_inline_table_summary_data = ""; - var nunil_eventhandlers_table_summary_data = ""; - $.each( - res, - function (index, label) { - if ("global" === index) { - $.each( - label, - function (index, value) { - var wlText = ""; - nunil_db_summary_data += ""; - nunil_db_summary_data += "" + value.type + ""; - if ("1" === value.whitelist) { - wlText = __("WL", "no-unsafe-inline"); - } else { - wlText = __("BL", "no-unsafe-inline"); - } - nunil_db_summary_data += "" + wlText + ""; - nunil_db_summary_data += "" + value.num + ""; - nunil_db_summary_data += "" + value.clusters + ""; - nunil_db_summary_data += ""; - } - ); - } - if ("inline" === index) { - $.each( - label, - function (index, value) { - var wlText = ""; - nunil_inline_table_summary_data += ""; - nunil_inline_table_summary_data += "" + value.directive + ""; - nunil_inline_table_summary_data += "" + value.tagname + ""; - nunil_inline_table_summary_data += "" + value.clustername + ""; - if ("1" === value.whitelist) { - wlText = __("WL", "no-unsafe-inline"); - } else { - wlText = __("BL", "no-unsafe-inline"); - } - nunil_inline_table_summary_data += "" + wlText + ""; - nunil_inline_table_summary_data += "" + value.num + ""; - nunil_inline_table_summary_data += ""; + } else { + clearTimeout(updateSummaryTablesWorker); + } + }, + data: { + action: "nunil_update_summary_tables" + }, + dataType: "json", + success: function(res) { + var nunil_db_summary_data = ""; + var nunil_external_table_summary_data = ""; + var nunil_inline_table_summary_data = ""; + var nunil_eventhandlers_table_summary_data = ""; + $.each( + res, + function(index, label) { + if ("global" === index) { + $.each( + label, + function(index, value) { + var wlText = ""; + nunil_db_summary_data += ""; + nunil_db_summary_data += "" + value.type + ""; + if ("1" === value.whitelist) { + wlText = __("WL", "no-unsafe-inline"); + } else { + wlText = __("BL", "no-unsafe-inline"); } - ); - } - if ("external" === index) { - $.each( - label, - function (index, value) { - var wlText = ""; - nunil_external_table_summary_data += ""; - nunil_external_table_summary_data += "" + value.directive + ""; - nunil_external_table_summary_data += "" + value.tagname + ""; - nunil_external_table_summary_data += "" + value.nonceable + ""; - switch (value.whitelist) { - case "1": - wlText = __("WL", "no-unsafe-inline"); - break; - case "0": - wlText = __("BL", "no-unsafe-inline"); - break; - default: - wlText = "--"; - } - nunil_external_table_summary_data += "" + wlText + ""; - nunil_external_table_summary_data += "" + value.num + ""; - nunil_external_table_summary_data += ""; + nunil_db_summary_data += "" + wlText + ""; + nunil_db_summary_data += "" + value.num + ""; + nunil_db_summary_data += "" + value.clusters + ""; + nunil_db_summary_data += ""; + } + ); + } + if ("inline" === index) { + $.each( + label, + function(index, value) { + var wlText = ""; + nunil_inline_table_summary_data += ""; + nunil_inline_table_summary_data += "" + value.directive + ""; + nunil_inline_table_summary_data += "" + value.tagname + ""; + nunil_inline_table_summary_data += "" + value.clustername + ""; + if ("1" === value.whitelist) { + wlText = __("WL", "no-unsafe-inline"); + } else { + wlText = __("BL", "no-unsafe-inline"); } - ); - } - if ("events" === index) { - $.each( - label, - function (index, value) { - var wlText = ""; - nunil_eventhandlers_table_summary_data += ""; - nunil_eventhandlers_table_summary_data += "" + value.tagname + ""; - nunil_eventhandlers_table_summary_data += "" + value.event_attribute + ""; - nunil_eventhandlers_table_summary_data += "" + value.clustername + ""; - if ("1" === value.whitelist) { + nunil_inline_table_summary_data += "" + wlText + ""; + nunil_inline_table_summary_data += "" + value.num + ""; + nunil_inline_table_summary_data += ""; + } + ); + } + if ("external" === index) { + $.each( + label, + function(index, value) { + var wlText = ""; + nunil_external_table_summary_data += ""; + nunil_external_table_summary_data += "" + value.directive + ""; + nunil_external_table_summary_data += "" + value.tagname + ""; + nunil_external_table_summary_data += "" + value.nonceable + ""; + switch (value.whitelist) { + case "1": wlText = __("WL", "no-unsafe-inline"); - } else { + break; + case "0": wlText = __("BL", "no-unsafe-inline"); - } - nunil_eventhandlers_table_summary_data += "" + wlText + ""; - nunil_eventhandlers_table_summary_data += "" + value.num + ""; - nunil_eventhandlers_table_summary_data += ""; + break; + default: + wlText = "--"; } - ); - } + nunil_external_table_summary_data += "" + wlText + ""; + nunil_external_table_summary_data += "" + value.num + ""; + nunil_external_table_summary_data += ""; + } + ); } - ); - $("#nunil_db_summary_body").html(nunil_db_summary_data); - $("#nunil_external_table_summary_body").html(nunil_external_table_summary_data); - $("#nunil_inline_table_summary_body").html(nunil_inline_table_summary_data); - $("#nunil_eventhandlers_table_summary_body").html(nunil_eventhandlers_table_summary_data); - }, - type: "post", - url: nunil_object.ajax_url - } - ); + if ("events" === index) { + $.each( + label, + function(index, value) { + var wlText = ""; + nunil_eventhandlers_table_summary_data += ""; + nunil_eventhandlers_table_summary_data += "" + value.tagname + ""; + nunil_eventhandlers_table_summary_data += "" + value.event_attribute + ""; + nunil_eventhandlers_table_summary_data += "" + value.clustername + ""; + if ("1" === value.whitelist) { + wlText = __("WL", "no-unsafe-inline"); + } else { + wlText = __("BL", "no-unsafe-inline"); + } + nunil_eventhandlers_table_summary_data += "" + wlText + ""; + nunil_eventhandlers_table_summary_data += "" + value.num + ""; + nunil_eventhandlers_table_summary_data += ""; + } + ); + } + } + ); + $("#nunil_db_summary_body").html(nunil_db_summary_data); + $("#nunil_external_table_summary_body").html(nunil_external_table_summary_data); + $("#nunil_inline_table_summary_body").html(nunil_inline_table_summary_data); + $("#nunil_eventhandlers_table_summary_body").html(nunil_eventhandlers_table_summary_data); + }, + type: "post", + url: nunil_object.ajax_url + }); } function isValidReportUrl(_string) { @@ -253,7 +251,7 @@ jQuery(document).ready(function ($) { // Open inline help from link $("#nunil-help-link").on( "click", - function () { + function() { $("#contextual-help-link").click(); } ); @@ -261,13 +259,117 @@ jQuery(document).ready(function ($) { // Trigger checkboxes check on select-all click. $("#cb-select-all-1").on( "click", - function () { + function() { $(":checkbox[name*='bulk-select[]']") .prop("checked", this.checked) .change(); } ); + // Buttons on operation report. + $("#nunil-db-sum-tabs-5").on( + "mouseenter", + function() { + $("#nunil_tools_operation_report_buttons").stop(true).fadeIn(600); + } + ); + + $("#nunil-db-sum-tabs-5").on( + "mouseleave", + function() { + $("#nunil_tools_operation_report_buttons").stop(true).fadeOut(600); + } + ); + $("#nunil_tools_operation_report_button_clipboard").tooltip({ + position: { + at: "right center", + my: "left+15 center" + } + }); + $("#nunil_tools_operation_report_button_clear").tooltip({ + position: { + at: "right center", + my: "left+15 center" + } + }); + + $("#nunil_tools_operation_report_button_clipboard").on( + "click", + function(event) { + event.preventDefault(); + CopyToClipboard($("#nunil_tools_operation_report").text(), true, $(this).data("notification")); + } + ); + function CopyToClipboard(value, showNotification, notificationText) { + var temparea = $("