UNPKG

4.35 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/content-helpers.js"],"names":["module","exports","makeHtmlMessage","body","htmlBody","msgtype","format","formatted_body","makeHtmlNotice","makeHtmlEmote","makeTextMessage","makeNotice","makeEmoteMessage"],"mappings":"AAAA;;;;;;;;;;;;;;;AAeA;;AAEA;;AACAA,OAAOC,OAAP,GAAiB;AACb;;;;;;AAMAC,qBAAiB,yBAASC,IAAT,EAAeC,QAAf,EAAyB;AACtC,eAAO;AACHC,qBAAS,QADN;AAEHC,oBAAQ,wBAFL;AAGHH,kBAAMA,IAHH;AAIHI,4BAAgBH;AAJb,SAAP;AAMH,KAdY;;AAgBb;;;;;;AAMAI,oBAAgB,wBAASL,IAAT,EAAeC,QAAf,EAAyB;AACrC,eAAO;AACHC,qBAAS,UADN;AAEHC,oBAAQ,wBAFL;AAGHH,kBAAMA,IAHH;AAIHI,4BAAgBH;AAJb,SAAP;AAMH,KA7BY;;AA+Bb;;;;;;AAMAK,mBAAe,uBAASN,IAAT,EAAeC,QAAf,EAAyB;AACpC,eAAO;AACHC,qBAAS,SADN;AAEHC,oBAAQ,wBAFL;AAGHH,kBAAMA,IAHH;AAIHI,4BAAgBH;AAJb,SAAP;AAMH,KA5CY;;AA8Cb;;;;;AAKAM,qBAAiB,yBAASP,IAAT,EAAe;AAC5B,eAAO;AACHE,qBAAS,QADN;AAEHF,kBAAMA;AAFH,SAAP;AAIH,KAxDY;;AA0Db;;;;;AAKAQ,gBAAY,oBAASR,IAAT,EAAe;AACvB,eAAO;AACHE,qBAAS,UADN;AAEHF,kBAAMA;AAFH,SAAP;AAIH,KApEY;;AAsEb;;;;;AAKAS,sBAAkB,0BAAST,IAAT,EAAe;AAC7B,eAAO;AACHE,qBAAS,SADN;AAEHF,kBAAMA;AAFH,SAAP;AAIH;AAhFY,CAAjB","file":"content-helpers.js","sourcesContent":["/*\nCopyright 2018 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\"use strict\";\n\n/** @module ContentHelpers */\nmodule.exports = {\n /**\n * Generates the content for a HTML Message event\n * @param {string} body the plaintext body of the message\n * @param {string} htmlBody the HTML representation of the message\n * @returns {{msgtype: string, format: string, body: string, formatted_body: string}}\n */\n makeHtmlMessage: function(body, htmlBody) {\n return {\n msgtype: \"m.text\",\n format: \"org.matrix.custom.html\",\n body: body,\n formatted_body: htmlBody,\n };\n },\n\n /**\n * Generates the content for a HTML Notice event\n * @param {string} body the plaintext body of the notice\n * @param {string} htmlBody the HTML representation of the notice\n * @returns {{msgtype: string, format: string, body: string, formatted_body: string}}\n */\n makeHtmlNotice: function(body, htmlBody) {\n return {\n msgtype: \"m.notice\",\n format: \"org.matrix.custom.html\",\n body: body,\n formatted_body: htmlBody,\n };\n },\n\n /**\n * Generates the content for a HTML Emote event\n * @param {string} body the plaintext body of the emote\n * @param {string} htmlBody the HTML representation of the emote\n * @returns {{msgtype: string, format: string, body: string, formatted_body: string}}\n */\n makeHtmlEmote: function(body, htmlBody) {\n return {\n msgtype: \"m.emote\",\n format: \"org.matrix.custom.html\",\n body: body,\n formatted_body: htmlBody,\n };\n },\n\n /**\n * Generates the content for a Plaintext Message event\n * @param {string} body the plaintext body of the emote\n * @returns {{msgtype: string, body: string}}\n */\n makeTextMessage: function(body) {\n return {\n msgtype: \"m.text\",\n body: body,\n };\n },\n\n /**\n * Generates the content for a Plaintext Notice event\n * @param {string} body the plaintext body of the notice\n * @returns {{msgtype: string, body: string}}\n */\n makeNotice: function(body) {\n return {\n msgtype: \"m.notice\",\n body: body,\n };\n },\n\n /**\n * Generates the content for a Plaintext Emote event\n * @param {string} body the plaintext body of the emote\n * @returns {{msgtype: string, body: string}}\n */\n makeEmoteMessage: function(body) {\n return {\n msgtype: \"m.emote\",\n body: body,\n };\n },\n};\n"]}
\No newline at end of file