diff --git a/Gemfile.lock b/Gemfile.lock index 3f36217c..107965e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - binda (0.1.3) + binda (0.1.4) aasm (>= 4.11, < 4.13) ancestry (>= 2.1, < 3.1) bourbon (= 4.3.4) @@ -100,7 +100,7 @@ GEM railties (>= 4.1.0, < 5.2) responders warden (~> 1.2.3) - devise-i18n (1.5.0) + devise-i18n (1.5.1) devise (>= 3.4) diff-lcs (1.3) docile (1.1.5) diff --git a/app/assets/javascripts/binda/components/login-shader.js b/app/assets/javascripts/binda/components/login-shader.js index 2e4c4e37..88abacc8 100644 --- a/app/assets/javascripts/binda/components/login-shader.js +++ b/app/assets/javascripts/binda/components/login-shader.js @@ -1,5 +1,18 @@ class Shader { - constructor() {} + constructor() { + this.uniforms = { + uTime: { type: "1f", value: 0.0 }, + uCurrentTime: { type: "1f", value: Math.sin(Date.now()) + 0.5 }, + uMouse: { + type: "2f", + value: [window.innerWidth, window.innerHeight] + }, + uWindowSize: { + type: "2f", + value: [window.innerWidth, window.innerHeight] + } + }; + } isSet() { if ($("#background-shader").length > 0) { @@ -20,7 +33,7 @@ class Shader { window.innerHeight ); - //Add the canvas to the HTML document + // //Add the canvas to the HTML document document .getElementById("background-shader") @@ -32,29 +45,16 @@ class Shader { this.renderer.view.style.position = "fixed"; this.renderer.view.style.display = "block"; + let fragmentShader = document.getElementById("fragmentShader").innerHTML; + this.customShader = new PIXI.AbstractFilter( null, - document.getElementById("fragmentShader").innerHTML, + fragmentShader, this.uniforms ); this.drawRectagle(); } - uniforms() { - return { - uTime: { type: "1f", value: 0.0 }, - uCurrentTime: { type: "1f", value: Math.sin(Date.now()) + 0.5 }, - uMouse: { - type: "2f", - value: [window.innerWidth, window.innerHeight] - }, - uWindowSize: { - type: "2f", - value: [window.innerWidth, window.innerHeight] - } - }; - } - // DRAW RECTANGLE drawRectagle() { this.rectangle = new PIXI.Graphics(); @@ -197,4 +197,4 @@ function hexToShaderRgb(hex) { /* init - you can init any event */ throttle("resize", "optimizedResize"); -})(); +})(); \ No newline at end of file diff --git a/app/assets/javascripts/binda/dist/binda.bundle.js b/app/assets/javascripts/binda/dist/binda.bundle.js index 4cef65c0..5662c30c 100644 --- a/app/assets/javascripts/binda/dist/binda.bundle.js +++ b/app/assets/javascripts/binda/dist/binda.bundle.js @@ -852,6 +852,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var Shader = function () { function Shader() { _classCallCheck(this, Shader); + + this.uniforms = { + uTime: { type: "1f", value: 0.0 }, + uCurrentTime: { type: "1f", value: Math.sin(Date.now()) + 0.5 }, + uMouse: { + type: "2f", + value: [window.innerWidth, window.innerHeight] + }, + uWindowSize: { + type: "2f", + value: [window.innerWidth, window.innerHeight] + } + }; } _createClass(Shader, [{ @@ -875,7 +888,7 @@ var Shader = function () { // Create 'renderer' this.renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight); - //Add the canvas to the HTML document + // //Add the canvas to the HTML document document.getElementById("background-shader").appendChild(this.renderer.view); @@ -885,25 +898,11 @@ var Shader = function () { this.renderer.view.style.position = "fixed"; this.renderer.view.style.display = "block"; - this.customShader = new PIXI.AbstractFilter(null, document.getElementById("fragmentShader").innerHTML, this.uniforms); + var fragmentShader = document.getElementById("fragmentShader").innerHTML; + + this.customShader = new PIXI.AbstractFilter(null, fragmentShader, this.uniforms); this.drawRectagle(); } - }, { - key: "uniforms", - value: function uniforms() { - return { - uTime: { type: "1f", value: 0.0 }, - uCurrentTime: { type: "1f", value: Math.sin(Date.now()) + 0.5 }, - uMouse: { - type: "2f", - value: [window.innerWidth, window.innerHeight] - }, - uWindowSize: { - type: "2f", - value: [window.innerWidth, window.innerHeight] - } - }; - } // DRAW RECTANGLE diff --git a/app/helpers/binda/components_helper.rb b/app/helpers/binda/components_helper.rb index 619dbeee..d8e06306 100644 --- a/app/helpers/binda/components_helper.rb +++ b/app/helpers/binda/components_helper.rb @@ -37,9 +37,9 @@ def prepare_description_for_form_hint(field_setting) # @param field_setting [Binda::FieldSetting] The field setting object def prepare_description_for_selections_form_hint(field_setting) description = [] - if field_setting.description.blank? && field_setting.allow_null? - description << field_setting.description - description << I18n.t("binda.null_is_not_allowed") if !field_setting.allow_null? + unless field_setting.description.blank? && field_setting.allow_null? + description << field_setting.description unless field_setting.description.blank? + description << I18n.t("binda.null_is_not_allowed") if !field_setting.allow_null? return description.join('. ') else return false diff --git a/lib/binda/version.rb b/lib/binda/version.rb index 40b85eae..5a99aa40 100644 --- a/lib/binda/version.rb +++ b/lib/binda/version.rb @@ -1,3 +1,3 @@ module Binda - VERSION = '0.1.3'.freeze + VERSION = '0.1.4'.freeze end \ No newline at end of file