Correction de 'notif.js'

This commit is contained in:
xdrm-brackets 2016-05-18 21:49:10 +02:00
parent bc51b65956
commit ecdd788e9e
5 changed files with 8 additions and 5 deletions

View File

@ -87,7 +87,7 @@
// } // }
$req = new ModuleRequest('download/facebook', array('subjects'=>array(1, 137))); $req = new ModuleRequest('download/phone', array('subjects'=>array(273)));
$res = $req->download(); $res = $req->download();

2
js/lib/notif-min.js vendored
View File

@ -1,4 +1,4 @@
var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array&&c instanceof Element))return null;var e=-1,d;for(d in a)if(-1<b.indexOf(a[d])){e=d;break}if(-1==e)return a.push(c)-1;a[e]=c;return e}; var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};var xxb=null;NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array&&c.element instanceof Element))return null;var e=-1,d;for(d in a)if(-1<b.indexOf(a[d])){e=d;break}if(-1==e)return a.push(c)-1;a[e]=c;return e};
NotificationClass.prototype.hide=function(a){if(isNaN(a))return!1;a=parseInt(a);this.stack[a].element instanceof Element&&this.container.removeChild(this.stack[a].element);this.stack[a]=null}; NotificationClass.prototype.hide=function(a){if(isNaN(a))return!1;a=parseInt(a);this.stack[a].element instanceof Element&&this.container.removeChild(this.stack[a].element);this.stack[a]=null};
NotificationClass.prototype.show=function(a,c,b,e){a=-1<this.types.indexOf(a)?a:this.types[0];c="string"==typeof c?c:"";b="string"==typeof b.toString()?b:"...";null!=this.errorCodes[b]&&(b=this.errorCodes[b]);e="number"==typeof e?e:this.defaultTimeout;var d={element:document.createElement("div"),type:a,title:c,message:b,timeout:null};d.element.className="notification-element";d.element.setAttribute("data-"+a,"");d.element.innerHTML="<p><strong>"+c+":</strong> "+b+"<p>";this.container.appendChild(d.element); NotificationClass.prototype.show=function(a,c,b,e){a=-1<this.types.indexOf(a)?a:this.types[0];c="string"==typeof c?c:"";b="string"==typeof b.toString()?b:"...";null!=this.errorCodes[b]&&(b=this.errorCodes[b]);e="number"==typeof e?e:this.defaultTimeout;var d={element:document.createElement("div"),type:a,title:c,message:b,timeout:null};d.element.className="notification-element";d.element.setAttribute("data-"+a,"");d.element.innerHTML="<p><strong>"+c+":</strong> "+b+"<p>";this.container.appendChild(d.element);
var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)}; var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)};

View File

@ -32,7 +32,9 @@ NotificationClass.prototype = {
* @emptyValues<Array> Liste des valeurs à considérer comme 'vides' * @emptyValues<Array> Liste des valeurs à considérer comme 'vides'
* *
*/ */
var xxb = null;
NotificationClass.prototype.pushStack = function(stack, element, emptyValues){ NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
/* (0) Vérification des INPUT /* (0) Vérification des INPUT
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) Vérification de @stack */ /* (1) Vérification de @stack */
@ -42,7 +44,7 @@ NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
if( !(emptyValues instanceof Array) ) if( !(emptyValues instanceof Array) )
return null; return null;
/* (3) Vérification de element */ /* (3) Vérification de element */
if( !(element instanceof Element) ) if( !(element.element instanceof Element) )
return null; return null;

View File

@ -6,7 +6,7 @@
class lightdb{ class lightdb{
// REPERTOIRE RACINE DE TOUTES LES BDD // REPERTOIRE RACINE DE TOUTES LES BDD
public static $default_root = __ROOT__.'/'; public static $default_root = __ROOT__;
// ATTRIBUTS // ATTRIBUTS
private $root; private $root;
@ -26,7 +26,7 @@
public function __construct($dbname, $root=null){ public function __construct($dbname, $root=null){
/* [0] On récupère les attributs /* [0] On récupère les attributs
=========================================================*/ =========================================================*/
$this->root = is_null($root) ? self::$default_root : $root; $this->root = is_null($root) ? self::$default_root.'/' : $root;
$this->dbname = $dbname; $this->dbname = $dbname;
$this->dir = $this->root.$dbname.'/'; $this->dir = $this->root.$dbname.'/';

File diff suppressed because one or more lines are too long