Plugin Directory

Changeset 1973361


Ignore:
Timestamp:
11/13/2018 05:46:56 AM (7 years ago)
Author:
sospiremedia
Message:

Bump version to 1.3, add compatibility with WordPress 5.0, and a bunch of other goodness!

Location:
lightweight-loading-bar/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lightweight-loading-bar/trunk/lw-loading-bar.php

    r1968095 r1973361  
    33Plugin Name: Lightweight Loading Bar
    44Description: Add a YouTube-style loading bar to the top of your site.
    5 Version: 1.2
     5Version: 1.3
    66Author: Sospire Media
    77Author URI: https://sospire.media?utm_source=wordpress.org&utm_content=wordpresspluginlightweightloadingbar
     
    2323*/
    2424
     25// Show on mobile (true = yes, false = no). true by default.
     26$enable_on_mobile = 'false';
     27
     28// Maximum width of screen to consider a mobile device. 600px by default.
     29$mobile_width = '600px';
     30
    2531// Do you want to enable the loading bar on the login page (true = yes, false = no). false by default.
    26 $enable_on_login = 'false';
     32$enable_on_login = 'true';
    2733
    2834// Do you want gradient (true = yes, false = no). false by default.
     
    4955
    5056// Register complicated global vars without conflict
     57$lw_lb_enableonmobile = $enable_on_mobile;
     58$lw_lb_mobilewidth = $mobile_width;
    5159$lw_lb_enableonlogin = $enable_on_login;
    5260$lw_lb_color = $color;
     
    5563$lw_lb_startgradient = $start_gradient;
    5664$lw_lb_endgradient = $end_gradient;
     65$lw_lb_position = $position;
    5766
    5867if ($lw_lb_isgradient == 'true') {
     
    6271}
    6372
    64 if ($position == 'top' Xor $position == 'bottom') {
    65   $lw_lb_position = $position;
     73
     74if ($lw_lb_enableonmobile == 'false') {
     75    $lw_lb_visibility = '@media screen and (max-width:' . $lw_lb_mobilewidth . ') {div#lw-loading-bar {visibility: hidden;}}';
    6676} else {
    67   $lw_lb_position = 'top';
     77    $lw_lb_visibility = '';
    6878}
     79
     80
    6981
    7082function lw_loading_bar_inject_element() {
    7183    ?>
    7284    <script type="text/javascript">
    73     (function(root){"use strict";var css=".lwloadingbar{width:100%;height:<?php global $lw_lb_height; echo $lw_lb_height ?>;z-index:9999;<?php global $lw_lb_position; echo $lw_lb_position ?>:0}.bar{width:0;height:100%;transition:height .3s;background:<?php global $lw_lb_style; echo "$lw_lb_style" ?>}";function addCss(){var s=document.getElementById("lwloadingbarcss");if(s===null){s=document.createElement("style");s.type="text/css";s.id="lwloadingbarcss";document.head.insertBefore(s,document.head.firstChild);if(!s.styleSheet)return s.appendChild(document.createTextNode(css));s.styleSheet.cssText=css}}function addClass(el,cls){if(el.classList)el.classList.add(cls);else el.className+=" "+cls}function createBar(rm){var el=document.createElement("div"),width=0,here=0,on=0,bar={el:el,go:go};addClass(el,"bar");function move(){var dist=width-here;if(dist<.1&&dist>-.1){place(here);on=0;if(width>=100){el.style.height=0;setTimeout(function(){rm(el)},300)}}else{place(width-dist/4);setTimeout(go,16)}}function place(num){width=num;el.style.width=width+"%"}function go(num){if(num>=0){here=num;if(!on){on=1;move()}}else if(on){move()}}return bar}function LWLoadingbar(opts){opts=opts||{};var el=document.createElement("div"),applyGo,lwloadingbar={el:el,go:function(p){applyGo(p);if(p>=100){init()}}};function rm(child){el.removeChild(child)}function init(){var bar=createBar(rm);el.appendChild(bar.el);applyGo=bar.go}addCss();addClass(el,"lwloadingbar");if(opts.id)el.id=opts.id;if(opts.classname)addClass(el,opts.classname);if(opts.target){el.style.position="relative";opts.target.insertBefore(el,opts.target.firstChild)}else{el.style.position="fixed";document.getElementsByTagName("body")[0].appendChild(el)}init();return lwloadingbar}if(typeof exports==="object"){module.exports=LWLoadingbar}else if(typeof define==="function"&&define.amd){define([],function(){return LWLoadingbar})}else{root.LWLoadingbar=LWLoadingbar}})(this);
     85    (function(root){"use strict";var css="<?php global $lw_lb_visibility; echo $lw_lb_visibility; ?> .lwloadingbar{width:100%;height:<?php global $lw_lb_height; echo $lw_lb_height ?>;z-index:9999;<?php global $lw_lb_position; echo $lw_lb_position ?>:0}.bar{width:0;height:100%;transition:height .3s;background:<?php global $lw_lb_style; echo "$lw_lb_style" ?>}";function addCss(){var s=document.getElementById("lwloadingbarcss");if(s===null){s=document.createElement("style");s.type="text/css";s.id="lwloadingbarcss";document.head.insertBefore(s,document.head.firstChild);if(!s.styleSheet)return s.appendChild(document.createTextNode(css));s.styleSheet.cssText=css}}function addClass(el,cls){if(el.classList)el.classList.add(cls);else el.className+=" "+cls}function createBar(rm){var el=document.createElement("div"),width=0,here=0,on=0,bar={el:el,go:go};addClass(el,"bar");function move(){var dist=width-here;if(dist<.1&&dist>-.1){place(here);on=0;if(width>=100){el.style.height=0;setTimeout(function(){rm(el)},300)}}else{place(width-dist/4);setTimeout(go,16)}}function place(num){width=num;el.style.width=width+"%"}function go(num){if(num>=0){here=num;if(!on){on=1;move()}}else if(on){move()}}return bar}function LWLoadingbar(opts){opts=opts||{};var el=document.createElement("div"),applyGo,lwloadingbar={el:el,go:function(p){applyGo(p);if(p>=100){init()}}};function rm(child){el.removeChild(child)}function init(){var bar=createBar(rm);el.appendChild(bar.el);applyGo=bar.go}addCss();addClass(el,"lwloadingbar");if(opts.id)el.id=opts.id;if(opts.classname)addClass(el,opts.classname);if(opts.target){el.style.position="relative";opts.target.insertBefore(el,opts.target.firstChild)}else{el.style.position="fixed";document.getElementsByTagName("body")[0].appendChild(el)}init();return lwloadingbar}if(typeof exports==="object"){module.exports=LWLoadingbar}else if(typeof define==="function"&&define.amd){define([],function(){return LWLoadingbar})}else{root.LWLoadingbar=LWLoadingbar}})(this);
    7486    </script>
    7587
  • lightweight-loading-bar/trunk/readme.txt

    r1969269 r1973361  
    33Tags: lightweight-loading-bar, loading-bar, loading, lw-loading-bar, loader, preload, youtube, progress, progressbar, progress-bar, preload, responsive, retina, custom, image, images, Post, plugin, posts, page, widget, admin, sidebar, google, twitter, comments, shortcode
    44Requires at least: 2.8.0
    5 Tested up to: 4.9.8
    6 Stable tag: 1.2
     5Tested up to: 5.0
     6Stable tag: 1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414### Lightweight Loading Bar
    1515
    16 Add a YouTube-style loading bar to your website easily! Extremely lightweight plugin that only adds 810 bytes to your page size. It also does not add anything to your database. Change color, height and all options of the loading bar from code easily. This design of preloader has a much more minimalist design and is not annoying at all compared to other full screen designs. This plugin has been tested with WP Rocket and should be fully compatible with other cache plugins as well. Please post bug reports, issues, and feature requests on [WordPress.org Support Forums](https://wordpress.org/support/plugin/lightweight-loading-bar) and I will respond ASAP! If you liked the plugin please [rate it](https://wordpress.org/support/plugin/lightweight-loading-bar/reviews/#new-post)!
     16Add a YouTube-style loading bar to your website easily! Extremely lightweight plugin that only adds 810 bytes to your page size. It also does not add anything to your database. Change color, height and all options of the loading bar from code easily. This design of preloader has a much more minimalist design and is not annoying at all compared to other full screen designs. Because most mobile browsers already have a built in loading bar, we allow you to disable it on devices smaller than 600px by default. This plugin has been tested with WP Rocket and should be fully compatible with other cache plugins as well. Please post bug reports, issues, and feature requests on [WordPress.org Support Forums](https://wordpress.org/support/plugin/lightweight-loading-bar) and I will respond ASAP! If you liked the plugin please [rate it](https://wordpress.org/support/plugin/lightweight-loading-bar/reviews/#new-post)!
    1717
    1818### Features
     
    2525* Set the position of the bar to either top or bottom.
    2626* Responsive and Retina ready.
     27* Option to hide on mobile devices.
    2728* Extremely small footprint at only 810 bytes.
    2829* Does not add any values to your database.
     
    3233
    3334* Go to /wp-content/plugins/lightweight-loading-bar/lw-loading-bar.php for instructions on how to customize the loading bar.
     35
     36### Coming Soon... A Settings Page!
     37
     38* The plugin will not be quite as lightweight, but we will be adding a full fledged GUI to the WordPress Admin! The reason it will be a bit slower is because the current setup allows the plugin to get the options directly from the filesystem, whereas if we have a settings page we will store them in a database which takes time to query. If you like this version of the plugin check out the [GitHub](https://github.com/CRIMSON501/Lightweight-Loading-Bar) page where we will respond to issues. If interest in the LITE version continues, we will make a fork and keep it maintained.
    3439
    3540== Installation ==
     
    4550== Changelog ==
    4651
     52= 1.3 =
     53
     54> Updating will overwrite your current configuration.
     55___
     56* Prepared for version 2 which will include a full GUI in the WP Dashboard to save your settings.
     57* Minor code refactor to improve performance.
     58* Added option to hide on mobile.
     59* Added suboption to set maximum width of screen to consider a mobile device.
     60
    4761= 1.2 =
    4862
Note: See TracChangeset for help on using the changeset viewer.