diff --git a/octoprint_BLOCKS/__init__.py b/octoprint_BLOCKS/__init__.py index 4339345..c600cd8 100644 --- a/octoprint_BLOCKS/__init__.py +++ b/octoprint_BLOCKS/__init__.py @@ -33,15 +33,6 @@ def on_after_startup(self): ##~~ SettingsPlugin mixin - ##Plugins including the mixing will get injected an additional property - ##self._settings which is an instance of PluginSettingsManager already properly - ##initialized for use by the plugin. In order for the manager to know about the - ##available settings structure and default values upon initialization, - ##implementing plugins will need to provide a dictionary with the plugin’s - ##default settings through overriding the method get_settings_defaults(). - ##The defined structure will then be available to access through the - ##settings manager available as self._settings. - def get_settings_defaults(self): return { # put your plugin's default settings here @@ -51,7 +42,7 @@ def get_settings_defaults(self): "fixedHeader" : True, "fixedFooter" : True, - + "blocksFooterInfo" : True, "removeCollapsible" : True @@ -63,25 +54,12 @@ def add_templatetype ( self, current_order, current_rules, *args, **kwargs): ("connectionWrapper", dict(), dict(template=lambda x: x + "_connectionWrapper.jinja2")) ] """ - ##Vou precisar de adicionar as definições de on_settings_save e ainda - ##on_after_startup para salvar as definições que tenhamos - ##~~ AssetPlugin mixi - ##Allows me to define additional static assets such as JavaScript or class - ##files to be automatically embedded into the pages delivered by the server - ##to be used within the client sided part of the plugin - def get_assets(self): # Define your plugin's asset(the folder) files to automatically include in the # core UI here. - - ##Defines the folder where the plugin stores its static assets - ##as defined in - #~Return string: the absolute path to the folder where the plugin - ##stores its static assets - return dict( js= ["js/BLOCKS.js","js/jquery-ui.min.js"], img= ["img/Blocks_Logo.png","img/settings.png"], @@ -95,20 +73,13 @@ def get_assets(self): ##web interface. def get_template_configs(self): - ##Allow configuration of injected navbar,sidebar,tab and settings - ##templates(and also additional templates of types specified by plugins - ##through hte octoprint.ui.web.templateytpes hook). - ##Basically i can allows me to configure Should be a list containing one - ##configuration object per template to inject. Each configuration object - ##is represented by a dictionary which may contain the following keys: - ##type|name|template|suffix|div |replaces|custom_bindings|data_bind| - ##classes|styles return[ dict(type="settings", custom_bindings=False), # Permite-me adicionar o meu novo container para a connection mas não sei se devo utilizar este type # ou criar meu próprio type de template... dict(type="sidebar", template="blocks_connectionWrapper.jinja2", custom_bindings=False), + # My refresh button for my connection wrapper dict(type="generic", template="refreshButton.jinja2", custom_bindings=False) ] diff --git a/octoprint_BLOCKS/static/css/BLOCKS.css b/octoprint_BLOCKS/static/css/BLOCKS.css index a2381cc..aacefdf 100644 --- a/octoprint_BLOCKS/static/css/BLOCKS.css +++ b/octoprint_BLOCKS/static/css/BLOCKS.css @@ -35,15 +35,12 @@ }*/ /* -------------------------*/ body.BLOCKSUIfixedHeader{ - margin-top: 50px; + /*margin-top: 50px;*/ } .BLOCKSMainContainer{ - padding-right: 10px; - padding-left: 10px; - } - .BLOCKSMainTabs.container-fluid{ padding-left: 0px; padding-right: 0px; + padding-top: 25px; } @@ -81,8 +78,15 @@ margin-left: 10px; } #control > .container-fluid > .row-fluid { - margin-inline-start: 70px; + position: relative; + left: 70px; } + #control .jog-panel>div.distance { + text-align: left; + position: relative; + top: 0px; + left: -5px; +} /* ----------------------------*/ /* Temperature wrapper properties */ @@ -97,6 +101,7 @@ #temp_wrapper { border: 1px solid #e5e5e5; border-radius: 4px; + height : 577px; } #temp { padding: 8px 15px; @@ -186,8 +191,15 @@ display: flex; flex-direction: column; } +/* To fix the button settings on the files */ + .open>.dropdown-menu { + display: block; + position: absolute; + top: auto; + left:auto; + right:auto; - + } /* Grid properties */ .TopRow{ @@ -197,7 +209,7 @@ } .BotRow{ display: flex ; - margin-top: 10px; + /*margin-top: 10px;*/ align-items: flex-start; flex-wrap:nowrap; @@ -272,9 +284,9 @@ input[type="search"], input[type="tel"], input[type="color"], .uneditable-input } #refreshButton.refresh-trigger{ - - position: static; - left: 100px; + + position: relative; + left: 40px; } label.form-check-text { font-weight: bold; diff --git a/octoprint_BLOCKS/static/js/BLOCKS.js b/octoprint_BLOCKS/static/js/BLOCKS.js index f300a7d..6c67363 100644 --- a/octoprint_BLOCKS/static/js/BLOCKS.js +++ b/octoprint_BLOCKS/static/js/BLOCKS.js @@ -18,20 +18,17 @@ $(function() { function BlocksViewModel(parameters) { var self = this; - //Run in debug/verbose mode self.debug = false; // assign the injected parameters, e.g.: - self.settings = parameters[0]; self.connection = parameters[1]; self.loginState = parameters[2]; // TODO: Implement your plugin's view model here. - - // Quick debug + // Taken from UICustomizer plugin self.logToConsole = function(msg){ if (!self.debug){ return true; @@ -41,16 +38,12 @@ $(function() { } }; - - - - //~~---------------------------------------------------- + //--------------------------------------------------------------------------- self.onAllBound = function(){ //Html can have mulitple classes $('#tabs').parent().addClass('BLOCKSMainTabs'); - //adds another class name for the octoprint-container i can now call it by BLOCKSMainContainer $('div.octoprint-container').addClass('BLOCKSMainContainer'); @@ -65,15 +58,17 @@ $(function() { }; // onAllBound END - //--------------------------------------------------- + //--------------------------------------------------------------------------- - // -------------------------------------------------------------------------- + //--------------------------------------------------------------------------- // Connection switch trigger functionality, this set of instructions is what // make the switch work // - // -------------------------------------------------------------------------- + //--------------------------------------------------------------------------- // ~~ observable so i know if my toggle switch is on or off + // ~~ My observable trigger, lets me know if the connection switch is + // ~~ on or off self.connectIt = ko.observable(undefined); // ~~ subscribes my switch to a funcion, this function will always run when the // ~~ switch state changes (When it's pressed or not) @@ -87,40 +82,40 @@ $(function() { } }); // ~~ Change the text on my connection trigger switch + // ~~ Will display Connected/Disconnected + // ~~ it also changes the color of the connection trigger + // ~~ Conected =:= Green + // ~~ Disconnected =:= Red self.connection_labelText = ko.pureComputed(function () { if (self.connection.isErrorOrClosed()){ - $('#blocks_printer_connect').css("border-color", "rgb(255, 59, 59)"); $('.form-check-input').css("background-color","rgb(255, 59, 59)"); return gettext("Disconnected"); - } - else{ + }else{ $('#blocks_printer_connect').css("border-color", "rgb(85, 247, 92)"); $('.form-check-input:checked').css("background-color", "rgb(85, 247, 92)"); return gettext("Connected"); - } }); - // ------------------------------------------------------------------------ - + //--------------------------------------------------------------------------- - - // ------------------------------------------------------------------------ + //--------------------------------------------------------------------------- self.UpdateLayout= function(settingsPlugin){ self.logToConsole('Updating layout'); + self.set_fixedHeader(settingsPlugin.fixedHeader()); - self.set_fixedFooter(settingsPlugin.fixedFooter()); + //self.set_fixedFooter(settingsPlugin.fixedFooter()); self.set_fluidLayout(settingsPlugin.fluidLayout()); self.set_blocksFooterInfo(settingsPlugin.blocksFooterInfo()); //Builds the main layout self.set_mainLayout(settingsPlugin); - + // Remove the collapsible feature self.set_removeCollapsible(settingsPlugin.removeCollapsible()); self.correctFilesWrapper(settingsPlugin); @@ -129,27 +124,21 @@ $(function() { }; - //------------------------------------------------------------------------- + //--------------------------------------------------------------------------- // Took from UICustumizer self.set_fixedHeader = function(enable) { if(enable){ $('body').addClass('BLOCKSUIfixedHeader'); $('#navbar').removeClass('navbar-static-top').addClass('navbar-fixed-top'); $('#navbar').css('overflow','visible').css('padding-top','0').css('display','block'); - - }else{ $('body').removeClass('BLOCKSUIfixedHeader'); $('#navbar').addClass('navbar-static-top').removeClass('navbar-fixed-top'); $('#navbar').css('overflow',''); } - - - - }; - //------------------------------------------------------------------------------------------------ + //--------------------------------------------------------------------------- self.set_fixedFooter = function(enable) { if(enable){ $('.footer').css("position", "fixed"); @@ -159,37 +148,29 @@ $(function() { $('.footer').css("left","0px"); $('.footer').css("bottom","0px"); $('.footer').css("right","0px"); - } }; - //------------------------------------------------------------------------------------------------ + //--------------------------------------------------------------------------- self.set_blocksFooterInfo = function(enable) { if(enable){ $('#footer_links').prepend('