2017 © Pedro Peláez
 

library progress-bar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

image

occ2/progress-bar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

  • Thursday, October 5, 2017
  • by packal
  • Repository
  • 1 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

ProgressBar

Simple progress bar control for Nette Framework., (*1)

Requirements:

PHP >=5.6 Nette >=2.4 Twitter Bootstrap >=3 (not for version 4) nette.ajax.js, (*2)

Installation:

composer require occ2/progress-bar, (*3)

  • copy assets/autorefresh.ajax.js to your_www_js_dir/ext and link it in your page.
  • don't forget to have Twitter bootstrap css and js files linked to your page

Usage in presenter

public function createComponentProgressBar(){
        $m=$this->model;
        $callback = function() use($m){
            return $m->getValue(); //change what you need .. must return integer !!
        };
        $config = [
            "title"=>"BAR TITLE", // bar title
            "minValue"=>0, // minimul value
            "maxValue"=>100,// maximum value
            "valuePrefix"=>"", // text before shown value
            "valueSuffix"=>"%", // text after shown value
            "showValue"=>true, // show value in progress bar?
            "strippedStyle"=>true, // use stripped style
            "animatedStyle"=>true, // use animated bar
            "colorStyle"=>"success" // color style (available info/warning/success/danger)
            "warningThreshold"=>null, // switch to warning style (if null nothing switched)
            "dangerThreshold"=>null // switch to danger style (if null nothing switched)
            ];
        $refreshTime = 3; // time to automatic AJAX refresh (set null if autorefresh disabled)
        return new \OCC2\ProgressBar\ProgressBar("cpuLoad", $callback, $config, $refreshTime);
}

Usage in latte template

{control progressBar}

Usage of autorefresh.ajax.sh

  1. During $.nette.init() all elements with class .autorefresh is found and read url ant time
  2. URL of autorefresh is in data-refresh-url attribute
  3. Refresh time is in data-refresh-time attribute

The Versions

05/10 2017

dev-stable

dev-stable https://github.com/OCC2/ProgressBar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

  Sources   Download

MIT

The Requires

 

05/10 2017

1.0.2

1.0.2.0 https://github.com/OCC2/ProgressBar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

  Sources   Download

MIT

The Requires

 

29/09 2017

1.0.1

1.0.1.0 https://github.com/OCC2/ProgressBar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

  Sources   Download

MIT

The Requires

 

29/09 2017

1.0.0

1.0.0.0 https://github.com/OCC2/ProgressBar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

  Sources   Download

MIT

The Requires

 

29/09 2017

dev-master

9999999-dev https://github.com/OCC2/ProgressBar

Simple progress bar control for Nette Framework. Based on Twitter Bootstrap 3

  Sources   Download

MIT

The Requires