Skip to content

Commit

Permalink
add license
Browse files Browse the repository at this point in the history
  • Loading branch information
riversun committed Mar 29, 2019
1 parent b5febcf commit a586374
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 15 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017-2019 Tom Misawa Tom Misawa ([email protected],https://github.com/riversun)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 8 additions & 1 deletion src/chat-client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import $ from 'jquery';

/**
* ChatClient
*
* MIT License
*
* @author Tom Misawa ([email protected],https://github.com/riversun)
*/
export default class ChatClient {

constructor(opts) {
Expand All @@ -17,7 +24,7 @@ export default class ChatClient {

this.errorResponse = {
output: [
{type: "text", value: "An error occurred."}
{type: 'text', value: 'An error occurred.'}
]
};
if (opts.errorResponse) {
Expand Down
4 changes: 3 additions & 1 deletion src/chat-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {isMobileDevice} from './chat-ux-util.js';
/**
* To show chatWindow/chatArea and start/end button for chat interface
*
* @author Tom Misawa ([email protected])
* MIT License
*
* @author Tom Misawa ([email protected],https://github.com/riversun)
*/
export default class ChatFrame {

Expand Down
26 changes: 14 additions & 12 deletions src/chat-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import BotUI from 'botui';


/**
* Chat user interface powered by BotUI ( forked ver. on https://github.com/riversun/botui)
* Chat user interface powered by BotUI (forked ver. on https://github.com/riversun/botui)
*
* MIT License
* @author Tom Misawa ([email protected])
*
* @author Tom Misawa ([email protected],https://github.com/riversun)
*/
export default class ChatUI {

Expand All @@ -21,7 +23,7 @@ export default class ChatUI {
this.botInfo.widget = {
sendLabel: 'SEND',
placeHolder: 'Please input text.'
}
};
}
}

Expand Down Expand Up @@ -171,7 +173,7 @@ export default class ChatUI {
delayMs += message.delayMs;
}

if (resType == "text") {
if (resType == 'text') {

if (outIdx == 0) {
//In the case of the first message,
Expand All @@ -191,32 +193,32 @@ export default class ChatUI {
});
}

} else if (resType == "image") {
} else if (resType == 'image') {

const type = null;
const contentValue = '![image](' + message.value + ')';
this.handleContent(outIdx, loadingIconMsgIdx, type, contentValue, delayMs);

} else if (resType == "youtube") {
} else if (resType == 'youtube') {

const type = 'embed';
const youtubeId = message.value;
const contentValue = `<iframe src="https://www.youtube.com/embed/${youtubeId}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
this.handleContent(outIdx, loadingIconMsgIdx, type, contentValue, delayMs);

} else if (resType == "embed") {
} else if (resType == 'embed') {

const type = 'embed';
const contentValue = message.value;
this.handleContent(outIdx, loadingIconMsgIdx, type, contentValue, delayMs);

} else if (resType == "html") {
} else if (resType == 'html') {

const type = 'html';
const contentValue = message.value;
this.handleContent(outIdx, loadingIconMsgIdx, type, contentValue, delayMs);

} else if (resType == "window" && (this.opts.parent && this.opts.parent.getRenderMode() === 'pc')) {
} else if (resType == 'window' && (this.opts.parent && this.opts.parent.getRenderMode() === 'pc')) {

let _delayMs = delayMs;

Expand Down Expand Up @@ -248,7 +250,7 @@ export default class ChatUI {
}

}
} else if (resType == "window" && (this.opts.parent && this.opts.parent.getRenderMode() === 'mobile')) {
} else if (resType == 'window' && (this.opts.parent && this.opts.parent.getRenderMode() === 'mobile')) {

const type = 'html';
let contentValue = null;
Expand Down Expand Up @@ -282,11 +284,11 @@ export default class ChatUI {
}


} else if (resType == "option") {
} else if (resType == 'option') {

const opts = message.options;

let aboutOption = "";
let aboutOption = '';

if (aboutOption.length > 0) {
if (outIdx == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/chat-ux.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import './app.css';
*
* MIT License
*
* @author Tom Misawa ([email protected])
* @author Tom Misawa ([email protected],https://github.com/riversun)
*/
export default class ChatUx {

Expand Down

0 comments on commit a586374

Please sign in to comment.