summaryrefslogtreecommitdiff
path: root/plugins/note/note.js
blob: 7724fab84a0e97bbe8ab0fbcc0ad57358bbfb383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Plugins.Af_Readability = {
	embed: function(id) {
		Notify.progress("Loading, please wait...");

		xhrJson("backend.php",{ op: "pluginhandler", plugin: "af_readability", method: "embed", param: id }, (reply) => {
			const content = $$(App.isCombinedMode() ? ".cdm[data-article-id=" + id + "] .content-inner" :
				".post[data-article-id=" + id + "] .content")[0];

			if (content && reply.content) {
				content.innerHTML = reply.content;
				Notify.close();
			} else {
				Notify.error("Unable to fetch content for this article");
			}
		});
	}
};