We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When we get an request with the proxy, the returned just the url in data, not the html and others elements in the preview of response.
Proposition:
`function (data) { // Build request URL var requestUrl = new URL(trumbowyg.o.plugins.noembed.proxy); Object.keys(data).forEach((key) => { requestUrl.searchParams.append(key, data[key].trim()); });
// Launch async request fetch(requestUrl, { method: 'GET', cache: 'no-cache', signal: AbortSignal.timeout(2000) }).then((response) => { return response.json().then((json) => { if (trumbowyg.o.plugins.noembed.success) { trumbowyg.o.plugins.noembed.success(json, trumbowyg, $modal); return; } if (!json.html) { trumbowyg.addErrorOnModalField( $('input[type=text]', $modal), json.error ); return; } trumbowyg.execCmd('insertHTML', json.html); setTimeout(function () { trumbowyg.closeModal(); }, 250); }); }).catch((...args) => { if (trumbowyg.o.plugins.noembed.error) { trumbowyg.o.plugins.noembed.error(...args); return; } trumbowyg.addErrorOnModalField( $('input[type=text]', $modal), trumbowyg.lang.noembedError ); }); }`
The text was updated successfully, but these errors were encountered:
I reproduce, i tested my proxy which return truly html but I don't know why sucess callback return only a json like {video: "url-of-video"}
EDIT: i just found the problem the case only append when a plugins.noembed.sucessCallback is provided,
Sorry, something went wrong.
No branches or pull requests
When we get an request with the proxy, the returned just the url in data, not the html and others elements in the preview of response.
Proposition:
`function (data) {
// Build request URL
var requestUrl = new URL(trumbowyg.o.plugins.noembed.proxy);
Object.keys(data).forEach((key) => {
requestUrl.searchParams.append(key, data[key].trim());
});
The text was updated successfully, but these errors were encountered: