PageSourceSearch

https://wslr.org/wp-content/plugins/smart-forms/js/bootstrap/bootstrapUtils.js?ver=5

js wslr.org collected 2026-10-03 22:57:13 UTC 12,862 bytes, 382 lines download raw bytes

1rnJQuery.fn.RNWait=function(param)
2{
3
4    if(param=='start')
5    {
6        rnJQuery(this).addClass('ladda-button');
7        rnJQuery(this).attr('data-style','expand-left');
8        var buttonAnimation=Ladda.create(this[0]);
9        buttonAnimation.start();
10        rnJQuery.data(this[0],'sdLadda',buttonAnimation);
11    }
12
13    if(param=='stop')
14    {
15        var buttonAnimation=rnJQuery.data(this[0],'sdLadda');
16        if(buttonAnimation!=null)
17            buttonAnimation.stop();
18
19        rnJQuery.removeData(this[0],'sdLadda');
20    }
21
22};
23
24rnJQuery.fn.RDNotifications=function(dynamicHeight)
25{
26    if(typeof dynamicHeight =='undefined')
27        dynamicHeight=false;
28
29    if(dynamicHeight==false)
30        this.wrap('<div style="height: 50px;"></div>')
31
32    return {
33        Element:rnJQuery(this),
34        ShowError:function(message)
35        {
36            this.SetAlert('error',message);
37        },
38        ShowWarning:function(message)
39        {
40            this.SetAlert('warning',message);
41        },
42
43        ShowSuccess:function(message)
44        {
45            this.SetAlert('success',message);
46
47        },
48        Clear:function()
49        {
50            this.Element.slideUp('1000','easeInQuint');
51        },
52        SetAlert:function(type,message)
53        {
54            this.ClearAlertTypes();
55            var classType='';
56            var glyph='';
57            switch (type)
58            {
59                case 'error':
60                    classType='alert-danger';
61                    glyph='glyphicon glyphicon-remove';
62                    break;
63                case 'success':
64                    classType='alert-success';
65                    glyph='glyphicon glyphicon-ok';
66                    break;
67                case 'warning':
68                    classType='alert-warning';
69                    glyph='glyphicon glyphicon-warning-sign';
70                    break;
71            }
72
73            this.Element.addClass('alert '+classType );
74            this.Element.hide();
75            this.Element.empty();
76            this.Element.append('<span class="'+glyph+'" style="margin-right: 5px;"></span><span>'+message+'</span>');
77            this.Element.slideDown('1000','easeInQuint');
78        },
79        ClearAlertTypes:function()
80        {
81            this.Element.removeClass('alert alert-success alert-info alert-warning alert-danger')
82        }
83    };
84};
85
86
87/************************************************************************************* Wait Dialog ***************************************************************************************************/
88rnJQuery.RNGetWaitDialog=function()
89{
90    if(typeof this.RNWaitDialog =='undefined')
91        this.RNWaitDialog=new RNWaitDialog();
92
93    return this.RNWaitDialog;
94};
95
96function RNWaitDialog()
97{
98    if(typeof RNWaitDialog.prototype.$Dialog=='undefined')
99    {
100        RNWaitDialog.prototype.$Dialog=rnJQuery(
101            '<div class="modal fade" data-backdrop="static"  data-keyboard="false">'+
102                '<div class="modal-dialog">'+
103                    '<div class="modal-content">'+
104                        '<div class="modal-header">'+
105                            '<h4 class="modal-title">Processing</h4>'+
106                        '</div>'+
107                        '<div class="modal-body">'+
108                            '<div class="progress">'+
109                                '<div class="progress-bar progress-bar-striped active"  role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>'+
110                            '</div>'+
111                        '</div>'+
112                    '</div>'+
113                '</div>' +
114            '</div>');
115
116        var container=rnJQuery('<div class="bootstrap-wrapper"></div>');
117        container.append(RNWaitDialog.prototype.$Dialog);
118        rnJQuery('body').append(container);
119    }
120}
121
122RNWaitDialog.prototype.Show=function(message)
123{
124    var $dialog = this.$Dialog.find(".modal-dialog");
125    var offset = (rnJQuery(window).height() - $dialog.height()) / 2;
126    // Center modal vertically in window
127    $dialog.css("margin-top", offset);
128    this.$Dialog.find('.modal-title').text(message);
129    this.$Dialog.modal('show');
130};
131
132
133RNWaitDialog.prototype.Hide=function()
134{
135    this.$Dialog.modal('hide');
136};
137
138
139/************************************************************************************* Alert Dialog ***************************************************************************************************/
140rnJQuery.RNGetAlertDialog=function()
141{
142    if(typeof this.RNAlertDialog =='undefined')
143        this.RNAlertDialog=new RNAlertDialog();
144
145    return this.RNAlertDialog;
146};
147
148function RNAlertDialog()
149{
150    if(typeof RNAlertDialog.prototype.$Dialog=='undefined')
151    {
152        //todo:create error and warning dialog
153        RNAlertDialog.prototype.$Dialog=rnJQuery(
154            '<div class="modal fade"  tabindex="-1">'+
155                '<div class="modal-dialog warning">'+
156                    '<div class="modal-content">'+
157                        '<div class="modal-header">'+
158                            '<span class="glyphicon glyphicon-warning-sign" style="display: inline"></span>'+
159                            '<h4 style="display: inline" class="modal-title"></h4>'+
160                        '</div>'+
161                        '<div class="modal-body">'+
162                        '</div>'+
163                        '<div class="modal-footer">'+
164                            '<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>'+
165                        '</div>'+
166                    '</div>'+
167                '</div>'+
168            '</div>');
169
170        var container=rnJQuery('<div class="bootstrap-wrapper"></div>');
171        container.append(RNAlertDialog.prototype.$Dialog);
172        rnJQuery('body').append(container);
173    }
174}
175
176RNAlertDialog.prototype.ShowWarning=function(title,message)
177{
178    var $dialog = this.$Dialog.find(".modal-dialog");
179    $dialog.find('.modal-body').html(RedNaoEscapeHtml(message));
180    $dialog.find('.modal-title').text(title);
181    var offset = (rnJQuery(window).height() - $dialog.height()) / 2;
182    // Center modal vertically in window
183    $dialog.css("margin-top", offset);
184    this.$Dialog.modal('show');
185};
186
187
188RNAlertDialog.prototype.Hide=function()
189{
190    this.$Dialog.modal('hide');
191};
192
193RNAlertDialog.prototype.Hide=function()
194{
195    this.$Dialog.modal('hide');
196};
197
198
199/************************************************************************************* Confirmation Dialog ***************************************************************************************************/
200rnJQuery.RNGetConfirmationDialog=function()
201{
202    if(typeof this.RNConfirmationDialog =='undefined')
203        this.RNConfirmationDialog=new RNConfirmationDialog();
204
205    return this.RNConfirmationDialog;
206};
207
208function RNConfirmationDialog()
209{
210    if(typeof RNConfirmationDialog.prototype.$Dialog=='undefined')
211    {
212        //todo:create error and warning dialog
213        RNConfirmationDialog.prototype.$Dialog=rnJQuery(
214            '<div class="modal fade"  tabindex="-1">'+
215                '<div class="modal-dialog">'+
216                '<div class="modal-content">'+
217                '<div class="modal-header" style="background-color: #3399FF;color:white;">'+
218                '<h4 style="display: inline" class="modal-title"></h4>'+
219                '</div>'+
220                '<div class="modal-body">'+
221                '</div>'+
222                '<div class="modal-footer">'+
223                '<button type="button" class="btn btn-success rnBtnYes" data-dismiss="modal"><span class="glyphicon glyphicon-ok"></span>Yes</button>'+
224                '<button type="button" class="btn btn-danger" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>No</button>'+
225                '</div>'+
226                '</div>'+
227                '</div>'+
228                '</div>');
229
230        var container=rnJQuery('<div class="bootstrap-wrapper"></div>');
231        container.append(RNConfirmationDialog.prototype.$Dialog);
232        rnJQuery('body').append(container);
233    }
234}
235
236RNConfirmationDialog.prototype.ShowConfirmation=function(title,message,callback)
237{
238    var $dialog = this.$Dialog.find(".modal-dialog");
239    $dialog.find('.modal-body').html(RedNaoEscapeHtml(message));
240    $dialog.find('.modal-title').html(title);
241    var offset = (rnJQuery(window).height() - $dialog.height()) / 2;
242    // Center modal vertically in window
243    $dialog.css("margin-top", offset);
244    this.$Dialog.find('.rnBtnYes').unbind('click').bind('click',function(){callback();});
245
246    this.$Dialog.modal('show');
247
248};
249
250
251rnJQuery.fn.modal.Constructor.prototype.ShowInCenter=function()
252{
253    var $dialog=this.$element.find('.modal-dialog');
254    var offset = (rnJQuery(window).height() - $dialog.height()) / 2-40;
255    // Center modal vertically in window
256    $dialog.css("margin-top", offset);
257    this.$element.modal('show');
258};
259
260
261//************************************************************************Dialog******************************************************
262
263rnJQuery.fn.RNDialog=function(params,param2)
264{
265    var $body=rnJQuery(this);
266    var rnDialog=$body.data('rndialog');
267    var command='';
268    if(typeof params=='string')
269    {
270        command=params;
271        params={};
272    }
273
274    if(typeof rnDialog=='undefined'||rnDialog==null)
275    {
276        rnDialog=new RNDialog($body,params);
277        rnDialog.$Dialog.data('rndialog',rnDialog);
278        $body.data('rndialog',rnDialog);
279    }
280
281    if(command!='')
282        rnDialog[command](param2);
283
284    return rnDialog.$Dialog;
285};
286
287
288
289function RNDialog($body,params)
290{
291    this.Options={};
292    this.$Body=$body;
293    this.SetUpOptions(params);
294    this.$Dialog=rnJQuery(
295        '<div class="modal fade" data-backdrop="static"  style="display: none" >'+
296            '<div class="modal-dialog">'+
297                '<div class="modal-content">'+
298                    '<div class="modal-header" style="background-color: #3399FF;color:white;">'+
299                        '<h4 style="display: inline" class="modal-title"></h4>'+
300                    '</div>'+
301                    '<div class="modal-body">'+
302                    '</div>'+
303                    '<div class="modal-footer">'+
304                    '</div>'+
305                '</div>'+
306            '</div>'+
307        '</div>');
308
309    if(this.Options.Width!=null)
310        this.$Dialog.find('.modal-dialog').css('width',this.Options.Width);
311
312
313
314    var container=rnJQuery('<div class="bootstrap-wrapper"></div>');
315    container.append(this.$Dialog);
316    rnJQuery('body').append(container);
317
318    if(this.Options.Title==null)
319        this.$Dialog.find('.modal-header').remove();
320    else
321        this.$Dialog.find('.modal-header').append(rnJQuery(this.Options.Title));
322
323    if(this.Options.Buttons.length==0)
324        this.$Dialog.find('.modal-footer').remove();
325    else
326        for(var i=0;i<this.Options.Buttons.length;i++)
327        {
328            var button=this.CreateButton(this.Options.Buttons[i]);
329            this.$Dialog.find('.modal-footer').append(button);
330        }
331
332    this.$Dialog.find('.modal-body').append($body);
333}
334
335RNDialog.prototype.Destroy=function(){
336    this.$Body.removeData('rndialog');
337};
338
339RNDialog.prototype.CreateButton=function(btnOptions)
340{
341    if(typeof btnOptions.Icon=='undefined')
342        btnOptions.Icon='';
343    var button=rnJQuery('<button data-button-id="'+btnOptions.Id+'" type="button" class="btn btn-'+btnOptions.Style+'" ><span class="'+btnOptions.Icon+'"></span>'+btnOptions.Label+'</button>');
344    var self=this;
345    button.click(function()
346    {
347        if(btnOptions.Action=='cancel')
348            self.Hide();
349        self.Options.ButtonClick(btnOptions.Action,button);
350    });
351    return button;
352};
353
354RNDialog.prototype.SetUpOptions=function(params)
355{
356    this.Options=rnJQuery.extend(
357        {
358            Title:null,
359            Width:null,
360            Buttons:[
361                {Label:'Cancel',Id:'dialogCancel',Style:'danger',Icon:'glyphicon glyphicon-remove',Action:'cancel'},
362                {Label:'Accept',Id:'dialogAccept',Style:'success',Icon:'glyphicon glyphicon-ok',Action:'accept'}
363            ],
364            ButtonClick:function(Action){}
365        },params
366    )
367};
368
369RNDialog.prototype.GetButton=function(buttonId)
370{
371    return this.$Dialog.find('button[data-button-id="'+buttonId+'"]');
372};
373
374RNDialog.prototype.Hide=function(params)
375{
376    this.$Dialog.modal('hide');
377};
378
379RNDialog.prototype.Show=function(params)
380{
381    this.$Dialog.modal('show');
382};

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.