PHP Classes

File: public/js/source/logger.js

Recommend this page to a friend!
  Classes of Josantonius  >  PHP Logger lib  >  public/js/source/logger.js  >  Download  
File: public/js/source/logger.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Logger lib
Log errors to files and display messages on a page
Author: By
Last change:
Date: 4 years ago
Size: 1,784 bytes
 

Contents

Class file image Download
/**
 * Php library to create logs easily and store them in Json format.
 * 
 * @author     Josantonius - hello@josantonius.com
 * @copyright  Copyright (c)
 * @license    https://opensource.org/licenses/MIT - The MIT License (MIT)
 * @link       https://github.com/Josantonius/PHP-Logger
 * @since      1.1.2
 */

var LOOGER = (function() {

   var el = document.getElementsByClassName('jst-log-line');

   for (var i = 0 ; i < el.length; i++) {

      el[i].addEventListener('click', function() {

         var expand = document.querySelectorAll('[data-' + this.id + ']');

         for (var i = 0 ; i < expand.length; i++) {

            if (expand[i].classList.contains('jst-no-display') === true) {

               fadeIn(expand[i]);
            
            } else {

               fadeOut(expand[i]);
            }
         }
      }, false); 
   }

   /**
    * @author Ibu <http://idiallo.com>
    */
   function fadeIn(element) {

      var op = 0.1;

      element.classList.remove('jst-no-display');

      var timer = setInterval(function () {

         if (op >= 1){
            
            clearInterval(timer);
         }
         
         element.style.opacity = op;
         
         element.style.filter = 'alpha(opacity=' + op * 100 + ")";
         
         op += op * 0.1;

       }, 10);
   }

   /**
    * @author Ibu <http://idiallo.com>
    */
   function fadeOut(element) {

      var op = 1;

      var timer = setInterval(function () {

         if (op <= 0.1){

            clearInterval(timer);
            
            element.classList.add('jst-no-display');
         }

         element.style.opacity = op;
         
         element.style.filter = 'alpha(opacity=' + op * 100 + ")";
         
         op -= op * 0.1;

       }, 10);
   }

})();
For more information send a message to info at phpclasses dot org.