PageSourceSearch

https://www.usine-online.com/themes/usineonline/js/modules/configu…ggodsddFSFgggdstestSSDttSDvaTESTftttffyfrni

js usine-online.com collected 2026-10-08 10:58:25 UTC 5,396 bytes, 146 lines download raw bytes

1/**
2 * 2007-2019 PrestaShop
3 *
4 * NOTICE OF LICENSE
5 *
6 * This source file is subject to the Academic Free License (AFL 3.0)
7 * that is bundled with this package in the file LICENSE.txt.
8 * It is also available through the world-wide-web at this URL:
9 * http://opensource.org/licenses/afl-3.0.php
10 * If you did not receive a copy of the license and are unable to
11 * obtain it through the world-wide-web, please send an email
12 * to [email protected] so we can send you a copy immediately.
13 *
14 * DISCLAIMER
15 *
16 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17 * versions in the future. If you wish to customize PrestaShop for your
18 * needs please refer to http://www.prestashop.com for more information.
19 *
20 *  @author DMConcept <[email protected]>
21 *  @copyright 2015 DMConcept
22 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
23 *  International Registered Trademark & Property of PrestaShop SA
24 *
25 * Don't forget to prefix your containers with your own identifier
26 * to avoid any conflicts with others containers.
27 */
28
29var CONFIGURATOR = CONFIGURATOR || {};
30CONFIGURATOR.MODULES = CONFIGURATOR.MODULES || {};
31
32/**
33 * Class that handles a progress bar. 
34 * @param {Object} params      Initialisation parameters
35 *                      progress_query  Query to select the targeted progress bar
36 *                      start_color     Color used around 0%
37 *                      end_color       Color used around 100%
38 *                      start           Start % for animating        
39 *                      end             End % for animating
40 *                      
41 */
42CONFIGURATOR.MODULES.ProgressBar= function(params) {
43
44    this.params;
45
46    var DEFAULT_START_COLOR = '#00b0ee';
47
48    var DEFAULT_END_COLOR = '#026799';
49
50    /**
51     * Stores current end % in order to provided an animation from this end
52     * until the new one for future call on 'launch'.
53     * Example: if currentEnd equals 50 and the value provided is 80. The 
54     * animation will be only from 50 to 80 instead of 0 to 80
55     */
56    this.currentEnd = 0;
57
58    /**
59     * Init progress bar.
60     * If start_color and end_color are not provided, there will be
61     * replace by default color. Call 'launch' in order to have the init 
62     * animation
63     * @param {Object} params       See global comment
64     */
65    this.init = function(params) {
66        this.params = params;
67
68        this.params.start_color = this.params.start_color || DEFAULT_START_COLOR;
69        this.params.end_color = this.params.end_color || DEFAULT_END_COLOR;
70        
71        this.currentEnd = 0;
72        
73        this.launch(params.start, params.end);
74    };
75
76    /**
77     * Animates the progress bar.
78     * if 'end' is provided, animates from start to end
79     * if not, animates from currentEnd to start
80     * @param {number} start    start value for progress bar animation
81     * @param {number} end      Optional, end value for progress bar animation
82     * @returns {undefined}
83     */
84    this.launch = function(start, end) {
85
86        var prog = $(this.params.progress_query);
87
88        // if not found, means that progress is not enable
89        if (prog.length > 0) {
90            var begin = start || 0;
91            if (!end) { 
92                end = begin;
93                begin = this.currentEnd;
94            }
95            
96            this.currentEnd = end;
97
98            var param = this.generateParam(prog, begin, end);
99            
100            prog.circleProgress(param).on('circle-animation-progress', 
101                                            this.onCircleAnimationProgress);
102        }
103    };
104
105    /**
106     * Generates parameters for circleProgress animation
107     * @param {type} progressElement    targeted circle progress
108     * @param {type} start              start value
109     * @param {type} end                end value
110     * @returns {Object} parameters for 'circleProgress'
111     */
112    this.generateParam = function(progressElement, start, end) {
113        return {
114            startAngle: -Math.PI / 2,
115            animationStartValue: parseInt(start) / 100,
116            value: parseInt(end) / 100,
117            size: progressElement.width(),
118            lineCap: 'round',
119            fill: { 
120                gradient: [this.params.start_color, 
121                            this.params.end_color], 
122                gradientAngle: Math.PI 
123                }
124        }; 
125    };
126
127    /**
128     * Callend when the progress bar is animated
129     * See 'launch' for more details
130     * @param {type} event
131     * @param {type} progress
132     * @param {type} stepValue
133     */
134    this.onCircleAnimationProgress = function(event, progress, stepValue) {
135        //$(this).find('strong').html(parseInt(100 * stepValue) + '%');
136        $('#configurator-progress2').find('strong').html(parseInt(100 * stepValue * progress) + '%');
137        $('#configurator-progress2 .progression').css('width', parseInt(100 * stepValue * progress) + '%');
138		$('#configurator-progress3').find('strong').html(parseInt(100 * stepValue * progress) + '%');
139		$('#configurator-progress3 .progression').css('width', parseInt(100 * stepValue * progress) + '%');
140    };
141
142
143    if (params) {
144        this.init(params);
145    } 
146};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.