PageSourceSearch

https://kzg.pl/wp-content/plugins/cp-multi-view-calendar/DC_MultiViewCal/src/Plugins/multiview.js?ver=7.0.6

js kzg.pl collected 2026-10-02 13:01:28 UTC 35,832 bytes, 630 lines download raw bytes

1$jc = jQuery.noConflict();
2function waitvisible(gridcontainer)
3                    {
4                        if ($jc(gridcontainer).width()==0)
5                            setTimeout("waitvisible('"+gridcontainer+"')",100);
6                        else
7                            $jc(gridcontainer).reload2();    
8                    }
9function fluidDialog() {
10        var $visible = $jc(".ui-dialog:visible");
11        // each open dialog
12        $visible.each(function () {
13            var $this = $jc(this);
14            var dialog = $this.find(".ui-dialog-content");
15            if (dialog.dialog("option","fluid")) {
16                var wWidth = $jc(window).width();
17                // check window width against dialog width
18                if (wWidth < (parseInt(dialog.dialog("option","maxWidth")) + 50))  {
19                    // keep dialog from filling entire screen
20                    $this.css("max-width", "90%");
21                } else {
22                    // fix maxWidth bug
23                    $this.css("max-width", dialog.dialog("option","maxWidth") + "px");
24                }
25                //reposition dialog
26                dialog.dialog("option","position", dialog.dialog("option","position"));
27            }
28        });
29    
30    }
31    $jc(window).resize(function () {
32       fluidDialog();
33    });
34    $jc(document).on("dialogopen", ".ui-dialog", function (event, ui) {
35        fluidDialog();
36    });
37window.$ = jQuery;
38function initMultiViewCal(container,calendarId,config)
39{
40    $jc("#"+container).addClass('notranslate');
41    $jc(document).ready(function($jc) {
42        (function( $jc ) {            
43            var def = {
44            numberOfMonths:6,
45            viewNew : config.edition,
46            viewToday : config.btoday,
47            viewDay : false,
48            viewWeek : false,
49            viewMonth : false,
50            viewNMonth : false,
51            viewRowMonth : false,
52            viewNDays : false,
53            viewList : false,
54            numberOfDays : 10,
55            nOfDays:10,
56            list_start:"", //"","now" or string compatible with strtotime 
57            list_end:"",  //"","now" or string compatible with strtotime 
58            list_order:"asc",//asc or desc
59            list_totalEvents:0, //0 = unlimited
60            list_eventsPerPage:10,            
61            list_readmore_numberofwords:0, //0 = unlimited, 
62            viewRefresh : config.brefresh,
63            viewNavigation : config.bnavigation,
64            view: config.viewdefault, //'day','week','month','nMonth','nDays'
65            weekstartday:config.start_weekday,
66            showtooltip:false,
67            tooltipon:1,
68            shownavigate:false,
69            navigateurl:config.url,
70            target:0,
71            cssStyle:"ui-darkness",
72            readonly:!config.edition,
73            nmonths:12,
74            dialogWidth:300,
75            dialogCloseAuto:false,
76            height:0,
77            showtooltipdwm:false,
78            viewWeekDays:[1,1,1,1,1,1,1],
79            militaryTime:true,
80            path:"",
81            hoursStart:0,
82            hoursEnd:23,
83            cellheight:42,
84            hourswidth:52,
85            rowsByCategory:"",
86            rowsList:"",
87            dayWithColumns:"",
88            dayWithTime:true,
89            thecontainer:container,
90            userAdd:true,
91            userEdit:true,
92            userDel:true,
93            userEditOwner:true,
94            userDelOwner:true,
95            userOwner:43,
96            columnsList:false,
97            rowsList:false,
98            palette:0,
99            paletteDefault:"f00"
100            }
101            if (config.rowsByCategory!="" && !config.dayWithTime)
102                config.dayWithTime = false;
103            config = $jc.extend(def, config);
104            if (!config.userAdd)
105                config.viewNew = false;
106            var tabs = 0;
107            if (config.viewNew && !config.readonly) tabs++;
108            if (config.viewToday) tabs++;
109            if (config.viewDay) tabs++;
110            if (config.viewWeek) tabs++;
111            if (config.viewMonth) tabs++;
112            if (config.viewRowMonth) tabs++;
113            if (config.viewNDays) tabs++;
114            if (config.viewList) tabs++;
115            if (config.viewNMonth) tabs++;
116            if (config.viewRefresh) tabs++;
117            if (config.viewNavigation && ((tabs==1 && config.viewList) || (tabs==1 && config.viewNMonth) || (tabs==2 && config.viewList && config.viewNMonth))) config.viewNavigation=false;
118            if (config.viewNavigation) tabs++;
119            var string = '<div id="calhead'+config.thecontainer+' "> '+
120            
121              ((tabs>1)?
122                  '      <div id="caltoolbar'+config.thecontainer+'" class="ctoolbar">'+
123                  ((config.viewNew && !config.readonly)?
124                  '          <div id="faddbtn'+config.thecontainer+'" class="fbutton ui-state-default">'+
125                  '              <div><span class="ui-icon ui-icon-new"></span><span title="'+i18n.dcmvcal.click_to_create_new_event+'" >'+i18n.dcmvcal.new_event+'</span></div>'+
126                  '          </div>':'')+
127                  ((config.viewRefresh)?
128                  '          <div  id="showreflashbtn'+config.thecontainer+'" class="fbutton ui-state-default">'+
129                  '              <div><span class="ui-icon ui-icon-refresh"></span><span title="'+i18n.dcmvcal.refresh_view+'" class="showdayflash">'+i18n.dcmvcal.refresh+'</span></div>'+
130                  '          </div>':'')+
131                  ((config.viewToday)?
132                  '          <div class="btnseparator"></div>'+
133                  '          <div id="showtodaybtn'+config.thecontainer+'" class="fbutton ui-state-default">'+
134                  '              <div><span class="ui-icon ui-icon-today"></span><span title="'+i18n.dcmvcal.click_to_back_to_today+'" class="showtoday">'+i18n.dcmvcal.today+'</span></div>'+
135                  '          </div>':'')+
136                  ((config.viewNavigation)?
137                  '          <div class="btnseparator"></div>'+
138                  '          <div id="sfprevbtn'+config.thecontainer+'" title="'+i18n.dcmvcal.prev+'"  class="fbutton fprevbtn ">'+
139                  '            <span class="ui-icon ui-icon-circle-triangle-w"></span>'+
140                  '          </div>'+
141                  '          <div id="sfnextbtn'+config.thecontainer+'" title="'+i18n.dcmvcal.next+'" class="fbutton ui-state-default">'+
142                  '              <span class="ui-icon ui-icon-circle-triangle-e"></span>'+
143                  '          </div>'+
144                  '          <div class="fshowdatep">'+
145                  '              <div>'+
146                  '                  <input type="hidden" name="txtshow" id="hdtxtshow'+config.thecontainer+'" />'+
147                  '                  <span id="txtdatetimeshow'+config.thecontainer+'">'+i18n.dcmvcal.loading+'</span>'+
148                  '              </div>'+
149                  '          </div>':'')+
150                  ((config.print_button)?
151                  '          <div  id="showprintbtn'+config.thecontainer+'" class="fbutton ui-state-default showprintbtn">'+
152                  '              <div><span title="Print" class="shownprintview">Print</span></div>'+
153                  '          </div>':'')+
154                  ((config.export_ical_button)?
155                  '          <div  id="shownICALbtn'+config.thecontainer+'" class="fbutton ui-state-default ">'+
156                  '              <div><span title="iCal" class="showicalview">iCal</span></div>'+
157                  '          </div>':'')+
158                  ((config.viewNavigation)?
159                  '<div class="mvSelectNavigation"><label for="display-select" style="position: absolute;width: 1px;height: 1px;margin: -1px;padding: 0;overflow: hidden;clip: rect(0, 0, 0, 0);border: 0;">Select a Calendar Display</label><select>'+
160                  ((config.viewDay)?'<option value="day" '+((config.view=="day")?'selected':'')+'>'+i18n.dcmvcal.sday+'</option>':'')+
161                  ((config.viewNDays)?'<option value="nDays" '+((config.view=="nDays")?'selected':'')+'>'+i18n.dcmvcal.ndays+'</option>':'')+
162                  ((config.viewWeek)?'<option value="week" '+((config.view=="week")?'selected':'')+'>'+i18n.dcmvcal.week+'</option>':'')+
163                  ((config.viewMonth)?'<option value="month" '+((config.view=="month")?'selected':'')+'>'+i18n.dcmvcal.month+'</option>':'')+
164                  ((config.viewRowMonth)?'<option value="rowMonth" '+((config.view=="rowMonth")?'selected':'')+'>'+i18n.dcmvcal.rowmonth+'</option>':'')+
165                  ((config.viewNMonth)?'<option value="nMonth" '+((config.view=="nMonth")?'selected':'')+'>'+i18n.dcmvcal.nmonth+'</option>':'')+
166                  ((config.viewList)?'<option value="list" '+((config.view=="list")?'selected':'')+'>'+i18n.dcmvcal.list+'</option>':'')+
167                  '</select></div>':'')+
168                  '      <div style="clear:both"></div></div>':'')+
169              '</div>'+
170              '<div id="editEventContainer"></div>'+
171              '<div>'+
172              '    <div id="dvCalMain'+config.thecontainer+'" class="calmain">'+
173              '          <div id="loadingpannel'+config.thecontainer+'" class="ptogtitle loadicon" style="display: none;">'+i18n.dcmvcal.loading_data+'</div>'+
174              '          <div id="errorpannel'+config.thecontainer+'" class="ptogtitle loaderror" style="display: none;">'+i18n.dcmvcal.sorry_could_not_load_your_data+'</div>'+
175            
176              '        <div  class="gridcontainercover"><div id="gridcontainer'+config.thecontainer+'" style="position:relative;overflow-y: visible;"></div></div>'+
177              '    </div>'+
178              '</div>';
179            var $container = $jc("#"+container);
180            if (tabs<=1 && config.viewList)
181               $jc("#"+container).parent().addClass("mvlist");
182            if (tabs<=1 && config.viewNMonth)
183               $jc("#"+container).parent().addClass("mvNMonth");   
184            $container.html(string);
185                    var DATA_FEED_URL = pathCalendar+"&f=datafeed";
186                    var DATA_EDIT_URL = pathCalendar+"&f=edit&month_index="+i18n.dcmvcal.dateformat.month_index+"&delete="+((config.userDel)?"1":"0")+"&palette="+config.palette+"&paletteDefault="+config.paletteDefault+"&calid="+calendarId;
187                    var op = {
188                        numberOfMonths:config.numberOfMonths,
189                        view: config.view,
190                        readonly:config.readonly,
191                        weekstartday: config.weekstartday,
192                        showtooltip:config.showtooltip,
193                        tooltipon:config.tooltipon,
194                        shownavigate:config.shownavigate,
195                        navigateurl:config.navigateurl,
196                        target:config.target,
197                        showday: new Date(),
198                        EditCmdhandler:Edit,
199                        DeleteCmdhandler:Delete,
200                        ViewCmdhandler:View,
201                        onWeekOrMonthToDay:wtd,
202                        onBeforeRequestData: cal_beforerequest,
203                        onAfterRequestData: cal_afterrequest,
204                        onRequestDataError: cal_onerror,
205                        autoload:true,
206                        url: DATA_FEED_URL + "&method=list&calid="+calendarId,
207                        quickAddUrl: DATA_FEED_URL + "&month_index="+i18n.dcmvcal.dateformat.month_index+"&method=add&calid="+calendarId,
208                        quickUpdateUrl: DATA_FEED_URL + "&method=update&calid="+calendarId,
209                        quickDeleteUrl: DATA_FEED_URL + "&method=remove&calid="+calendarId,
210                        dialogWidth:config.dialogWidth,
211                        dialogCloseAuto:config.dialogCloseAuto,
212                        height:config.height
213            
214                    };
215                    op = $jc.extend(config, op);
216                    if (op.startdate && (op.startdate.length>=8) && (op.startdate.length<=10))
217                    {
218                        var i = op.startdate.split("-");
219                        op.startdate = new Date(i[0]*1,i[1]*1-1,i[2]*1);
220                        op.showday = op.startdate;
221                    }
222                    else
223                        op.startdate = "";
224                        
225                    if ((typeof op.mindate !== 'undefined') && ($.isNumeric(op.mindate)))
226                    {
227                        var date = new Date();
228                        date.setDate(date.getDate() + op.mindate);
229                        op.mindate = date;
230                    }
231                    else if ((typeof op.mindate !== 'undefined') && (op.mindate.length>=8) && (op.mindate.length<=10))
232                    {
233                        var i = op.mindate.split("-");
234                        op.mindate = new Date(i[0]*1,i[1]*1-1,i[2]*1);
235                    }
236                    else
237                        op.mindate = "";
238                    if ((typeof op.maxdate !== 'undefined') && ($.isNumeric(op.maxdate)))
239                    {
240                        var date = new Date();
241                        date.setDate(date.getDate() + op.maxdate);
242                        op.maxdate = date;
243                    }
244                    else if ((typeof op.maxdate !== 'undefined') && (op.maxdate.length>=8) && (op.maxdate.length<=10))
245                    {
246                        var i = op.maxdate.split("-");
247                        op.maxdate = new Date(i[0]*1,i[1]*1-1,i[2]*1);
248                    }
249                    else
250                        op.maxdate = ""; 
251                    if (op.maxdate && op.mindate)
252                    {
253                        var oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
254                        var diffDays = Math.abs((op.maxdate.getTime() - op.mindate.getTime()) / (oneDay));
255                        if ((diffDays/30)<op.numberOfMonths)
256                            op.numberOfMonths = Math.ceil(diffDays/30);
257                    }
258                            
259                    var $dv = $jc("#calhead"+op.thecontainer);
260                    var _MH = document.documentElement.clientHeight;
261                    var dvH = $dv.height() + 2;
262                    //op.height = _MH - dvH;
263                    //op.height = "100%";
264                    op.eventItems =[];
265                    setTimeout("waitvisible('#gridcontainer"+op.thecontainer+"')",100);
266                    var p = $jc("#gridcontainer"+op.thecontainer).bcalendar(op).BcalGetOp();
267                    if (p && p.datestrshow) {
268                        $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
269                    }
270                    $jc("#caltoolbar"+op.thecontainer).noSelect();
271                    try {
272                    $jc("#hdtxtshow"+op.thecontainer).datepicker({ picker: "#txtdatetimeshow"+op.thecontainer, showtarget: $jc("#txtdatetimeshow"+op.thecontainer),
273                    onReturn:function(r){
274                                    var p = $jc("#gridcontainer"+op.thecontainer).gotoDate(r).BcalGetOp();
275                                    if (p && p.datestrshow) {
276                                        $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
277                                    }
278                             }
279                    });
280                    } catch(e){};
281                    function cal_beforerequest(type)
282                    {
283                        var t=i18n.dcmvcal.loading_data;
284                        switch(type)
285                        {
286                            case 1:
287                                t=i18n.dcmvcal.loading_data;
288                                break;
289                            case 2:
290                            case 3:
291                            case 4:
292                                t=i18n.dcmvcal.request_processed;
293                                break;
294                        }
295                        $jc("#errorpannel"+op.thecontainer).hide();
296                        $jc("#loadingpannel"+op.thecontainer).html(t);
297                        $jc("#loadingpannel"+op.thecontainer).show();
298                    }
299                    function cal_afterrequest(type)
300                    {
301                        switch(type)
302                        {
303                            case 1:
304                                $jc("#loadingpannel"+op.thecontainer).hide();
305                                break;
306                            case 2:
307                            case 3:
308                            case 4:
309                                $jc("#loadingpannel"+op.thecontainer).html(i18n.dcmvcal.success);
310                                window.setTimeout(function(){ $jc("#loadingpannel"+op.thecontainer).hide();},2000);
311                            break;
312                        }
313            
314                    }
315                    function cal_onerror(type,data)
316                    {
317                        if (type!=2)
318                        $jc("#errorpannel"+op.thecontainer).show();
319                        if (data.Msg=='OVERLAPPING')
320                            alert(i18n.dcmvcal.error_overlapping);
321                        else if (!(data.Msg === undefined))
322                            alert(data.Msg);    
323                        else if (data == '-1')
324                            alert('Authentication token not longer valid. Please refresh the page.');
325                    }
326                    function Edit(data,pos)
327                    {
328                    	 if (pos === undefined) pos = "";
329                       var eurl=DATA_EDIT_URL+"&mt="+(config.militaryTime?"true":"false")+"&css="+config.cssStyle+"&lang="+config.language+"&weekstartday="+config.weekstartday+"&hoursStart="+config.hoursStart+"&hoursEnd="+config.hoursEnd+"&id={0}&start={2}&end={3}&isallday={4}&title={1}";
330                        if(data)
331                        {
332                            var url = StrFormat(eurl,data); 
333                            showEditEvent(url,pos);
334                        }
335                    }
336                    function View(data)
337                    {
338                        var str = "";
339                        $jc.each(data, function(i, item){
340                            str += "[" + i + "]: " + item + "\n";
341                        });
342                    }
343                    function Delete(data,callback)
344                    {
345            
346                        $jc.alerts.okButton=i18n.dcmvcal.ok;
347                        $jc.alerts.cancelButton=i18n.dcmvcal.cancel;
348                        hiConfirm(i18n.dcmvcal.are_you_sure_delete, 'Confirm',function(r){ r && callback(0,data[0]);});
349                    }
350                    function wtd(p)
351                    {
352                       if (p && p.datestrshow) {
353                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
354                        }
355                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
356                            $jc(this).removeClass("ui-state-active");
357                        })
358                        $jc("#showdaybtn"+op.thecontainer).addClass("ui-state-active");
359                    }
360                    try {
361                    $jc(".mvSelectNavigation select").change(function(e) {
362                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView($jc(this).val()).BcalGetOp();
363                        if (p && p.datestrshow) {
364                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
365                        }
366                    });
367                    } catch(e){};
368                    //to show day view
369                    try {
370                    $jc("#showdaybtn"+op.thecontainer).click(function(e) {
371                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
372                            $jc(this).removeClass("ui-state-active");
373                        })
374                        $jc(this).addClass("ui-state-active");
375                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("day").BcalGetOp();
376                        if (p && p.datestrshow) {
377                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
378                        }
379                    });
380                    } catch(e){};
381                    //to show week view
382                    try {
383                    $jc("#showweekbtn"+op.thecontainer).click(function(e) {
384                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
385                            $jc(this).removeClass("ui-state-active");
386                        })
387                        $jc(this).addClass("ui-state-active");
388                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("week").BcalGetOp();
389                        if (p && p.datestrshow) {
390                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
391                        }
392            
393                    });
394                    } catch(e){};
395                    //to show month view
396                    try {
397                    $jc("#showmonthbtn"+op.thecontainer).click(function(e) {
398                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
399                            $jc(this).removeClass("ui-state-active");
400                        })
401                        $jc(this).addClass("ui-state-active");
402                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("month").BcalGetOp();
403                        if (p && p.datestrshow) {
404                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
405                        }
406                    });
407                    } catch(e){};
408                    //to show nDays view
409                    try {
410                    $jc("#shownDaysbtn"+op.thecontainer).click(function(e) {
411                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
412                            $jc(this).removeClass("ui-state-active");
413                        })
414                        $jc(this).addClass("ui-state-active");
415                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("nDays").BcalGetOp();
416                        if (p && p.datestrshow) {
417                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
418                        }
419                    });
420                    } catch(e){};
421                    //to show List view
422                    try {
423                    $jc("#shownListbtn"+op.thecontainer).click(function(e) {
424                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
425                            $jc(this).removeClass("ui-state-active");
426                        })
427                        $jc(this).addClass("ui-state-active");
428                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("list").BcalGetOp();
429                        
430                        if (p && p.datestrshow) {
431                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
432                        }
433                    });                    
434                    } catch(e){};
435                    //to show rowMonth view
436                    try {
437                    $jc("#showrowMonthbtn"+op.thecontainer).click(function(e) {
438                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
439                            $jc(this).removeClass("ui-state-active");
440                        })
441                        $jc(this).addClass("ui-state-active");
442                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("rowMonth").BcalGetOp();
443                        if (p && p.datestrshow) {
444                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
445                        }
446                    });                    
447                    } catch(e){};
448                    //to show nMonth view
449                    try {
450                    $jc("#shownMonthbtn"+op.thecontainer).click(function(e) {
451                        $jc("#caltoolbar"+op.thecontainer+" div.ui-state-active").each(function() {
452                            $jc(this).removeClass("ui-state-active");
453                        })
454                        $jc(this).addClass("ui-state-active");
455                        var p = $jc("#gridcontainer"+op.thecontainer).swtichView("nMonth").BcalGetOp();
456                        if (p && p.datestrshow) {
457                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
458                        }
459                    });
460                    } catch(e){};
461                    try {
462                    $jc("#showreflashbtn"+op.thecontainer).click(function(e){
463                        $jc("#gridcontainer"+op.thecontainer).reload();
464                    });
465                    } catch(e){};
466                    try {
467                    $jc("#shownICALbtn"+op.thecontainer).click(function(e){
468                        window.location = DATA_FEED_URL.replace("datafeed","ical")+"&id="+calendarId;
469                    });
470                    } catch(e){};
471                    function CallPrint(code)
472                    {
473                        var printWindow = window.open();
474                        printWindow.document.write('<html>\n');  
475                        printWindow.document.write('<head><style>#multicalendar .ctoolbar{height:22px}#multicalendar .fbutton{display:none}</style>\n');                 
476                        if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1)
477                        {
478                        }
479                        else
480                        {         
481                           printWindow.document.write('<link href="'+config.mvcsspath+config.cssStyle+'/calendar.css" rel="Stylesheet" type="text/css" />\n');
482                           printWindow.document.write('<link href="'+config.mvcsspath+'main.css" rel="Stylesheet" type="text/css" />\n');
483                        }
484                        printWindow.document.write('<script>\n');
485                        if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1)
486                        {         
487                           printWindow.document.write('var chromeCss = document.createElement("link");\n'); 
488                           printWindow.document.write('chromeCss.rel = "stylesheet";\n');      
489                           printWindow.document.write('chromeCss.href = "'+config.mvcsspath+config.cssStyle+'/calendar.css";\n');            
490                           printWindow.document.write('document.getElementsByTagName("head")[0].appendChild(chromeCss);\n');
491                           printWindow.document.write('var chromeCss = document.createElement("link");\n'); 
492                           printWindow.document.write('chromeCss.rel = "stylesheet";\n');      
493                           printWindow.document.write('chromeCss.href = "'+config.mvcsspath+'main.css";\n');            
494                           printWindow.document.write('document.getElementsByTagName("head")[0].appendChild(chromeCss);\n');                                               
495                        }
496                        printWindow.document.write('function winPrint()\n');
497                        printWindow.document.write('{\n');
498                        printWindow.document.write('window.focus();\n');
499                        if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1)
500                            printWindow.document.write('printChrome();\n');
501                        else
502                        	  printWindow.document.write('window.print();\n');
503                        if(navigator.userAgent.toLowerCase().indexOf("firefox") > -1)
504                            printWindow.document.write('window.close();\n');
505                        else
506                            printWindow.document.write('chkstate();\n');         
507                        printWindow.document.write('}\n');              
508                        
509                        printWindow.document.write('function chkstate()\n');
510                        printWindow.document.write('{\n');
511                        printWindow.document.write('if(document.readyState=="complete")');
512                        printWindow.document.write('{\n');                  
513                        printWindow.document.write('window.close();\n'); 
514                        printWindow.document.write('}\n'); 
515                        printWindow.document.write('else{\n');          
516                        printWindow.document.write('setTimeout("chkstate();",3000);\n'); 
517                        printWindow.document.write('}\n'); 
518                        printWindow.document.write('}\n');
519                        
520                        printWindow.document.write('function printChrome()\n');
521                        printWindow.document.write('{\n');         
522                        printWindow.document.write('if(document.readyState=="complete")');
523                        printWindow.document.write('{\n');                                                      
524                        printWindow.document.write('window.print();\n'); 
525                        printWindow.document.write('}\n'); 
526                        printWindow.document.write('else{\n');                       
527                        printWindow.document.write('setTimeout("printChrome();",3000);\n'); 
528                        printWindow.document.write('}\n'); 
529                        printWindow.document.write('}\n');                       
530                        
531                        printWindow.document.write('</scr');
532                        printWindow.document.write('ipt>');         
533                        
534                        printWindow.document.write('</head>');
535                        printWindow.document.write('<body onload="winPrint()" >');
536                        printWindow.document.write('<div id="multicalendar">'+code+'</div>');
537                        printWindow.document.write('</body>');  
538                        printWindow.document.write('</html>');  
539                        printWindow.document.close();
540                    }	
541                    try {
542                    $jc("#showprintbtn"+op.thecontainer).click(function(e){
543                         //var printWindow=window.open();
544                         var code = $jc("#"+op.thecontainer).parent().html()+"";
545                         if ($jc("#gridcontainer"+op.thecontainer).BcalGetOp().view=="nMonth")
546                             code = code.replace(/width:/g,"width-");
547                             CallPrint(code);                             
548                    });
549                    } catch(e){};	
550                    function showEditEvent(url,pos)
551                    {
552                    	var div = $jc('<div id="editEvent" op="'+op.thecontainer+'" ></div>');
553                    	var html = '<form id="mvEditForm" target="mvEditFormFrame"  action="'+DATA_EDIT_URL+'" method="POST">'
554                         +'<input type="submit">'
555                         +'</form>'
556                         +'<iframe name="mvEditFormFrame" src="'+DATA_EDIT_URL+'" width="100%" height="100%" allowtransparency="true" frameborder="0" style="z-index: 2147483647; background: rgba(0,0,0,0.003); border: 0px none transparent; visibility: visible; margin: 0px; padding: 0; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden;"></iframe>';
557                        div.html(html);
558                        $jc(document.body).append(div);
559                        var form= $jc("#mvEditForm");                         
560                        var urlparams = (url.replace(DATA_EDIT_URL,""));
561                        var params = urlparams.split("&")
562                        for (var i in params) {
563                            var tmp= params[i].split('=');
564                            if (tmp.length==2)
565                            {
566                                var key = decodeURIComponent(tmp[0]), value = decodeURIComponent(tmp[1]);
567                                $jc(document.createElement('input')).attr('type', 'hidden').attr('name', key).attr('value', value).appendTo(form);
568                            }
569                        }
570                        form.css("display","none");
571                        $jc(form).submit();
572                    }
573                    //Add a new event
574                    try {
575                    $jc("#faddbtn"+op.thecontainer).click(function(e) {
576                        var url =DATA_EDIT_URL+"&r="+Math.random()+"&css="+config.cssStyle+"&lang="+config.language+"&weekstartday="+config.weekstartday+"&hoursStart="+config.hoursStart+"&hoursEnd="+config.hoursEnd;
577                        showEditEvent(url);
578            
579            
580                    });
581                    } catch(e){};
582                    //go to today
583                    try {
584                    $jc("#showtodaybtn"+op.thecontainer).click(function(e) {
585                        var p = $jc("#gridcontainer"+op.thecontainer).gotoDate().BcalGetOp();
586                        if (p && p.datestrshow) {
587                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
588                        }
589            
590            
591                    });
592                    } catch(e){};
593                    //previous date range
594                    try {
595                    $jc("#sfprevbtn"+op.thecontainer).click(function(e) {
596                        if (!$jc("#sfprevbtn"+op.thecontainer).hasClass("non-navigate"))
597                        {
598                            
599                        var p = $jc("#gridcontainer"+op.thecontainer).previousRange().BcalGetOp();
600                        if (p && p.datestrshow) {
601                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
602                        }
603                        }
604                    });
605                    } catch(e){};
606                    //next date range
607                    try {
608                    $jc("#sfnextbtn"+op.thecontainer).click(function(e) {
609                        if (!$jc("#sfnextbtn"+op.thecontainer).hasClass("non-navigate"))
610                        {
611                        var p = $jc("#gridcontainer"+op.thecontainer).nextRange().BcalGetOp();
612                        if (p && p.datestrshow) {
613                            $jc("#txtdatetimeshow"+op.thecontainer).text(p.datestrshow);
614                        }
615                        }
616                    });
617                    } catch(e){};
618                    
619            
620            
621            
622            
623            
624            
625            
626            
627           })($jc); 
628
629        });
630}

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.