DmitrMakeev commited on
Commit
e781c0f
·
verified ·
1 Parent(s): fdc8eae

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +129 -0
pages.html CHANGED
@@ -728,10 +728,139 @@ editor.Blocks.add('video-player-settings-block', {
728
 
729
 
730
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731
  </script>
732
 
733
  <script>
734
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
735
  editor.BlockManager.add('custom-iframe', {
736
  label: 'Custom Iframe',
737
  content: `<iframe id="custom-iframe" frameborder="0" width="720" height="405" src="https://rutube.ru/play/embed/538dc9cc0b952dd52f47e28df7df5e81/" allow="clipboard-write; autoplay" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: relative; top: 0; margin: 0 auto; display: block;"></iframe>`,
 
728
 
729
 
730
 
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
  </script>
787
 
788
  <script>
789
 
790
+
791
+
792
+
793
+
794
+
795
+
796
+ editor.BlockManager.add('custom-countdown', {
797
+ label: 'Custom Countdown',
798
+ content: `
799
+ <div id="ixo2" class="countdown">
800
+ <span data-js="countdown" class="countdown-cont">
801
+ <div class="countdown-block">
802
+ <div data-js="countdown-day" class="countdown-digit"></div>
803
+ <div class="countdown-label">days</div>
804
+ </div>
805
+ <div class="countdown-block">
806
+ <div data-js="countdown-hour" class="countdown-digit"></div>
807
+ <div class="countdown-label">hours</div>
808
+ </div>
809
+ <div class="countdown-block">
810
+ <div data-js="countdown-minute" class="countdown-digit"></div>
811
+ <div class="countdown-label">minutes</div>
812
+ </div>
813
+ <div class="countdown-block">
814
+ <div data-js="countdown-second" class="countdown-digit"></div>
815
+ <div class="countdown-label">seconds</div>
816
+ </div>
817
+ </span>
818
+ <span data-js="countdown-endtext" class="countdown-endtext"></span>
819
+ </div>
820
+ `,
821
+ attributes: {
822
+ class: 'fa fa-clock-o'
823
+ },
824
+ script: function() {
825
+ const blockIdInput = document.getElementById('blockIdInput');
826
+ const props = {
827
+ "ixo2": {
828
+ "startfrom": "",
829
+ "endText": "EXPIRED",
830
+ "blockId": blockIdInput ? blockIdInput.value : "" // ID блока, который нужно закрыть
831
+ }
832
+ };
833
+
834
+ const ids = Object.keys(props).map(id => `#${id}`).join(',');
835
+ const els = document.querySelectorAll(ids);
836
+
837
+ for (let i = 0, len = els.length; i < len; i++) {
838
+ const el = els[i];
839
+ (function(n) {
840
+ const t = n.startfrom, e = n.endText, blockId = n.blockId, o = this, a = new Date(t).getTime(), c = o.querySelector('[data-js=countdown]'), d = o.querySelector('[data-js=countdown-endtext]'), s = o.querySelector('[data-js=countdown-day]'), l = o.querySelector('[data-js=countdown-hour]'), i = o.querySelector('[data-js=countdown-minute]'), r = o.querySelector('[data-js=countdown-second]'), u = o.__gjsCountdownInterval;
841
+ u && clearInterval(u);
842
+ const p = window.__gjsCountdownIntervals || [], v = [];
843
+ p.forEach(n => n.isConnected || (clearInterval(n.__gjsCountdownInterval), v.push(n))), p.indexOf(o) < 0 && p.push(o), window.__gjsCountdownIntervals = p.filter(n => v.indexOf(n) < 0);
844
+ const y = (n, t, e, o) => {
845
+ s.innerHTML = `${n < 10 ? '0' + n : n}`, l.innerHTML = `${t < 10 ? '0' + t : t}`, i.innerHTML = `${e < 10 ? '0' + e : e}`, r.innerHTML = `${o < 10 ? '0' + o : o}`;
846
+ };
847
+ const f = () => {
848
+ const n = (new Date).getTime(), t = a - n, s = Math.floor(t / 864e5), l = Math.floor(t % 864e5 / 36e5), i = Math.floor(t % 36e5 / 6e4), r = Math.floor(t % 6e4 / 1e3);
849
+ y(s, l, i, r), t < 0 && (clearInterval(o.__gjsCountdownInterval), d.innerHTML = e, c.style.display = 'none', d.style.display = '', blockId && (document.getElementById(blockId).style.display = 'none'));
850
+ };
851
+ a ? (o.__gjsCountdownInterval = setInterval(f, 1e3), d.style.display = 'none', c.style.display = '', f()) : y(0, 0, 0, 0);
852
+ }).bind(el)(props[el.id]);
853
+ }
854
+ }
855
+ });
856
+
857
+
858
+ </script>
859
+
860
+ <script>
861
+
862
+
863
+
864
  editor.BlockManager.add('custom-iframe', {
865
  label: 'Custom Iframe',
866
  content: `<iframe id="custom-iframe" frameborder="0" width="720" height="405" src="https://rutube.ru/play/embed/538dc9cc0b952dd52f47e28df7df5e81/" allow="clipboard-write; autoplay" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: relative; top: 0; margin: 0 auto; display: block;"></iframe>`,