This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const line = require('@line/bot-sdk'); | |
| const request = require('request'); | |
| const CHANNEL_ACCESS_TOKEN = 'YOUR_CHANNEL_ACCESS_TOKEN'; | |
| const CHANNEL_SECRET = 'YOUR_CHANNEL_SECRET'; | |
| const OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY'; | |
| // 建立 LINE Bot 物件 | |
| const config = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
| Titanium.UI.setBackgroundColor('#000'); | |
| // create tab group | |
| var tabGroup = Titanium.UI.createTabGroup(); | |
| // | |
| // create base UI tab and root window | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var data = []; | |
| for(var i = 0; i < 10 ; i++){ | |
| var row = Ti.UI.createTableViewRow({ | |
| height:90 | |
| }); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var data = []; | |
| for(var i = 0; i < 10 ; i++){ | |
| data.push({title:'row ' + i, hasDetail:true}); | |
| } | |
| var table = Ti.UI.createTableView({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var web = Ti.UI.createWebView({ | |
| html:'<html>' + | |
| ' <head>' + | |
| ' <style type="text/css">' + | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var web = Ti.UI.createWebView({ | |
| url:'http://jsdc.tw/' | |
| }); | |
| win.add(web); | |
| win.open(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var image = Ti.UI.createImageView({ | |
| image:'KS_nav_ui.png', | |
| width:46, | |
| heigth:43, | |
| top:20, | |
| left:20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
| Titanium.UI.setBackgroundColor('#000'); | |
| // create tab group | |
| var tabGroup = Titanium.UI.createTabGroup(); | |
| // | |
| // create base UI tab and root window | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title:'button', | |
| width:100, | |
| height:44, | |
| top:100 | |
| }); |