nodebb-plugin-facebook-post 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/lib/composer.js +8 -7
package/package.json
CHANGED
package/static/lib/composer.js
CHANGED
|
@@ -112,17 +112,18 @@
|
|
|
112
112
|
if ($results.children().length) $results.show();
|
|
113
113
|
});
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
// NodeBB 4.x fires 'action:composer.submit' with { composerData } (the object
|
|
116
|
+
// sent to the socket). Modifying composerData by reference is enough.
|
|
117
|
+
$(window).off('action:composer.submit.fbpost')
|
|
118
|
+
.on('action:composer.submit.fbpost', function (ev2, data) {
|
|
117
119
|
const enabled = $enabled.is(':checked');
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
const postData = (data && data.composerData) || (data && data.postData) || data;
|
|
121
|
+
if (!postData || typeof postData !== 'object') return;
|
|
122
|
+
postData.fbPostEnabled = enabled;
|
|
121
123
|
if (enabled) {
|
|
122
124
|
const placeId = $composer.find('[data-fbpost-place-id]').val();
|
|
123
|
-
if (placeId)
|
|
125
|
+
if (placeId) postData.fbPlaceId = placeId;
|
|
124
126
|
}
|
|
125
|
-
return submitData;
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
129
|
|