Skip to content
Snippets Groups Projects
Select Git revision
  • bf090a8a83b28bf4e35ab544727fb63ed6263e1f
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
41 results

gluon-web-model.js

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    • Kasalehlia's avatar
      bf090a8a
      gluon-web-model: update inputs on form reset · bf090a8a
      Kasalehlia authored
      Register to 'reset' event on form element and make call to 'update' function
      delayed in 'data-update' handler to allow the form values to update beforehand.
      
      When using a form's 'reset' button, form field visibility was not updated.
      This could lead to situations where a checkbox had to be toggled again
      twice to display the detail text inputs. (Example taken from private
      wifi package)
      bf090a8a
      History
      gluon-web-model: update inputs on form reset
      Kasalehlia authored
      Register to 'reset' event on form element and make call to 'update' function
      delayed in 'data-update' handler to allow the form values to update beforehand.
      
      When using a form's 'reset' button, form field visibility was not updated.
      This could lead to situations where a checkbox had to be toggled again
      twice to display the detail text inputs. (Example taken from private
      wifi package)
    gluon-web-model.js 11.26 KiB
    /*
    	Copyright 2008 Steven Barth <steven@midlink.org>
    	Copyright 2008-2012 Jo-Philipp Wich <jow@openwrt.org>
    	Copyright 2017 Matthias Schiffer <mschiffer@universe-factory.net>
    
    	Licensed under the Apache License, Version 2.0 (the "License");
    	you may not use this file except in compliance with the License.
    	You may obtain a copy of the License at
    
    	http://www.apache.org/licenses/LICENSE-2.0
    */
    
    /*
    	Build using:
    
    	uglifyjs javascript/gluon-web-model.js -o files/lib/gluon/web/www/static/gluon-web-model.js -c -m --support-ie8
    */
    
    
    
    (function() {
    	var dep_entries = {};
    
    	function Int(x) {
    		return (/^-?\d+$/.test(x) ? +x : NaN);
    	}
    
    	function Dec(x) {
    		return (/^-?\d*\.?\d+?$/.test(x) ? +x : NaN);
    	}
    
    	var validators = {
    
    		'integer': function() {
    			return !isNaN(Int(this));
    		},
    
    		'uinteger': function() {
    			return (Int(this) >= 0);
    		},
    
    		'float': function() {
    			return !isNaN(Dec(this));
    		},
    
    		'ufloat': function() {
    			return (Dec(this) >= 0);
    		},
    
    		'ipaddr': function() {
    			return validators.ip4addr.apply(this) ||
    				validators.ip6addr.apply(this);
    		},
    
    		'ip4addr': function() {
    			var match;
    			if ((match = this.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/))) {
    				return (match[1] >= 0) && (match[1] <= 255) &&
    				       (match[2] >= 0) && (match[2] <= 255) &&
    				       (match[3] >= 0) && (match[3] <= 255) &&
    				       (match[4] >= 0) && (match[4] <= 255);
    			}
    
    			return false;
    		},
    
    		'ip6addr': function() {
    			if (this.indexOf('::') < 0)
    				return (this.match(/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i) != null);