Load library and new instance
<!-- Library - SJJS -->
<script src="https://cdn.jsdelivr.net/npm/@sj-js/crossman/dist/js/crossman.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/storageman/dist/js/storageman.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/keyman/dist/js/keyman.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/boxman/dist/js/boxman.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/popman/dist/js/popman.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/menuman/dist/js/menuman.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/variableman/dist/js/variableman.js"></script>
<!-- Library - SJJS-Jelly -->
<link href="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/css/jelly.css" rel="stylesheet" type="text/css"/>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-model.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-icon.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-runner-key.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-runner-speech.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-runner-schedule.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-stats.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-icon-manager.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-icon-manager-inputer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-alarm-manager.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-db-manager.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-xhr-manager.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-command-search-test.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/jelly/dist/js/jelly-speaker-plugin-word-chain.js"></script>
<script>
var jelly = new Jelly();
</script>
OR in ES6+
const Jelly = require('@sj-js/jelly');
const jelly = new Jelly();
addMenu
//TODO: κ°λ
μ 리μ€
var jelly = new JellySpeaker({modeNeedsToCallName: true, validTimeToCommand: 4000, storagePath: '/jelly/icon'})
.addPlugin([
new JellySpeaker.PluginStats(),
new JellySpeaker.PluginCommandSearchTest('search', 'κ²μ'),
new JellySpeaker.PluginWordChain(),
new JellySpeaker.PluginAlarmManager(),
new JellySpeaker.PluginDBManager(),
new JellySpeaker.PluginXHRManager(),
new JellySpeaker.PluginIconManager(),
new JellySpeaker.PluginIconManagerInputer().setLoadData(function(){
return { hi: {id:'test', type:'click'}, hello: {id:'test2', type:'click'}, };
}),
])
.setupSystemIcon([
new JellySpeaker.Icon('search').setCommand(function(parameter){
searchWithParameterURL(parameter.keyword); //μμΌλ©΄ μλμΌλ‘ Inputμ Value μ±μ·¨
}),
new JellySpeaker.Icon('search-on-naver').setCommand(function(parameter){
window.open("https://search.naver.com/search.naver?ie=UTF-8&query=" +parameter, "_blank");
}),
new JellySpeaker.Icon('search-on-google').setCommand(function(parameter){
window.open("https://www.google.com/search?q=" +parameter, "_blank");
}),
new JellySpeaker.Icon('show').setCommand(function(parameter){
// run('show', parameter);
}),
new JellySpeaker.Icon('open').setCommand(function(parameter){
window.open('https://naver.com', '_blank');
}),
new JellySpeaker.Icon('move-to-home').setCommand(function(parameter){
location.href = SEARCHER.URL_TO_HOME;
}),
new JellySpeaker.Icon('open-user-manager').setCommand(function(parameter){
openUserManager();
}),
new JellySpeaker.Icon().setCommand('search').setRunner([
new JellySpeaker.SpeechRunner('${parameter.except(μ΄λΌκ³ ).except(λΌκ³ )} κ²μ'),
new JellySpeaker.SpeechRunner(new RegExp('\\w+ κ²μ')),
]),
new JellySpeaker.Icon().setCommand('search-on-naver').setRunner([
new JellySpeaker.SpeechRunner('${parameter.except(μ΄λΌκ³ ).except(λΌκ³ )} λ€μ΄λ²μμ κ²μ'),
new JellySpeaker.SpeechRunner(new RegExp('.+ κ²μ')),
]),
])
.setupUserIcon([
/** λ°μ΄ν° 보쑰 **/
new JellySpeaker.Icon('user-manager').setTitle('μ¬μ©μ κ΄λ¦¬μ').setHTML('π§').setCommand('open-user-manager').setRunner([
new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N2]),
]),
new JellySpeaker.Icon('team-manager').setTitle('μμ κ΄λ¦¬μ').setHTML('π¨βπ©βπ§ ').setCommand('open-team-manager').setRunner([
new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N9]),
]),
new JellySpeaker.Icon('category-manager').setTitle('μΉ΄ν
κ³ λ¦¬ κ΄λ¦¬μ').setHTML('ποΈ').setCommand('open-category-manager').setRunner([
new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N3]),
]),
new JellySpeaker.Icon('product-manager').setTitle('μν κ΄λ¦¬μ').setHTML('π¦').setCommand('open-product-manager').setRunner([
new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N4]),
]),
new JellySpeaker.Icon('index-manager').setTitle('μΈλ±μ€ κ΄λ¦¬μ').setHTML('π΅οΈββοΈ').setCommand('open-index-manager').setRunner([
new JellySpeaker.KeyRunner([KeyMan.ALT, KeyMan.N6]),
]),
/** κ΄μ **/
new JellySpeaker.Icon('page-gitlab').setTitle('GitLab').setHTML('π¦').setURL('http://192.168.0.18'),
new JellySpeaker.Icon('page-jelly').setTitle('Jelly').setHTML('Jelly').setURL('http://192.168.0.18:8080/jelly'),
new JellySpeaker.Icon('page-ealsticsearch').setTitle('ElasticSearch').setHTML('ES').setURL('http://192.168.0.18:9200'),
new JellySpeaker.Icon('page-kibana').setTitle('Kibana').setHTML('Kibana').setURL('http://192.168.0.18:5601'),
new JellySpeaker.Icon('page-logstash').setTitle('Logstash').setHTML('Logstash').setURL('http://192.168.0.18:9600'),
// new JellySpeaker.Icon('page-tibero').setTitle('Tibero').setHTML('Tibero').setURL('jdbc:tibero:thin:@192.168.0.18:8629:tibero').setData({username:'nia', password:'nia'}),
new JellySpeaker.Icon('page-postgres').setTitle('Postgres').setHTML('Postgres').setURL('jdbc:postgresql://192.168.0.18:5432/postgres').setData({username:'postgres', password:'postgres'}),
/** κΈ°λ₯λ€ **/
new JellySpeaker.Icon('schedule-001').setTitle('μ£ΌκΈ°μ μΌλ‘ Data Count κ°μ Έμ').setHTML('π’').setCommand(function(){ loadCount() }).setRunner([
new JellySpeaker.ScheduleRunner(30 * 1000)
]),
// new JellySpeaker.Icon('testing').setTitle('testing').setHTML('π’').setCommand(function(){ console.error(new Date().getTime()) }).setRunner([
// new JellySpeaker.ScheduleRunner('{dayOfWeek(μΌ), cycle(23:45, 23:46, 23:50, 23:55, 00:37, 00:42)}, {dayOfWeek(μ,ν), cycle(2m)}')
// ]),
new JellySpeaker.Icon('button-002').setTitle('νμ΅ν΄λ΄!').setHTML('π©βπ').setCommand(function(){ testLearn() }).setRunner([
new JellySpeaker.SpeechRunner('νμ΅ ν΄ λ΄'),
]),
new JellySpeaker.Icon('toggle-memory-watcher').setTitle('λ©λͺ¨λ¦¬ κ°μμ').setHTML('π').setClass(JellySpeaker.PluginIconManager.CLASS_ICON_TOGGLE)
.setCommand(function(parameter, resolve){
parameter.status ? stopMemoryWatcher(resolve) : startMemoryWatcher(resolve);
})
.setModeStatusCheck(true, function(resolve){
checkMemoryWatcher(function(result){ resolve(result); });
}),
])
.loadIcon()
.detect()
.start();
For convenience, the following code, which loads and creates a Library in the example, is omitted.
...
Example)