PluginProbe ʕ •ᴥ•ʔ
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress / 2.17.1
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress v2.17.1
4.8.1 trunk 1.0 1.1 1.12.1 1.2.3 1.2.4 1.2.5 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5 1.5.1 1.5.2 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.4.1 1.6.5 1.6.5.1 1.6.6 1.6.6.1 1.6.6.2 1.6.6.3 1.6.7 1.6.7.1 1.6.8 1.6.8.1 1.6.8.2 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.9.0 1.9.1 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.8.1 1.9.9 1.9.9.1 1.9.9.2 1.9.9.3 2.0 2.0.1 2.1 2.1.1 2.1.2 2.1.3 2.10 2.11 2.11.1 2.12 2.12.1 2.12.2 2.12.3 2.12.4 2.13 2.14 2.14.1 2.15 2.15.1 2.16 2.16.1 2.17 2.17.1 2.18 2.18.1 2.18.2 2.18.3 2.19 2.19.1 2.19.2 2.19.3 2.2 2.2.1 2.3 2.3.1 2.3.10 2.3.2 2.3.3 2.3.4 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.1.1 2.4.1.2 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5 2.5.1 2.5.2 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.7 2.7.1 2.7.2 2.8 2.9 2.9.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.7.5 4.7.6 4.7.7
custom-facebook-feed / js / cff-blocks.js
custom-facebook-feed / js Last commit date
admin-notifications.js 5 years ago cff-admin-scripts.js 5 years ago cff-blocks.js 6 years ago cff-scripts.js 5 years ago cff-scripts.min.js 6 years ago jquery.matchHeight-min.js 6 years ago
cff-blocks.js
148 lines
1 "use strict";
2 window.cffmetatrans = false;
3 (function () {
4 var _wp = wp,
5 _wp$serverSideRender = _wp.serverSideRender,
6 createElement = wp.element.createElement,
7 ServerSideRender = _wp$serverSideRender === void 0 ? wp.components.ServerSideRender : _wp$serverSideRender,
8 _ref = wp.blockEditor || wp.editor,
9 InspectorControls = _ref.InspectorControls,
10 _wp$components = wp.components,
11 TextareaControl = _wp$components.TextareaControl,
12 Button = _wp$components.Button,
13 PanelBody = _wp$components.PanelBody,
14 Placeholder = _wp$components.Placeholder,
15 registerBlockType = wp.blocks.registerBlockType;
16
17 var cffIcon = createElement('svg', {
18 width: 20,
19 height: 20,
20 viewBox: '0 0 448 512',
21 className: 'dashicon'
22 }, createElement('path', {
23 fill: 'currentColor',
24 d: 'M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z'
25 }));
26
27 registerBlockType('cff/cff-feed-block', {
28 title: 'Custom Facebook Feed',
29 icon: cffIcon,
30 category: 'widgets',
31 attributes: {
32 noNewChanges: {
33 type: 'boolean',
34 },
35 shortcodeSettings: {
36 type: 'string',
37 },
38 executed: {
39 type: 'boolean'
40 }
41 },
42 edit: function edit(props) {
43 var _props = props,
44 setAttributes = _props.setAttributes,
45 _props$attributes = _props.attributes,
46 _props$attributes$sho = _props$attributes.shortcodeSettings,
47 shortcodeSettings = _props$attributes$sho === void 0 ? cff_block_editor.shortcodeSettings : _props$attributes$sho,
48 _props$attributes$cli = _props$attributes.noNewChanges,
49 noNewChanges = _props$attributes$cli === void 0 ? true : _props$attributes$cli;
50
51 function setState(shortcodeSettingsContent) {
52 setAttributes({
53 noNewChanges: false,
54 shortcodeSettings: shortcodeSettingsContent
55 })
56 }
57
58 function previewClick(content) {
59 setAttributes({
60 noNewChanges: true,
61 })
62 }
63
64 function cffGutenbergSizeVisualHeader() {
65 jQuery('.cff-visual-header.cff-has-cover').each(function() {
66 var wrapperHeight = jQuery(this).find('.cff-header-hero').innerHeight(),
67 imageHeight = jQuery(this).find('.cff-header-hero img').innerHeight(),
68 wrapperWidth = jQuery(this).find('.cff-header-hero').innerWidth(),
69 imageWidth = jQuery(this).find('.cff-header-hero img').innerWidth(),
70 wrapperAspect = wrapperWidth/wrapperHeight,
71 imageAspect = imageWidth/imageHeight,
72 width = wrapperAspect < imageAspect ? wrapperHeight * imageAspect + 'px' : '100%',
73 difference = imageHeight - wrapperHeight,
74 topMargin = Math.max(0,Math.round(difference/2)),
75 leftMargin = width !== '100%' ? Math.max(0,Math.round(((wrapperHeight * imageAspect)-wrapperWidth)/2)) : 0;
76 jQuery(this).find('.cff-header-hero img').css({
77 'opacity' : 1,
78 'display' : 'block',
79 'visibility' : 'visible',
80 'max-width' : 'none',
81 'max-height' : 'none',
82 'margin-top' : - topMargin + 'px',
83 'margin-left' : - leftMargin + 'px',
84 'width' : width,
85 });
86 });
87 }
88
89 function afterRender() {
90 jQuery(window).resize(function () {
91 setTimeout(function(){
92 cffGutenbergSizeVisualHeader();
93 }, 500);
94 });
95 var executed = false;
96 // no way to run a script after AJAX call to get feed so we just try to execute it on a few intervals
97 setTimeout(function() { if (typeof cffGutenbergSizeVisualHeader !== 'undefined' && !executed) {cffGutenbergSizeVisualHeader();}},1000);
98 setTimeout(function() { if (typeof cffGutenbergSizeVisualHeader !== 'undefined' && !executed) {cffGutenbergSizeVisualHeader();}},2000);
99 setTimeout(function() { if (typeof cffGutenbergSizeVisualHeader !== 'undefined' && !executed) {cffGutenbergSizeVisualHeader();}},3000);
100 setTimeout(function() { if (typeof cffGutenbergSizeVisualHeader !== 'undefined' && !executed) {cffGutenbergSizeVisualHeader();}},5000);
101 setTimeout(function() { if (typeof cffGutenbergSizeVisualHeader !== 'undefined' && !executed) {cffGutenbergSizeVisualHeader();}},10000);
102 }
103
104 var jsx = [React.createElement(InspectorControls, {
105 key: "cff-gutenberg-setting-selector-inspector-controls"
106 }, React.createElement(PanelBody, {
107 title: cff_block_editor.i18n.addSettings
108 }, React.createElement(TextareaControl, {
109 key: "cff-gutenberg-settings",
110 className: "cff-gutenberg-settings",
111 label: cff_block_editor.i18n.shortcodeSettings,
112 help: cff_block_editor.i18n.example + ": 'id=\"smashballoon\" showheader=\"true\"'",
113 value: shortcodeSettings,
114 onChange: setState
115 }), React.createElement(Button, {
116 key: "cff-gutenberg-preview",
117 className: "cff-gutenberg-preview",
118 onClick: previewClick,
119 isDefault: true
120 }, cff_block_editor.i18n.preview)))];
121
122 if (noNewChanges) {
123 afterRender();
124 jsx.push(React.createElement(ServerSideRender, {
125 key: "custom-facebook-feeds/custom-facebook-feeds",
126 block: "cff/cff-feed-block",
127 attributes: props.attributes,
128 }));
129 } else {
130 props.attributes.noNewChanges = false;
131 jsx.push(React.createElement(Placeholder, {
132 key: "cff-gutenberg-setting-selector-select-wrap",
133 className: "cff-gutenberg-setting-selector-select-wrap"
134 }, React.createElement(Button, {
135 key: "cff-gutenberg-preview",
136 className: "cff-gutenberg-preview",
137 onClick: previewClick,
138 isDefault: true
139 }, cff_block_editor.i18n.preview)));
140 }
141
142 return jsx;
143 },
144 save: function save() {
145 return null;
146 }
147 });
148 })();