forked from pmpkk/openhab_spotify-webconnect-api
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTime.widget.json
executable file
·3 lines (3 loc) · 5.36 KB
/
Time.widget.json
1
2
3
{
"template": "\n<div class=\"section\">\n <div class=\"thing\"></div>\n\n <div class=\"sectionIconContainer\"><div class=\"sectionIcon\"><svg viewBox=\"0 0 48 48\"><use xlink:href=\"/static/matrix-theme/squidink.svg#line-visuals\"></use></svg></div></div>\n <div class=\"title\">Music</div>\n <div class=\"controls\">\n\n<!-- <div class=\"widget\">\n<class=\"name\">Clock widget </class>\n<div ng-init=\"clockmodel={\n'mode':'digital',\n'font_size':16,\n'digital_format':'HH:mm:ss'\n}\">\n<widget-clock ng-model=\"clockmodels\"></widget-clock>\n</div>\n</div>\n--> \n\n <div class=\"widget\" oc-lazy-load=\"['/static/js/time.js']\" >\n \n<div ng-app=\"myApp\">\n <div ng-controller='TimeCtrl' ng-init=\"resetTimer=true\">\n <button><ng-click=\"resetTimer=!resetTimer\">Click to reset timer</ng-click></button>\n <div ng-if=\"resetTimer==true\" ng-init=\"sTime=clock\">in if {{sTime}}\n <div ng-init=\"sTime=clock; resetTimer=false\"></div>\n </div>\n <p ng-init=\"fTime=clock\">clock reset at {{sTime}}</p>\n <p>{{ clock | date:'HH:mm:ss'}}</p>\n <b>{{ clock }} clock ftime {{ fTime }}</b>\n </div>\n</div>\n \n \n \n <div ng-controller='TimeCtrl'>\n <p>{{ clock | date:'medium'}}</p>\n </div>\n <div ng-app=\"myTime\">\n <div class=\"button\" ng-click=\"time_callbacks.startTimer\">Start Clock</div>\n <div ng-controller=\"MainCtrl\" class=\"wrapper\">\n <div class=\"mytime\" ></div>\n <div class=\"value\" ng-init=\"tvar=time_callbacks.tvar\"> tvar is {{tvar}}</div>\n <div class=\"name\" ng-model=\"time_callbacks.value=87\"> value is {{ time_callbacks.value }} </div>\n </div>\n </div>\n </div>\n\n\n\n <div class=\"widget\" >\n <div class=\"icon off\"><svg viewBox=\"0 0 48 48\"><use xlink:href=\"/static/matrix-theme/squidink.svg#line-visuals\"></use></svg></div>\n <div class=\"name\">Track</div>\n\n <div class=\"playback\" oc-lazy-load=\"['/static/js/spotifySlider.js']\" >\n\n <div ng-app=\"spotifySlider\">\n <div ng-controller=\"MainCtrl\" class=\"wrapper\">\n <div class=\"name\" ng-init=\"stoggle=true; offsetTime=slider_callbacks.getTime()\"></div>Update time is {{offsetTime}}\n <div onclick=\"slider_callbacks.getTime()\">Click Me {{offsetTime}} {{slider_callbacks.offVal}}</div>\n <div ng-model=\"slider_callbacks.options.ceil=(itemValue('spotify_current_duration') - itemValue('spotify_current_duration')%1000 )/1000\"></div>\n <div ng-if=\"stoggle!=false\" ng-model=\"slider_callbacks.value=itemValue('spotify_current_progress')\"></div>\n <div ng-if=\"stoggle==false\" ng-init=\"slider_callbacks.value=itemValue('spotify_current_progress')\"></div>\n <rzslider rz-slider-model=\"slider_callbacks.value\"\n rz-slider-options=\"slider_callbacks.options\" ng-click=\"sendCmd('spotify_current_progress',slider_callbacks.value)\"></rzslider>\n </div>\n </div>\n </div>\n </div>\n\n\n <div class=\"widget\" ng-init=\"deviceVolume={ value: itemValue('spotify_current_volume') }\">\n <div class=\"icon off\" ><svg viewBox=\"0 0 48 48\"><use xlink:href=\"/static/matrix-theme/squidink.svg#volume\"></use></svg></div>\n <div ng-if=\"itemValue('spotify_current_device') != 'KERES'\" ng-model=\"deviceVolume.value=itemValue('spotify_current_volume')\" ></div >\n <div ng-if=\"itemValue('spotify_current_device') == 'KERES'\" ng-model=\"deviceVolume.value=((1000 * itemValue('LG_TV0_Volume'))/ 10)\" ></div >\n <div class=\"name\">Volume<div class=\"value\">{{deviceVolume.value }} </div></div>\n <div class=\"controlGroup\">\n <div class=\"control\" ng-click=\"sendCmd('spotify_set_volume', 'up')\"><svg viewBox=\"0 0 80 80\"><use xlink:href=\"/static/matrix-theme/squidink.svg#top-arrow-2\"></use></svg></div>\n <div class=\"control\" ng-click=\"sendCmd('spotify_set_volume', 'volume_down')\"><svg viewBox=\"0 0 80 80\"><use xlink:href=\"/static/matrix-theme/squidink.svg#down-arrow-2\"></use></svg></div>\n <div class=\"control on\" ng-if=\"itemValue('spotify_current_volume')=='0'\" ng-click=\"sendCmd('spotify_set_volume', 'mute')\"><svg viewBox=\"0 0 80 80\"><use xlink:href=\"/static/matrix-theme/squidink.svg#volume-close\"></use></svg></div>\n <div class=\"control\" ng-if=\"itemValue('spotify_current_volume')!='0'\" ng-click=\"sendCmd('spotify_set_volume', 'mute')\"><svg viewBox=\"0 0 80 80\"><use xlink:href=\"/static/matrix-theme/squidink.svg#volume\"></use></svg></div>\n\n\n <div class=\"playback\" oc-lazy-load=\"['/static/js/myslider.js']\" >\n <div ng-app=\"rzSliderDemo\">\n <div ng-controller=\"MainCtrl\" class=\"wrapper\">\n <div class=\"name\" ></div>\n <div ng-init=\"slider_volume.toggle=true\"></div>\n <div ng-if=\"slider_volume.toggle==false\" ng-init=\"slider_volume.value=deviceVolume.value\"></div>\n <div ng-if=\"slider_volume.toggle!=false\" ng-model=\"slider_volume.value=deviceVolume.value\"></div>\n <rzslider rz-slider-model=\"slider_volume.value\"\n rz-slider-options=\"slider_volume.options\" ng-click=\"sendCmd('spotify_set_volume', slider_volume.value)\"></rzslider>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n\n\n </div> \n</div>"
}