├── public ├── css │ ├── jcrop │ │ ├── account.css │ │ └── .account.css.swp │ └── page │ │ ├── account.css │ │ ├── iphone.css │ │ └── login.css ├── js │ ├── jcrop │ │ ├── account.js │ │ └── .account.js.swp │ ├── page │ │ ├── workspace.js │ │ ├── common.js │ │ └── product.js │ └── npm.js ├── img │ ├── en.png │ ├── 404.png │ ├── 500.png │ ├── bg.001.jpg │ ├── bg2.001.jpg │ ├── chrome.png │ ├── default.jpg │ ├── default.png │ ├── design.jpg │ ├── favicon.ico │ ├── refresh.png │ ├── search.png │ ├── tisan.png │ ├── bg_right.jpg │ ├── icon │ │ ├── air.png │ │ ├── led.png │ │ ├── display.png │ │ ├── engine.png │ │ ├── switch.png │ │ ├── humidity.png │ │ ├── light_sun.png │ │ ├── temperature.png │ │ └── humidity_64px_1169891_easyicon.net.png │ ├── about_tisan.jp2 │ ├── about_tisan.jpg │ ├── commercial.jpg │ ├── default-avant.png │ ├── item-background.png │ ├── phone-background.png │ └── about-tisan │ │ ├── tisan-1.jpg │ │ ├── tisan-2.jpg │ │ ├── tisan-3.jpg │ │ └── tisan-4.jpg ├── document │ ├── image │ │ ├── L9110.pdf │ │ ├── app_0.png │ │ ├── peiz1.png │ │ ├── w_main.png │ │ ├── wei_0.png │ │ ├── wei_1.png │ │ ├── wei_2.png │ │ ├── wei_21.png │ │ ├── wei_3.png │ │ ├── wei_g0.png │ │ ├── wei_g1.png │ │ ├── wei_g2.png │ │ ├── wei_g3.png │ │ ├── wei_g4.png │ │ ├── wei_g5.png │ │ ├── wei_g6.png │ │ ├── wei_g7.png │ │ ├── wei_g8.png │ │ ├── wei_g9.png │ │ ├── Compile2.jpg │ │ ├── app_m11.png │ │ ├── app_m21.png │ │ ├── app_m31.png │ │ ├── app_main.png │ │ ├── d_click2.jpg │ │ ├── shaolu1.png │ │ ├── tisan-r1.png │ │ ├── unpack1.jpg │ │ ├── w_add_p0.png │ │ ├── w_login.png │ │ ├── w_logout.png │ │ ├── wei_g2_1.png │ │ ├── wei_g91.png │ │ ├── app_config.png │ │ ├── app_login.png │ │ ├── app_regit.png │ │ ├── app_rgb_pin.png │ │ ├── building2.jpg │ │ ├── example-01.png │ │ ├── example-adc.png │ │ ├── example-jdq.png │ │ ├── example-rgb.png │ │ ├── example_01.png │ │ ├── example_jdq.png │ │ ├── example_rgb.png │ │ ├── user_init.png │ │ ├── w_obj_edit.png │ │ ├── w_prod_key.png │ │ ├── w_regedit.png │ │ ├── w_regedit1.png │ │ ├── work_addp1.png │ │ ├── work_addp2.png │ │ ├── work_addp3.png │ │ ├── work_addp5.png │ │ ├── work_addp6.png │ │ ├── work_addp7.png │ │ ├── work_addp8.png │ │ ├── app_configing.png │ │ ├── example-dht11.png │ │ ├── example-motor.png │ │ ├── example_dht11.png │ │ ├── example_motor.png │ │ ├── gen_firmware2.jpg │ │ ├── load_project2.jpg │ │ ├── w_objcode_add.png │ │ ├── choose_cygwin2.jpg │ │ ├── import_project12.jpg │ │ ├── import_project2.jpg │ │ ├── set_workspace2.jpg │ │ ├── tisan-base-board.pdf │ │ ├── tisan-core-board.png │ │ ├── tisan-core_pcb.pdf │ │ ├── tisan_base_pcb.pdf │ │ ├── w_prod_key_edit.png │ │ ├── download_bin_all2.jpg │ │ ├── download_bin_all2.png │ │ └── download_bin_all3.png │ └── reference │ │ ├── L9110.pdf │ │ ├── tisan-core_pcb.pdf │ │ ├── tisan_base_pcb.pdf │ │ ├── tisan-base-board.pdf │ │ └── tisan-core-board.png ├── codemirror │ ├── lib │ │ └── .codemirror.js.swp │ ├── addon │ │ ├── display │ │ │ ├── fullscreen.css │ │ │ ├── fullscreen.js │ │ │ └── autorefresh.js │ │ ├── search │ │ │ └── matchesonscrollbar.css │ │ ├── fold │ │ │ ├── foldgutter.css │ │ │ ├── indent-fold.js │ │ │ └── markdown-fold.js │ │ ├── dialog │ │ │ └── dialog.css │ │ ├── hint │ │ │ ├── show-hint.css │ │ │ └── anyword-hint.js │ │ ├── mode │ │ │ └── multiplex_test.js │ │ ├── lint │ │ │ ├── yaml-lint.js │ │ │ ├── json-lint.js │ │ │ ├── css-lint.js │ │ │ ├── coffeescript-lint.js │ │ │ └── html-lint.js │ │ ├── edit │ │ │ ├── trailingspace.js │ │ │ └── continuelist.js │ │ ├── tern │ │ │ └── worker.js │ │ ├── runmode │ │ │ └── colorize.js │ │ └── scroll │ │ │ ├── simplescrollbars.css │ │ │ └── scrollpastend.js │ └── mode │ │ ├── tiddlywiki │ │ └── tiddlywiki.css │ │ ├── ruby │ │ └── test.js │ │ ├── css │ │ └── gss_test.js │ │ ├── tiki │ │ └── tiki.css │ │ ├── rust │ │ ├── test.js │ │ └── index.html │ │ ├── diff │ │ └── diff.js │ │ ├── mscgen │ │ └── index_msgenny.html │ │ ├── asciiarmor │ │ └── index.html │ │ ├── htmlembedded │ │ └── htmlembedded.js │ │ ├── ntriples │ │ └── index.html │ │ ├── twig │ │ └── index.html │ │ ├── spreadsheet │ │ └── index.html │ │ ├── http │ │ └── index.html │ │ ├── clike │ │ └── test.js │ │ ├── solr │ │ └── index.html │ │ ├── ecl │ │ └── index.html │ │ ├── z80 │ │ └── index.html │ │ ├── oz │ │ └── index.html │ │ ├── turtle │ │ └── index.html │ │ ├── pascal │ │ └── index.html │ │ ├── pig │ │ └── index.html │ │ ├── vbscript │ │ └── index.html │ │ ├── gherkin │ │ └── index.html │ │ ├── properties │ │ └── index.html │ │ ├── javascript │ │ └── typescript.html │ │ ├── sass │ │ └── index.html │ │ ├── perl │ │ └── index.html │ │ ├── elm │ │ └── index.html │ │ ├── idl │ │ └── index.html │ │ ├── dart │ │ ├── index.html │ │ └── dart.js │ │ ├── handlebars │ │ └── handlebars.js │ │ ├── xml │ │ └── test.js │ │ ├── jinja2 │ │ └── index.html │ │ └── shell │ │ └── test.js ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── iotboard │ ├── dummy.model.min.js │ ├── iotboard.min.css │ ├── iotboard.css │ └── index.html ├── views ├── error.ejs ├── template │ ├── text.ejs │ ├── .thermometer.ejs.swp │ ├── code_h.ejs │ ├── plug.ejs │ ├── air.ejs │ ├── pm25.ejs │ ├── motor.ejs │ ├── default.ejs │ ├── humiture.ejs │ ├── temperature.ejs │ ├── thermohygrometer.ejs │ └── led.ejs ├── layout.ejs ├── document │ ├── faq.md │ ├── start.md │ ├── web-ide.md │ ├── interface.md │ ├── wechat-support.md │ ├── quick-start.md │ ├── demo.md │ ├── fireware.md │ ├── enviroment.md │ └── firmware.md ├── 404.ejs ├── 500.ejs ├── download_chrome.ejs ├── commercial.ejs ├── iot.ejs └── about.ejs ├── bin ├── start.sh └── www ├── service ├── mail.js ├── grpc.js └── authcheck.js ├── source ├── widgets │ ├── led │ │ ├── colorwheel.png │ │ ├── img │ │ │ └── colorwheel.png │ │ ├── led.widget.min.css │ │ ├── led.widget.min.js │ │ ├── led.template │ │ └── led.widget.css │ ├── text │ │ ├── text.widget.min.css │ │ ├── text.widget.css │ │ ├── text.widget.min.js │ │ └── text.widget.js │ ├── atmosphere │ │ ├── atmosphere.widget.min.js │ │ ├── atmosphere.widget.js │ │ ├── thermometer.svg │ │ ├── atmosphere.widget.min.css │ │ ├── water.svg │ │ ├── air.svg │ │ └── atmosphere.widget.css │ ├── default │ │ ├── default.widget.css │ │ └── default.widget.js │ ├── air │ │ └── air.widget.js │ ├── pm25 │ │ └── pm25.widget.js │ ├── humiture │ │ └── humiture.widget.js │ ├── temperature │ │ └── temperature.widget.js │ ├── plug │ │ ├── plug.widget.js │ │ └── plug.widget.css │ ├── thermohygrometer │ │ └── thermohygrometer.widget.js │ └── motor │ │ └── motor.widget.js ├── js │ ├── utils.js │ └── widget.js ├── css │ ├── board.css │ └── reset.css └── merged │ └── css │ └── iotboard.css ├── db ├── mysql.js └── redis.js ├── config ├── index.js ├── error.js └── deploy.example.json ├── models ├── mysql │ ├── hardware.js │ ├── object.js │ ├── product.js │ └── user.js └── rpc │ └── product.proto ├── README.md ├── package.json ├── .gitignore ├── LICENSE └── routes ├── workspace.js └── index.js /public/css/jcrop/account.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/js/jcrop/account.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 | <%=message%> 2 | <%=error%> 3 | -------------------------------------------------------------------------------- /public/js/page/workspace.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 3 | })() 4 | -------------------------------------------------------------------------------- /bin/start.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/bin/start.sh -------------------------------------------------------------------------------- /public/img/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/en.png -------------------------------------------------------------------------------- /service/mail.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/service/mail.js -------------------------------------------------------------------------------- /public/img/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/404.png -------------------------------------------------------------------------------- /public/img/500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/500.png -------------------------------------------------------------------------------- /public/img/bg.001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/bg.001.jpg -------------------------------------------------------------------------------- /public/img/bg2.001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/bg2.001.jpg -------------------------------------------------------------------------------- /public/img/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/chrome.png -------------------------------------------------------------------------------- /public/img/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/default.jpg -------------------------------------------------------------------------------- /public/img/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/default.png -------------------------------------------------------------------------------- /public/img/design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/design.jpg -------------------------------------------------------------------------------- /public/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/favicon.ico -------------------------------------------------------------------------------- /public/img/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/refresh.png -------------------------------------------------------------------------------- /public/img/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/search.png -------------------------------------------------------------------------------- /public/img/tisan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/tisan.png -------------------------------------------------------------------------------- /public/img/bg_right.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/bg_right.jpg -------------------------------------------------------------------------------- /public/img/icon/air.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/air.png -------------------------------------------------------------------------------- /public/img/icon/led.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/led.png -------------------------------------------------------------------------------- /views/template/text.ejs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/views/template/text.ejs -------------------------------------------------------------------------------- /public/img/about_tisan.jp2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/about_tisan.jp2 -------------------------------------------------------------------------------- /public/img/about_tisan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/about_tisan.jpg -------------------------------------------------------------------------------- /public/img/commercial.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/commercial.jpg -------------------------------------------------------------------------------- /public/img/icon/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/display.png -------------------------------------------------------------------------------- /public/img/icon/engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/engine.png -------------------------------------------------------------------------------- /public/img/icon/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/switch.png -------------------------------------------------------------------------------- /public/img/default-avant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/default-avant.png -------------------------------------------------------------------------------- /public/img/icon/humidity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/humidity.png -------------------------------------------------------------------------------- /public/img/icon/light_sun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/light_sun.png -------------------------------------------------------------------------------- /public/document/image/L9110.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/L9110.pdf -------------------------------------------------------------------------------- /public/document/image/app_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_0.png -------------------------------------------------------------------------------- /public/document/image/peiz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/peiz1.png -------------------------------------------------------------------------------- /public/document/image/w_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_main.png -------------------------------------------------------------------------------- /public/document/image/wei_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_0.png -------------------------------------------------------------------------------- /public/document/image/wei_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_1.png -------------------------------------------------------------------------------- /public/document/image/wei_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_2.png -------------------------------------------------------------------------------- /public/document/image/wei_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_21.png -------------------------------------------------------------------------------- /public/document/image/wei_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_3.png -------------------------------------------------------------------------------- /public/document/image/wei_g0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g0.png -------------------------------------------------------------------------------- /public/document/image/wei_g1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g1.png -------------------------------------------------------------------------------- /public/document/image/wei_g2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g2.png -------------------------------------------------------------------------------- /public/document/image/wei_g3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g3.png -------------------------------------------------------------------------------- /public/document/image/wei_g4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g4.png -------------------------------------------------------------------------------- /public/document/image/wei_g5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g5.png -------------------------------------------------------------------------------- /public/document/image/wei_g6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g6.png -------------------------------------------------------------------------------- /public/document/image/wei_g7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g7.png -------------------------------------------------------------------------------- /public/document/image/wei_g8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g8.png -------------------------------------------------------------------------------- /public/document/image/wei_g9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g9.png -------------------------------------------------------------------------------- /public/img/icon/temperature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/temperature.png -------------------------------------------------------------------------------- /public/img/item-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/item-background.png -------------------------------------------------------------------------------- /public/img/phone-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/phone-background.png -------------------------------------------------------------------------------- /public/js/jcrop/.account.js.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/js/jcrop/.account.js.swp -------------------------------------------------------------------------------- /public/css/jcrop/.account.css.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/css/jcrop/.account.css.swp -------------------------------------------------------------------------------- /public/document/image/Compile2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/Compile2.jpg -------------------------------------------------------------------------------- /public/document/image/app_m11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_m11.png -------------------------------------------------------------------------------- /public/document/image/app_m21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_m21.png -------------------------------------------------------------------------------- /public/document/image/app_m31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_m31.png -------------------------------------------------------------------------------- /public/document/image/app_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_main.png -------------------------------------------------------------------------------- /public/document/image/d_click2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/d_click2.jpg -------------------------------------------------------------------------------- /public/document/image/shaolu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/shaolu1.png -------------------------------------------------------------------------------- /public/document/image/tisan-r1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/tisan-r1.png -------------------------------------------------------------------------------- /public/document/image/unpack1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/unpack1.jpg -------------------------------------------------------------------------------- /public/document/image/w_add_p0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_add_p0.png -------------------------------------------------------------------------------- /public/document/image/w_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_login.png -------------------------------------------------------------------------------- /public/document/image/w_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_logout.png -------------------------------------------------------------------------------- /public/document/image/wei_g2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g2_1.png -------------------------------------------------------------------------------- /public/document/image/wei_g91.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/wei_g91.png -------------------------------------------------------------------------------- /public/img/about-tisan/tisan-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/about-tisan/tisan-1.jpg -------------------------------------------------------------------------------- /public/img/about-tisan/tisan-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/about-tisan/tisan-2.jpg -------------------------------------------------------------------------------- /public/img/about-tisan/tisan-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/about-tisan/tisan-3.jpg -------------------------------------------------------------------------------- /public/img/about-tisan/tisan-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/about-tisan/tisan-4.jpg -------------------------------------------------------------------------------- /source/widgets/led/colorwheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/source/widgets/led/colorwheel.png -------------------------------------------------------------------------------- /public/document/image/app_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_config.png -------------------------------------------------------------------------------- /public/document/image/app_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_login.png -------------------------------------------------------------------------------- /public/document/image/app_regit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_regit.png -------------------------------------------------------------------------------- /public/document/image/app_rgb_pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_rgb_pin.png -------------------------------------------------------------------------------- /public/document/image/building2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/building2.jpg -------------------------------------------------------------------------------- /public/document/image/example-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example-01.png -------------------------------------------------------------------------------- /public/document/image/example-adc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example-adc.png -------------------------------------------------------------------------------- /public/document/image/example-jdq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example-jdq.png -------------------------------------------------------------------------------- /public/document/image/example-rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example-rgb.png -------------------------------------------------------------------------------- /public/document/image/example_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example_01.png -------------------------------------------------------------------------------- /public/document/image/example_jdq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example_jdq.png -------------------------------------------------------------------------------- /public/document/image/example_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example_rgb.png -------------------------------------------------------------------------------- /public/document/image/user_init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/user_init.png -------------------------------------------------------------------------------- /public/document/image/w_obj_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_obj_edit.png -------------------------------------------------------------------------------- /public/document/image/w_prod_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_prod_key.png -------------------------------------------------------------------------------- /public/document/image/w_regedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_regedit.png -------------------------------------------------------------------------------- /public/document/image/w_regedit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_regedit1.png -------------------------------------------------------------------------------- /public/document/image/work_addp1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp1.png -------------------------------------------------------------------------------- /public/document/image/work_addp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp2.png -------------------------------------------------------------------------------- /public/document/image/work_addp3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp3.png -------------------------------------------------------------------------------- /public/document/image/work_addp5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp5.png -------------------------------------------------------------------------------- /public/document/image/work_addp6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp6.png -------------------------------------------------------------------------------- /public/document/image/work_addp7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp7.png -------------------------------------------------------------------------------- /public/document/image/work_addp8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/work_addp8.png -------------------------------------------------------------------------------- /public/document/reference/L9110.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/reference/L9110.pdf -------------------------------------------------------------------------------- /source/widgets/led/img/colorwheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/source/widgets/led/img/colorwheel.png -------------------------------------------------------------------------------- /views/template/.thermometer.ejs.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/views/template/.thermometer.ejs.swp -------------------------------------------------------------------------------- /public/document/image/app_configing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/app_configing.png -------------------------------------------------------------------------------- /public/document/image/example-dht11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example-dht11.png -------------------------------------------------------------------------------- /public/document/image/example-motor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example-motor.png -------------------------------------------------------------------------------- /public/document/image/example_dht11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example_dht11.png -------------------------------------------------------------------------------- /public/document/image/example_motor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/example_motor.png -------------------------------------------------------------------------------- /public/document/image/gen_firmware2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/gen_firmware2.jpg -------------------------------------------------------------------------------- /public/document/image/load_project2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/load_project2.jpg -------------------------------------------------------------------------------- /public/document/image/w_objcode_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_objcode_add.png -------------------------------------------------------------------------------- /source/widgets/text/text.widget.min.css: -------------------------------------------------------------------------------- 1 | .widget[iotb-widget=text]{color:#000;padding:4px}.widget[iotb-widget=text] .text{margin-top:4px} -------------------------------------------------------------------------------- /public/codemirror/lib/.codemirror.js.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/codemirror/lib/.codemirror.js.swp -------------------------------------------------------------------------------- /public/document/image/choose_cygwin2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/choose_cygwin2.jpg -------------------------------------------------------------------------------- /public/document/image/import_project12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/import_project12.jpg -------------------------------------------------------------------------------- /public/document/image/import_project2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/import_project2.jpg -------------------------------------------------------------------------------- /public/document/image/set_workspace2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/set_workspace2.jpg -------------------------------------------------------------------------------- /public/document/image/tisan-base-board.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/tisan-base-board.pdf -------------------------------------------------------------------------------- /public/document/image/tisan-core-board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/tisan-core-board.png -------------------------------------------------------------------------------- /public/document/image/tisan-core_pcb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/tisan-core_pcb.pdf -------------------------------------------------------------------------------- /public/document/image/tisan_base_pcb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/tisan_base_pcb.pdf -------------------------------------------------------------------------------- /public/document/image/w_prod_key_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/w_prod_key_edit.png -------------------------------------------------------------------------------- /public/document/image/download_bin_all2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/download_bin_all2.jpg -------------------------------------------------------------------------------- /public/document/image/download_bin_all2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/download_bin_all2.png -------------------------------------------------------------------------------- /public/document/image/download_bin_all3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/image/download_bin_all3.png -------------------------------------------------------------------------------- /public/document/reference/tisan-core_pcb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/reference/tisan-core_pcb.pdf -------------------------------------------------------------------------------- /public/document/reference/tisan_base_pcb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/reference/tisan_base_pcb.pdf -------------------------------------------------------------------------------- /public/document/reference/tisan-base-board.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/reference/tisan-base-board.pdf -------------------------------------------------------------------------------- /public/document/reference/tisan-core-board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/document/reference/tisan-core-board.png -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /views/template/code_h.ejs: -------------------------------------------------------------------------------- 1 | #ifndef OBJECTS_<#=label #>_H_ 2 | #define OBJECTS_<#=label #>_H_ 3 | 4 | void <#=label #>_object_init(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /public/img/icon/humidity_64px_1169891_easyicon.net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tisan-kit/tisan-web-ide/HEAD/public/img/icon/humidity_64px_1169891_easyicon.net.png -------------------------------------------------------------------------------- /views/layout.ejs: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /public/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /source/widgets/text/text.widget.css: -------------------------------------------------------------------------------- 1 | .widget[iotb-widget="text"] { 2 | color: black; 3 | padding: 4px; 4 | } 5 | 6 | .widget[iotb-widget="text"] .text { 7 | margin-top: 4px; 8 | } -------------------------------------------------------------------------------- /source/js/utils.js: -------------------------------------------------------------------------------- 1 | function clone(myObj){ 2 | if(typeof(myObj) != 'object') return myObj; 3 | if(myObj == null) return myObj; 4 | var myNewObj = new Object(); 5 | for(var i in myObj) 6 | myNewObj[i] = clone(myObj[i]); 7 | return myNewObj; 8 | } 9 | -------------------------------------------------------------------------------- /public/codemirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /public/js/page/common.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var hm = document.createElement("script"); 3 | hm.src = "//hm.baidu.com/hm.js?ec177b38528ef37ccba62efa4f7b21a0"; 4 | var s = document.getElementsByTagName("script")[0]; 5 | s.parentNode.insertBefore(hm, s); 6 | })(); 7 | 8 | -------------------------------------------------------------------------------- /public/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /source/widgets/atmosphere/atmosphere.widget.min.js: -------------------------------------------------------------------------------- 1 | /*! iot-board 2015-09-13 */ 2 | !function(){return window.iotboard?(window.iotboard.defineWidget("atmosphere",{status:{temperature:0,humidity:0,pm25:0},render:function(a){var a=clone(a);return a.status=this.status,template("template-atmosphere",a)}}),void console.log("add widget {atmosphere}")):void console.log("iotboard not initialized!")}(); -------------------------------------------------------------------------------- /db/mysql.js: -------------------------------------------------------------------------------- 1 | var Sequelize = require("sequelize"); 2 | var config = require("../config/index").mysql; 3 | 4 | var sequelize = new Sequelize( 5 | config.database, 6 | config.user, 7 | config.password, 8 | { 9 | host: config.host, 10 | port: config.port, 11 | //dialect: 'mysql', 12 | pool: { maxConnections: 5, maxIdleTime: 30}, 13 | sync: { force: true } 14 | } 15 | ); 16 | 17 | module.exports = sequelize; 18 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | var finalConfig={}; 4 | if(fs.existsSync(__dirname+'/deploy.json')){ 5 | finalConfig = require('./depoy.json') 6 | if(!finalConfig['env']&&finalConfig['env']==='development'){ 7 | finalConfig['env']='development'; 8 | } 9 | }else{ 10 | console.error('Can\'t find deploy config file in ./config'); 11 | process.exit(0); 12 | } 13 | 14 | console.log(finalConfig); 15 | 16 | module.exports=finalConfig; 17 | 18 | -------------------------------------------------------------------------------- /source/widgets/text/text.widget.min.js: -------------------------------------------------------------------------------- 1 | /*! iot-board 2015-09-13 */ 2 | !function(){return window.iotboard?(window.iotboard.defineWidget("text",{status:{text:"loading..."},render:function(a){var b=clone(a);return b.status=this.status,template("template-text",b)},listeners:[{selector:".text",event:"click",behavior:"set"},{selector:".title",event:"click",behavior:"get"}],parseStatus:function(a){return{text:a.find(".text").html()}}}),void console.log("add widget {text}")):void console.log("iotboard not initialized!")}(); -------------------------------------------------------------------------------- /db/redis.js: -------------------------------------------------------------------------------- 1 | var redis = require('redis'); 2 | var config = require('../config/index').redis; 3 | 4 | //TODO 连接数量控制 5 | exports.init=function(address){ 6 | if(!address){ 7 | address={} 8 | } 9 | var client = redis.createClient(address.port || config.port,address.host || config.host); 10 | client.get('connecting-test',function(result){ 11 | if(result===null){ 12 | console.log('redis server connected at host : '+config.host+',port : '+config.port); 13 | } 14 | }) 15 | return client; 16 | } 17 | -------------------------------------------------------------------------------- /public/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /public/codemirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("divide_equal_operator", 9 | "[variable bar] [operator /=] [variable foo]"); 10 | 11 | MT("divide_equal_operator_no_spacing", 12 | "[variable foo][operator /=][number 42]"); 13 | 14 | })(); 15 | -------------------------------------------------------------------------------- /models/mysql/hardware.js: -------------------------------------------------------------------------------- 1 | var Sequelize = require("sequelize"); 2 | var DbSequelize = require("../../db/mysql.js");//todo path 3 | 4 | var Hardware = DbSequelize.define("tbl_hardware",{ 5 | "id": { type:Sequelize.INTEGER, primaryKey: true, autoIncreament: true }, 6 | "name": { type: Sequelize.CHAR(255)}, 7 | "user_id": { type: Sequelize.INTEGER(11)}, 8 | "code": { type: Sequelize.CHAR(50)}, 9 | },{ 10 | timestamps: false, 11 | underscored: true, 12 | freezeTableName: true, 13 | tableName: "tbl_hardware" 14 | }); 15 | exports.Hardware= Hardware; 16 | -------------------------------------------------------------------------------- /public/codemirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /public/codemirror/mode/css/gss_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } 9 | 10 | MT("atComponent", 11 | "[def @component] {", 12 | "[tag foo] {", 13 | " [property color]: [keyword black];", 14 | "}", 15 | "}"); 16 | 17 | })(); 18 | -------------------------------------------------------------------------------- /public/codemirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px ! important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /source/widgets/atmosphere/atmosphere.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | window.iotboard.defineWidget("atmosphere", { 8 | status: { 9 | temperature: 0.0, 10 | humidity: 0.0, 11 | pm25: 0.0 12 | }, 13 | render: function(dataset){ 14 | var dataset=clone(dataset); 15 | dataset.status=this.status; 16 | return template('template-atmosphere',dataset); 17 | } 18 | }); 19 | 20 | console.log("add widget {atmosphere}"); 21 | }(); 22 | -------------------------------------------------------------------------------- /views/document/faq.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## 现在的固件是基于1.3.0开发的吗? 4 | 是基于乐鑫SDK1.3.0 开发的。 5 | ## 微信公众号中可以添加多个设备吗? 6 | 可以。 7 | ## 微信添加设备后显示“未绑定” 8 | 正常现象,不是问题,未绑定是因为没有用微信后台的接口关联设备,我们测试的账号是一对多个设备,所以没走微信那套。不影响使用。 9 | ## 为什么用以前版本的烧录软件烧录的板子微信扫描失败? 10 | - 请务必保证板子已经配置上网; 11 | - 乐鑫出的老模块用以前的烧录软件生成二维码可以用微信扫描没有问题; 12 | - 乐鑫新出的模块(由于老模块把以前的号用尽了)需要新的生成规则,所以需要使用新的烧录软件。 13 | 14 | ## app配置WiFi会用到设备的MAC吗? 15 | - app配置WiFi使用设备的MAC地址,配置过程中,设备程序会给app返回MAC地址; 16 | - 微信公众号添加设备扫描的二维码信息包含了烧录软件生成MAC地址,所以如果烧录软件生成的MAC地址与设备程序返回的MAC地址不一致,就会导致微信添加设备失败的情况。**注意使用最新的烧录软件来烧录固件**。 17 | 18 | ## 同一个产品Key可以对应多个模块吗? 19 | 可以。 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tisan-web-ide 2 | The Web IDE Source Code. Written in NodeJS. 3 | 4 | ## dependency 5 | * [NodeJS](nodejs.org) 6 | * [express](http://expressjs.com/) 7 | * [mysql](http://www.mysql.com/) 8 | * [redis](http://http://redis.io/) 9 | * [pando iot cloud](https://github.com/PandoCloud/pando-cloud): open source IoT cloud. 10 | * [iot board](https://github.com/ruizeng/iot-board): HTML5 ui interface for IoT devices. 11 | 12 | ## how to install 13 | 1. install pando iot cloud. 14 | 2. download source. 15 | 3. `npm install` 16 | 4. create a `config/deploy.json` file, following the `config/deploy.example.json` example 17 | 5. `node app.js` 18 | -------------------------------------------------------------------------------- /views/template/plug.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 16 | -------------------------------------------------------------------------------- /source/widgets/default/default.widget.css: -------------------------------------------------------------------------------- 1 | .default-status-wrap{ 2 | display:-webkit-box; 3 | -webkit-box-orient:horizontal; 4 | width:100%; 5 | } 6 | .default-status-input{ 7 | width:100%; 8 | border:0; 9 | } 10 | .default-status-name{ 11 | -webkit-box-flex:1; 12 | text-align:start; 13 | width:200px; 14 | padding-left:4px; 15 | line-height:46px; 16 | } 17 | .default-status-input-wrap{ 18 | position:relative; 19 | -webkit-box-flex:1; 20 | padding:3px; 21 | } 22 | .default-status-input{ 23 | width: 100%; 24 | height: 40px; 25 | background: #eee; 26 | border-radius: 4px; 27 | padding: 10px; 28 | } 29 | .widget[iotb-widget=default] .btn-set { 30 | float: right; 31 | } 32 | -------------------------------------------------------------------------------- /public/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: inherit; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: inherit; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iot-board", 3 | "devDependencies": { 4 | "grunt": "^0.4.5", 5 | "grunt-cli": "^0.1.13", 6 | "grunt-contrib-concat": "^0.5.1", 7 | "grunt-contrib-copy": "^0.8.1", 8 | "grunt-contrib-cssmin": "^0.13.0", 9 | "grunt-contrib-uglify": "^0.9.2" 10 | }, 11 | "dependencies": { 12 | "autolinker": "^0.18.1", 13 | "connect-redis": "^3.0.1", 14 | "express-session": "^1.12.1", 15 | "formidable": "^1.0.17", 16 | "json5": "^0.4.0", 17 | "mysql": "^2.9.0", 18 | "nodemailer": "^1.10.0", 19 | "redis": "^2.3.1", 20 | "remarkable": "^1.6.1", 21 | "sequelize": "^3.14.1", 22 | "underscore": "^1.8.3" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /views/template/air.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | # Config File 30 | config/deploy.json 31 | -------------------------------------------------------------------------------- /models/mysql/object.js: -------------------------------------------------------------------------------- 1 | var Sequelize = require("sequelize"); 2 | var DbSequelize = require("../../db/mysql.js");//todo path 3 | 4 | var Objects = DbSequelize.define("tbl_object",{ 5 | "id": { type:Sequelize.INTEGER, primaryKey: true, autoIncreament: true }, 6 | "name": { type: Sequelize.CHAR(100)}, 7 | "c_code": { type: Sequelize.CHAR(1000)}, 8 | "status": { type: Sequelize.CHAR(5000)}, 9 | "label": { type: Sequelize.CHAR(100)}, 10 | "is_public": { type: Sequelize.INTEGER}, 11 | "user_id":{type:Sequelize.INTEGER}, 12 | "delete":{type:Sequelize.CHAR(2)}, 13 | },{ 14 | timestamps: false, 15 | underscored: true, 16 | freezeTableName: true, 17 | tableName: "tbl_object" 18 | }); 19 | exports.Objects = Objects; 20 | -------------------------------------------------------------------------------- /views/template/pm25.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | -------------------------------------------------------------------------------- /source/css/board.css: -------------------------------------------------------------------------------- 1 | html { 2 | min-height: 100%; 3 | } 4 | 5 | body { 6 | padding: 10px; 7 | background:url(img/bg2.jpeg); 8 | background-size:100% 100%; 9 | background-repeat:no-repeat; 10 | overflow-y: scroll; 11 | overflow-x: hidden; 12 | } 13 | 14 | .widget { 15 | background-color: white; 16 | opacity: 0.8; 17 | border: 1px solid #ccc; 18 | padding: 4px; 19 | border-radius: 4px; 20 | font-size: 14px; 21 | margin-bottom: 10px; 22 | position: relative; 23 | width:100%; 24 | overflow-x:hidden; 25 | overflow-y:hidden; 26 | } 27 | 28 | .widget .title { 29 | font-weight: bold; 30 | border-bottom: solid 1px gray; 31 | font-size: 18px; 32 | height: 24px; 33 | line-height: 24px; 34 | text-align: center; 35 | } 36 | -------------------------------------------------------------------------------- /source/widgets/air/air.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='air'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | mark:'-' 11 | }, 12 | render: function(dataset){ 13 | var dataset=clone(dataset); 14 | dataset.status=this.status; 15 | return template('template-'+widgetName,dataset); 16 | }, 17 | listeners: [ 18 | { 19 | selector: ".btn-refresh", 20 | event: "click", 21 | behavior: "get" 22 | } 23 | ], 24 | parseStatus: function(dom){ 25 | return { 26 | mark: dom.find(".mark").val() 27 | } 28 | }, 29 | }); 30 | }(); 31 | -------------------------------------------------------------------------------- /source/widgets/pm25/pm25.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='pm25'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | pm25:'-' 11 | }, 12 | render: function(dataset){ 13 | var dataset=clone(dataset); 14 | dataset.status=this.status; 15 | return template('template-'+widgetName,dataset); 16 | }, 17 | listeners: [ 18 | { 19 | selector: ".btn-refresh", 20 | event: "click", 21 | behavior: "get" 22 | } 23 | ], 24 | parseStatus: function(dom){ 25 | return { 26 | on: dom.find(".pm25").val() 27 | } 28 | }, 29 | }); 30 | }(); 31 | -------------------------------------------------------------------------------- /config/error.js: -------------------------------------------------------------------------------- 1 | module.exports={ 2 | user_exist:{ 3 | code:1001, 4 | msg:'user already exist', 5 | }, 6 | wrong_username:{ 7 | code:1050, 8 | msg:'wrong username or user not exist' 9 | }, 10 | wrong_password:{ 11 | code:1010, 12 | msg:'wrong password' 13 | }, 14 | data_format_error:{ 15 | code:2001, 16 | msg:'input data format error' 17 | }, 18 | mail_send:{ 19 | code:3000, 20 | msg:'activation email has been sent successfully' 21 | }, 22 | send_mail_many_times:{ 23 | code:3001, 24 | msg:'send mail check too many times' 25 | }, 26 | send_mail_check_invalid:{ 27 | code:3020, 28 | msg:'long time no use activty url' 29 | }, 30 | mac_code_not_set:{ 31 | code:4000, 32 | msg:'mac code not set' 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source/widgets/humiture/humiture.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='humiture'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | humiture:'-' 11 | }, 12 | render: function(dataset){ 13 | var dataset=clone(dataset); 14 | dataset.status=this.status; 15 | return template('template-'+widgetName,dataset); 16 | }, 17 | listeners: [ 18 | { 19 | selector: ".btn-refresh", 20 | event: "click", 21 | behavior: "get" 22 | } 23 | ], 24 | parseStatus: function(dom){ 25 | return { 26 | humiture:dom.find('.humiture-text').text() 27 | } 28 | }, 29 | }); 30 | }(); 31 | -------------------------------------------------------------------------------- /models/mysql/product.js: -------------------------------------------------------------------------------- 1 | var Sequelize = require("sequelize"); 2 | var DbSequelize = require("../../db/mysql.js");//todo path 3 | 4 | var Product = DbSequelize.define("tbl_product",{ 5 | "id": { type:Sequelize.INTEGER, primaryKey: true, autoIncreament: true }, 6 | "user_id": { type: Sequelize.INTEGER(11)}, 7 | "product_id": { type: Sequelize.INTEGER(11)}, 8 | "name": { type: Sequelize.CHAR(100)}, 9 | "descript": { type: Sequelize.CHAR(100)}, 10 | "avatar": { type: Sequelize.CHAR(100)}, 11 | "objects": { type: Sequelize.CHAR(5000)}, 12 | "commands": { type: Sequelize.CHAR(2000)}, 13 | "events": { type: Sequelize.CHAR(1000)} 14 | },{ 15 | timestamps: false, 16 | underscored: true, 17 | freezeTableName: true, 18 | tableName: "tbl_product" 19 | }); 20 | exports.Product = Product; 21 | -------------------------------------------------------------------------------- /source/widgets/temperature/temperature.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='temperature'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | temperature:'-' 11 | }, 12 | render: function(dataset){ 13 | var dataset=clone(dataset); 14 | dataset.status=this.status; 15 | return template('template-'+widgetName,dataset); 16 | }, 17 | listeners: [ 18 | { 19 | selector: ".btn-refresh", 20 | event: "click", 21 | behavior: "get" 22 | } 23 | ], 24 | parseStatus: function(dom){ 25 | return { 26 | temperature:dom.find('.temperature-text').text() 27 | } 28 | }, 29 | }); 30 | }(); 31 | -------------------------------------------------------------------------------- /views/template/motor.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | -------------------------------------------------------------------------------- /models/rpc/product.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package pb; 3 | message CommonResult { 4 | int32 code = 1; 5 | string msg = 2; 6 | } 7 | 8 | message IdList { 9 | repeated int32 list = 1; 10 | } 11 | 12 | message Product { 13 | int32 id = 1; 14 | int32 vendor_id = 2; 15 | string name = 3; 16 | string code = 4; 17 | string description = 5; 18 | string key = 6; 19 | bool verified = 7; 20 | string icon = 8; 21 | string webapp = 9; 22 | int32 secure_level = 10; 23 | string config = 11; 24 | } 25 | 26 | message ProductList { 27 | repeated Product products = 1; 28 | } 29 | 30 | service ProductCMDS { 31 | rpc CreateProduct(Product) returns (Product); 32 | rpc DeleteProduct(IdList) returns (CommonResult); 33 | rpc UpdateProduct(Product) returns (CommonResult); 34 | rpc ReadProduct(IdList) returns (ProductList); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /source/widgets/plug/plug.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var cnt = 0; 8 | 9 | window.iotboard.defineWidget("plug", { 10 | status: { 11 | on: false 12 | }, 13 | render: function(dataset){ 14 | cnt ++; 15 | var dataset=clone(dataset); 16 | dataset.status=this.status; 17 | dataset.cnt=cnt; 18 | return template('template-plug',dataset); 19 | }, 20 | listeners: [ 21 | { 22 | selector: ".plug-wrap label", 23 | event: "click", 24 | behavior: "set" 25 | } 26 | ], 27 | parseStatus: function(dom){ 28 | return { 29 | on: dom.find(".slider-v1").is( ":checked" )?0:1 30 | } 31 | }, 32 | }); 33 | 34 | console.log("add widget {plug}"); 35 | }(); 36 | -------------------------------------------------------------------------------- /public/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /source/widgets/atmosphere/thermometer.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /service/grpc.js: -------------------------------------------------------------------------------- 1 | var grpc = require('grpc'); 2 | var product_grpc = grpc.load(__dirname+'/../models/rpc/product.proto').pb; 3 | var config = require('../config/index'); 4 | var client = new product_grpc.ProductCMDS(config.grpc[0],grpc.Credentials.createInsecure()); 5 | 6 | exports.readProduct=function(userList,callback){ 7 | client.readProduct(userList,function(err,result){ 8 | callback(result); 9 | }) 10 | } 11 | exports.createProduct=function(product,callback){ 12 | client.createProduct(product,function(err,result){ 13 | callback(result); 14 | }) 15 | } 16 | exports.deleteProduct=function(idList,callback){ 17 | client.deleteProduct(idList,function(err,result){ 18 | callback(result); 19 | }) 20 | } 21 | exports.updateProduct=function(product,callback){ 22 | client.updateProduct(product,function(err,result){ 23 | callback(result); 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /source/widgets/text/text.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | window.iotboard.defineWidget("text", { 8 | status: { 9 | text: "loading..." 10 | }, 11 | render: function(dataset){ 12 | var data=clone(dataset); 13 | data.status=this.status; 14 | return template('template-text',data); 15 | }, 16 | listeners: [ 17 | { 18 | selector: ".text", 19 | event: "click", 20 | behavior: "set" 21 | }, 22 | { 23 | selector: ".title", 24 | event: "click", 25 | behavior: "get" 26 | } 27 | ], 28 | parseStatus: function(dom){ 29 | return { 30 | text: dom.find(".text").html() 31 | } 32 | }, 33 | }); 34 | 35 | console.log("add widget {text}"); 36 | }(); 37 | -------------------------------------------------------------------------------- /views/template/default.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | -------------------------------------------------------------------------------- /source/widgets/thermohygrometer/thermohygrometer.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='thermohygrometer'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | thermometer:'-', 11 | hygrometer:'-' 12 | }, 13 | render: function(dataset){ 14 | var dataset=clone(dataset); 15 | dataset.status=this.status; 16 | return template('template-'+widgetName,dataset); 17 | }, 18 | listeners: [ 19 | { 20 | selector: ".btn-refresh", 21 | event: "click", 22 | behavior: "get" 23 | } 24 | ], 25 | parseStatus: function(dom){ 26 | return { 27 | thermometer:dom.find('.thermometer').text(), 28 | hygrometer:dom.find('.hygrometer').text() 29 | } 30 | }, 31 | }); 32 | }(); 33 | -------------------------------------------------------------------------------- /views/document/start.md: -------------------------------------------------------------------------------- 1 | # Tisan快速入门 2 | 3 | ## 开箱即用体验Tisan 4 | 首次拿到Tisan开发板,开箱即用,立马体验!注意请在WiFi环境中体验,因为需要WiFi的SSID和密码: 5 | 6 | - [关联与互动](Guide/app_dev.md): 下载手机app,并进行注册用户和关联设备。 7 | 8 | ## 快速开发入门 9 | - 下载[SDK](): 软件包、应用程序接口API、软件框架、硬件平台等开发应用的开发工具的集合。 10 | - 编程IDE:一个免安装版的eclipse的IDE,进行调试代码、编译程序,非常方便。 11 | 下载[编程IDE](http://pan.baidu.com/s/1qW9VpX6),下载后解压即可。 12 | - [烧写软件](http://pan.baidu.com/s/1bnyk36n):将编译后的bin文件烧写到模块上。 13 | - 如何使用IDE进行编程?如何用编译软件进行编译?如何烧写软件?可以参考[开发环境](开发环境.md) 14 | 15 | 打开IDE,导入SDK,编译,然后进行烧写软件,一键烧写,非常方便。 16 | 17 | 18 | ## 更多了解Tisan 19 | 20 | - [介绍](Guide/Introduction.md):说说Tisan是什么和为什么你想要使用它。 21 | - [SDK](): 软件包、应用程序接口API、软件框架、硬件平台等开发应用的开发工具的集合。 22 | - [Pando](固件开发.md): 嵌入式的开发框架,类似于中间件,消除了联网、接入云服务的复杂性,提供开发接口给嵌入式开发者,让开发者可以快速搭建物联网产品的应用! 23 | - [故障排除](Guide/Troubleshooting.md):关于出现问题时该怎么做的建议。 24 | 指南的完整版请访问[基础部分](),你可以深入了解Tisan的原理以及其背后的平台技术。 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /config/deploy.example.json: -------------------------------------------------------------------------------- 1 | { 2 | "msg":"这是部署配置文件", 3 | "host":"http://localhost", 4 | "listenPort" :8000, 5 | "redis":{ 6 | "host":"localhost", 7 | "port":9000, 8 | "sessionSecret": "yoursecret" 9 | }, 10 | "mysql" : { 11 | "connectionLimit" : 10, 12 | "host" : "localhost", 13 | "user" : "", 14 | "password" : "", 15 | "database" : "", 16 | "port": "3306" 17 | }, 18 | "qiniu":{ 19 | "name":"", 20 | "host":"", 21 | "accountAvatarCallback":"", 22 | "productAvatarCallback":"" 23 | }, 24 | "mailconfig":[{ 25 | "host":"", 26 | "port":25, 27 | "auth":{ 28 | "user":"", 29 | "pass":"" 30 | } 31 | }], 32 | "mailoptions":{ 33 | "from":" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Tisan - 404 10 | 11 | 12 | 13 | 14 | <%include navigation.ejs%> 15 |
16 |
17 |
18 | 19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /views/500.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Tisan - 404 10 | 11 | 12 | 13 | 14 | <%include navigation.ejs%> 15 |
16 |
17 |
18 | 19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/iotboard/dummy.model.min.js: -------------------------------------------------------------------------------- 1 | /*! iot-board 2015-11-09 */ 2 | !function(){if(!window.iotboard)return void console.log("iotboard not initialized!");var a={};a.onWidgetStatusChanged=function(a,b,c){console.log("widget {"+a+"} status changed:"+b),console.log(JSON.stringify(c))},a.getCurrentStatus=function(a,b,c){switch(a){case"text":c({text:"status changed:"+new Date});break;case"switch":setTimeout(function(){c({on:Math.floor(100*Math.random())%2==0?!0:!1})},1e3);break;case"led":setTimeout(function(){c([Math.floor(256*Math.random()),Math.floor(256*Math.random()),Math.floor(256*Math.random())])},1e3);break;case"atmosphere":setTimeout(function(){c({temperature:30.3,humidity:45.1,pm25:56.6})},1e3);break;case"temperature":case"humiture":setTimeout(function(){c([33.33333])},1e3);break;case"pm25":case"air":setTimeout(function(){c([345])},1e3);break;case"motor":setTimeout(function(){c([8])},1e3);break;case"default":setTimeout(function(){c([1,2,3.3])},1e3);break;default:console.log("widget {"+a+"} handler not found!")}},window.iotboard.setModel(a)}(); -------------------------------------------------------------------------------- /views/template/humiture.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | -------------------------------------------------------------------------------- /source/widgets/atmosphere/atmosphere.widget.min.css: -------------------------------------------------------------------------------- 1 | .widget[iotb-widget=atmosphere]{color:#fff;padding:30% 4px 4px;background-color:transparent;border:none;opacity:1;font-family:'Arial Narrow'}.widget[iotb-widget=atmosphere] .temperature{font-weight:700;text-align:center;font-size:30px;width:200px;height:200px;margin:auto;line-height:200px;border:2px solid #ccc;border-radius:100px;box-shadow:1px 1px 1px #888}.widget[iotb-widget=atmosphere] .temperature-val{font-size:60px}.widget[iotb-widget=atmosphere] .humidity-val,.widget[iotb-widget=atmosphere] .pm25-val{font-size:30px}.widget[iotb-widget=atmosphere] .humidity{margin-top:30px;text-align:center;width:45%;display:inline-block}.widget[iotb-widget=atmosphere] .humidity-icon{background:url(water.svg) no-repeat;width:20px;height:20px;display:inline-block;margin-right:10px}.widget[iotb-widget=atmosphere] .pm25{margin-top:30px;text-align:center;width:45%;margin-left:10%;display:inline-block}.widget[iotb-widget=atmosphere] .pm25-icon{background:url(air.svg) no-repeat;width:20px;height:20px;display:inline-block;margin-right:10px} -------------------------------------------------------------------------------- /models/mysql/user.js: -------------------------------------------------------------------------------- 1 | var Sequelize = require("sequelize"); 2 | var DbSequelize = require("../../db/mysql.js");//todo path 3 | 4 | var User = DbSequelize.define("tbl_user",{ 5 | "id": { type:Sequelize.INTEGER, primaryKey: true, autoIncreament: true }, 6 | "email": { type: Sequelize.CHAR(500)}, 7 | 8 | "nickname": { type: Sequelize.CHAR(100)}, 9 | "realname": { type: Sequelize.CHAR(100)}, 10 | "avatar": { type: Sequelize.CHAR(100)}, 11 | "username": { type: Sequelize.CHAR(100)}, 12 | "password": { type: Sequelize.CHAR(100)}, 13 | 14 | "sex": { type: Sequelize.CHAR(1)}, 15 | "telephone": {type: Sequelize.INTEGER}, 16 | 17 | "province": { type: Sequelize.CHAR(100)}, 18 | "city": { type: Sequelize.CHAR(100)}, 19 | "register_time": { type: Sequelize.INTEGER}, 20 | "age": { type: Sequelize.INTEGER}, 21 | "birthday": { type: Sequelize.INTEGER}, 22 | "hardwarekey": { type: Sequelize.CHAR(3000)}, 23 | },{ 24 | timestamps: false, 25 | underscored: true, 26 | freezeTableName: true, 27 | tableName: "tbl_user" 28 | }); 29 | exports.User = User; 30 | -------------------------------------------------------------------------------- /views/template/temperature.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | -------------------------------------------------------------------------------- /source/widgets/atmosphere/water.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /source/js/widget.js: -------------------------------------------------------------------------------- 1 | !function(global){ 2 | global.iotboard = global.iotboard || {}; 3 | 4 | /** 5 | * Object Widget manage the behavour and look of a widget. 6 | * @param {Object} [dom] [a jQuery/Zepto Dom Selector Object] 7 | * @param {Object} conf [config] 8 | */ 9 | function Widget(dom, conf){ 10 | 11 | var defaultConf = { 12 | 13 | }; 14 | 15 | this.dom = dom; 16 | var config = $.extend({}, defaultConf, conf); 17 | 18 | var render = function(){ 19 | dom.html(config.render(dom[0].dataset)); 20 | 21 | if(config.onRendered){ 22 | config.onRendered(dom); 23 | } 24 | } 25 | 26 | Object.defineProperty(this, 'status', { 27 | get: function(){ 28 | return config.status; 29 | }, 30 | set: function(newStatus){ 31 | config.status = newStatus; 32 | render(); 33 | }, 34 | enumerable: true, 35 | configurable: true 36 | }); 37 | 38 | this.config = config; 39 | this.render = render; 40 | } 41 | 42 | 43 | window.iotboard.Widget = Widget; 44 | }(window); -------------------------------------------------------------------------------- /views/document/web-ide.md: -------------------------------------------------------------------------------- 1 | # WebIDE介绍 2 | WebIDE首先是为了配合Tisan的pando开发框架而生,另外一方面,WebIDE给开发者提供了一个新的开发模式和开发思维,非常具有创新意义!当然更重要的是给开发者带来了简单、快速、高效的开发! 3 | WebIDE以可视化的界面进行呈现, 开发者通过WebIDE添加产品,在产品里面添加应用组件,把产品组件的自动生成代码拷贝到SDK的指定文件夹里的新建文件里,具体过程可参考[SDK固件开发](firmware.md)。 4 | WebIDE还提供微信二维码扫描,帮助用户使用微信接入的功能,具体详情可参考[微信支持](wechat-support.md)。 5 | 6 | 7 | ## WebIDE开发指南 8 | 9 | 进入[WebIDE](http://tisan.pandocloud.com)所在网址: 10 | ![进入WebIDE](image/w_main.png) 11 | 12 | 1 注册用户: 13 | ![Regedit](image/w_regedit.png) 14 | 15 | 注册后会提示到注册邮箱激活: 16 | ![Tip_Regedit](image/w_regedit1.png) 17 | 18 | 2 登陆账户: 19 | ![login_w](image/w_login.png) 20 | 21 | 3 在工作区添加产品: 22 | ![add_product](image/w_add_p0.png) 23 | 24 | 4 获取产品Key,录入产品信息(产品名称、介绍),添加产品需要的组件,操作结束后保存: 25 | ![get_p_key](image/work_addp1.png) 26 | 27 | 录入产品信息、介绍: 28 | ![input_pd_info](image/work_addp2.png) 29 | 30 | 添加产品需要的组件: 31 | ![add_pd_obj](image/work_addp3.png) 32 | 33 | 添加完成后可直接浏览手机应用程序的界面: 34 | ![phone_look](image/work_addp5.png) 35 | 36 | 最后保存: 37 | ![save_pd](image/work_addp7.png) 38 | 39 | -------------------------------------------------------------------------------- /public/codemirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 5 | 6 | // declare global: jsonlint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "json", function(text) { 19 | var found = []; 20 | jsonlint.parseError = function(str, hash) { 21 | var loc = hash.loc; 22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 24 | message: str}); 25 | }; 26 | try { jsonlint.parse(text); } 27 | catch(e) {} 28 | return found; 29 | }); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /public/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tisan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /public/iotboard/iotboard.min.css: -------------------------------------------------------------------------------- 1 | body,html{min-height:100%}html{font-family:'Open Sans','Helvetica Neue'}.widget{background-color:#fff;border:1px solid #ccc;border-radius:4px;font-size:14px;margin-bottom:10px;position:relative;box-shadow:0 0 10px rgba(0,0,0,.1)}.widget .title{color:#fff;background-color:#61c0ec;height:30px;line-height:30px;text-align:center;font-size:1.1em}.clf{clear:both};html,a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}*{-webkit-tap-highlight-color:transparent} -------------------------------------------------------------------------------- /source/widgets/led/led.widget.min.css: -------------------------------------------------------------------------------- 1 | .clf{clear:both}.widget[iotb-widget=led] .colorpicker{border-radius:5px;color:#FFF;font-size:12px;width:200px;margin:10px;float:left}.widget[iotb-widget=led] .picker{cursor:crosshair;border:0}.widget[iotb-widget=led] .controls{margin:10px}.widget[iotb-widget=led] .preview{float:right;margin:50px 10px}.widget[iotb-widget=led] .preview>div{margin-top:20px}.widget[iotb-widget=led] .controls>div{border:1px solid #2F2F2F;margin-bottom:5px;overflow:hidden;padding:5px}.widget[iotb-widget=led] .controls label{float:left}.widget[iotb-widget=led] .controls>div input{border:1px solid #2F2F2F;color:#DDD;float:right;font-size:10px;height:14px;margin-left:6px;text-align:center;text-transform:uppercase;width:150px}.widget[iotb-widget=led] .preview>div input{background-color:#CCC;width:10px;height:10px;text-align:center;border:0}.widget[iotb-widget=led] .btn{margin:0 10px;width:100px;height:30px;border-radius:5px;color:#fff;line-height:30px;text-align:center;font-weight:700}.widget[iotb-widget=led] .btn-refresh{float:left}.widget[iotb-widget=led] .btn-set{float:right}.widget[iotb-widget=led]{color:#000;padding:4px}.widget[iotb-widget=led] .text{margin-top:4px} -------------------------------------------------------------------------------- /service/authcheck.js: -------------------------------------------------------------------------------- 1 | var Product = require('../models/mysql/product').Product; 2 | //登录输入数据合法性检测 3 | exports.loginCheck=function(username,password){ 4 | var q=0; 5 | if(username.length>5&&username.length>50){ 6 | q=1; 7 | } if(password.length<5||password.length>20){ 8 | q=1; 9 | } 10 | //username是否是邮箱格式 11 | var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 12 | if(!filter.test(username)){ 13 | q=1; 14 | } 15 | //password特殊字符验证 16 | 17 | if(/[^a-zA-Z0-9]/.test(password)){ 18 | q=1; 19 | } 20 | //如果输入格式错误 21 | if(q){ return false}; 22 | 23 | //去空格 24 | return { 25 | username:username.replace(/\s+/g,""), 26 | password:password.replace(/\s+/g,""), 27 | } 28 | } 29 | exports.productHandleCheck=function(req,id,callback){ 30 | if(!req.session.user){ 31 | callback(false); 32 | return; 33 | } 34 | 35 | Product.find({where:{product_id:id}}).then(function(result){ 36 | if(!result){ 37 | callback(false); 38 | return; 39 | } 40 | if(result.dataValues.user_id==req.session.user.id){ 41 | callback(true); 42 | return; 43 | }else{ 44 | callback(false); 45 | } 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /public/codemirror/mode/rust/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 4}, "rust"); 6 | function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} 7 | 8 | MT('integer_test', 9 | '[number 123i32]', 10 | '[number 123u32]', 11 | '[number 123_u32]', 12 | '[number 0xff_u8]', 13 | '[number 0o70_i16]', 14 | '[number 0b1111_1111_1001_0000_i32]', 15 | '[number 0usize]'); 16 | 17 | MT('float_test', 18 | '[number 123.0f64]', 19 | '[number 0.1f64]', 20 | '[number 0.1f32]', 21 | '[number 12E+99_f64]'); 22 | 23 | MT('string-literals-test', 24 | '[string "foo"]', 25 | '[string r"foo"]', 26 | '[string "\\"foo\\""]', 27 | '[string r#""foo""#]', 28 | '[string "foo #\\"# bar"]', 29 | '[string r##"foo #"# bar"##]', 30 | 31 | '[string b"foo"]', 32 | '[string br"foo"]', 33 | '[string b"\\"foo\\""]', 34 | '[string br#""foo""#]', 35 | '[string br##"foo #" bar"##]', 36 | 37 | "[string-2 'h']", 38 | "[string-2 b'h']"); 39 | 40 | })(); 41 | -------------------------------------------------------------------------------- /source/widgets/motor/motor.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='motor'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | speed:'-' 11 | }, 12 | render: function(dataset){ 13 | var dataset=clone(dataset); 14 | dataset.status=this.status; 15 | return template('template-'+widgetName,dataset); 16 | }, 17 | listeners: [ 18 | { 19 | selector: ".motor-range", 20 | event: "change", 21 | behavior: "set" 22 | },{ 23 | selector: ".btn-refresh", 24 | event: "click", 25 | behavior: "get" 26 | } 27 | ], 28 | parseStatus: function(dom){ 29 | return { 30 | speed: dom.find(".motor-range").val() 31 | } 32 | }, 33 | onRendered:function(dom){ 34 | dom.find('.motor-range').on('input',function(){ 35 | dom.find('.motor-speed').text($(this).val()); 36 | }); 37 | dom.find('.btn-reset').on('click',function(){ 38 | dom.find('.motor-range').val(0); 39 | dom.find('.motor-speed').text(0); 40 | dom.find('.motor-range').change(); 41 | }); 42 | } 43 | }); 44 | }(); 45 | -------------------------------------------------------------------------------- /public/css/page/account.css: -------------------------------------------------------------------------------- 1 | .avant-img{ 2 | width150px; 3 | height:90%; 4 | max-height:150px; 5 | margin-bottom:10px; 6 | cursor:pointer; 7 | border-radius:100%; 8 | } 9 | .avant-img-box{ 10 | border-radius:100%; 11 | margin-left:50px; 12 | } 13 | .avant-img-a{ 14 | padding:0px;!important; 15 | margin-bottom:0px;!important; 16 | } 17 | .avant-img-title{ 18 | display:none; 19 | top:60px; 20 | left:65px; 21 | font-size:24px; 22 | font-weight:bold; 23 | color:#337ab7; 24 | position:absolute; 25 | cursor:pointer; 26 | } 27 | .form-center{ 28 | width:180px; 29 | } 30 | .bs-example{ 31 | position:relative; 32 | padding:45px 15px 15px; 33 | margin:0 -15px 15px; 34 | border-color:#e5e5e5; 35 | border-style:solid; 36 | border-width:1px; 37 | border-radius:5px; 38 | -webkit-box-shadow:inset 0 3px 6px rgba(0,0,0,.05); 39 | box-shadow:inset 0 3px 6px rgba(0,0,0,.05) 40 | } 41 | .remarks-title{ 42 | line-height:33px; 43 | color:#777; 44 | font-size:80%; 45 | } 46 | #user-face{ 47 | background: #ccc; 48 | width: 300px; 49 | height: 300px; 50 | border-radius: 150px; 51 | display: inline-block; 52 | } 53 | .head-portrait-warp{ 54 | width:400px; 55 | } 56 | .upload-avant-cancle{ 57 | background-color:#d9534f; 58 | } 59 | -------------------------------------------------------------------------------- /public/css/page/iphone.css: -------------------------------------------------------------------------------- 1 | .iphone { 2 | background: #aaa; 3 | border-radius: 40px; 4 | font-family: Helvetica, Arial, sans-serif; 5 | font-size: 14px; 6 | font-weight: 100; 7 | -webkit-transform-origin-y:0; 8 | -webkit-transform:scale(0.8); 9 | height: 666px; 10 | margin: auto; 11 | max-width: 350px; 12 | padding: 80px 15px; 13 | position: relative; 14 | } 15 | .iphone:before { 16 | background: rgba(0,0,0,0.35); 17 | border-radius: 4px; 18 | content: " "; 19 | height: 8px; 20 | left: 50%; 21 | margin-left: -30px; 22 | position: absolute; 23 | top: 45px; 24 | width: 60px; 25 | z-index: 99; 26 | } 27 | .iphone:after { 28 | background: rgba(0,0,0,0.35); 29 | border: 4px solid rgba(255,255,255,0.6); 30 | border-radius: 50%; 31 | bottom: 11px; 32 | content: " "; 33 | height: 50px; 34 | left: 50%; 35 | margin-left: -29px; 36 | position: absolute; 37 | width: 50px; 38 | z-index: 99; 39 | } 40 | .screen { 41 | background: #fff; 42 | border-radius: 2px; 43 | width:320px; 44 | height: 100%; 45 | overflow: auto; 46 | position: relative; 47 | z-index: 1; 48 | } 49 | .screen:after { 50 | clear: both; 51 | content: " "; 52 | display: table; 53 | } 54 | * { 55 | * box-sizing: border-box; 56 | * } 57 | -------------------------------------------------------------------------------- /source/css/reset.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | font: inherit; 19 | vertical-align: baseline; 20 | } 21 | /* HTML5 display-role reset for older browsers */ 22 | article, aside, details, figcaption, figure, 23 | footer, header, hgroup, menu, nav, section { 24 | display: block; 25 | } 26 | body { 27 | line-height: 1; 28 | } 29 | ol, ul { 30 | list-style: none; 31 | } 32 | blockquote, q { 33 | quotes: none; 34 | } 35 | blockquote:before, blockquote:after, 36 | q:before, q:after { 37 | content: ''; 38 | content: none; 39 | } 40 | table { 41 | border-collapse: collapse; 42 | border-spacing: 0; 43 | } 44 | 45 | *{ 46 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 47 | } -------------------------------------------------------------------------------- /public/css/page/login.css: -------------------------------------------------------------------------------- 1 | textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { 2 | border: 2px solid #dce4ec; 3 | color: #34495e; 4 | font-family: "Lato", sans-serif; 5 | font-size: 14px; 6 | padding: 8px 0 9px 10px; 7 | text-indent: 1px; 8 | -webkit-border-radius: 6px; 9 | -moz-border-radius: 6px; 10 | border-radius: 6px; 11 | -webkit-box-shadow: none; 12 | -moz-box-shadow: none; 13 | box-shadow: none; 14 | } 15 | .login-screen { 16 | background-color: #1abc9c; 17 | min-height: 317px; 18 | padding: 123px 199px 33px 306px; 19 | } 20 | .login-form { 21 | background-color: #eceff1; 22 | border-radius: 6px; 23 | padding: 24px 23px 20px; 24 | position: relative; 25 | } 26 | .login-form .control-group { 27 | margin-bottom: 6px; 28 | position: relative; 29 | } 30 | .margintop{ 31 | margin-top:100px; 32 | } 33 | .form-control-lg{ 34 | height:50px; !important 35 | } 36 | .marginup{ 37 | margin-top:40px; 38 | } 39 | .login-btn{ 40 | widht:80%; 41 | } 42 | .wrong-tag{ 43 | margin-left:0px; 44 | } 45 | -------------------------------------------------------------------------------- /views/document/interface.md: -------------------------------------------------------------------------------- 1 | #WebIDE开发指南 2 | WebIDE的介绍 3 | 4 | ## WebIDE 5 | 进入[WebIDE](http://tisan.pandocloud.com)所在网址 6 | 7 | main 8 | 9 | 1 注册用户 10 | 11 | main 12 | 13 | 注册后会提示到注册邮箱激活 14 | 15 | ---- 16 | main 17 | ---- 18 | 2 登陆账户 19 | main 20 | 3 在工作区添加产品 21 | main 22 | 4 获取产品Key,录入产品信息(产品名称、介绍),添加产品需要的组件,操作结束后保存。 23 | main 24 | 录入产品信息、介绍 25 | main 26 | 添加产品需要的组件 27 | main 28 | 添加完成后可直接浏览手机应用程序的界面 29 | main 30 | 最后保存: 31 | main 32 | 33 | -------------------------------------------------------------------------------- /public/codemirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on csslint.js from https://github.com/stubbornella/csslint 5 | 6 | // declare global: CSSLint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "css", function(text) { 19 | var found = []; 20 | if (!window.CSSLint) return found; 21 | var results = CSSLint.verify(text), messages = results.messages, message = null; 22 | for ( var i = 0; i < messages.length; i++) { 23 | message = messages[i]; 24 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 25 | found.push({ 26 | from: CodeMirror.Pos(startLine, startCol), 27 | to: CodeMirror.Pos(endLine, endCol), 28 | message: message.message, 29 | severity : message.type 30 | }); 31 | } 32 | return found; 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /routes/workspace.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var grpc = require('../service/grpc'); 4 | var Product = require('../models/mysql/product').Product; var Objects = require('../models/mysql/object').Objects; 5 | var authCheck = require('../service/authcheck'); 6 | router.use(auth); 7 | 8 | router.get('/', function(req, res) { 9 | Product.findAll({where:{user_id:req.session.user.id}}).then(function(result){ 10 | var p=[]; 11 | for(var i in result){ 12 | p.push(result[i].product_id); 13 | } 14 | grpc.readProduct(p,function(result){ 15 | if(!result){ 16 | result['products']=""; 17 | } 18 | console.log(result); 19 | var data=[]; 20 | for(var i in result.products){ 21 | var tmp=result.products[i]; 22 | data.push({ 23 | avatar:tmp.icon, 24 | descript:tmp.description, 25 | name:tmp.name, 26 | id:tmp.id 27 | }) 28 | } 29 | res.render('workspace', { 30 | user: req.session.user, 31 | navigation:'workspace', 32 | product:data 33 | }); 34 | }) 35 | }) 36 | }); 37 | 38 | 39 | function auth(req,res,next){ 40 | if(!req.session.user){ 41 | res.redirect('/user/login'); 42 | } 43 | next(); 44 | } 45 | module.exports = router; 46 | -------------------------------------------------------------------------------- /views/document/wechat-support.md: -------------------------------------------------------------------------------- 1 | # 微信支持 2 | 本文档说明如何通过关注freeiot公众号对硬件进行联网控制。 3 | 4 | ## 具体步骤 5 | 6 | 1. 关注freeiot微信公众账号; 7 | 搜索微信公众号:freeiot 8 | ![搜索公众号](image/wei_g0.png) 9 | 点击FreeIOT,并关注: 10 | ![FreeIOT公众号界面](image/wei_g1.png) 11 | 12 | 2. 如果设备还没有连上网,需要对设备进行wifi联网配置;如果设备已经联上网了,直接进行第三步即可。长按配置键3秒,核心板上的绿色灯快速闪烁,表示设备进入wifi联网配置状态,微信公众号这边点击“添加设备”——>“WiFi配置”——>“开始配置”——>输入wifi账号密码——>配置中——>配置结束。示例图如下。 13 | 在菜单选择“WiFi配置”: 14 | ![WiFi配置0](image/wei_g2.png) 15 | 点击“开始配置”: 16 | ![WiFi配置1](image/wei_g3.png) 17 | 输入wifi账号密码: 18 | ![WiFi配置2](image/wei_g4.png) 19 | 联网配置中: 20 | ![WiFi配置3](image/wei_g5.png) 21 | 配置结束: 22 | ![WiFi配置4](image/wei_g6.png) 23 | 24 | 25 | 3. 点击WebIDE手机图形界面下面的二维码按钮,点击公众号菜单中的扫描设备扫描二维码。如果设备的MAC地址还没有录入,WebIDE会提示录入MAC地址。具体过程如下: 26 | 点击WebIDE下面的二维码按钮: 27 | ![二维码按钮](image/wei_1.png) 28 | 如果没有录入设备的MAC地址,请录入MAC地址,设备的MAC地址可由烧写软件得出: 29 | ![录入MAC](image/wei_21.png) 30 | 再点击二维码按钮,即可出现生成的二维码图片: 31 | ![二维码pic](image/wei_3.png) 32 | 在微信公众号里点击“添加设备”,再点击“扫描二维码”的选项: 33 | ![wei 0_0](image/wei_g2_1.png) 34 | 扫描二维码图片: 35 | ![wei 1](image/wei_g7.png) 36 | 添加设备成功,在“我的设备”里面会新增刚添加进来的设备,名称与WebIDE里面创建的产品名称相同: 37 | ![wei 2](image/wei_g8.png) 38 | 39 | 4. 如果添加成功,便可以在我的设备菜单找到设备,进行控制测试。 40 | 在“我的设备”里面找到要控制的设备,点击进入控制界面: 41 | ![wei 3](image/wei_g91.png) 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /source/widgets/default/default.widget.js: -------------------------------------------------------------------------------- 1 | !function(){ 2 | if (!window.iotboard){ 3 | console.log("iotboard not initialized!"); 4 | return; 5 | } 6 | 7 | var widgetName='default'; 8 | window.iotboard.defineWidget(widgetName, { 9 | status: { 10 | 'loading':'' 11 | }, 12 | render: function(dataset){ 13 | console.log(dataset); 14 | var id=dataset.id; 15 | var no=dataset.no; 16 | 17 | var w; 18 | for(var i in addedWidgets.objects){ 19 | if(addedWidgets.objects[i].id==id&&addedWidgets.objects[i].no==no){ 20 | w=clone(addedWidgets.objects[i]); 21 | break; 22 | } 23 | } 24 | for(i in dataset.status){ 25 | w.status[i]=dataset.status[i]; 26 | } 27 | console.log(w); 28 | return template('template-'+widgetName,w); 29 | }, 30 | listeners: [ 31 | { 32 | selector: ".btn-set", 33 | event: "click", 34 | behavior: "set" 35 | }, 36 | { 37 | selector: ".btn-refresh", 38 | event: "click", 39 | behavior: "get" 40 | } 41 | ], 42 | parseStatus: function(dom){ 43 | var res={ 44 | }; 45 | dom.find('.default-status-wrap').each(function(){ 46 | res[$(this).find('.default-status-name').text()+'']=$(this).find('.default-status-input').val(); 47 | }); 48 | return res; 49 | }, 50 | }); 51 | }(); 52 | -------------------------------------------------------------------------------- /public/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineMode("diff", function() { 15 | 16 | var TOKEN_NAMES = { 17 | '+': 'positive', 18 | '-': 'negative', 19 | '@': 'meta' 20 | }; 21 | 22 | return { 23 | token: function(stream) { 24 | var tw_pos = stream.string.search(/[\t ]+?$/); 25 | 26 | if (!stream.sol() || tw_pos === 0) { 27 | stream.skipToEnd(); 28 | return ("error " + ( 29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 30 | } 31 | 32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 33 | 34 | if (tw_pos === -1) { 35 | stream.skipToEnd(); 36 | } else { 37 | stream.pos = tw_pos; 38 | } 39 | 40 | return token_name; 41 | } 42 | }; 43 | }); 44 | 45 | CodeMirror.defineMIME("text/x-diff", "diff"); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /views/document/quick-start.md: -------------------------------------------------------------------------------- 1 | # Tisan快速体验 2 | 3 | ## 体验Tisan 4 | 首次拿到Tisan开发板,默认已经烧录三色灯的固件,可以立马体验!注意请在WiFi环境中体验,因为需要WiFi的SSID和密码。 5 | 6 | FreeIOT与设备之间通过smartconfig进行配置。FreeIOT是Tisan的在移动端的通用App,自由免费的,同时开源,有兴趣的开发者可在github下载[安卓版](https://github.com/PandoCloud/freeiot-android)或[IOS版](https://github.com/PandoCloud/freeiot-ios)的源码进行参考研究。 7 | 首先下载FreeIOT。 8 | - [安卓版下载地址](http://shouji.baidu.com/software/item?docid=7996553&from=as&qq-pf-to=pcqq.discussion)。 9 | - IOS版请在appstore里面搜索最新版本的FreeIOT,并下载安装。 10 | 11 | 12 | 13 | 下面以安卓为例,介绍App与设备之间的操作流程: 14 | 1. 安装**FreeIOT** 15 | ![app_0](image/app_0.png) 16 | 17 | 2. 启动FreeIOT,如果没有账户,先注册用户,再登陆。 18 | 注册用户: 19 | ![app_regit](image/app_regit.png) 20 | 用户登陆: 21 | ![app_login](image/app_login.png) 22 | 第一次进入的时候可以看到列表是空的: 23 | ![app_login1](image/app_m11.png) 24 | 25 | 3. 长按Tisan开发板的配置键3秒,LED快闪,表示设备进入配置模式 26 | ![长按配置键3秒](image/peiz1.png) 27 | 28 | 4. 点击FreeIOT右上角的“添加”键,输入能够联网的WiFi以及密码,输完后点击“确定”,静等5到10秒,配置成功后会返回设备列表界面,配置结束时LED灭; 29 | ![app_config](image/app_config.png) 30 | 31 | 5. 如果没配成功,可重复操作步骤3和步骤4; 32 | 6. 配置成功后,往下拉一下,刷新设备列表,找到刚配置成功的设备,点击进去,就进入操作该设备的主界面!用户可进行设备状态查询、远程控制等功能。 33 | 34 | ![app_main](image/app_m21.png) 35 | 点击进去可以看到如下控制界面: 36 | ![app_main](image/app_m31.png) 37 | 38 | ## 更多体验 39 | 更多体验可参考[示例说明](demo.md),可直接烧写程序进行其他项目的体验! 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /views/template/thermohygrometer.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 35 | -------------------------------------------------------------------------------- /public/codemirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // declare global: tern, server 5 | 6 | var server; 7 | 8 | this.onmessage = function(e) { 9 | var data = e.data; 10 | switch (data.type) { 11 | case "init": return startServer(data.defs, data.plugins, data.scripts); 12 | case "add": return server.addFile(data.name, data.text); 13 | case "del": return server.delFile(data.name); 14 | case "req": return server.request(data.body, function(err, reqData) { 15 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 16 | }); 17 | case "getFile": 18 | var c = pending[data.id]; 19 | delete pending[data.id]; 20 | return c(data.err, data.text); 21 | default: throw new Error("Unknown message type: " + data.type); 22 | } 23 | }; 24 | 25 | var nextId = 0, pending = {}; 26 | function getFile(file, c) { 27 | postMessage({type: "getFile", name: file, id: ++nextId}); 28 | pending[nextId] = c; 29 | } 30 | 31 | function startServer(defs, plugins, scripts) { 32 | if (scripts) importScripts.apply(null, scripts); 33 | 34 | server = new tern.Server({ 35 | getFile: getFile, 36 | async: true, 37 | defs: defs, 38 | plugins: plugins 39 | }); 40 | } 41 | 42 | this.console = { 43 | log: function(v) { postMessage({type: "debug", message: v}); } 44 | }; 45 | -------------------------------------------------------------------------------- /views/template/led.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 34 | -------------------------------------------------------------------------------- /public/codemirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 5 | 6 | // declare global: coffeelint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 19 | var found = []; 20 | var parseError = function(err) { 21 | var loc = err.lineNumber; 22 | found.push({from: CodeMirror.Pos(loc-1, 0), 23 | to: CodeMirror.Pos(loc, 0), 24 | severity: err.level, 25 | message: err.message}); 26 | }; 27 | try { 28 | var res = coffeelint.lint(text); 29 | for(var i = 0; i < res.length; i++) { 30 | parseError(res[i]); 31 | } 32 | } catch(e) { 33 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 34 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 35 | severity: 'error', 36 | message: e.message}); 37 | } 38 | return found; 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /public/codemirror/mode/mscgen/index_msgenny.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: msgenny mode 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: msgenny mode

13 | 14 |
34 | 35 | 41 | 42 |

MIME types defined: text/x-msgenny

43 | 44 | 45 | -------------------------------------------------------------------------------- /public/codemirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("./runmode")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "./runmode"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 15 | 16 | function textContent(node, out) { 17 | if (node.nodeType == 3) return out.push(node.nodeValue); 18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 19 | textContent(ch, out); 20 | if (isBlock.test(node.nodeType)) out.push("\n"); 21 | } 22 | } 23 | 24 | CodeMirror.colorize = function(collection, defaultMode) { 25 | if (!collection) collection = document.body.getElementsByTagName("pre"); 26 | 27 | for (var i = 0; i < collection.length; ++i) { 28 | var node = collection[i]; 29 | var mode = node.getAttribute("data-lang") || defaultMode; 30 | if (!mode) continue; 31 | 32 | var text = []; 33 | textContent(node, text); 34 | node.innerHTML = ""; 35 | CodeMirror.runMode(text.join(""), mode, node); 36 | 37 | node.className += " cm-s-default"; 38 | } 39 | }; 40 | }); 41 | -------------------------------------------------------------------------------- /public/codemirror/mode/asciiarmor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ASCII Armor (PGP) mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ASCII Armor (PGP) mode

27 |
36 | 37 | 42 | 43 |

MIME types 44 | defined: application/pgp, application/pgp-keys, application/pgp-signature

45 | 46 |
47 | -------------------------------------------------------------------------------- /views/download_chrome.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Tisan - 404 10 | 11 | 12 | 18 | 19 | 20 |
21 |
22 | 抱歉您的浏览器不支持Tisan-ide,请下载最新webkit内核浏览器 23 |
24 |
25 |
26 |
27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/widgets/atmosphere/air.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /public/codemirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), 7 | require("../../addon/mode/multiplex")); 8 | else if (typeof define == "function" && define.amd) // AMD 9 | define(["../../lib/codemirror", "../htmlmixed/htmlmixed", 10 | "../../addon/mode/multiplex"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 17 | return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { 18 | open: parserConfig.open || parserConfig.scriptStartRegex || "<%", 19 | close: parserConfig.close || parserConfig.scriptEndRegex || "%>", 20 | mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) 21 | }); 22 | }, "htmlmixed"); 23 | 24 | CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); 25 | CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 26 | CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 27 | CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); 28 | }); 29 | -------------------------------------------------------------------------------- /public/codemirror/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: NTriples mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 28 | 29 |
30 |

NTriples mode

31 |
32 | 39 |
40 | 41 | 44 |

MIME types defined: text/n-triples.

45 |
46 | -------------------------------------------------------------------------------- /public/codemirror/mode/twig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Twig mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Twig mode

27 |
40 | 45 |
46 | -------------------------------------------------------------------------------- /public/codemirror/mode/spreadsheet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Spreadsheet mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Spreadsheet mode

28 |
29 | 30 | 37 | 38 |

MIME types defined: text/x-spreadsheet.

39 | 40 |

The Spreadsheet Mode

41 |

Created by Robert Plummer

42 |
43 | -------------------------------------------------------------------------------- /public/codemirror/mode/http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HTTP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

HTTP mode

27 | 28 | 29 |
39 | 40 | 43 | 44 |

MIME types defined: message/http.

45 |
46 | -------------------------------------------------------------------------------- /views/document/demo.md: -------------------------------------------------------------------------------- 1 | # 示例项目 2 | 如果还不想编写代码,可直接烧写程序进行快速体验所有示例项目!直接下载示例项目所有的[默认固件](http://pan.baidu.com/s/1nttObVj),具体烧录方法可参考[开发环境](environment.md)关于固件烧录的方法说明,记得每个示例项目所需要的跳帽连接,具体可参考下面的图。 3 | 在使用板子之前,请注意核心板插在底板上的方向,如下图所示: 4 | ![核心板方向示意图](image/example-01.png) 5 | 6 | ### 1.RGB三色灯例子 7 | 用跳帽短接三色灯和模块GPIO:BLED连GPIO13,RlED连GPIO14,GLED连GPIO15,如下图: 8 | ![核心板方向示意图](image/example-rgb.png) 9 | 在user_main文件中添加文件引用: 10 | ```c 11 | #include "objects/led.h" 12 | ``` 13 | 在user_main文件的user_init函数中添加以下代码: 14 | ```c 15 | led_object_init(); 16 | ``` 17 | ### 2.电机的例子 18 | 用跳帽短接电机驱动和模块GPIO:IA连GPIO13,IB连GPIO12,如下图: 19 | ![电机连接示意图](image/example-motor.png) 20 | 在user_main文件中添加文件引用: 21 | ```c 22 | #include "objects/motor.h" 23 | ``` 24 | 在user_main文件的user_init函数中添加以下代码: 25 | ```c 26 | motor_object_init(); 27 | ``` 28 | ### 3.温度的例子 29 | 用跳帽短接DHT11和模块GPIO:DHT连GPIO12,如下图: 30 | ![温度连接示意图](image/example-dht11.png) 31 | 在user_main文件中添加文件引用: 32 | ```c 33 | #include "objects/temperature.h" 34 | ``` 35 | 在user_main文件的user_init函数中添加以下代码: 36 | ```c 37 | temperature_object_init(); 38 | ``` 39 | ### 4.湿度的例子 40 | 用跳帽短接DHT11和模块GOIO:DHT连GPIO12,同温度的例子 41 | 在user_main文件中添加文件引用: 42 | ```c 43 | #include "objects/humiture.h" 44 | ``` 45 | 在user_main文件的user_init函数中添加以下代码: 46 | ```c 47 | humiture_object_init(); 48 | ``` 49 | ### 5.继电器的例子 50 | 用跳帽短接继电器和模块GPIO:JDQ连GPIO12,如下图: 51 | ![继电器连接示意图](image/example-jdq.png) 52 | 在user_main文件中添加文件引用: 53 | ```c 54 | #include "objects/jdq.h" 55 | ``` 56 | 在user_main文件的user_init函数中添加以下代码: 57 | ```c 58 | jdq_object_init(); 59 | ``` 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /public/codemirror/mode/clike/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("indent", 9 | "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {", 10 | " [variable-3 int] [variable c] [operator =] [variable b] [operator +]", 11 | " [number 1];", 12 | " [keyword return] [operator *][variable a];", 13 | "}"); 14 | 15 | MT("indent_switch", 16 | "[keyword switch] ([variable x]) {", 17 | " [keyword case] [number 10]:", 18 | " [keyword return] [number 20];", 19 | " [keyword default]:", 20 | " [variable printf]([string \"foo %c\"], [variable x]);", 21 | "}"); 22 | 23 | MT("def", 24 | "[variable-3 void] [def foo]() {}", 25 | "[keyword struct] [def bar]{}", 26 | "[variable-3 int] [variable-3 *][def baz]() {}"); 27 | 28 | MT("double_block", 29 | "[keyword for] (;;)", 30 | " [keyword for] (;;)", 31 | " [variable x][operator ++];", 32 | "[keyword return];"); 33 | 34 | var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src"); 35 | function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); } 36 | 37 | MTCPP("cpp14_literal", 38 | "[number 10'000];", 39 | "[number 0b10'000];", 40 | "[number 0x10'000];", 41 | "[string '100000'];"); 42 | })(); 43 | -------------------------------------------------------------------------------- /public/codemirror/mode/solr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Solr mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 33 | 34 |
35 |

Solr mode

36 | 37 |
38 | 47 |
48 | 49 | 55 | 56 |

MIME types defined: text/x-solr.

57 |
58 | -------------------------------------------------------------------------------- /source/widgets/led/led.widget.min.js: -------------------------------------------------------------------------------- 1 | /*! iot-board 2015-09-13 */ 2 | !function(){return window.iotboard?(window.iotboard.defineWidget("led",{status:{red:255,green:255,blue:255,freq:100,white:100},render:function(a){var a=clone(a);return a.status=this.status,template("template-led",a)},listeners:[{selector:".btn-refresh",event:"click",behavior:"get"},{selector:".btn-set",event:"click",behavior:"set"}],parseStatus:function(a){return{red:parseInt(a.find(".rVal").val()),green:parseInt(a.find(".gVal").val()),blue:parseInt(a.find(".bVal").val()),freq:parseInt(a.find(".freqVal").text()),white:parseInt(a.find(".wVal").text())}},onRendered:function(a){console.log("on widget rendered."),a.find(".picker").each(function(){var a=this.getContext("2d"),b=new Image;b.onload=function(){console.log("color picker loaded..."),a.drawImage(b,0,0)};var c="/iotboard/dist/widgets/led/colorwheel.png";b.src=c}),a.find(".picker").on("click",function(a){var b=$(this).closest(".widget"),c=this.getContext("2d"),d=$(this).offset(),e=Math.floor(a.pageX-d.left),f=Math.floor(a.pageY-d.top),g=c.getImageData(e,f,1,1),h=g.data;b.find(".rPrev").css("background-color","#"+h[0].toString(16)+"0000"),b.find(".gPrev").css("background-color","#00"+h[1].toString(16)+"00"),b.find(".bPrev").css("background-color","#0000"+h[2].toString(16)),b.find(".rVal").val(h[0]),b.find(".gVal").val(h[1]),b.find(".bVal").val(h[2])}),a.find(".freqCtrl").change(function(){$(this).closest(".controls").find(".freqVal").text($(this).val())}),a.find(".wCtrl").change(function(){$(this).closest(".controls").find(".wVal").text($(this).val())})}}),void console.log("add widget {led}")):void console.log("iotboard not initialized!")}(); 3 | -------------------------------------------------------------------------------- /public/codemirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ECL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ECL mode

27 |
45 | 48 | 49 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

50 |

MIME types defined: text/x-ecl.

51 | 52 |
53 | -------------------------------------------------------------------------------- /public/codemirror/mode/z80/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Z80 assembly mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Z80 assembly mode

27 | 28 | 29 |
45 | 46 | 51 | 52 |

MIME types defined: text/x-z80, text/x-ez80.

53 |
54 | -------------------------------------------------------------------------------- /source/widgets/led/led.template: -------------------------------------------------------------------------------- 1 | <#if(title){#> 2 |
<#=title#>
3 | <#}#> 4 |
5 | 6 |
7 |
8 |
9 | 10 | 0000"/> 11 |
12 |
13 | 14 | 00"/> 15 |
16 |
17 | 18 | "/> 19 |
20 |
21 |
22 |
23 | "/> 24 | "/> 25 | "/> 26 |
27 | 28 | "/> 29 |
30 |
31 | 32 | "/> 33 |
34 |
35 | 36 | 37 |
38 | -------------------------------------------------------------------------------- /public/js/page/product.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var avantPlay={ 3 | block:function(){ 4 | $('.avant-img-title').css({display:'block'}); 5 | $('.avant-img').css({opacity:0.4}); 6 | }, 7 | none:function(result){ 8 | if(result==''){ 9 | $('.avant-img-title').css({display:'none'}); 10 | $('.avant-img').css({opacity:1}); 11 | return; 12 | } 13 | if(result.toElement.className!='avant-img-title'){ 14 | $('.avant-img-title').css({display:'none'}); 15 | $('.avant-img').css({opacity:1}); 16 | } 17 | } 18 | } 19 | $('.avant-img').mouseenter(function(){ 20 | avantPlay.block(); 21 | }) 22 | 23 | $('.avant-img').mouseout(function(result){ 24 | avantPlay.none(result); 25 | }) 26 | $('.avant-img').click(function(result){ 27 | $('.cutting-avant-fix-btn').click(); 28 | }) 29 | $('.avant-img-title').on('click',function(){ 30 | $('.cutting-avant-fix-btn').click(); 31 | }) 32 | $('.avant-img-title,.avant-img').on('click',function(){ 33 | $('.cutting-avant-fix-box').css({'display':'block'}) 34 | }) 35 | 36 | $('.save-btn').on('click',function(){ 37 | var tmp={ 38 | productName:$('.name-input').val(), 39 | productDescript:$('.descript-input').val() 40 | } 41 | 42 | $.ajax({ 43 | url:'/workspace/product/info', 44 | type:'POST', 45 | data:tmp, 46 | success:function(result){ 47 | console.log(result); 48 | } 49 | }) 50 | }) 51 | })() 52 | 53 | 54 | -------------------------------------------------------------------------------- /public/codemirror/mode/oz/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Oz mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 26 | 27 |
28 |

Oz mode

29 | 50 |

MIME type defined: text/x-oz.

51 | 52 | 59 |
60 | -------------------------------------------------------------------------------- /views/commercial.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | <%include navigation.ejs%> 17 |
18 | 19 |
Tisan服务仅适用于个人开发者和企业Demo应用,如需商用请联系: 24 |
qq:1034579387 e-mail:wusiwei@pandocloud.com 25 |
26 |
27 | 28 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /views/iot.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IOT Board 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | <% if(from=='ide') { %> 22 | 23 | <% } else {%> 24 | 25 | <% } %> 26 | 27 | 28 | 29 | <% if( config.objects ) { 30 | for(var i=0; i 34 |
35 | <% } else {%> 36 |
37 | <% }%> 38 | <% } %> 39 | <% } %> 40 | 41 | 42 | -------------------------------------------------------------------------------- /public/codemirror/addon/scroll/simplescrollbars.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { 2 | position: absolute; 3 | background: #ccc; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box; 6 | border: 1px solid #bbb; 7 | border-radius: 2px; 8 | } 9 | 10 | .CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { 11 | position: absolute; 12 | z-index: 6; 13 | background: #eee; 14 | } 15 | 16 | .CodeMirror-simplescroll-horizontal { 17 | bottom: 0; left: 0; 18 | height: 8px; 19 | } 20 | .CodeMirror-simplescroll-horizontal div { 21 | bottom: 0; 22 | height: 100%; 23 | } 24 | 25 | .CodeMirror-simplescroll-vertical { 26 | right: 0; top: 0; 27 | width: 8px; 28 | } 29 | .CodeMirror-simplescroll-vertical div { 30 | right: 0; 31 | width: 100%; 32 | } 33 | 34 | 35 | .CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { 36 | display: none; 37 | } 38 | 39 | .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { 40 | position: absolute; 41 | background: #bcd; 42 | border-radius: 3px; 43 | } 44 | 45 | .CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { 46 | position: absolute; 47 | z-index: 6; 48 | } 49 | 50 | .CodeMirror-overlayscroll-horizontal { 51 | bottom: 0; left: 0; 52 | height: 6px; 53 | } 54 | .CodeMirror-overlayscroll-horizontal div { 55 | bottom: 0; 56 | height: 100%; 57 | } 58 | 59 | .CodeMirror-overlayscroll-vertical { 60 | right: 0; top: 0; 61 | width: 6px; 62 | } 63 | .CodeMirror-overlayscroll-vertical div { 64 | right: 0; 65 | width: 100%; 66 | } 67 | -------------------------------------------------------------------------------- /source/widgets/atmosphere/atmosphere.widget.css: -------------------------------------------------------------------------------- 1 | .widget[iotb-widget="atmosphere"] { 2 | color: #fff; 3 | padding: 4px; 4 | background-color: #fff; 5 | background-color: transparent; 6 | border: none; 7 | opacity: 1; 8 | padding-top: 30%; 9 | font-family: 'Arial Narrow'; 10 | } 11 | 12 | .widget[iotb-widget="atmosphere"] .temperature { 13 | font-weight: bold; 14 | text-align: center; 15 | font-size: 30px; 16 | width: 200px; 17 | height: 200px; 18 | margin: auto; 19 | line-height: 200px; 20 | border: 2px solid #ccc; 21 | border-radius: 100px; 22 | box-shadow: 1px 1px 1px #888; 23 | } 24 | 25 | .widget[iotb-widget="atmosphere"] .temperature-val { 26 | font-size: 60px; 27 | } 28 | 29 | .widget[iotb-widget="atmosphere"] .humidity { 30 | margin-top: 30px; 31 | text-align: center; 32 | width: 45%; 33 | display: inline-block; 34 | } 35 | 36 | .widget[iotb-widget="atmosphere"] .humidity-icon { 37 | background:url(water.svg); 38 | background-repeat: no-repeat; 39 | width: 20px; 40 | height: 20px; 41 | display: inline-block; 42 | margin-right: 10px; 43 | } 44 | 45 | .widget[iotb-widget="atmosphere"] .humidity-val { 46 | font-size: 30px; 47 | } 48 | 49 | .widget[iotb-widget="atmosphere"] .pm25 { 50 | margin-top: 30px; 51 | text-align: center; 52 | width: 45%; 53 | margin-left: 10%; 54 | display: inline-block; 55 | } 56 | 57 | .widget[iotb-widget="atmosphere"] .pm25-val { 58 | font-size: 30px; 59 | } 60 | 61 | .widget[iotb-widget="atmosphere"] .pm25-icon { 62 | background:url(air.svg); 63 | background-repeat: no-repeat; 64 | width: 20px; 65 | height: 20px; 66 | display: inline-block; 67 | margin-right: 10px; 68 | } -------------------------------------------------------------------------------- /public/codemirror/addon/display/fullscreen.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { 15 | if (old == CodeMirror.Init) old = false; 16 | if (!old == !val) return; 17 | if (val) setFullscreen(cm); 18 | else setNormal(cm); 19 | }); 20 | 21 | function setFullscreen(cm) { 22 | var wrap = cm.getWrapperElement(); 23 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, 24 | width: wrap.style.width, height: wrap.style.height}; 25 | wrap.style.width = ""; 26 | wrap.style.height = "auto"; 27 | wrap.className += " CodeMirror-fullscreen"; 28 | document.documentElement.style.overflow = "hidden"; 29 | cm.refresh(); 30 | } 31 | 32 | function setNormal(cm) { 33 | var wrap = cm.getWrapperElement(); 34 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); 35 | document.documentElement.style.overflow = ""; 36 | var info = cm.state.fullScreenRestore; 37 | wrap.style.width = info.width; wrap.style.height = info.height; 38 | window.scrollTo(info.scrollLeft, info.scrollTop); 39 | cm.refresh(); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var Remarkable = require('remarkable'); 4 | var md = new Remarkable(); 5 | var fs = require('fs'); 6 | var config = require('../config/index'); 7 | 8 | /* GET home page. */ 9 | router.get('/', function(req, res) { 10 | res.render('index', { 11 | user: req.session.user, 12 | navigation:'index' 13 | }); 14 | }); 15 | 16 | router.get('/document/:page', function(req, res) { 17 | var page = req.params['page']; 18 | if(page.indexOf('.')!=-1) page=page.split('.')[0]; 19 | 20 | console.log(page); 21 | fs.readFile(__dirname+'/../views/document/'+page+'.md','utf-8',function(err,data){ 22 | res.render('document', { 23 | user: req.session.user, 24 | page:page, 25 | navigation:'document', 26 | data:md.render(data) 27 | }); 28 | }) 29 | }); 30 | 31 | router.get('/about', function(req, res){ 32 | res.render('about', { 33 | user: req.session.user, 34 | navigation:'about' 35 | }); 36 | }) 37 | 38 | router.get('/contribute', function(req, res){ 39 | res.render('contribute', { 40 | user: req.session.user, 41 | navigation:'contribute' 42 | }); 43 | }) 44 | router.get('/commercial', function(req, res){ 45 | res.render('commercial', { 46 | user: req.session.user, 47 | navigation:'commercial' 48 | }); 49 | }) 50 | 51 | router.get('/404',function(req,res){ 52 | res.render('404',{ 53 | user: req.session.user, 54 | navigation:'index' 55 | }); 56 | }) 57 | router.get('/500',function(req,res){ 58 | res.render('500',{ 59 | user: req.session.user, 60 | navigation:'index' 61 | }); 62 | }) 63 | 64 | module.exports = router; 65 | -------------------------------------------------------------------------------- /views/about.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | <%include navigation.ejs%> 17 |
18 | 19 |
20 |
21 | 22 |
23 |
24 | 25 |
26 |
27 | 28 |
29 | 30 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /public/codemirror/mode/turtle/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Turtle mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Turtle mode

27 |
41 | 47 | 48 |

MIME types defined: text/turtle.

49 | 50 |
51 | -------------------------------------------------------------------------------- /public/codemirror/addon/scroll/scrollpastend.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { 15 | if (old && old != CodeMirror.Init) { 16 | cm.off("change", onChange); 17 | cm.off("refresh", updateBottomMargin); 18 | cm.display.lineSpace.parentNode.style.paddingBottom = ""; 19 | cm.state.scrollPastEndPadding = null; 20 | } 21 | if (val) { 22 | cm.on("change", onChange); 23 | cm.on("refresh", updateBottomMargin); 24 | updateBottomMargin(cm); 25 | } 26 | }); 27 | 28 | function onChange(cm, change) { 29 | if (CodeMirror.changeEnd(change).line == cm.lastLine()) 30 | updateBottomMargin(cm); 31 | } 32 | 33 | function updateBottomMargin(cm) { 34 | var padding = ""; 35 | if (cm.lineCount() > 1) { 36 | var totalH = cm.display.scroller.clientHeight - 30, 37 | lastLineH = cm.getLineHandle(cm.lastLine()).height; 38 | padding = (totalH - lastLineH) + "px"; 39 | } 40 | if (cm.state.scrollPastEndPadding != padding) { 41 | cm.state.scrollPastEndPadding = padding; 42 | cm.display.lineSpace.parentNode.style.paddingBottom = padding; 43 | cm.setSize(); 44 | } 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /public/codemirror/addon/lint/html-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on htmlhint.js from http://htmlhint.com/js/htmlhint.js 5 | 6 | // declare global: HTMLHint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror"), require("htmlhint")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror", "htmlhint"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | var defaultRules = { 19 | "tagname-lowercase": true, 20 | "attr-lowercase": true, 21 | "attr-value-double-quotes": true, 22 | "doctype-first": false, 23 | "tag-pair": true, 24 | "spec-char-escape": true, 25 | "id-unique": true, 26 | "src-not-empty": true, 27 | "attr-no-duplication": true 28 | }; 29 | 30 | CodeMirror.registerHelper("lint", "html", function(text, options) { 31 | var found = []; 32 | if (!window.HTMLHint) return found; 33 | var messages = HTMLHint.verify(text, options && options.rules || defaultRules); 34 | for (var i = 0; i < messages.length; i++) { 35 | var message = messages[i]; 36 | var startLine = message.line - 1, endLine = message.line - 1, startCol = message.col - 1, endCol = message.col; 37 | found.push({ 38 | from: CodeMirror.Pos(startLine, startCol), 39 | to: CodeMirror.Pos(endLine, endCol), 40 | message: message.message, 41 | severity : message.type 42 | }); 43 | } 44 | return found; 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /public/codemirror/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pascal mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pascal mode

27 | 28 | 29 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-pascal.

61 |
62 | -------------------------------------------------------------------------------- /public/codemirror/mode/pig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pig Latin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pig Latin mode

27 |
39 | 40 | 47 | 48 |

49 | Simple mode that handles Pig Latin language. 50 |

51 | 52 |

MIME type defined: text/x-pig 53 | (PIG code) 54 | 55 |

56 | -------------------------------------------------------------------------------- /public/codemirror/addon/display/autorefresh.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")) 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod) 9 | else // Plain browser env 10 | mod(CodeMirror) 11 | })(function(CodeMirror) { 12 | "use strict" 13 | 14 | CodeMirror.defineOption("autoRefresh", false, function(cm, val) { 15 | if (cm.state.autoRefresh) { 16 | stopListening(cm, cm.state.autoRefresh) 17 | cm.state.autoRefresh = null 18 | } 19 | if (val && cm.display.wrapper.offsetHeight == 0) 20 | startListening(cm, cm.state.autoRefresh = {delay: val.delay || 250}) 21 | }) 22 | 23 | function startListening(cm, state) { 24 | function check() { 25 | if (cm.display.wrapper.offsetHeight) { 26 | stopListening(cm, state) 27 | if (cm.display.lastWrapHeight != cm.display.wrapper.clientHeight) 28 | cm.refresh() 29 | } else { 30 | state.timeout = setTimeout(check, state.delay) 31 | } 32 | } 33 | state.timeout = setTimeout(check, state.delay) 34 | state.hurry = function() { 35 | clearTimeout(state.timeout) 36 | state.timeout = setTimeout(check, 50) 37 | } 38 | CodeMirror.on(window, "mouseup", state.hurry) 39 | CodeMirror.on(window, "keyup", state.hurry) 40 | } 41 | 42 | function stopListening(_cm, state) { 43 | clearTimeout(state.timeout) 44 | CodeMirror.off(window, "mouseup", state.hurry) 45 | CodeMirror.off(window, "keyup", state.hurry) 46 | } 47 | }); 48 | -------------------------------------------------------------------------------- /public/codemirror/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: VBScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

VBScript mode

27 | 28 | 29 |
46 | 47 | 53 | 54 |

MIME types defined: text/vbscript.

55 |
56 | -------------------------------------------------------------------------------- /source/widgets/plug/plug.widget.css: -------------------------------------------------------------------------------- 1 | .plug-wrap { 2 | position:absolute; 3 | right: 10px; 4 | top: 5px; 5 | width:33.33%; 6 | display: inline-block; 7 | } 8 | 9 | .clf {clear: both;} 10 | 11 | .widget[iotb-widget="plug"] .plug-title{ 12 | display: inline-block; 13 | color: black; 14 | font-size: 18px; 15 | line-height: 42px; 16 | height: 42px; 17 | margin: 0 10px; 18 | font-weight: bold; 19 | } 20 | 21 | [class*="slider-"] { display:none } 22 | 23 | .slider-v1 + label { 24 | position: relative; 25 | display: block; 26 | width: 5.5em; 27 | height: 3em; 28 | cursor: pointer; 29 | border-radius: 1.5em; 30 | background: #ddd; 31 | box-shadow: 0 0.07em 0.1em -0.1em rgba(0, 0, 0, 0.4) inset, 0 0.05em 0.08em -0.01em rgba(255, 255, 255, 0.7); 32 | } 33 | 34 | .slider-v1 + label::before { 35 | position: absolute; 36 | content: ''; 37 | width: 2em; 38 | height: 2em; 39 | top: 0.5em; 40 | left: 0.5em; 41 | border-radius: 50%; 42 | background: #f5f5f5; 43 | box-shadow: 0 0.1em 0.15em -0.05em rgba(255, 255, 255, 0.9) inset, 0 0.5em 0.3em -0.1em rgba(0, 0, 0, 0.25); 44 | } 45 | 46 | .slider-v1 + label::after { 47 | position: absolute; 48 | content: ''; 49 | width: 1em; 50 | height: 1em; 51 | top: 1em; 52 | left: 6em; 53 | border-radius: 50%; 54 | background: #ddd; 55 | box-shadow: 0 0.08em 0.15em -0.1em rgba(0, 0, 0, 0.5) inset, 0 0.05em 0.08em -0.01em rgba(255, 255, 255, 0.7), -7.25em 0 0 -0.25em rgba(0, 0, 0, 0.3); 56 | } 57 | 58 | .slider-v1:checked + label::after { 59 | background: #4c6; 60 | box-shadow: 0 0.08em 0.15em -0.1em rgba(0, 0, 0, 0.5) inset, 0 0.05em 0.08em -0.01em rgba(255, 255, 255, 0.7), -7.25em 0 0 -0.25em rgba(0, 0, 0, 0.12); 61 | } 62 | 63 | .slider-v1:checked + label::before { 64 | left: 3em; 65 | } 66 | -------------------------------------------------------------------------------- /public/codemirror/mode/gherkin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gherkin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gherkin mode

27 |
42 | 45 | 46 |

MIME types defined: text/x-feature.

47 | 48 |
49 | -------------------------------------------------------------------------------- /public/codemirror/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Properties files mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Properties files mode

27 |
46 | 49 | 50 |

MIME types defined: text/x-properties, 51 | text/x-ini.

52 | 53 |
54 | -------------------------------------------------------------------------------- /public/codemirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "indent", function(cm, start) { 15 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); 16 | if (!/\S/.test(firstLine)) return; 17 | var getIndent = function(line) { 18 | return CodeMirror.countColumn(line, null, tabSize); 19 | }; 20 | var myIndent = getIndent(firstLine); 21 | var lastLineInFold = null; 22 | // Go through lines until we find a line that definitely doesn't belong in 23 | // the block we're folding, or to the end. 24 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { 25 | var curLine = cm.getLine(i); 26 | var curIndent = getIndent(curLine); 27 | if (curIndent > myIndent) { 28 | // Lines with a greater indent are considered part of the block. 29 | lastLineInFold = i; 30 | } else if (!/\S/.test(curLine)) { 31 | // Empty lines might be breaks within the block we're trying to fold. 32 | } else { 33 | // A non-empty line at an indent equal to or less than ours marks the 34 | // start of another block. 35 | break; 36 | } 37 | } 38 | if (lastLineInFold) return { 39 | from: CodeMirror.Pos(start.line, firstLine.length), 40 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) 41 | }; 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /public/codemirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Rust mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Rust mode

28 | 29 | 30 |
53 | 54 | 62 | 63 |

MIME types defined: text/x-rustsrc.

64 |
65 | -------------------------------------------------------------------------------- /public/codemirror/addon/fold/markdown-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "markdown", function(cm, start) { 15 | var maxDepth = 100; 16 | 17 | function isHeader(lineNo) { 18 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); 19 | return tokentype && /\bheader\b/.test(tokentype); 20 | } 21 | 22 | function headerLevel(lineNo, line, nextLine) { 23 | var match = line && line.match(/^#+/); 24 | if (match && isHeader(lineNo)) return match[0].length; 25 | match = nextLine && nextLine.match(/^[=\-]+\s*$/); 26 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; 27 | return maxDepth; 28 | } 29 | 30 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); 31 | var level = headerLevel(start.line, firstLine, nextLine); 32 | if (level === maxDepth) return undefined; 33 | 34 | var lastLineNo = cm.lastLine(); 35 | var end = start.line, nextNextLine = cm.getLine(end + 2); 36 | while (end < lastLineNo) { 37 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; 38 | ++end; 39 | nextLine = nextNextLine; 40 | nextNextLine = cm.getLine(end + 2); 41 | } 42 | 43 | return { 44 | from: CodeMirror.Pos(start.line, firstLine.length), 45 | to: CodeMirror.Pos(end, cm.getLine(end).length) 46 | }; 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /public/codemirror/mode/javascript/typescript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TypeScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

TypeScript mode

27 | 28 | 29 |
51 | 52 | 59 | 60 |

This is a specialization of the JavaScript mode.

61 |
62 | -------------------------------------------------------------------------------- /public/codemirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var WORD = /[\w$]+/, RANGE = 500; 15 | 16 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 17 | var word = options && options.word || WORD; 18 | var range = options && options.range || RANGE; 19 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 20 | var end = cur.ch, start = end; 21 | while (start && word.test(curLine.charAt(start - 1))) --start; 22 | var curWord = start != end && curLine.slice(start, end); 23 | 24 | var list = options && options.list || [], seen = {}; 25 | var re = new RegExp(word.source, "g"); 26 | for (var dir = -1; dir <= 1; dir += 2) { 27 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 28 | for (; line != endLine; line += dir) { 29 | var text = editor.getLine(line), m; 30 | while (m = re.exec(text)) { 31 | if (line == cur.line && m[0] === curWord) continue; 32 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { 33 | seen[m[0]] = true; 34 | list.push(m[0]); 35 | } 36 | } 37 | } 38 | } 39 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /public/codemirror/mode/sass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Sass mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Sass mode

28 |
58 | 64 | 65 |

MIME types defined: text/x-sass.

66 |
67 | -------------------------------------------------------------------------------- /public/iotboard/iotboard.css: -------------------------------------------------------------------------------- 1 | html, body{ 2 | min-height: 100%; 3 | } 4 | 5 | body { 6 | padding: 10px; 7 | } 8 | 9 | html { 10 | font-family: 'Open Sans', 'Helvetica Neue'; 11 | } 12 | 13 | .widget { 14 | background-color: white; 15 | border: 1px solid #ccc; 16 | border-radius: 4px; 17 | font-size: 14px; 18 | margin-bottom: 10px; 19 | position: relative; 20 | box-shadow: 0 0 10px rgba(0, 0, 0, .1); 21 | } 22 | 23 | .widget .title { 24 | color: #fff; 25 | background-color: #61c0ec; 26 | height: 30px; 27 | line-height: 30px; 28 | text-align: center; 29 | font-size: 1.1em; 30 | } 31 | 32 | .clf {clear: both;};html, body, div, span, applet, object, iframe, 33 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 34 | a, abbr, acronym, address, big, cite, code, 35 | del, dfn, em, img, ins, kbd, q, s, samp, 36 | small, strike, strong, sub, sup, tt, var, 37 | b, u, i, center, 38 | dl, dt, dd, ol, ul, li, 39 | fieldset, form, label, legend, 40 | table, caption, tbody, tfoot, thead, tr, th, td, 41 | article, aside, canvas, details, embed, 42 | figure, figcaption, footer, header, hgroup, 43 | menu, nav, output, ruby, section, summary, 44 | time, mark, audio, video { 45 | margin: 0; 46 | padding: 0; 47 | border: 0; 48 | font-size: 100%; 49 | font: inherit; 50 | vertical-align: baseline; 51 | } 52 | /* HTML5 display-role reset for older browsers */ 53 | article, aside, details, figcaption, figure, 54 | footer, header, hgroup, menu, nav, section { 55 | display: block; 56 | } 57 | body { 58 | line-height: 1; 59 | } 60 | ol, ul { 61 | list-style: none; 62 | } 63 | blockquote, q { 64 | quotes: none; 65 | } 66 | blockquote:before, blockquote:after, 67 | q:before, q:after { 68 | content: ''; 69 | content: none; 70 | } 71 | table { 72 | border-collapse: collapse; 73 | border-spacing: 0; 74 | } 75 | 76 | *{ 77 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 78 | } -------------------------------------------------------------------------------- /public/iotboard/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IOT Board 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 35 | -------------------------------------------------------------------------------- /public/codemirror/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Perl mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Perl mode

27 | 28 | 29 |
67 | 68 | 73 | 74 |

MIME types defined: text/x-perl.

75 |
76 | -------------------------------------------------------------------------------- /source/widgets/led/led.widget.css: -------------------------------------------------------------------------------- 1 | .clf {clear: both;} 2 | /* colorpicker styles */ 3 | .widget[iotb-widget="led"] .colorpicker { 4 | border-radius: 5px 5px 5px 5px; 5 | color: #FFFFFF; 6 | font-size: 12px; 7 | width: 200px; 8 | margin: 10px; 9 | float: left; 10 | } 11 | .widget[iotb-widget="led"] .picker { 12 | cursor: crosshair; 13 | border: 0; 14 | } 15 | .widget[iotb-widget="led"] .controls { 16 | margin: 10px; 17 | } 18 | .widget[iotb-widget="led"] .preview { 19 | float: right; 20 | margin: 50px 10px; 21 | } 22 | .widget[iotb-widget="led"] .preview > div{ 23 | margin-top: 20px; 24 | } 25 | .widget[iotb-widget="led"] .controls > div { 26 | border: 1px solid #2F2F2F; 27 | margin-bottom: 5px; 28 | overflow: hidden; 29 | padding: 5px; 30 | } 31 | .widget[iotb-widget="led"] .controls label { 32 | float: left; 33 | } 34 | .widget[iotb-widget="led"] .controls > div input{ 35 | border: 1px solid #2F2F2F; 36 | color: #DDDDDD; 37 | float: right; 38 | font-size: 10px; 39 | height: 14px; 40 | margin-left: 6px; 41 | text-align: center; 42 | text-transform: uppercase; 43 | width: 150px; 44 | } 45 | .widget[iotb-widget="led"] .preview > div input { 46 | background-color: #CCC; 47 | width: 10px; 48 | height: 10px; 49 | text-align: center; 50 | border: 0; 51 | } 52 | .widget[iotb-widget="led"] .btn { 53 | margin: 0 10px; 54 | width: 100px; 55 | height: 30px; 56 | border-radius: 5px; 57 | color: white; 58 | line-height: 30px; 59 | text-align: center; 60 | font-weight: bold; 61 | } 62 | .widget[iotb-widget="led"] .btn-refresh { 63 | float: left; 64 | } 65 | .widget[iotb-widget="led"] .btn-set { 66 | float: right; 67 | } 68 | 69 | .widget[iotb-widget="led"] { 70 | color: black; 71 | padding: 4px; 72 | } 73 | 74 | .widget[iotb-widget="led"] .text { 75 | margin-top: 4px; 76 | } 77 | -------------------------------------------------------------------------------- /public/codemirror/mode/elm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Elm mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Elm mode

27 | 28 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-elm.

61 |
62 | -------------------------------------------------------------------------------- /public/codemirror/mode/idl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: IDL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

IDL mode

27 | 28 |
52 | 62 | 63 |

MIME types defined: text/x-idl.

64 |
65 | -------------------------------------------------------------------------------- /views/document/fireware.md: -------------------------------------------------------------------------------- 1 | # 固件开发 2 | 3 | 这里给开发者讲解如何进行固件开发,如何结合[WebIDE](http://tisan.pandocloud.com)开发自己的产品。 4 | 5 | ## 准备工作 6 | 搭建环境和准备好SDK,参考[快速开始](快速开始.md) 7 | 8 | ## 在WebIDE中添加产品 9 | 在WebIDE中添加产品,并保存。如何使用WebIDE可以参考[WebIDE开发](界面开发.md) 10 | 11 | ## 取得产品Key 12 | 在WebIDE的工作区添加产品,取得产品key,并将其复制到device_config.h文件中宏定义PANDO_PRODUCT_KEY的值。 13 | device_config.h文件在SDK的 **app/user** 目录下。 14 | 15 | ## 组织产品组件代码 16 | 点击WebIDE中产品组件区域所选的组件,会弹出一个代码预览框,该代码即为pando框架中object(组件)的基础代码,复制的SDK中 **app/user/objects** 目录下,只要稍作修改就可以使用。 下面示例是一个RGB灯的产品示例: 17 | main 18 | 代码预览中的led.c和led.h复制到SDK中 **app/user/objects** 目录下,如图: 19 | ![添加led组件示例代码](image/w_objcode_add.png) 20 | 需要对led.c补充驱动代码,注意是补充代码中**TODO:**的函数: 21 | 22 | - 首先添加外设驱动的引用: 23 | `#include "../../peripheral/peri_rgb_light.h"` 24 | 添加obj编号,**注意同一个工程里面的obj编号必须唯一**: 25 | `#define LED_OBJECT_NO 1` 26 | - 补充初始化函数,注意,初始化调用的外设请在**peripheral**中相应的驱动里面去配置: 27 | ``` 28 | void ICACHE_FLASH_ATTR 29 | led_init() 30 | { 31 | peri_rgb_light_init(); 32 | } 33 | ``` 34 | 35 | - 补充set和get方法,在这里是led_set以及led_get方法: 36 | ``` 37 | void ICACHE_FLASH_ATTR 38 | led_set(struct led* value) 39 | { 40 | struct LIGHT_PARAM light_value; 41 | light_value.pwm_duty[0] = value->red; 42 | light_value.pwm_duty[1] = value->green; 43 | light_value.pwm_duty[2] = value->blue; 44 | peri_rgb_light_param_set(light_value); 45 | } 46 | ``` 47 | ``` 48 | void ICACHE_FLASH_ATTR 49 | led_get(struct led* value) 50 | { 51 | struct LIGHT_PARAM light_value; 52 | light_value = peri_rgb_light_param_get(); 53 | light_value.pwm_duty[0] = value->red; 54 | light_value.pwm_duty[1] = value->green; 55 | light_value.pwm_duty[2] = value->blue; 56 | } 57 | ``` 58 | - 另外如果object还有其他需要**TODO:**的地方,请参考TODO的提示来进行代码补充。 59 | 60 | 好了代码补充完毕了,直接编译,生成bin文件,就可以对Tisan进行烧录了! 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /public/codemirror/mode/dart/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Dart mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Dart mode

27 |
28 | 62 |
63 | 64 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /public/codemirror/mode/handlebars/handlebars.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../../addon/mode/simple"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineSimpleMode("handlebars", { 15 | start: [ 16 | { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, 17 | { regex: /\{\{!/, push: "comment", token: "comment" }, 18 | { regex: /\{\{/, push: "handlebars", token: "tag" } 19 | ], 20 | handlebars: [ 21 | { regex: /\}\}/, pop: true, token: "tag" }, 22 | 23 | // Double and single quotes 24 | { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, 25 | { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, 26 | 27 | // Handlebars keywords 28 | { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, 29 | { regex: /(?:else|this)\b/, token: "keyword" }, 30 | 31 | // Numeral 32 | { regex: /\d+/i, token: "number" }, 33 | 34 | // Atoms like = and . 35 | { regex: /=|~|@|true|false/, token: "atom" }, 36 | 37 | // Paths 38 | { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } 39 | ], 40 | dash_comment: [ 41 | { regex: /--\}\}/, pop: true, token: "comment" }, 42 | 43 | // Commented code 44 | { regex: /./, token: "comment"} 45 | ], 46 | comment: [ 47 | { regex: /\}\}/, pop: true, token: "comment" }, 48 | { regex: /./, token: "comment" } 49 | ] 50 | }); 51 | 52 | CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); 53 | }); 54 | -------------------------------------------------------------------------------- /views/document/enviroment.md: -------------------------------------------------------------------------------- 1 | ## 导读 2 | 该文档说明**tisan**评估板的开发环境,主要涉及以下内容: 3 | - IDE编译环境 4 | - 如何用工具生成固件 5 | - 如何烧写固件 6 | 7 | ## IDE编译环境 8 | 可以到这里下载IDE:[**8266_SDK_IDE**](http://yun.baidu.com/s/1sjG2r2P)。 9 | 解压缩后会得到以下文件: 10 | ![解压缩文件](image/unpack1.jpg) 11 | 双击**ESP8266IDE**打开: 12 | ![IDE主界面](image/d_click2.jpg) 13 | 这是IDE启动界面,需要等一会:) 14 | 选择一个Workspace,然后等进度条走完: 15 | ![设置Workspace](image/set_workspace2.jpg) 16 | 17 | 开始,准备导入工程,点击右上角的File: 18 | ![Import工程1](image/import_project2.jpg) 19 | 在Import界面选择**C/C++**下面的**Existing Code as Makefile Project** 20 | ![Import工程2](image/import_project12.jpg) 21 | 在Import现有代码的界面浏览选择要编辑/编译的工程,并在**Toolchain for Indexer Settings**里选择**Cygwin GCC**: 22 | ![选择Cygwin](image/choose_cygwin2.jpg) 23 | 好,然后所有高级特性都出来了,比如代码补全、自动代码分析,代码跟踪等。 24 | ![加载完成](image/load_project2.jpg) 25 | 点击编译按钮,或者按Ctrl+B,编译整个工程: 26 | ![编译工程](image/Compile2.jpg) 27 | 编译成功成后即生成bin固件,可以到bin/upgrage文件夹中找到bin文件。 28 | ![固件生成](image/building2.jpg) 29 | 30 | 31 | 32 | ## 如何烧写固件 33 | 适用于存储空间大于4MB的flash(若flash大小小于4M,烧写方法会有所不同),不按该配置烧写将导致固件无法正常运行。 34 | [烧写软件](http://pan.baidu.com/s/1bnyk36n): 烧录bin文件的软件 35 | 烧写工具: 支持TTL电平的USB转串口的工具 36 | 烧写方法如下: 37 | 38 | 1. 打开烧写软件:flash_download_tool_v0.9.6_150419.exe; 39 | 2. 把bin文件放入对应栏并注意对应地址,前面记得打“√”; 40 | 3. “SPI MODE”处为QIO(默认就是); 41 | 4. “FLASH SIZE”处改为“32Mbit(仅针对32Mbit的ESP12&ESP-12E)”,其他普通模块为8Mbit; 42 | 5. "COM"选择对应的串口号,具体可以在电脑设备管理器上查看; 43 | 6. 点击“START”然后重新上电即可; 44 | 7. 将模块GPIO0与GND短接, 烧写的TxRx和gnd连线接好; 45 | 8. 进度条不走的话可反复上电或者点击“STOP”后重新执行上一步; 46 | 9. 烧写完成后GPIO 0拉高. 47 | 48 | ![烧写固件界面](image/download_bin_all2.jpg) 49 | 50 | 烧写地址对应表(4M的flash): 51 | 52 | | bin file | address offset | 53 | | -------- | -------------- | 54 | | boot_v1.2.bin | 0x00000 | 55 | | user1.4096.new.4.bin | 0x01000 | 56 | | esp_init_data_default.bin | 0x3FC000 | 57 | | blank.bin | 0x3FE000 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /public/codemirror/mode/xml/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } 7 | 8 | MT("matching", 9 | "[tag&bracket <][tag top][tag&bracket >]", 10 | " text", 11 | " [tag&bracket <][tag inner][tag&bracket />]", 12 | "[tag&bracket ]"); 13 | 14 | MT("nonmatching", 15 | "[tag&bracket <][tag top][tag&bracket >]", 16 | " [tag&bracket <][tag inner][tag&bracket />]", 17 | " [tag&bracket ]"); 18 | 19 | MT("doctype", 20 | "[meta ]", 21 | "[tag&bracket <][tag top][tag&bracket />]"); 22 | 23 | MT("cdata", 24 | "[tag&bracket <][tag top][tag&bracket >]", 25 | " [atom ]", 27 | "[tag&bracket ]"); 28 | 29 | // HTML tests 30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); 31 | 32 | MT("selfclose", 33 | "[tag&bracket <][tag html][tag&bracket >]", 34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", 35 | "[tag&bracket ]"); 36 | 37 | MT("list", 38 | "[tag&bracket <][tag ol][tag&bracket >]", 39 | " [tag&bracket <][tag li][tag&bracket >]one", 40 | " [tag&bracket <][tag li][tag&bracket >]two", 41 | "[tag&bracket ]"); 42 | 43 | MT("valueless", 44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); 45 | 46 | MT("pThenArticle", 47 | "[tag&bracket <][tag p][tag&bracket >]", 48 | " foo", 49 | "[tag&bracket <][tag article][tag&bracket >]bar"); 50 | 51 | })(); 52 | -------------------------------------------------------------------------------- /public/codemirror/addon/edit/continuelist.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/, 15 | emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/, 16 | unorderedListRE = /[*+-]\s/; 17 | 18 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 19 | if (cm.getOption("disableInput")) return CodeMirror.Pass; 20 | var ranges = cm.listSelections(), replacements = []; 21 | for (var i = 0; i < ranges.length; i++) { 22 | var pos = ranges[i].head; 23 | var eolState = cm.getStateAfter(pos.line); 24 | var inList = eolState.list !== false; 25 | var inQuote = eolState.quote !== 0; 26 | 27 | var line = cm.getLine(pos.line), match = listRE.exec(line); 28 | if (!ranges[i].empty() || (!inList && !inQuote) || !match) { 29 | cm.execCommand("newlineAndIndent"); 30 | return; 31 | } 32 | if (emptyListRE.test(line)) { 33 | cm.replaceRange("", { 34 | line: pos.line, ch: 0 35 | }, { 36 | line: pos.line, ch: pos.ch + 1 37 | }); 38 | replacements[i] = "\n"; 39 | } else { 40 | var indent = match[1], after = match[5]; 41 | var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 42 | ? match[2] 43 | : (parseInt(match[3], 10) + 1) + match[4]; 44 | 45 | replacements[i] = "\n" + indent + bullet + after; 46 | } 47 | } 48 | 49 | cm.replaceSelections(replacements); 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('tisan:server'); 9 | var http = require('http'); 10 | var config = require('../config/index'); 11 | 12 | /** 13 | * Get port from environment and store in Express. 14 | */ 15 | 16 | app.set('port', config.listen_port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(config.listen_port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /public/codemirror/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Jinja2 mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Jinja2 mode

27 |
49 | 54 |
55 | -------------------------------------------------------------------------------- /source/merged/css/iotboard.css: -------------------------------------------------------------------------------- 1 | html { 2 | min-height: 100%; 3 | } 4 | 5 | body { 6 | padding: 10px; 7 | background:url(img/bg2.jpeg); 8 | background-size:100% 100%; 9 | background-repeat:no-repeat; 10 | overflow-y: scroll; 11 | overflow-x: hidden; 12 | } 13 | 14 | .widget { 15 | background-color: white; 16 | opacity: 0.8; 17 | border: 1px solid #ccc; 18 | padding: 4px; 19 | border-radius: 4px; 20 | font-size: 14px; 21 | margin-bottom: 10px; 22 | position: relative; 23 | width:100%; 24 | overflow-x:hidden; 25 | overflow-y:hidden; 26 | } 27 | 28 | .widget .title { 29 | font-weight: bold; 30 | border-bottom: solid 1px gray; 31 | font-size: 18px; 32 | height: 24px; 33 | line-height: 24px; 34 | text-align: center; 35 | } 36 | ;html, body, div, span, applet, object, iframe, 37 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 38 | a, abbr, acronym, address, big, cite, code, 39 | del, dfn, em, img, ins, kbd, q, s, samp, 40 | small, strike, strong, sub, sup, tt, var, 41 | b, u, i, center, 42 | dl, dt, dd, ol, ul, li, 43 | fieldset, form, label, legend, 44 | table, caption, tbody, tfoot, thead, tr, th, td, 45 | article, aside, canvas, details, embed, 46 | figure, figcaption, footer, header, hgroup, 47 | menu, nav, output, ruby, section, summary, 48 | time, mark, audio, video { 49 | margin: 0; 50 | padding: 0; 51 | border: 0; 52 | font-size: 100%; 53 | font: inherit; 54 | vertical-align: baseline; 55 | } 56 | /* HTML5 display-role reset for older browsers */ 57 | article, aside, details, figcaption, figure, 58 | footer, header, hgroup, menu, nav, section { 59 | display: block; 60 | } 61 | body { 62 | line-height: 1; 63 | } 64 | ol, ul { 65 | list-style: none; 66 | } 67 | blockquote, q { 68 | quotes: none; 69 | } 70 | blockquote:before, blockquote:after, 71 | q:before, q:after { 72 | content: ''; 73 | content: none; 74 | } 75 | table { 76 | border-collapse: collapse; 77 | border-spacing: 0; 78 | } 79 | 80 | *{ 81 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 82 | } -------------------------------------------------------------------------------- /views/document/firmware.md: -------------------------------------------------------------------------------- 1 | # 固件开发 2 | 3 | 这里给开发者讲解如何进行固件开发,如何结合[WebIDE](http://tisan.pandocloud.com)开发自己的产品。 4 | 5 | ## 准备工作 6 | 搭建环境和准备好SDK,参考[快速开始](quick-start.md) 7 | 8 | ## 在WebIDE中添加产品 9 | 在WebIDE中添加产品,并保存。如何使用WebIDE可以参考[WebIDE开发](wed-ide.md) 10 | 11 | ## 取得产品Key 12 | 在WebIDE的工作区添加产品,取得产品key: 13 | ![w_prod_key](image/w_prod_key.png) 14 | 点击“查看”,在弹出框里将key的字符串复制到device_config.h文件中宏定义PANDO_PRODUCT_KEY的值。 15 | device_config.h文件在SDK的 **app/user** 目录下: 16 | ![w_prod_key_edit](image/w_prod_key_edit.png) 17 | 18 | 19 | ## 组织产品组件代码 20 | 点击WebIDE中产品组件区域所选的组件,会弹出一个代码预览框,该代码即为pando框架中object(组件)的基础代码,复制的SDK中 **app/user/objects** 目录下,只要稍作修改就可以使用。 下面示例是一个RGB灯的产品示例: 21 | ![w_obj_edit](image/w_obj_edit.png) 22 | 代码预览中的led.c和led.h复制到SDK中 **app/user/objects** 目录下,如图: 23 | ![添加led组件示例代码](image/w_objcode_add.png) 24 | 需要对led.c补充驱动代码,注意是补充代码中**TODO:**的函数: 25 | 26 | - 首先添加外设驱动的引用: 27 | `#include "../../peripheral/peri_rgb_light.h"` 28 | 添加obj编号,**注意同一个工程里面的obj编号必须唯一**: 29 | `#define LED_OBJECT_NO 1` 30 | - 补充初始化函数,注意,初始化调用的外设请在**peripheral**中相应的驱动里面去配置: 31 | ``` 32 | void ICACHE_FLASH_ATTR 33 | led_init() 34 | { 35 | peri_rgb_light_init(); 36 | } 37 | ``` 38 | 39 | - 补充set和get方法,在这里是led_set以及led_get方法: 40 | ``` 41 | void ICACHE_FLASH_ATTR 42 | led_set(struct led* value) 43 | { 44 | struct LIGHT_PARAM light_value; 45 | light_value.pwm_duty[0] = value->red; 46 | light_value.pwm_duty[1] = value->green; 47 | light_value.pwm_duty[2] = value->blue; 48 | peri_rgb_light_param_set(light_value); 49 | } 50 | ``` 51 | ``` 52 | void ICACHE_FLASH_ATTR 53 | led_get(struct led* value) 54 | { 55 | struct LIGHT_PARAM light_value; 56 | light_value = peri_rgb_light_param_get(); 57 | light_value.pwm_duty[0] = value->red; 58 | light_value.pwm_duty[1] = value->green; 59 | light_value.pwm_duty[2] = value->blue; 60 | } 61 | ``` 62 | - 另外如果object还有其他需要**TODO:**的地方,请参考TODO的提示来进行代码补充。 63 | 64 | 好了代码补充完毕了,直接编译,生成bin文件,就可以对Tisan进行烧录了! 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /public/codemirror/mode/shell/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({}, "shell"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("var", 9 | "text [def $var] text"); 10 | MT("varBraces", 11 | "text[def ${var}]text"); 12 | MT("varVar", 13 | "text [def $a$b] text"); 14 | MT("varBracesVarBraces", 15 | "text[def ${a}${b}]text"); 16 | 17 | MT("singleQuotedVar", 18 | "[string 'text $var text']"); 19 | MT("singleQuotedVarBraces", 20 | "[string 'text ${var} text']"); 21 | 22 | MT("doubleQuotedVar", 23 | '[string "text ][def $var][string text"]'); 24 | MT("doubleQuotedVarBraces", 25 | '[string "text][def ${var}][string text"]'); 26 | MT("doubleQuotedVarPunct", 27 | '[string "text ][def $@][string text"]'); 28 | MT("doubleQuotedVarVar", 29 | '[string "][def $a$b][string "]'); 30 | MT("doubleQuotedVarBracesVarBraces", 31 | '[string "][def ${a}${b}][string "]'); 32 | 33 | MT("notAString", 34 | "text\\'text"); 35 | MT("escapes", 36 | "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); 37 | 38 | MT("subshell", 39 | "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); 40 | MT("doubleQuotedSubshell", 41 | "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); 42 | 43 | MT("hashbang", 44 | "[meta #!/bin/bash]"); 45 | MT("comment", 46 | "text [comment # Blurb]"); 47 | 48 | MT("numbers", 49 | "[number 0] [number 1] [number 2]"); 50 | MT("keywords", 51 | "[keyword while] [atom true]; [keyword do]", 52 | " [builtin sleep] [number 3]", 53 | "[keyword done]"); 54 | MT("options", 55 | "[builtin ls] [attribute -l] [attribute --human-readable]"); 56 | MT("operator", 57 | "[def var][operator =]value"); 58 | })(); 59 | -------------------------------------------------------------------------------- /public/codemirror/mode/dart/dart.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../clike/clike")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../clike/clike"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var keywords = ("this super static final const abstract class extends external factory " + 15 | "implements get native operator set typedef with enum throw rethrow " + 16 | "assert break case continue default in return new deferred async await " + 17 | "try catch finally do else for if switch while import library export " + 18 | "part of show hide is").split(" "); 19 | var blockKeywords = "try catch finally do else for if switch while".split(" "); 20 | var atoms = "true false null".split(" "); 21 | var builtins = "void bool num int double dynamic var String".split(" "); 22 | 23 | function set(words) { 24 | var obj = {}; 25 | for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 26 | return obj; 27 | } 28 | 29 | CodeMirror.defineMIME("application/dart", { 30 | name: "clike", 31 | keywords: set(keywords), 32 | multiLineStrings: true, 33 | blockKeywords: set(blockKeywords), 34 | builtin: set(builtins), 35 | atoms: set(atoms), 36 | hooks: { 37 | "@": function(stream) { 38 | stream.eatWhile(/[\w\$_]/); 39 | return "meta"; 40 | } 41 | } 42 | }); 43 | 44 | CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); 45 | 46 | // This is needed to make loading through meta.js work. 47 | CodeMirror.defineMode("dart", function(conf) { 48 | return CodeMirror.getMode(conf, "application/dart"); 49 | }, "clike"); 50 | }); 51 | --------------------------------------------------------------------------------