Inital commit
This commit is contained in:
57
octoprint_webcamtab/__init__.py
Normal file
57
octoprint_webcamtab/__init__.py
Normal file
@ -0,0 +1,57 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "Sven Lohrmann <malnvenshorn@gmail.com>"
|
||||
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
|
||||
__copyright__ = "Copyright (C) 2017 Sven Lohrmann - Released under terms of the AGPLv3 License"
|
||||
|
||||
import octoprint.plugin
|
||||
|
||||
|
||||
class WebcamTabPlugin(octoprint.plugin.SettingsPlugin,
|
||||
octoprint.plugin.AssetPlugin,
|
||||
octoprint.plugin.TemplatePlugin):
|
||||
|
||||
# SettingsPlugin mixin
|
||||
|
||||
def get_settings_defaults(self):
|
||||
return dict()
|
||||
|
||||
# AssetPlugin mixin
|
||||
|
||||
def get_assets(self):
|
||||
return dict(
|
||||
js=["js/webcamtab.js"]
|
||||
)
|
||||
|
||||
# Softwareupdate hook
|
||||
|
||||
def get_update_information(self):
|
||||
return dict(
|
||||
webcamtab=dict(
|
||||
displayName="Webcam Tab",
|
||||
displayVersion=self._plugin_version,
|
||||
|
||||
# version check: github repository
|
||||
type="github_release",
|
||||
user="malnvenshorn",
|
||||
repo="OctoPrint-WebcamTab",
|
||||
current=self._plugin_version,
|
||||
|
||||
# update method: pip
|
||||
pip="https://github.com/malnvenshorn/OctoPrint-WebcamTab/archive/{target_version}.zip"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
__plugin_name__ = "Webcam Tab"
|
||||
|
||||
|
||||
def __plugin_load__():
|
||||
global __plugin_implementation__
|
||||
__plugin_implementation__ = WebcamTabPlugin()
|
||||
|
||||
global __plugin_hooks__
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
|
||||
}
|
28
octoprint_webcamtab/static/js/webcamtab.js
Normal file
28
octoprint_webcamtab/static/js/webcamtab.js
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* View model for OctoPrint-WebcamTab
|
||||
*
|
||||
* Author: Sven Lohrmann
|
||||
* License: AGPLv3
|
||||
*/
|
||||
$(function() {
|
||||
function WebcamTabViewModel(parameters) {
|
||||
var self = this;
|
||||
|
||||
// assign the injected parameters, e.g.:
|
||||
// self.loginStateViewModel = parameters[0];
|
||||
// self.settingsViewModel = parameters[1];
|
||||
|
||||
// TODO: Implement your plugin's view model here.
|
||||
}
|
||||
|
||||
// view model class, parameters for constructor, container to bind to
|
||||
OCTOPRINT_VIEWMODELS.push([
|
||||
WebcamTabViewModel,
|
||||
|
||||
// e.g. loginStateViewModel, settingsViewModel, ...
|
||||
[ /* "loginStateViewModel", "settingsViewModel" */ ],
|
||||
|
||||
// e.g. #settings_plugin_webcamtab, #tab_plugin_webcamtab, ...
|
||||
[ /* ... */ ]
|
||||
]);
|
||||
});
|
Reference in New Issue
Block a user