How to use global method in wpt

Best JavaScript code snippet using wpt

main.js

Source:main.js Github

copy

Full Screen

1/*2CardDavMATE - the open source CardDAV Web Client3Copyright (C) 2011-20154 Jan Mate <jan.mate@inf-it.com>5 Andrej Lezo <andrej.lezo@inf-it.com>6 Matej Mihalik <matej.mihalik@inf-it.com>7This program is free software: you can redistribute it and/or modify8it under the terms of the GNU Affero General Public License as9published by the Free Software Foundation, either version 3 of the10License, or (at your option) any later version.11This program is distributed in the hope that it will be useful,12but WITHOUT ANY WARRANTY; without even the implied warranty of13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14GNU Affero General Public License for more details.15You should have received a copy of the GNU Affero General Public License16along with this program. If not, see <http://www.gnu.org/licenses/>.17*/18var globalAddressbookList=new AddressbookList();19var globalResourceCardDAVList=new ResourceCardDAVList();20var globalQs=null;21var globalRefABList=null;22var globalRefABListTable=null;23var globalRefAbListTableHeader=null;24var globalRefABListTableCols=null;25var globalRefABListInnerTableCols=null;26var globalRefAddContact=null;27var globalRefVcardEditor=null; // editor reference stored after each editor cleanup28var globalOrigCardDAVListTemplate=null; // template for clean resource list29var globalOrigABListHeader=null; // template for clean addressbook header30var globalOrigABListItem=null; // template for clean addressbook item31var globalOrigVcardTemplate=null; // template for clean editor object32var globalTranslCardDAVListTemplate=null; // template for translated resource list33var globalTranslCardDAVListHeader=null; // template for translated resource header34var globalTranslCardDAVListItem=null; // template for translated resource item35var globalTranslVcardTemplate=null; // template for translated editor object36var globalCardDAVInitLoad=true;37var globalCardDAVResourceSync=false;38var globalCardDAVCollectionSync=false;39var isCardDAVLoaded=false;40var isCardDAVAvaible=true;41var globalDefaultAddressbookCollectionActiveAll=false;42var globalDefaultAddrCollectionLoadAll=false;43var globalAddressbookNumber=0;44var globalAddressbookNumberCount=0;45var globalABEditorCounter=new Object();46var globalAddressElementOldData=new Object();47var globalAddressbookCollectionsLoading=false;48var globalDisableAnimationMessageHiding='';49if(typeof globalContactPhotoScaleFactor==='undefined')50 var globalContactPhotoScaleFactor=1.5;51var globalFixedContactDataColumnsCount = 1;52var globalContactDataColumnDefs = {53 'CATEGORIES': {54 'property': 'cats',55 'minWidth': 9056 },57 'COMPANY': {58 'property': 'company',59 'minWidth': 13560 },61 'DEPARTMENT': {62 'property': 'department',63 'minWidth': 9064 },65 'LASTNAME': {66 'property': 'lastname',67 'minWidth': 9068 },69 'FIRSTNAME': {70 'property': 'firstname',71 'minWidth': 4572 },73 'MIDDLENAME': {74 'property': 'middlename',75 'minWidth': 4576 },77 'PREFIX': {78 'property': 'prefix',79 'minWidth': 2780 },81 'SUFFIX': {82 'property': 'sufix',83 'minWidth': 2784 },85 'NICKNAME': {86 'property': 'nickname',87 'minWidth': 4588 },89 'PHONETICLASTNAME': {90 'property': 'phoneticLastName',91 'minWidth': 9092 },93 'PHONETICFIRSTNAME': {94 'property': 'phoneticFirstName',95 'minWidth': 4596 },97 'BIRTHDAY': {98 'property': 'birthday',99 'minWidth': 90100 },101 'JOBTITLE': {102 'property': 'title',103 'minWidth': 90104 },105 'NOTETEXT': {106 'property': 'note',107 'minWidth': 180108 },109 'ADDRESS': {110 'property': 'address',111 'filterProperities': {112 'TYPE': 'type'113 },114 'minWidth': 180115 },116 'PHONE': {117 'property': 'phone',118 'filterProperities': {119 'TYPE': 'type'120 },121 'minWidth': 90122 },123 'EMAIL': {124 'property': 'email',125 'filterProperities': {126 'TYPE': 'type'127 },128 'minWidth': 135129 },130 'URL': {131 'property': 'url',132 'filterProperities': {133 'TYPE': 'type'134 },135 'minWidth': 135136 },137 'DATES': {138 'property': 'date',139 'filterProperities': {140 'TYPE': 'type'141 },142 'minWidth': 90143 },144 'RELATED': {145 'property': 'related',146 'filterProperities': {147 'TYPE': 'type'148 },149 'minWidth': 45150 },151 'PROFILE': {152 'property': 'social',153 'filterProperities': {154 'TYPE': 'type'155 },156 'minWidth': 90157 },158 'IM': {159 'property': 'impp',160 'filterProperities': {161 'TYPE': 'type',162 'SERVICE-TYPE': 'serviceType'163 },164 'minWidth': 90165 }166};167globalContactDataColumnLabelVars = {168 'Name': 'txtName',169 'FirstName': 'pholderGiven',170 'LastName': 'pholderFamily',171 'MiddleName': 'pholderMiddle',172 'NickName': 'pholderNickname',173 'Prefix': 'pholderPrefix',174 'Suffix': 'pholderSuffix',175 'BirthDay': 'pholderBday',176 'PhoneticLastName': 'pholderPhFamily',177 'PhoneticFirstName': 'pholderPhGiven',178 'JobTitle': 'pholderTitle',179 'Company': 'pholderOrg',180 'Department': 'pholderDepartment',181 'Categories': 'txtCategories',182 'NoteText': 'pholderNoteVal',183 'Address': 'txtAddress',184 'AddressWork': 'txtAddressWork',185 'AddressHome': 'txtAddressHome',186 'AddressOther': 'txtAddressOther',187 'Phone': 'txtPhone',188 'PhoneWork': 'txtPhoneWork',189 'PhoneHome': 'txtPhoneHome',190 'PhoneCell': 'txtPhoneCell',191 'PhoneMain': 'txtPhoneMain',192 'PhonePager': 'txtPhonePager',193 'PhoneFax': 'txtPhoneFax',194 'PhoneIphone': 'txtPhoneIphone',195 'PhoneOther': 'txtPhoneOther',196 'Email': 'txtEmail',197 'EmailWork': 'txtEmailWork',198 'EmailHome': 'txtEmailHome',199 'EmailMobileme': 'txtEmailMobileme',200 'EmailOther': 'txtEmailOther',201 'URL': 'txtUrl',202 'URLWork': 'txtUrlWork',203 'URLHome': 'txtUrlHome',204 'URLHomepage': 'txtUrlHomepage',205 'URLOther': 'txtUrlOther',206 'Dates': 'txtDates',207 'DatesAnniversary': 'txtDatesAnniversary',208 'DatesOther': 'txtDatesOther',209 'Related': 'txtRelated',210 'RelatedManager': 'txtRelatedManager',211 'RelatedAssistant': 'txtRelatedAssistant',212 'RelatedFather': 'txtRelatedFather',213 'RelatedMother': 'txtRelatedMother',214 'RelatedParent': 'txtRelatedParent',215 'RelatedBrother': 'txtRelatedBrother',216 'RelatedSister': 'txtRelatedSister',217 'RelatedChild': 'txtRelatedChild',218 'RelatedFriend': 'txtRelatedFriend',219 'RelatedSpouse': 'txtRelatedSpouse',220 'RelatedPartner': 'txtRelatedPartner',221 'RelatedOther': 'txtRelatedOther',222 'Profile': 'txtProfile',223 'ProfileTwitter': 'txtProfileTwitter',224 'ProfileFacebook': 'txtProfileFacebook',225 'ProfileFlickr': 'txtProfileFlickr',226 'ProfileLinkedin': 'txtProfileLinkedin',227 'ProfileMyspace': 'txtProfileMyspace',228 'ProfileSinaweibo': 'txtProfileSinaweibo',229 'IM': 'txtIm',230 'IMWork': 'txtImWork',231 'IMHome': 'txtImHome',232 'IMMobileme': 'txtImMobileme',233 'IMOther': 'txtImOther',234 'IMAim': 'txtImProtAim',235 'IMIcq': 'txtImProtIcq',236 'IMIrc': 'txtImProtIrc',237 'IMJabber': 'txtImProtJabber',238 'IMMsn': 'txtImProtMsn',239 'IMYahoo': 'txtImProtYahoo',240 'IMFacebook': 'txtImProtFacebook',241 'IMGadugadu': 'txtImProtGadugadu',242 'IMGoogletalk': 'txtImProtGoogletalk',243 'IMQq': 'txtImProtQq',244 'IMSkype': 'txtImProtSkype'245};246var globalSettings={247 version: {value: (typeof globalSettingsVersion!='undefined' && globalSettingsVersion!=null) ? globalSettingsVersion : 1, locked:false},248 resourcealphabetsorting: {value: (typeof globalResourceAlphabetSorting!='undefined' && globalResourceAlphabetSorting!=null) ? globalResourceAlphabetSorting : true, locked:false},249 usejqueryauth: {value: (typeof globalUseJqueryAuth!='undefined' && globalUseJqueryAuth!=null) ? globalUseJqueryAuth : false, locked:false},250 settingstype: {value: (typeof globalSettingsType!='undefined' && globalSettingsType!=null && globalSettingsType!='') ? globalSettingsType : 'principal-URL', locked:false},251 defaultactiveapp: {value: (typeof globalDefaultActiveApp!='undefined' && globalDefaultActiveApp!=null && globalDefaultActiveApp!='') ? globalDefaultActiveApp : null, locked:false},252 islastdefaultactiveapp: {value: false, locked:false},253 datepickerfirstdayofweek: {value: (typeof globalDatepickerFirstDayOfWeek!='undefined' && globalDatepickerFirstDayOfWeek!=null) ? globalDatepickerFirstDayOfWeek : 1, locked:false},254 syncresourcesinterval: {value: (typeof globalSyncResourcesInterval!='undefined' && globalSyncResourcesInterval!=null) ? globalSyncResourcesInterval :300000, locked:false},255 datepickerformat: {value: (typeof globalDatepickerFormat!='undefined' && globalDatepickerFormat!=null && globalDatepickerFormat!='') ? globalDatepickerFormat : localization[globalInterfaceLanguage]._default_datepicker_format_, locked:false},256 backgroundsync: {value: (typeof globalBackgroundSync!='undefined' && globalBackgroundSync!=null) ? globalBackgroundSync : true, locked:false},257 enablekbnavigation: {value: (typeof globalEnableKbNavigation!='undefined' && globalEnableKbNavigation!=null) ? globalEnableKbNavigation : true, locked:false},258 rewritetimezonecomponent: {value: (typeof globalRewriteTimezoneComponent!='undefined' && globalRewriteTimezoneComponent!=null) ? globalRewriteTimezoneComponent : true, locked:false},259 removeunknowntimezone: {value: (typeof globalRemoveUnknownTimezone!='undefined' && globalRemoveUnknownTimezone!=null) ? globalRemoveUnknownTimezone : false, locked:false},260 mozillasupport: {value: (typeof globalMozillaSupport!='undefined' && globalMozillaSupport!=null) ? globalMozillaSupport : false, locked:false},261 appleremindersmode: {value: (typeof globalAppleRemindersMode!='undefined' && globalAppleRemindersMode!=null) ? globalAppleRemindersMode : false, locked:false},262 titleformatmonth: {value: localization[globalInterfaceLanguage]._default_title_format_month_, locked:false},263 titleformatweek: {value: localization[globalInterfaceLanguage]._default_title_format_week_, locked:false},264 titleformatday: {value: localization[globalInterfaceLanguage]._default_title_format_day_, locked:false},265 titleformattable: {value: localization[globalInterfaceLanguage]._default_title_format_table_, locked:false},266 columnformatagenda: {value: localization[globalInterfaceLanguage]._default_column_format_agenda_, locked:false},267 activecalendarcollections: {value: (typeof globalActiveCalendarCollections!='undefined' && globalActiveCalendarCollections!=null) ? globalActiveCalendarCollections : new Array(), locked:false},268 activetodocollections: {value: (typeof globalActiveTodoCollections!='undefined' && globalActiveTodoCollections!=null) ? globalActiveTodoCollections : new Array(), locked:false},269 loadedcalendarcollections: {value: (typeof globalLoadedCalendarCollections!='undefined' && globalLoadedCalendarCollections!=null) ? globalLoadedCalendarCollections : new Array(), locked:false},270 loadedtodocollections: {value: (typeof globalLoadedTodoCollections!='undefined' && globalLoadedTodoCollections!=null) ? globalLoadedTodoCollections : new Array(), locked:false},271 todolistfilterselected: {value: (typeof globalTodoListFilterSelected!='undefined' && globalTodoListFilterSelected!=null && globalTodoListFilterSelected!='') ? globalTodoListFilterSelected : ['filterAction', 'filterProgress'], locked:false},272 activeview: {value: (typeof globalActiveView!='undefined' && globalActiveView!=null && globalActiveView!='') ? globalActiveView : 'multiWeek', locked:false},273 islastactiveview: {value: true, locked:false},274 calendarselected: {value: (typeof globalCalendarSelected!='undefined' && globalCalendarSelected!=null && globalCalendarSelected!='') ? globalCalendarSelected : '', locked:false},275 todocalendarselected: {value: (typeof globalTodoCalendarSelected!='undefined' && globalTodoCalendarSelected!=null && globalTodoCalendarSelected!='') ? globalTodoCalendarSelected : '', locked:false},276 timezone: {value: (typeof globalTimeZone!='undefined' && globalTimeZone!=null && globalTimeZone!='') ? globalTimeZone : 'local', locked:false},277 islasttimezone: {value: true, locked:false},278 openformmode: {value: (typeof globalOpenFormMode!='undefined' && globalOpenFormMode!=null && globalOpenFormMode!='') ? globalOpenFormMode : 'double', locked:false},279 calendarstartofbusiness: {value: (typeof globalCalendarStartOfBusiness!='undefined' && globalCalendarStartOfBusiness!=null) ? globalCalendarStartOfBusiness : 8, locked:false},280 calendarendofbusiness: {value: (typeof globalCalendarEndOfBusiness!='undefined' && globalCalendarEndOfBusiness!=null) ? globalCalendarEndOfBusiness : 17, locked:false},281 defaulteventduration: {value: (typeof globalDefaultEventDuration!='undefined' && globalDefaultEventDuration!=null && globalDefaultEventDuration>=0) ? globalDefaultEventDuration : null, locked:false},282 ampmformat: {value: (typeof globalAMPMFormat!='undefined' && globalAMPMFormat!=null) ? globalAMPMFormat : localization[globalInterfaceLanguage]._default_AMPM_format_, locked:false},283 timeformatagenda: {value: (typeof globalTimeFormatAgenda!='undefined' && globalTimeFormatAgenda!=null && globalTimeFormatAgenda!='') ? globalTimeFormatAgenda : null, locked:false},284 timeformatbasic: {value: (typeof globalTimeFormatBasic!='undefined' && globalTimeFormatBasic!=null && globalTimeFormatBasic!='') ? globalTimeFormatBasic : null, locked:false},285 displayhiddenevents: {value: (typeof globalDisplayHiddenEvents!='undefined' && globalDisplayHiddenEvents!=null) ? globalDisplayHiddenEvents : false, locked:false},286 timezonesupport: {value: (typeof globalTimeZoneSupport!='undefined' && globalTimeZoneSupport!=null) ? globalTimeZoneSupport : true, locked:false},287 timezonesenabled: {value: (typeof globalTimeZonesEnabled!='undefined' && globalTimeZonesEnabled!=null && globalTimeZonesEnabled!='') ? globalTimeZonesEnabled : [], locked:false},288 showhiddenalarms: {value: (typeof globalShowHiddenAlarms!='undefined' && globalShowHiddenAlarms!=null) ? globalShowHiddenAlarms : false, locked:false},289 ignorecompletedorcancelledalarms: {value: (typeof globalIgnoreCompletedOrCancelledAlarms!='undefined' && globalIgnoreCompletedOrCancelledAlarms!=null) ? globalIgnoreCompletedOrCancelledAlarms : true, locked:false},290 weekenddays: {value: (typeof globalWeekendDays!='undefined' && globalWeekendDays!=null && globalWeekendDays!='') ? globalWeekendDays : [0, 6], locked:false},291 eventstartpastlimit: {value: (typeof globalEventStartPastLimit!='undefined' && globalEventStartPastLimit!=null) ? globalEventStartPastLimit : 3, locked:false},292 todopastlimit: {value: (typeof globalTodoPastLimit!='undefined' && globalTodoPastLimit!=null) ? globalTodoPastLimit : 3, locked:false},293 eventstartfuturelimit: {value: (typeof globalEventStartFutureLimit!='undefined' && globalEventStartFutureLimit!=null) ? globalEventStartFutureLimit : 3, locked:false},294 compatibility: {value: (typeof globalCompatibility!='undefined' && globalCompatibility!=null && globalCompatibility!='') ? globalCompatibility : {anniversaryOutputFormat: ['apple']}, locked:false},295 contactstorefn: {value: (typeof globalContactStoreFN!='undefined' && globalContactStoreFN!=null && globalContactStoreFN!='') ? globalContactStoreFN : ['prefix',' last',' middle',' first',' suffix'], locked:false},296 urihandlertel: {value: (typeof globalUriHandlerTel!='undefined' && globalUriHandlerTel!=null && globalUriHandlerTel!='') ? globalUriHandlerTel : 'tel:', locked:false},297 urihandleremail: {value: (typeof globalUriHandlerEmail!='undefined' && globalUriHandlerEmail!=null && globalUriHandlerEmail!='') ? globalUriHandlerEmail : 'mailto:', locked:false},298 urihandlerurl: {value: (typeof globalUriHandlerUrl!='undefined' && globalUriHandlerUrl!=null && globalUriHandlerUrl!='') ? globalUriHandlerUrl : 'http://', locked:false},299 urihandlerprofile: {value: (typeof globalUriHandlerProfile!='undefined' && globalUriHandlerProfile!=null && globalUriHandlerProfile!='') ? globalUriHandlerProfile : {'twitter': 'http://twitter.com/%u', 'facebook': 'http://www.facebook.com/%u', 'flickr': 'http://www.flickr.com/photos/%u', 'linkedin': 'http://www.linkedin.com/in/%u', 'myspace': 'http://www.myspace.com/%u', 'sinaweibo': 'http://weibo.com/n/%u'}, locked:false},300 addresscountryequivalence: {value: (typeof globalAddressCountryEquivalence!='undefined' && globalAddressCountryEquivalence!=null && globalAddressCountryEquivalence!='') ? globalAddressCountryEquivalence : [{country: 'de', regex: '^\\W*Deutschland\\W*$'}, {country: 'sk', regex: '^\\W*Slovensko\\W*$'}], locked:false},301 addressbookselected: {value: (typeof globalAddressbookSelected!='undefined' && globalAddressbookSelected!=null && globalAddressbookSelected!='') ? globalAddressbookSelected : '', locked:false},302 collectiondisplay: {value: (typeof globalCollectionDisplay!='undefined' && globalCollectionDisplay!=null && globalCollectionDisplay!='') ? globalCollectionDisplay : (303 (typeof globalGroupContactsByCompanies!='undefined' && globalGroupContactsByCompanies) ?304 [{label: '{Name}', value: {company: ['{Company}', ' [{Department}]'], personal: ['{LastName}', ' {MiddleName}', ' {FirstName}']}}, {label: '{JobTitle}', value: ['{JobTitle}']}, {label: '{Email}', value: ['{Email[:0]}']}, {label: '{Phone} 1', value: ['{Phone[:0]}']}, {label: '{Phone} 2', value: ['{Phone[:1]}']}, {label: '{NoteText}', value: ['{NoteText}']}] :305 [{label: '{Name}', value: ['{LastName}', ' {MiddleName}', ' {FirstName}']}, {label: '{Company} [{Department}]', value: ['{Company}', ' [{Department}]']}, {label: '{JobTitle}', value: ['{JobTitle}']}, {label: '{Email}', value: ['{Email[:0]}']}, {label: '{Phone} 1', value: ['{Phone[:0]}']}, {label: '{Phone} 2', value: ['{Phone[:1]}']}, {label: '{NoteText}', value: ['{NoteText}']}]306 ), locked:false},307 collectionsort: {value: (typeof globalCollectionSort!='undefined' && globalCollectionSort!=null && globalCollectionSort!='') ? globalCollectionSort : '', locked:false},308 defaultaddresscountry: {value: (typeof globalDefaultAddressCountry!='undefined' && globalDefaultAddressCountry!=null && globalDefaultAddressCountry!='') ? globalDefaultAddressCountry :'us', locked:false},309 addresscountryfavorites: {value: (typeof globalAddressCountryFavorites!='undefined' && globalAddressCountryFavorites!=null && globalAddressCountryFavorites!='') ? globalAddressCountryFavorites :[], locked:false},310 activeaddressbookcollections: {value: (typeof globalActiveAddressbookCollections!='undefined' && globalActiveAddressbookCollections!=null) ? globalActiveAddressbookCollections : new Array(), locked:false},311 loadedaddressbookcollections: {value: (typeof globalLoadedAddressbookCollections!='undefined' && globalLoadedAddressbookCollections!=null) ? globalLoadedAddressbookCollections : new Array(), locked:false}312};313function resetSettings()314{315 globalSettings={316 version: {value: (typeof globalSettingsVersion!='undefined' && globalSettingsVersion!=null) ? globalSettingsVersion : 1, locked:false},317 resourcealphabetsorting: {value: (typeof globalResourceAlphabetSorting!='undefined' && globalResourceAlphabetSorting!=null) ? globalResourceAlphabetSorting : true, locked:false},318 usejqueryauth: {value: (typeof globalUseJqueryAuth!='undefined' && globalUseJqueryAuth!=null) ? globalUseJqueryAuth : false, locked:false},319 settingstype: {value: (typeof globalSettingsType!='undefined' && globalSettingsType!=null && globalSettingsType!='') ? globalSettingsType : 'principal-URL', locked:false},320 defaultactiveapp: {value: (typeof globalDefaultActiveApp!='undefined' && globalDefaultActiveApp!=null && globalDefaultActiveApp!='') ? globalDefaultActiveApp : null, locked:false},321 islastdefaultactiveapp: {value: false, locked:false},322 datepickerfirstdayofweek: {value: (typeof globalDatepickerFirstDayOfWeek!='undefined' && globalDatepickerFirstDayOfWeek!=null) ? globalDatepickerFirstDayOfWeek : 1, locked:false},323 syncresourcesinterval: {value: (typeof globalSyncResourcesInterval!='undefined' && globalSyncResourcesInterval!=null) ? globalSyncResourcesInterval :300000, locked:false},324 datepickerformat: {value: (typeof globalDatepickerFormat!='undefined' && globalDatepickerFormat!=null && globalDatepickerFormat!='') ? globalDatepickerFormat : localization[globalInterfaceLanguage]._default_datepicker_format_, locked:false},325 backgroundsync: {value: (typeof globalBackgroundSync!='undefined' && globalBackgroundSync!=null) ? globalBackgroundSync : true, locked:false},326 enablekbnavigation: {value: (typeof globalEnableKbNavigation!='undefined' && globalEnableKbNavigation!=null) ? globalEnableKbNavigation : true, locked:false},327 rewritetimezonecomponent: {value: (typeof globalRewriteTimezoneComponent!='undefined' && globalRewriteTimezoneComponent!=null) ? globalRewriteTimezoneComponent : true, locked:false},328 removeunknowntimezone: {value: (typeof globalRemoveUnknownTimezone!='undefined' && globalRemoveUnknownTimezone!=null) ? globalRemoveUnknownTimezone : false, locked:false},329 mozillasupport: {value: (typeof globalMozillaSupport!='undefined' && globalMozillaSupport!=null) ? globalMozillaSupport : false, locked:false},330 appleremindersmode: {value: (typeof globalAppleRemindersMode!='undefined' && globalAppleRemindersMode!=null) ? globalAppleRemindersMode : false, locked:false},331 titleformatmonth: {value: localization[globalInterfaceLanguage]._default_title_format_month_, locked:false},332 titleformatweek: {value: localization[globalInterfaceLanguage]._default_title_format_week_, locked:false},333 titleformatday: {value: localization[globalInterfaceLanguage]._default_title_format_day_, locked:false},334 titleformattable: {value: localization[globalInterfaceLanguage]._default_title_format_table_, locked:false},335 columnformatagenda: {value: localization[globalInterfaceLanguage]._default_column_format_agenda_, locked:false},336 activecalendarcollections: {value: (typeof globalActiveCalendarCollections!='undefined' && globalActiveCalendarCollections!=null) ? globalActiveCalendarCollections : new Array(), locked:false},337 activetodocollections: {value: (typeof globalActiveTodoCollections!='undefined' && globalActiveTodoCollections!=null) ? globalActiveTodoCollections : new Array(), locked:false},338 loadedcalendarcollections: {value: (typeof globalLoadedCalendarCollections!='undefined' && globalLoadedCalendarCollections!=null) ? globalLoadedCalendarCollections : new Array(), locked:false},339 loadedtodocollections: {value: (typeof globalLoadedTodoCollections!='undefined' && globalLoadedTodoCollections!=null) ? globalLoadedTodoCollections : new Array(), locked:false},340 todolistfilterselected: {value: (typeof globalTodoListFilterSelected!='undefined' && globalTodoListFilterSelected!=null && globalTodoListFilterSelected!='') ? globalTodoListFilterSelected : ['filterAction', 'filterProgress'], locked:false},341 activeview: {value: (typeof globalActiveView!='undefined' && globalActiveView!=null && globalActiveView!='') ? globalActiveView : 'multiWeek', locked:false},342 islastactiveview: {value: true, lockedlocked:false},343 calendarselected: {value: (typeof globalCalendarSelected!='undefined' && globalCalendarSelected!=null && globalCalendarSelected!='') ? globalCalendarSelected : '', locked:false},344 todocalendarselected: {value: (typeof globalTodoCalendarSelected!='undefined' && globalTodoCalendarSelected!=null && globalTodoCalendarSelected!='') ? globalTodoCalendarSelected : '', locked:false},345 timezone: {value: (typeof globalTimeZone!='undefined' && globalTimeZone!=null && globalTimeZone!='') ? globalTimeZone : 'local', locked:false},346 islasttimezone: {value: true, locked:false},347 openformmode: {value: (typeof globalOpenFormMode!='undefined' && globalOpenFormMode!=null && globalOpenFormMode!='') ? globalOpenFormMode : 'double', locked:false},348 calendarstartofbusiness: {value: (typeof globalCalendarStartOfBusiness!='undefined' && globalCalendarStartOfBusiness!=null) ? globalCalendarStartOfBusiness : 8, locked:false},349 calendarendofbusiness: {value: (typeof globalCalendarEndOfBusiness!='undefined' && globalCalendarEndOfBusiness!=null) ? globalCalendarEndOfBusiness : 17, locked:false},350 defaulteventduration: {value: (typeof globalDefaultEventDuration!='undefined' && globalDefaultEventDuration!=null && globalDefaultEventDuration>=0) ? globalDefaultEventDuration : null, locked:false},351 ampmformat: {value: (typeof globalAMPMFormat!='undefined' && globalAMPMFormat!=null) ? globalAMPMFormat : localization[globalInterfaceLanguage]._default_AMPM_format_, locked:false},352 timeformatagenda: {value: (typeof globalTimeFormatAgenda!='undefined' && globalTimeFormatAgenda!=null && globalTimeFormatAgenda!='') ? globalTimeFormatAgenda : null, locked:false},353 timeformatbasic: {value: (typeof globalTimeFormatBasic!='undefined' && globalTimeFormatBasic!=null && globalTimeFormatBasic!='') ? globalTimeFormatBasic : null, locked:false},354 displayhiddenevents: {value: (typeof globalDisplayHiddenEvents!='undefined' && globalDisplayHiddenEvents!=null) ? globalDisplayHiddenEvents : false, locked:false},355 timezonesupport: {value: (typeof globalTimeZoneSupport!='undefined' && globalTimeZoneSupport!=null) ? globalTimeZoneSupport : true, locked:false},356 timezonesenabled: {value: (typeof globalTimeZonesEnabled!='undefined' && globalTimeZonesEnabled!=null && globalTimeZonesEnabled!='') ? globalTimeZonesEnabled : [], locked:false},357 showhiddenalarms: {value: (typeof globalShowHiddenAlarms!='undefined' && globalShowHiddenAlarms!=null) ? globalShowHiddenAlarms : false, locked:false},358 ignorecompletedorcancelledalarms: {value: (typeof globalIgnoreCompletedOrCancelledAlarms!='undefined' && globalIgnoreCompletedOrCancelledAlarms!=null) ? globalIgnoreCompletedOrCancelledAlarms : true, locked:false},359 weekenddays: {value: (typeof globalWeekendDays!='undefined' && globalWeekendDays!=null && globalWeekendDays!='') ? globalWeekendDays : [0, 6], locked:false},360 eventstartpastlimit: {value: (typeof globalEventStartPastLimit!='undefined' && globalEventStartPastLimit!=null) ? globalEventStartPastLimit : 3, locked:false},361 todopastlimit: {value: (typeof globalTodoPastLimit!='undefined' && globalTodoPastLimit!=null) ? globalTodoPastLimit : 3, locked:false},362 eventstartfuturelimit: {value: (typeof globalEventStartFutureLimit!='undefined' && globalEventStartFutureLimit!=null) ? globalEventStartFutureLimit : 3, locked:false},363 compatibility: {value: (typeof globalCompatibility!='undefined' && globalCompatibility!=null && globalCompatibility!='') ? globalCompatibility : {anniversaryOutputFormat: ['apple']}, locked:false},364 contactstorefn: {value: (typeof globalContactStoreFN!='undefined' && globalContactStoreFN!=null && globalContactStoreFN!='') ? globalContactStoreFN : ['prefix',' last',' middle',' first',' suffix'], locked:false},365 urihandlertel: {value: (typeof globalUriHandlerTel!='undefined' && globalUriHandlerTel!=null && globalUriHandlerTel!='') ? globalUriHandlerTel : 'tel:', locked:false},366 urihandleremail: {value: (typeof globalUriHandlerEmail!='undefined' && globalUriHandlerEmail!=null && globalUriHandlerEmail!='') ? globalUriHandlerEmail : 'mailto:', locked:false},367 urihandlerurl: {value: (typeof globalUriHandlerUrl!='undefined' && globalUriHandlerUrl!=null && globalUriHandlerUrl!='') ? globalUriHandlerUrl : 'http://', locked:false},368 urihandlerprofile: {value: (typeof globalUriHandlerProfile!='undefined' && globalUriHandlerProfile!=null && globalUriHandlerProfile!='') ? globalUriHandlerProfile : {'twitter': 'http://twitter.com/%u', 'facebook': 'http://www.facebook.com/%u', 'flickr': 'http://www.flickr.com/photos/%u', 'linkedin': 'http://www.linkedin.com/in/%u', 'myspace': 'http://www.myspace.com/%u', 'sinaweibo': 'http://weibo.com/n/%u'}, locked:false},369 addresscountryequivalence: {value: (typeof globalAddressCountryEquivalence!='undefined' && globalAddressCountryEquivalence!=null && globalAddressCountryEquivalence!='') ? globalAddressCountryEquivalence : [{country: 'de', regex: '^\\W*Deutschland\\W*$'}, {country: 'sk', regex: '^\\W*Slovensko\\W*$'}], locked:false},370 addressbookselected: {value: (typeof globalAddressbookSelected!='undefined' && globalAddressbookSelected!=null && globalAddressbookSelected!='') ? globalAddressbookSelected : '', locked:false},371 collectiondisplay: {value: (typeof globalCollectionDisplay!='undefined' && globalCollectionDisplay!=null && globalCollectionDisplay!='') ? globalCollectionDisplay : (372 (typeof globalGroupContactsByCompanies!='undefined' && globalGroupContactsByCompanies) ?373 [{label: '{Name}', value: {company: ['{Company}', ' [{Department}]'], personal: ['{LastName}', ' {MiddleName}', ' {FirstName}']}}, {label: '{JobTitle}', value: ['{JobTitle}']}, {label: '{Email}', value: ['{Email[:0]}']}, {label: '{Phone} 1', value: ['{Phone[:0]}']}, {label: '{Phone} 2', value: ['{Phone[:1]}']}, {label: '{NoteText}', value: ['{NoteText}']}] :374 [{label: '{Name}', value: ['{LastName}', ' {MiddleName}', ' {FirstName}']}, {label: '{Company} [{Department}]', value: ['{Company}', ' [{Department}]']}, {label: '{JobTitle}', value: ['{JobTitle}']}, {label: '{Email}', value: ['{Email[:0]}']}, {label: '{Phone} 1', value: ['{Phone[:0]}']}, {label: '{Phone} 2', value: ['{Phone[:1]}']}, {label: '{NoteText}', value: ['{NoteText}']}]375 ), locked:false},376 collectionsort: {value: (typeof globalCollectionSort!='undefined' && globalCollectionSort!=null && globalCollectionSort!='') ? globalCollectionSort : '', locked:false},377 defaultaddresscountry: {value: (typeof globalDefaultAddressCountry!='undefined' && globalDefaultAddressCountry!=null && globalDefaultAddressCountry!='') ? globalDefaultAddressCountry :'us', locked:false},378 addresscountryfavorites: {value: (typeof globalAddressCountryFavorites!='undefined' && globalAddressCountryFavorites!=null && globalAddressCountryFavorites!='') ? globalAddressCountryFavorites :[], locked:false},379 activeaddressbookcollections: {value: (typeof globalActiveAddressbookCollections!='undefined' && globalActiveAddressbookCollections!=null) ? globalActiveAddressbookCollections : new Array(), locked:false},380 loadedaddressbookcollections: {value: (typeof globalLoadedAddressbookCollections!='undefined' && globalLoadedAddressbookCollections!=null) ? globalLoadedAddressbookCollections : new Array(), locked:false}381 };382}383function transformToServer(inSettings)384{385 var serverSettings={};386 for(var prop in inSettings)387 {388 serverSettings[prop]=inSettings[prop].value;389 }390 return serverSettings;391}392var globalWindowFocus=true;393var globalLoginUsername='';394var globalLoginPassword='';395var isUserLogged=false;396var isDelegationLoaded=false;397var globalActiveApp='';398var globalAvailableAppsArray=new Array();399var globalEnableAppSwitch=true;400var globalAppName='CardDavMATE';401var globalVersion='0.13.1';402var globalBuildNo=1442928605;403var globalXMLCache=null;404var globalVersionCheckURL=(location.protocol=='file:' ? 'http:' : location.protocol)+'//www.inf-it.com/versioncheck/'+globalAppName+'/?v='+globalVersion;405var globalXClientHeader=globalAppName+' '+globalVersion+' (Inf-IT CardDAV Web Client)';406var globalResourceNumberCount=0;407var globalResourceNumber=0;408var globalResourceIntervalID=null;409var globalFirstLoadNextApp=false;410var globalObjectLoading=false;411var settingsLoaded=false;412var globalKBNavigationPaddingRate=0.2;413var globalParallelAjaxCallCardDAVEnabled=true;414var globalParallelAjaxCallCalDAVEnabled=true;415var globalCacheUpdateInterval=null;416var isIntegrated=false;417var SVG_select='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="19px" height="19px" viewBox="0 0 19 19" overflow="visible" enable-background="new 0 0 19 19" xml:space="preserve"><defs></defs><rect x="2" fill="#585858" width="17" height="19"/><polygon fill="#FFFFFF" points="14,7 10.5,13 7,7 "/><rect fill="#FFFFFF" width="2" height="19"/></svg>';418var SVG_select_inv='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="19px" height="19px" viewBox="0 0 19 19" overflow="visible" enable-background="new 0 0 19 19" xml:space="preserve"><defs></defs><rect x="2" fill="#585858" width="17" height="19"/><polygon fill="#FFFFFF" points="14,13 10.5,7 7,13"/><rect fill="#FFFFFF" width="2" height="19"/></svg>';419var SVG_select_login='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="19px" height="28px" viewBox="0 0 19 28" overflow="visible" enable-background="new 0 0 19 28" xml:space="preserve"><defs></defs><rect fill="#FFFFFF" width="19" height="28"/></svg>';420var SVG_select_dis='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="22px" height="19px" viewBox="0 0 22 19" overflow="visible" enable-background="new 0 0 22 19" xml:space="preserve"><defs></defs><rect fill="#FFFFFF" width="22" height="19"/></svg>';421var globalDefinedSettings = new Array();422var globalLoadedPrincipals = new Array();423var globalEnableAllResourceSync = true;424if(typeof isSettingsAvaible == 'undefined')425 var globalPreviousSupportedSettings = ['activecalendarcollections','activetodocollections', 'activeaddressbookcollections','todolistfilterselected','activeview','defaultactiveapp','calendarselected', 'todocalendarselected','addressbookselected','timezone', 'loadedtodocollections', 'loadedcalendarcollections', 'loadedaddressbookcollections', 'version'];426var globalSettingsSaving = '';427var globalFirstHideLoader = true;428var globalLoadedCollectionsNumber = 0;429var globalLoadedCollectionsCount = 0;430var ignoreServerSettings=false;431var globalPreventLogoutSync=false;432var globalEmailAddress='';433var globalSettingsVersion=3;434var globalSyncSettingsSave=false;435// Timepicker hack (prevent IE to re-open the datepicker on date click + focus)436var globalTmpTimePickerHackTime=new Object();437function isAvaible(app)438{439 return globalAvailableAppsArray.indexOf(app)!=-1440}441function loadAllResources()442{443 if(globalResourceIntervalID==null)444 netFindResource(globalAccountSettings[0], 0, true, 0);445}446function getAccount(accountUID)447{448 // find the original settings for the resource and user449 var tmp=accountUID.match(RegExp('^(https?://)([^@/]+(?:@[^@/]+)?)@([^/]+)(.*/)','i'));450 var resource_href=tmp[1]+tmp[3]+tmp[4];451 var resource_user=tmp[2];452 for(var i=0;i<globalAccountSettings.length;i++)453 if(globalAccountSettings[i].href==resource_href && globalAccountSettings[i].userAuth.userName==resource_user)454 resourceSettings=globalAccountSettings[i];455 return resourceSettings;456}457function checkForUnloadedResources()458{459 var rex=new RegExp('^(https?://)([^@/]+(?:@[^@/]+)?)@([^/]+)(.*/)', 'i');460 for(var i=globalLoadedPrincipals.length-1; i>=0;i--)461 {462 var resourceCounter = 0;463 if(isAvaible('CardDavMATE'))464 for(var j=0; j<globalResourceCardDAVList.collections.length;j++)465 if(globalResourceCardDAVList.collections[j].uid!=undefined&&globalResourceCardDAVList.collections[j].makeLoaded)466 {467 var tmp=globalResourceCardDAVList.collections[j].accountUID.match(rex);468 var resourceCalDAV_href=tmp[1]+tmp[3]+tmp[4];469 if(globalLoadedPrincipals[i]==resourceCalDAV_href)470 resourceCounter++;471 }472 if(isAvaible('CalDavZAP'))473 {474 for(var j=0; j<globalResourceCalDAVList.collections.length;j++)475 if(globalResourceCalDAVList.collections[j].uid!=undefined&&globalResourceCalDAVList.collections[j].makeLoaded)476 {477 var tmp=globalResourceCalDAVList.collections[j].accountUID.match(rex);478 var resourceCalDAV_href=tmp[1]+tmp[3]+tmp[4];479 if(globalLoadedPrincipals[i]==resourceCalDAV_href)480 resourceCounter++;481 }482 for(var j=0; j<globalResourceCalDAVList.TodoCollections.length;j++)483 if(globalResourceCalDAVList.TodoCollections[j].uid!=undefined&&globalResourceCalDAVList.TodoCollections[j].makeLoaded)484 {485 var tmp=globalResourceCalDAVList.TodoCollections[j].accountUID.match(rex);486 var resourceCalDAV_href=tmp[1]+tmp[3]+tmp[4];487 if(globalLoadedPrincipals[i]==resourceCalDAV_href)488 resourceCounter++;489 }490 }491 if(resourceCounter==0)492 globalLoadedPrincipals.splice(i,1);493 }494}495function reloadResources(dontSaveSettings, loadArray)496{497 if((isAvaible('CardDavMATE')&&(globalCardDAVInitLoad||globalCardDAVResourceSync)) || (isAvaible('CalDavZAP')&&(globalCalDAVInitLoad||globalCalDAVResourceSync))498 || (isAvaible('Projects')&&!isProjectsLoaded) || (isAvaible('Settings')&&(!isSettingsLoaded || (globalSettingsSaving!=''&&!dontSaveSettings))) || (isAvaible('CalDavZAP')&&(globalLimitLoading!='' || globalLimitTodoLoading!='')))499 return false;500 if(globalWindowFocus==false)501 return false;502 globalCardDAVResourceSync=true;503 globalCalDAVResourceSync=true;504 if(isAvaible('CalDavZAP'))505 {506 globalCalDAVResourceSync = true;507 globalToday.setHours(0);508 globalToday.setMinutes(0);509 globalToday.setSeconds(0);510 globalToday.setMilliseconds(0);511 var currentToday=new Date();512 currentToday.setHours(0);513 currentToday.setMinutes(0);514 currentToday.setSeconds(0);515 currentToday.setMilliseconds(0);516 if(currentToday.getTime()!=globalToday.getTime())517 {518 if(isAvaible('CalDavZAP'))519 $('.date').datepicker('refresh');520 if(isAvaible('CardDavMATE'))521 $('#vCardEditor').find('input[data-type^="date_"]').datepicker('refresh');522 if(isAvaible('Projects'))523 $('.project_date').datepicker('refresh');524 $('#calendar').fullCalendar('updateToday');525 $('#calendar').fullCalendar('gotoDate', currentToday);526 $('#todoList').fullCalendar('gotoDate', currentToday);527 if(currentToday.getTime()>globalToday.getTime())528 {529 getNextMonths($('#calendar').fullCalendar('getView').end);530 getNextMonthsTodo();531 }532 else //support for timezone with backward time flow533 {534 getPrevMonths($('#calendar').fullCalendar('getView').start);535 getPrevMonthsTodo();536 }537 globalToday=currentToday;538 }539 }540 checkForUnloadedResources();541 if(!globalEnableAllResourceSync&&(typeof loadArray=='undefined' || loadArray==null))542 netFindResource(globalAccountSettings[0], 0, false, 0, globalLoadedPrincipals);543 else544 netFindResource(globalAccountSettings[0], 0, false, 0, loadArray);545}546function ifLoadCollections()547{548 if((isAvaible('CardDavMATE') && (globalCardDAVInitLoad || globalCardDAVResourceSync)) || (isAvaible('CalDavZAP') && (globalCalDAVInitLoad || globalCalDAVResourceSync)))549 return false;550 var changeCounter = 0;551 if(isAvaible('CardDavMATE'))552 for(var i=0; i<globalResourceCardDAVList.collections.length;i++)553 if(globalResourceCardDAVList.collections[i].uid!=undefined && globalResourceCardDAVList.collections[i].someChanged)554 changeCounter++;555 if(isAvaible('CalDavZAP'))556 {557 for(var i=0; i<globalResourceCalDAVList.collections.length;i++)558 if(globalResourceCalDAVList.collections[i].uid!=undefined && globalResourceCalDAVList.collections[i].someChanged)559 changeCounter++;560 for(var i=0; i<globalResourceCalDAVList.TodoCollections.length;i++)561 if(globalResourceCalDAVList.TodoCollections[i].uid!=undefined && globalResourceCalDAVList.TodoCollections[i].someChanged)562 changeCounter++;563 }564 if(changeCounter>0 || globalSettingsSaving!='')565 loadNextApplication(false);566}567function bindColorPickerClick(newElement)568{569 newElement.click(function(event){570 var collectionType=null;571 var resourceSelectedClass=null;572 var resourceItems=null;573 if(newElement.parent().hasClass('resourceCalDAV_item'))574 {575 if(globalEventCollectionsLoading)576 return false;577 collectionType='event';578 resourceSelectedClass='resourceCalDAV_item_selected';579 resourceItems=newElement.parent().siblings('.resourceCalDAV_item_selected');580 }581 else if(newElement.parent().hasClass('resourceCalDAVTODO_item'))582 {583 if(globalTodoCollectionsLoading)584 return false;585 collectionType='todo';586 resourceSelectedClass='resourceCalDAV_item_selected';587 resourceItems=newElement.parent().siblings('.resourceCalDAV_item_selected');588 }589 else if(newElement.hasClass('resourceCardDAVColor'))590 {591 if(globalAddressbookCollectionsLoading)592 return false;593 collectionType='addressbook';594 resourceSelectedClass='resourceCardDAV_selected';595 resourceItems=newElement.parent().parent().siblings().find('.resourceCardDAV_selected');596 }597 var showInput = event.shiftKey;598 var colorpicker=$(this).siblings('.colorPicker');599 if(!$(this).hasClass('hasColorpicker'))600 {601 $(this).addClass('hasColorpicker');602 colorpicker.spectrum({603 chooseText: localization[globalInterfaceLanguage].buttonSave,604 cancelText: localization[globalInterfaceLanguage].buttonCancel,605 color: newElement.css('background-color'),606 showInput: showInput,607 preferredFormat: 'hex6',608 move: function(color)609 {610 newElement.css('background', color);611 },612 hide: function(color)613 {614 if(newElement.css('background-color') != colorpicker.spectrum('get').toRgbString())615 newElement.css('background', colorpicker.spectrum('get').toRgbString());616 },617 change: function(color)618 {619 newElement.css('background', color);620 if(collectionType=='event')621 {622 var coll = globalResourceCalDAVList.getEventCollectionByUID($(this).parent().attr('data-id'));623 netSaveProperty(coll, (typeof globalCalendarColorPropertyXmlns!='undefined'&&globalCalendarColorPropertyXmlns!=null&&globalCalendarColorPropertyXmlns!='' ? globalCalendarColorPropertyXmlns : 'http://apple.com/ns/ical/'), 'calendar-color', color.toHexString())624 }625 else if(collectionType=='todo')626 {627 var coll = globalResourceCalDAVList.getTodoCollectionByUID($(this).parent().attr('data-id'));628 netSaveProperty(coll, (typeof globalCalendarColorPropertyXmlns!='undefined'&&globalCalendarColorPropertyXmlns!=null&&globalCalendarColorPropertyXmlns!='' ? globalCalendarColorPropertyXmlns : 'http://apple.com/ns/ical/'), 'calendar-color', color.toHexString())629 }630 else if(collectionType=='addressbook')631 {632 var coll = globalResourceCardDAVList.getCollectionByUID($(this).parent().attr('data-id'));633 netSaveProperty(coll, (typeof globalAddrColorPropertyXmlns!='undefined'&&globalAddrColorPropertyXmlns!=null&&globalAddrColorPropertyXmlns!='' ? globalAddrColorPropertyXmlns : 'http://inf-it.com/ns/ab/'), 'addressbook-color', color.toHexString())634 }635 }636 });637 }638 else if(showInput!=colorpicker.spectrum('option', 'showInput'))639 colorpicker.spectrum('option', 'showInput',showInput);640 var container = colorpicker.spectrum('container');641 if(container.is(':visible')) {642 colorpicker.spectrum('hide');643 }644 else {645 var offset=$(this).offset();646 colorpicker.spectrum('show');647 if(event.pageY<$(window).height()/2) {648 offset.top+=$(this).outerHeight();649 container.removeClass('sp-inverse');650 }651 else {652 offset.top-=container.outerHeight();653 container.addClass('sp-inverse');654 }655 container.offset(offset);656 }657 resourceItems.removeClass(resourceSelectedClass);658 newElement.parent().addClass(resourceSelectedClass);659 return false;660 });661}662function loadNextApplication(forceLoad)663{664 if(!globalFirstLoadNextApp)665 {666 if(isAvaible('CardDavMATE'))667 setAddressbookNumber();668 if(isAvaible('CalDavZAP'))669 setCalendarNumber(true);670 globalFirstLoadNextApp=true;671 }672 if(isAvaible('CardDavMATE') && !globalCardDAVCollectionSync && globalResourceCardDAVList.collections.length>0)673 {674 globalCardDAVCollectionSync=true;675 CardDAVnetLoadCollection(globalResourceCardDAVList.collections[0], forceLoad, false, null, 0, globalResourceCardDAVList.collections,true);676 }677 else if(isAvaible('CalDavZAP') && !globalCalDAVCollectionSync && globalResourceCalDAVList.collections.length>0)678 {679 globalCalDAVCollectionSync=true;680 CalDAVnetLoadCollection(globalResourceCalDAVList.collections[0], forceLoad, true, 0, globalResourceCalDAVList.collections);681 }682 else if(isAvaible('Projects') && !globalProjectSync && !isProjectsLoaded && getLoggedUser()!=null)683 {684 $('#MainLoaderInner').html('Loading projects');685 globalProjectSync=true;686 if(typeof globalCRMSettings != 'undefined')687 netLoadXSLT(globalCRMSettings.XSLTHref);688 else689 {690 console.log("Error: globalCRMSettings is not defined");691 loadNextApplication(false);692 }693 }694 else if(isAvaible('Reports') && !globalReportsSync && !isReportsLoaded && getLoggedUser()!=null)695 {696 $('#MainLoaderInner').html('Loading Reports');697 globalReportsSync=true;698 if(typeof globalCRMSettings != 'undefined')699 netLoadReportList(globalCRMSettings);700 else701 {702 console.log("Error: globalCRMSettings is not defined");703 loadNextApplication(false);704 }705 }706 else if(isAvaible('Settings') && !globalSettingsSync && !isSettingsLoaded && getLoggedUser()!=null)707 {708 globalSettingsSync = true;709 if(!isSettingsLoaded)710 loadNextApplication(false);711 if($('#ResourceSettingsList').children('.resourceSettings_item').length)712 $('#ResourceSettingsList').children().eq(0).trigger('click');713 }714 else715 {716 if((isAvaible('CalDavZAP') && !isCalDAVLoaded) || (isAvaible('CardDavMATE') && !isCardDAVLoaded))717 $('#MainLoader').fadeOut(1200, function(){$('#MainLoader').css('left','50px');});718 if(isAvaible('CardDavMATE'))719 {720 globalCardDAVCollectionSync=false;721 if(!isCardDAVLoaded)722 isCardDAVLoaded=true;723 }724 if(isAvaible('CalDavZAP'))725 {726 globalCalDAVCollectionSync=false;727 if(!isCalDAVLoaded)728 isCalDAVLoaded=true;729 }730 if(isAvaible('Projects'))731 {732 globalProjectSync=false;733 isProjectsLoaded = true;734 }735 if(isAvaible('Reports'))736 {737 globalReportsSync=false;738 isReportsLoaded = true;739 }740 if(isAvaible('Settings'))741 {742 globalSettingsSync=false;743 isSettingsLoaded = true;744 }745 }746}747function checkForApplication(inputApp)748{749 if(!globalEnableAppSwitch || globalObjectLoading)750 return false;751 globalEnableAppSwitch=false;752 globalActiveApp=inputApp;753 var inputID = 'System'+inputApp;754 $('.System').not('#'+inputID).each(function(){755 $(this).animate({opacity : 0}, 666, function(){756 /* XXX - System display:none changes757 if($(this).attr('id').indexOf('CalDav')==-1)758 $(this).css('display','none');759 else*/760 $(this).css('visibility','hidden');761 });762 });763 /* XXX - System display:none changes764 if(inputID.indexOf('CalDav')==-1)765 $('#'+inputID).css('display','block').animate({opacity : 1}, 666, function(){globalEnableAppSwitch=true;});766 else*/767 $('#'+inputID).css('visibility','visible').animate({opacity : 1}, 666, function(){globalEnableAppSwitch=true;});768}769function getLoggedUser()770{771 for(var i=0; i<globalAccountSettings.length;i++)772 if(globalAccountSettings[i].href.indexOf(globalLoginUsername)!=-1)773 return globalAccountSettings[i];774 return globalAccountSettings[0];775}776function login()777{778 $('#LoginLoader').fadeTo(1200, 1, function(){779 globalLoginUsername=$('#LoginPage').find('[data-type="system_username"]').val();780 globalLoginPassword=$('#LoginPage').find('[data-type="system_password"]').val();781 loadConfig();782 });783}784function logout(forceLogout)785{786 if((typeof forceLogout=='undefined' || forceLogout==null ) && (787 (isAvaible('CardDavMATE') && (!isCardDAVLoaded || globalCardDAVResourceSync)) || 788 (isAvaible('CalDavZAP') && (!isCalDAVLoaded || globalCalDAVResourceSync)) || 789 (isAvaible('Projects') && !isProjectsLoaded) || 790 (isAvaible('Settings') && (!isSettingsLoaded || (globalSettingsSaving!='' && !dontSaveSettings))) || 791 (isAvaible('CalDavZAP') && (globalLimitLoading!='' || globalLimitTodoLoading!=''))792 ))793 {794 globalPreventLogoutSync=true;795 return false;796 }797 clearInterval(globalResourceIntervalID);798 if(globalFirstLoadNextApp)799 globalFirstLoadNextApp=false;800 settingsLoaded=false;801 ignoreServerSettings=false;802 //save settings803 checkBeforeClose(false);804 globalResourceIntervalID=null;805 globalLoginUsername='';806 globalLoginPassword='';807 globalXMLCache=null;808 globalResourceNumber=0;809 globalResourceNumberCount=0;810 globalLoadedPrincipals=new Array();811 globalEmailAddress='';812 globalPreventLogoutSync=false;813 globalSyncSettingsSave=false;814 $(document.documentElement).unbind();815 // reset page title816 var tmpMatch = document.title.match('^(.*) \\[.*\\]$');817 if(tmpMatch!=null)818 document.title = tmpMatch[1];819 $('#LoginPage').fadeTo(2000, 1, function(){820 if(typeof isCalDAVLoaded!='undefined' && isCalDAVLoaded)821 {822 logoutCalDAV();823 isCalDAVLoaded=false;824 }825 if(typeof isCardDAVLoaded!='undefined' && isCardDAVLoaded)826 {827 logoutCardDAV();828 isCardDAVLoaded=false;829 }830 if(typeof isProjectsLoaded!='undefined' && isProjectsLoaded)831 {832 logoutProjects();833 isProjectsLoaded = false;834 }835 if(typeof isReportsLoaded!='undefined' && isReportsLoaded)836 {837 logoutReports();838 isReportsLoaded = false;839 }840 if(typeof isSettingsLoaded!='undefined' && isSettingsLoaded)841 {842 logoutSettings();843 isSettingsLoaded = false;844 }845 for(var i=globalAccountSettings.length-1;i>=0;i--)846 if(globalAccountSettings[i].type=='network')847 globalAccountSettings.splice(i, 1);848 if(typeof globalDemoMode=='undefined')849 {850 $('[data-type="system_username"]').val('').change();851 $('[data-type="system_password"]').val('').change();852 }853 $('.integration_d').hide();854 isUserLogged=false;855 if(globalSettings.defaultactiveapp.value==null)856 {857 if(isAvaible('CalDavZAP'))858 globalActiveApp='CalDavZAP';859 else if(isAvaible('CardDavMATE'))860 globalActiveApp='CardDavMATE';861 }862 else863 globalActiveApp=globalSettings.defaultactiveapp.value;864 resetSettings();865 if(isAvaible('CardDavMATE'))866 mainCardDAV();867 if(isAvaible('CalDavZAP'))868 mainCalDAV();869 if(isAvaible('Settings'))870 mainSettings();871 if(isAvaible('Projects'))872 mainProjects();873 if(isAvaible('Reports'))874 mainReports();875 init();876 });877}878function init()879{880 // browser check881 if(($.browser.msie && parseInt($.browser.version, 10)<9) || $.browser.opera)882 $('#login_message').css('display','').text(localization[globalInterfaceLanguage].unsupportedBrowser);883 if(typeof globalDemoMode!='undefined')884 {885 if(typeof globalDemoMode.userName!=undefined)886 $('[data-type="system_username"]').val(globalDemoMode.userName).change();887 if(typeof globalDemoMode.userPassword!=undefined)888 $('[data-type="system_password"]').val(globalDemoMode.userPassword).change();889 }890 loadConfig();891}892function run()893{894 isUserLogged=true;895 window.onfocus=function(){globalWindowFocus=true;}896 window.onblur=function(){if(globalSettings.backgroundsync.value==false) globalWindowFocus=false;}897 $('#LoginPage').fadeOut(2000);898 if(typeof globalAccountSettings=='undefined')899 {900 console.log('Error: \'no account configured\': see config.js!');901 return false;902 }903 if(typeof globalNewVersionNotifyUsers=='undefined' || globalNewVersionNotifyUsers!=null)904 netVersionCheck();905 document.title+=' ['+globalAccountSettings[0].userAuth.userName+']';906 // Automatically detect crossDomain settings907 var detectedHref=location.protocol+'//'+location.hostname+(location.port ? ':'+location.port : '');908 for(var i=0;i<globalAccountSettings.length;i++)909 {910 if(globalAccountSettings[i].crossDomain==undefined || typeof globalAccountSettings[i].crossDomain!='boolean')911 {912 if(globalAccountSettings[i].href.indexOf(detectedHref)==0)913 globalAccountSettings[i].crossDomain=false;914 else915 globalAccountSettings[i].crossDomain=true;916 console.log("Info: [userAccount: '"+globalAccountSettings[i].href.replace('\/\/', '//'+globalAccountSettings[i].userAuth.userName+'@')+"']: crossDomain set to: '"+(globalAccountSettings[i].crossDomain==true ? 'true' : 'false')+"'");917 }918 }919 if(typeof globalAvailableAppsArray!='undefined' && globalAvailableAppsArray!=null && globalAvailableAppsArray.length>1) {920 // show integration banner921 $('.integration_d').css('display', 'block');922 // show app buttons for available apps only923 if(globalAvailableAppsArray.indexOf('CalDavZAP')!=-1)924 $('#intCaldav').attr('title',localization[globalInterfaceLanguage].txtCalendars).css('display', 'block').find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);925 if(globalAvailableAppsArray.indexOf('CalDavTODO')!=-1)926 $('#intCaldavTodo').attr('title',localization[globalInterfaceLanguage].txtTodos).css('display', 'block').find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);927 if(globalAvailableAppsArray.indexOf('CardDavMATE')!=-1)928 $('#intCarddav').attr('title',localization[globalInterfaceLanguage].txtContacts).css('display', 'block').find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);929 if(globalAvailableAppsArray.indexOf('Projects')!=-1)930 $('#intProjects').attr('title',localization[globalInterfaceLanguage].txtProjects).css('display', 'block').find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);931 if(globalAvailableAppsArray.indexOf('Reports')!=-1)932 $('#intReports').attr('title',localization[globalInterfaceLanguage].txtReports).css('display', 'block').find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);933 if(globalAvailableAppsArray.indexOf('Settings')!=-1)934 $('#intSettings').attr('title',localization[globalInterfaceLanguage].txtSettings).css('display', 'block').find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);935 // show the refresh button936 if(typeof globalEnableRefresh==='boolean' && globalEnableRefresh && (globalAvailableAppsArray.indexOf('CalDavZAP')!=-1 || globalAvailableAppsArray.indexOf('CalDavTODO')!=-1 || globalAvailableAppsArray.indexOf('CardDavMATE')!=-1)) {937 $('#intRefresh').attr('title',localization[globalInterfaceLanguage].txtRefresh).find('.int_error').attr('alt',localization[globalInterfaceLanguage].txtError);938 $('#intRefresh').prev().addBack().css('display', 'block');939 }940 }941 $('#cacheDialogText').text(localization[globalInterfaceLanguage].txtCacheText);942 $('#cacheDialogButton').attr('value',localization[globalInterfaceLanguage].txtCacheButton);943}944function loadConfig()945{946 if(isUserLogged)// !!!!!! kedy moze toto nastat? nexapem ...947 return false;948 var configLoaded=true;949 // Automatically detect crossDomain settings950 var detectedHref=location.protocol+'//'+location.hostname+(location.port ? ':'+location.port : '');951 // check username and password against the server and create config from globalNetworkCheckSettings952 if(typeof globalNetworkCheckSettings!='undefined' && globalNetworkCheckSettings!=null)953 {954 if(globalLoginUsername=='' || globalLoginPassword=='')955 {956 $('#LoginPage').fadeTo(500, 1, function(){if(typeof globalDemoMode=='undefined') $('[data-type="system_username"]').focus()});957 $('#LoginLoader').fadeOut(1200);958 return false;959 }960 else961 {962 if(globalNetworkCheckSettings.crossDomain==undefined || typeof globalNetworkCheckSettings.crossDomain!='boolean')963 {964 if(globalNetworkCheckSettings.href.indexOf(detectedHref)==0)965 globalNetworkCheckSettings.crossDomain=false;966 else967 globalNetworkCheckSettings.crossDomain=true;968 console.log("Info: [globalNetworkCheckSettings: '"+globalNetworkCheckSettings.href+"']: crossDomain set to: '"+(globalNetworkCheckSettings.crossDomain==true ? 'true' : 'false')+"'");969 }970// !!!! preco sa riesi s logout buttonom prave tu?971 // show the logout button972 if(typeof globalAvailableAppsArray!='undefined' && globalAvailableAppsArray!=null && globalAvailableAppsArray.length>1) {973 $('#intLogout').prev().addBack().css('display', 'block');974 $('#intLogout').attr('title',localization[globalInterfaceLanguage].altLogout);975 }976 else {977 $('#Logout').css('display', 'block');978 }979 netCheckAndCreateConfiguration(globalNetworkCheckSettings);980 return true;981 }982 }983 // load the configuration XML(s) from the network984 if(typeof globalNetworkAccountSettings!='undefined' && globalNetworkAccountSettings!=null)985 {986 if(globalLoginUsername=='' || globalLoginPassword=='')987 {988 $('#LoginPage').fadeTo(500, 1, function(){if(typeof globalDemoMode=='undefined') $('[data-type="system_username"]').focus()});989 $('#LoginLoader').fadeOut(1200);990 return false;991 }992 else993 {994 if(globalNetworkAccountSettings.crossDomain==undefined || typeof globalNetworkAccountSettings.crossDomain!='boolean')995 {996 if(globalNetworkAccountSettings.href.indexOf(detectedHref)==0)997 globalNetworkAccountSettings.crossDomain=false;998 else999 globalNetworkAccountSettings.crossDomain=true;1000 console.log("Info: [globalNetworkAccountSettings: '"+globalNetworkAccountSettings.href+"']: crossDomain set to: '"+(globalNetworkAccountSettings.crossDomain==true ? 'true' : 'false')+"'");1001 }1002// !!!! preco sa riesi s logout buttonom prave tu?1003 // show the logout button1004 if(typeof globalAvailableAppsArray!='undefined' && globalAvailableAppsArray!=null && globalAvailableAppsArray.length>1) {1005 $('#intLogout').prev().addBack().css('display', 'block');1006 $('#intLogout').attr('title',localization[globalInterfaceLanguage].altLogout);1007 }1008 else {1009 $('#Logout').css('display', 'block');1010 }1011 netLoadConfiguration(globalNetworkAccountSettings);1012 return true;1013 }1014 }1015 if((typeof globalNetworkAccountSettings=='undefined' || globalNetworkAccountSettings==null) && (typeof globalNetworkCheckSettings=='undefined' || globalNetworkCheckSettings==null) && (typeof globalAccountSettings!='undefined' && globalAccountSettings!=null) && globalAccountSettings.length>0)1016 {1017 var delegCount=0, delegIndex=0;1018 if(!isDelegationLoaded)1019 {1020 for(var i=0; i<globalAccountSettings.length; i++)1021 if((typeof globalAccountSettings[i].delegation=='boolean' && globalAccountSettings[i].delegation) || (globalAccountSettings[i].delegation instanceof Array && globalAccountSettings[i].delegation.length>0))1022 delegIndex=i;1023 for(var i=0; i<globalAccountSettings.length; i++)1024 if((typeof globalAccountSettings[i].delegation=='boolean' && globalAccountSettings[i].delegation) || (globalAccountSettings[i].delegation instanceof Array && globalAccountSettings[i].delegation.length>0))1025 {1026 delegCount++;1027 DAVresourceDelegation(globalAccountSettings[i], i, delegIndex);1028 }1029 if(delegCount>0)1030 isDelegationLoaded = true;1031 }1032 if(delegCount==0 && !isDelegationLoaded)1033 {1034 // start the client1035 if(isAvaible('CardDavMATE'))1036 runCardDAV();1037 if(isAvaible('CalDavZAP'))1038 runCalDAV();1039 if(isAvaible('Projects'))1040 runProjects();1041 if(isAvaible('Settings'))1042 runSettings();1043 globalResourceNumber=globalAccountSettings.length;1044 loadAllResources();1045 }1046 }1047}1048function globalMain()1049{1050 for(var prop in globalSettings)1051 globalDefinedSettings.push(prop);1052 if(typeof globalEnabledApps=='undefined' || globalEnabledApps==null)1053 {1054 if(typeof isCalDAVAvaible!='undefined' && isCalDAVAvaible!=null && isCalDAVAvaible)1055 {1056 globalAvailableAppsArray[globalAvailableAppsArray.length]='CalDavZAP';1057 globalAvailableAppsArray[globalAvailableAppsArray.length]='CalDavTODO';1058 }1059 if(typeof isCardDAVAvaible!='undefined' && isCardDAVAvaible!=null && isCardDAVAvaible)1060 globalAvailableAppsArray[globalAvailableAppsArray.length]='CardDavMATE';1061 if(typeof isSettingsAvaible!='undefined' && isSettingsAvaible!=null && isSettingsAvaible)1062 globalAvailableAppsArray[globalAvailableAppsArray.length]='Settings';1063 if(typeof isProjectsAvaible!='undefined' && isProjectsAvaible!=null && isProjectsAvaible)1064 globalAvailableAppsArray[globalAvailableAppsArray.length]='Projects';1065 if(typeof isReportsAvaible!='undefined' && isReportsAvaible!=null && isReportsAvaible)1066 globalAvailableAppsArray[globalAvailableAppsArray.length]='Reports';1067 }1068 else1069 {1070 if(typeof isCalDAVAvaible!='undefined' && isCalDAVAvaible!=null && isCalDAVAvaible && (globalEnabledApps.indexOf('CalDavZAP')!=-1 || globalEnabledApps.indexOf('CalDavTODO')!=-1 ))1071 {1072 globalAvailableAppsArray[globalAvailableAppsArray.length]='CalDavZAP';1073 globalAvailableAppsArray[globalAvailableAppsArray.length]='CalDavTODO';1074 }1075 if(typeof isCardDAVAvaible!='undefined' && isCardDAVAvaible!=null && isCardDAVAvaible && globalEnabledApps.indexOf('CardDavMATE')!=-1)1076 globalAvailableAppsArray[globalAvailableAppsArray.length]='CardDavMATE';1077 if(typeof isSettingsAvaible!='undefined' && isSettingsAvaible!=null && isSettingsAvaible && globalEnabledApps.indexOf('Settings')!=-1)1078 globalAvailableAppsArray[globalAvailableAppsArray.length]='Settings';1079 if(typeof isProjectsAvaible!='undefined' && isProjectsAvaible!=null && isProjectsAvaible && globalEnabledApps.indexOf('Projects')!=-1)1080 globalAvailableAppsArray[globalAvailableAppsArray.length]='Projects';1081 if(typeof isReportsAvaible!='undefined' && isReportsAvaible!=null && isReportsAvaible)1082 globalAvailableAppsArray[globalAvailableAppsArray.length]='Reports';1083 }1084 if(globalAvailableAppsArray.length>1)1085 isIntegrated=true;1086 if(globalSettings.defaultactiveapp.value==null)1087 {1088 if(isAvaible('CardDavMATE'))1089 globalActiveApp='CardDavMATE';1090 else if(isAvaible('CalDavZAP'))1091 globalActiveApp='CalDavZAP';1092 }1093 else1094 globalActiveApp=globalSettings.defaultactiveapp.value;1095 if(isAvaible('CardDavMATE'))1096 {1097 // Modify available inputs before making additional changes to vCard form1098 if(typeof globalDisabledContactAttributes!='undefined' && globalDisabledContactAttributes instanceof Array)1099 for(var i=0;i<globalDisabledContactAttributes.length;i++)1100 $('#vCardTemplate').find('[data-attr-name="'+jqueryEscapeSelector(globalDisabledContactAttributes[i])+'"]').remove();1101 // hook for vCard template extension1102 if(typeof(globalContactsExtInitMain)=='function')1103 globalContactsExtInitMain($('#vCardTemplate'));1104 }1105 /*************************** BAD HACKS SECTION ***************************/1106 // here we fix the cross OS/cross broser problems (unfixable in pure CSS)1107 if($.browser.webkit && !!window.chrome) /* Chrome */1108 {1109 if(navigator.platform.toLowerCase().indexOf('win')==0) /* Windows version */1110 {1111 $('#LoginPage, #vCardTemplate, #event_details_template, #todo_details_template, #EditorBoxSettings').find('input').css('text-indent', '2px');1112 $('#LoginPage, #vCardTemplate, #event_details_template, #todo_details_template, #EditorBoxSettings').find('select').css({'padding-left': '0px', 'padding-right': '13px'});1113 }1114 else /* non-Windows version */1115 $('#LoginPage, #vCardTemplate, #event_details_template, #todo_details_template, #EditorBoxSettings').find('input').css('text-indent', '1px');1116 }1117 else if($.browser.safari)1118 {1119 $('#LoginPage, #vCardTemplate, #event_details_template, #todo_details_template, #EditorBoxSettings').find('textarea').addClass('safari_hack');1120 $('#LoginPage, #vCardTemplate, #event_details_template, #todo_details_template, #EditorBoxSettings').find('input').addClass('safari_hack');1121 }1122 else if($.browser.msie) /* IE */1123 {1124 if(parseInt($.browser.version, 10)==10) /* IE 10 (because there are no more conditional comments) */1125 {1126 $('select').css({'padding-top': '1px', 'padding-left': '0px', 'padding-right': '0px'});1127 $('textarea').css('padding-top', '3px');1128 $('input[type=button]').css('padding-top', '2px');1129 }1130 // ADD SVG to login screen1131 var newSVG=$(SVG_select_login).attr('data-type', 'select_icon').css({'pointer-events': 'none', 'z-index': '1', 'display': 'inline', 'margin-left': '-19px', 'vertical-align': 'top', 'background-color': '#ffffff'}); // background-color = stupid IE9 bug1132 $('#Login').find('select[data-type="language"]').after($($('<div>').append($(newSVG).clone()).html()));1133 }1134 else if($.browser.mozilla)1135 {1136 // ADD SVG to login screen1137 var newSVG=$(SVG_select_login).attr('data-type', 'select_icon').css({'pointer-events': 'none', 'z-index': '1', 'display': 'inline', 'margin-left': '-19px', 'vertical-align': 'top', 'background-color': '#ffffff'}); // background-color = stupid IE9 bug1138 $('#Login').find('select[data-type="language"]').after($($('<div>').append($(newSVG).clone()).html()));1139 }1140 /*************************** END OF BAD HACKS SECTION ***************************/1141 /* language selector */1142 var lang_num=0;1143 var language_option=$('#Login').find('[data-type="language"]').find('option');1144 $('#Login').find('[data-type="language"]').html('');1145 if(typeof globalInterfaceCustomLanguages!='undefined' && globalInterfaceCustomLanguages.length!=undefined && globalInterfaceCustomLanguages.length>0)1146 {1147 for(var i=0; i<globalInterfaceCustomLanguages.length; i++)1148 if(localization[globalInterfaceCustomLanguages[i]]!=undefined)1149 {1150 var tmp=language_option;1151 tmp.attr('data-type',globalInterfaceCustomLanguages[i]);1152 tmp.text(localization[globalInterfaceCustomLanguages[i]]['_name_']);1153 $('#Login').find('[data-type="language"]').append(tmp.clone());1154 lang_num++;1155 }1156 }1157 if(lang_num==0) // no language option, use the default (all languages from localization.js)1158 for(var loc in localization)1159 {1160 var tmp=language_option;1161 tmp.attr('data-type',loc);1162 tmp.text(localization[loc]['_name_']); // translation1163 $('#Login').find('[data-type="language"]').append(tmp.clone());1164 }1165 // select the globalInterfaceLanguage in the interface1166 $('[data-type="language"]').find('[data-type='+globalInterfaceLanguage+']').prop('selected',true);1167 // set login screen logo1168 if(isAvaible('CalDavZAP') && !isAvaible('CardDavMATE'))1169 {1170 $('[data-size="login_logo"]').find('img').attr('src', "caldavzap/images/cdz_logo.svg");1171 $('#LoginPage').find('.footer').text('CalDavZAP - the open source CalDAV web client');1172 }1173 else if(isAvaible('CardDavMATE') && !isAvaible('CalDavZAP'))1174 {1175 $('[data-size="login_logo"]').find('img').attr('src', "images/cdm_logo.svg");1176 $('#LoginPage').find('.footer').text('CardDavMATE - the open source CardDAV web client');1177 }1178 else1179 {1180 $('#Login').css('margin-top', '41px');1181 $('[data-size="login_logo"]').find('img').attr('src', "images/infcloud_logo.svg");1182 $('#LoginPage').find('.footer').text('InfCloud - the open source CalDAV/CardDAV web client');1183 }1184 $('#LoginPage').find('.footer').attr('title', globalVersion);1185 if(isAvaible('CardDavMATE'))1186 globalMainCardDAV();1187 if(isAvaible('CalDavZAP'))1188 globalMainCalDAV();1189 if(isAvaible('Projects'))1190 globalMainProjects();1191 if(isAvaible('Reports'))1192 globalMainReports();1193 if(isAvaible('Settings'))1194 globalMainSettings();1195 if(isAvaible('CardDavMATE'))1196 mainCardDAV();1197 if(isAvaible('CalDavZAP'))1198 mainCalDAV();1199 if(isAvaible('Projects'))1200 mainProjects();1201 if(isAvaible('Reports'))1202 mainReports();1203 if(isAvaible('Settings'))1204 mainSettings();1205 init();1206}1207function saveSettings(isFormSave)1208{1209 if(globalSettings.islastdefaultactiveapp.value)1210 globalSettings.defaultactiveapp.value=globalActiveApp;1211 globalSettings.version.value=globalSettingsVersion;1212 var rex = new RegExp('^(https?://)([^@/]+(?:@[^@/]+)?)@(.*)');1213 if(isAvaible('CalDavZAP'))1214 {1215 globalSettings.activecalendarcollections.value.splice(0, globalSettings.activecalendarcollections.value.length);1216 globalSettings.activetodocollections.value.splice(0, globalSettings.activetodocollections.value.length);1217 globalSettings.todolistfilterselected.value.splice(0, globalSettings.todolistfilterselected.value.length);1218 for(var i=0;i<globalVisibleCalDAVCollections.length;i++)1219 {1220 var uidParts=globalVisibleCalDAVCollections[i].match(rex)1221 globalSettings.activecalendarcollections.value.splice(globalSettings.activecalendarcollections.value.length , 0, uidParts[1]+uidParts[3]);1222 }1223 for(var i=0;i<globalVisibleCalDAVTODOCollections.length;i++)1224 {1225 var uidParts=globalVisibleCalDAVTODOCollections[i].match(rex);1226 globalSettings.activetodocollections.value.splice(globalSettings.activetodocollections.value.length , 0, uidParts[1]+uidParts[3]);1227 }1228 if(globalSettings.islastactiveview.value)1229 {1230 var view= $('#calendar').fullCalendar('getView');1231 globalSettings.activeview.value=view.name;1232 }1233 if(globalSettings.islasttimezone.value)1234 globalSettings.timezone.value=globalSessionTimeZone;1235 var uidSelected=$('#ResourceCalDAVList').find('.resourceCalDAV_item_selected').attr('data-id');1236 if(uidSelected!=undefined && uidSelected!='')1237 {1238 var par=uidSelected.split('/');1239 globalSettings.calendarselected.value=par[par.length-3]+'/'+par[par.length-2]+'/';1240 }1241 uidSelected=$('#ResourceCalDAVTODOList').find('.resourceCalDAV_item_selected').attr('data-id');1242 if(uidSelected!=undefined && uidSelected!='')1243 {1244 var par=uidSelected.split('/');1245 globalSettings.todocalendarselected.value=par[par.length-3]+'/'+par[par.length-2]+'/';1246 }1247 var filterArray = $('.fc-filter-option-selected');1248 for(var i=0; i<filterArray.length; i++)1249 globalSettings.todolistfilterselected.value.splice(globalSettings.todolistfilterselected.value.length,0,$($('.fc-filter-option-selected')[i]).attr('data-type'));1250 }1251 if(isAvaible('CardDavMATE'))1252 {1253 globalSettings.activeaddressbookcollections.value.splice(0, globalSettings.activeaddressbookcollections.value.length);1254 var visAddrs = dataGetChecked('#ResourceCardDAVList');1255 for(var i=0;i<visAddrs.length;i++)1256 {1257 if(visAddrs[i]!='undefined')1258 {1259 var uidPart=visAddrs[i].match(RegExp('^(https?://)(.*)', 'i'))[1];1260 var uidPart2= visAddrs[i].match(RegExp('^(https?://)(.*)', 'i'))[2].split('@')[2];1261 globalSettings.activeaddressbookcollections.value.splice(globalSettings.activeaddressbookcollections.value.length , 0, uidPart+uidPart2);1262 }1263 }1264 if($('#ResourceCardDAVList').find('.group.resourceCardDAV_selected').length>0)1265 var uidASelected=$('#ResourceCardDAVList').find('.group.resourceCardDAV_selected').attr('data-id');1266 else if($('#ResourceCardDAVList').find('.resourceCardDAV_selected').length>0)1267 var uidASelected=$('#ResourceCardDAVList').find('.resourceCardDAV_selected').attr('data-id');1268 else1269 var uidASelected='';1270 if(uidASelected!=undefined && uidASelected!='')1271 globalSettings.addressbookselected.value=uidASelected;1272 }1273 if(isAvaible('Settings') && isFormSave)1274 return applyFormSettings();1275 else1276 return globalSettings;1277}1278function loadXMLSetings(settingsXML)1279{1280 $(settingsXML).children().each(1281 function(ind,elm)1282 {1283 var type = $(elm).attr('type');1284 var locked = typeof $(elm).attr('locked')!='undefined'&&$(elm).attr('locked')!=null&&$(elm).attr('locked')=='true' ? true : false;1285 if(typeof globalSettings[$(elm).prop('tagName').toLowerCase()] == 'undefined')1286 return true;1287 if(locked)1288 globalSettings[$(elm).prop('tagName').toLowerCase()].locked=true;1289 if($(elm).children().length>0)1290 {1291 globalSettings[$(elm).prop('tagName').toLowerCase()].value = new Array();1292 $(elm).children().each(function(pind,pelm)1293 {1294 if($(elm).prop('tagName').toLowerCase() == 'urihandlerprofile')1295 {1296 globalSettings[$(elm).prop('tagName').toLowerCase()].value = {};1297 globalSettings[$(elm).prop('tagName').toLowerCase()].value[$(pelm).text().toLowerCase()] = $(pelm).attr('url');1298 }1299 else if($(elm).prop('tagName').toLowerCase() == 'addresscountryequivalence')1300 {1301 var eqObject = {};1302 eqObject['country'] = $(pelm).attr('name');1303 eqObject['regex'] = $(pelm).attr('regex');1304 globalSettings[$(elm).prop('tagName').toLowerCase()].value.push(eqObject);1305 }1306 else if($(elm).prop('tagName').toLowerCase() == 'compatibility')1307 {1308 globalSettings[$(elm).prop('tagName').toLowerCase()].value = {};1309 globalSettings[$(elm).prop('tagName').toLowerCase()].value[$(pelm).attr('name')] = new Array();1310 $(pelm).children().each(function(rind,relm)1311 {1312 globalSettings[$(elm).prop('tagName').toLowerCase()].value[$(pelm).attr('name')].push($(relm).text());1313 });1314 }1315 else if($(pelm).text()!='')1316 {1317 switch(type)1318 {1319 case 'integer':1320 globalSettings[$(elm).prop('tagName').toLowerCase()].value.push(parseInt($(pelm).text(),10));1321 break;1322 case 'string':1323 if($(pelm).text()!='null')1324 globalSettings[$(elm).prop('tagName').toLowerCase()].value.push($(pelm).text());1325 else1326 globalSettings[$(elm).prop('tagName').toLowerCase()].value.push(null);1327 break;1328 case 'boolean':1329 if($(pelm).text() == 'true')1330 globalSettings[$(elm).prop('tagName').toLowerCase()].value.push(true);1331 else1332 globalSettings[$(elm).prop('tagName').toLowerCase()].value.push(false);1333 break;1334 default:1335 break;1336 }1337 }1338 });1339 }1340 else if($(elm).text()!='')1341 {1342 switch(type)1343 {1344 case 'integer':1345 globalSettings[$(elm).prop('tagName').toLowerCase()].value = parseInt($(elm).text(),10);1346 break;1347 case 'string':1348 if($(elm).text()!='null')1349 globalSettings[$(elm).prop('tagName').toLowerCase()].value = $(elm).text();1350 else1351 globalSettings[$(elm).prop('tagName').toLowerCase()].value = null;1352 break;1353 case 'boolean':1354 if($(elm).text() == 'true')1355 globalSettings[$(elm).prop('tagName').toLowerCase()].value = true;1356 else if($(elm).text() == 'false')1357 globalSettings[$(elm).prop('tagName').toLowerCase()].value = false;1358 break;1359 default:1360 break;1361 }1362 }1363 });1364}1365function applyServerSettings(inputSettings)1366{1367 if(typeof inputSettings.activecalendarcollections == 'undefined' || inputSettings.activecalendarcollections==null)1368 inputSettings.activecalendarcollections = new Array();1369 if(typeof inputSettings.activetodocollections == 'undefined' || inputSettings.activetodocollections==null)1370 inputSettings.activetodocollections = new Array();1371 if(typeof inputSettings.loadedcalendarcollections == 'undefined' || inputSettings.loadedcalendarcollections==null)1372 {1373 inputSettings.loadedcalendarcollections = new Array();1374 if(isAvaible('CalDavZAP'))1375 $('#showUnloadedCalendars').css('display','none');1376 }1377 if(typeof inputSettings.loadedtodocollections == 'undefined' || inputSettings.loadedtodocollections==null)1378 {1379 inputSettings.loadedtodocollections = new Array();1380 if(isAvaible('CalDavZAP'))1381 $('#showUnloadedCalendarsTODO').css('display','none');1382 }1383 if(typeof inputSettings.activeaddressbookcollections == 'undefined' || inputSettings.activeaddressbookcollections==null)1384 inputSettings.activeaddressbookcollections = new Array();1385 if(typeof inputSettings.loadedaddressbookcollections == 'undefined' || inputSettings.loadedaddressbookcollections==null)1386 {1387 inputSettings.loadedaddressbookcollections = new Array();1388 if(isAvaible('CardDavMATE'))1389 $('#showUnloadedAddressbooks').css('display','none');1390 }1391 transformSettings(inputSettings);1392 for(var prop in inputSettings)1393 {1394 if(globalDefinedSettings.indexOf(prop)==-1 || (typeof globalPreviousSupportedSettings !='undefined' && globalPreviousSupportedSettings.indexOf(prop)==-1))1395 {1396 if(globalDefinedSettings.indexOf(prop)==-1)1397 console.log('Warning: Unsupported property: \''+prop+'\' (you can safely ignore this message)');1398 continue;1399 }1400 if(typeof globalSettings[prop] !='undefined' && !globalSettings[prop].locked)1401 globalSettings[prop].value=inputSettings[prop];1402 }1403}1404function transformSettings(settings) {1405 if(!settings.version) {1406 settings.version = 1;1407 }1408 while(settings.version<globalSettingsVersion) {1409 console.log('Warning: Detected outdated server settings (version ' + settings.version++ +') - transforming to version ' + settings.version);1410 switch(settings.version) {1411 case 2:1412 if(typeof globalActiveCalendarCollections!='undefined' && globalActiveCalendarCollections!=null)1413 settings.activecalendarcollections=globalActiveCalendarCollections.slice();1414 else1415 settings.activecalendarcollections.splice(0, settings.activecalendarcollections.length);1416 if(typeof globalActiveTodoCollections!='undefined' && globalActiveTodoCollections!=null)1417 settings.activetodocollections=globalActiveTodoCollections.slice();1418 else1419 settings.activetodocollections.splice(0, settings.activetodocollections.length);1420 if(typeof globalLoadedCalendarCollections!='undefined' && globalLoadedCalendarCollections!=null)1421 settings.loadedcalendarcollections=globalLoadedCalendarCollections.slice();1422 else1423 settings.loadedcalendarcollections.splice(0, settings.loadedcalendarcollections.length);1424 if(typeof globalLoadedTodoCollections!='undefined' && globalLoadedTodoCollections!=null)1425 settings.loadedtodocollections=globalLoadedTodoCollections.slice();1426 else1427 settings.loadedtodocollections.splice(0, settings.loadedtodocollections.length);1428 if(typeof globalActiveAddressbookCollections!='undefined' && globalActiveAddressbookCollections!=null)1429 settings.activeaddressbookcollections=globalActiveAddressbookCollections.slice();1430 else1431 settings.activeaddressbookcollections.splice(0, settings.activeaddressbookcollections.length);1432 if(typeof globalLoadedAddressbookCollections!='undefined' && globalLoadedAddressbookCollections!=null)1433 settings.loadedaddressbookcollections=globalLoadedAddressbookCollections.slice();1434 else1435 settings.loadedaddressbookcollections.splice(0, settings.loadedaddressbookcollections.length);1436 if(typeof globalContactStoreFN!='undefined' && globalContactStoreFN!=null)1437 settings.contactstorefn=globalContactStoreFN.slice();1438 else1439 settings.contactstorefn=['prefix', ' last', ' middle', ' first', ' suffix'];1440 break;1441 case 3:1442 settings.collectiondisplay=(typeof globalCollectionDisplay!='undefined' && globalCollectionDisplay!=null && globalCollectionDisplay!='') ? globalCollectionDisplay : (1443 (typeof globalGroupContactsByCompanies!='undefined' && globalGroupContactsByCompanies) ?1444 [{label: '{Name}', value: {company: ['{Company}', ' [{Department}]'], personal: ['{LastName}', ' {MiddleName}', ' {FirstName}']}}, {label: '{JobTitle}', value: ['{JobTitle}']}, {label: '{Email}', value: ['{Email[:0]}']}, {label: '{Phone} 1', value: ['{Phone[:0]}']}, {label: '{Phone} 2', value: ['{Phone[:1]}']}, {label: '{NoteText}', value: ['{NoteText}']}] :1445 [{label: '{Name}', value: ['{LastName}', ' {MiddleName}', ' {FirstName}']}, {label: '{Company} [{Department}]', value: ['{Company}', ' [{Department}]']}, {label: '{JobTitle}', value: ['{JobTitle}']}, {label: '{Email}', value: ['{Email[:0]}']}, {label: '{Phone} 1', value: ['{Phone[:0]}']}, {label: '{Phone} 2', value: ['{Phone[:1]}']}, {label: '{NoteText}', value: ['{NoteText}']}]1446 );1447 settings.collectionsort=(typeof globalCollectionSort!='undefined' && globalCollectionSort!=null && globalCollectionSort!='') ? globalCollectionSort : '';1448 break;1449 default:1450 break;1451 }1452 }1453}1454function loadSettings(strobj, fromServer, syncMode)1455{1456 if(settingsLoaded && !syncMode)1457 return false;1458 try1459 {1460 objNew = jQuery.parseJSON(strobj);1461 if(typeof objNew=='object')1462 {1463 if(!syncMode && typeof globalSettingsXML!='undefined' && globalSettingsXML!=null && globalSettingsXML!='')1464 loadXMLSetings($(globalSettingsXML));1465 if(fromServer)1466 applyServerSettings(objNew);1467// $.extend(globalSettings,objNew);1468 }1469 }1470 catch(err)1471 {1472 console.log('load settings - JSON parsing error: '+err);1473 delete globalSettings.version.value;1474 loadSettings(JSON.stringify(globalSettings), false, false);1475 return false;1476 }1477 if(syncMode)1478 return false;1479 if(isAvaible('CalDavZAP'))1480 {1481 for(var i=0;i<globalSettings.timezonesenabled.value.length;i++)1482 if(timeZonesEnabled.indexOf(globalSettings.timezonesenabled.value[i])==-1)1483 timeZonesEnabled.push(globalSettings.timezonesenabled.value[i]);1484 if(globalSettings.timezonesupport.value)1485 {1486 globalSessionTimeZone=globalSettings.timezone.value;1487 if(globalSessionTimeZone != null && timeZonesEnabled.indexOf(globalSessionTimeZone)==-1)1488 timeZonesEnabled.push(globalSessionTimeZone);1489 }1490 else1491 {1492 globalSessionTimeZone = 'local';1493 timeZonesEnabled.push('local');1494 }1495 initTimepicker(globalSettings.ampmformat.value);1496 if(globalSettings.timeformatagenda.value==null)1497 {1498 if(globalSettings.ampmformat.value)1499 globalSettings.timeformatagenda.value='h:mm TT{ - h:mm TT}';1500 else1501 globalSettings.timeformatagenda.value='H:mm{ - H:mm}';1502 }1503 if(globalSettings.timeformatbasic.value==null)1504 {1505 if(globalSettings.ampmformat.value)1506 globalSettings.timeformatbasic.value = 'h:mmT{-h:mmT}';1507 else1508 globalSettings.timeformatbasic.value = 'H:mm{-H:mm}';1509 }1510 if(globalSettings.appleremindersmode.value)1511 {1512 if(globalSettings.todolistfilterselected.value.indexOf('filterAction')==-1 && globalSettings.todolistfilterselected.value.indexOf('filterCompleted')==-1)1513 {1514 if(globalSettings.todolistfilterselected.value.indexOf('filterProgress')!=-1)1515 globalSettings.todolistfilterselected.value[globalSettings.todolistfilterselected.value.indexOf('filterProgress')] = 'filterAction';1516 if(globalSettings.todolistfilterselected.value.indexOf('filterCanceled')!=-1)1517 globalSettings.todolistfilterselected.value[globalSettings.todolistfilterselected.value.indexOf('filterCanceled')] = 'filterAction';1518 }1519 }1520 if(globalSettings.eventstartfuturelimit.value == null)1521 {1522 var now=new Date();1523 globalToLoadedLimit = new Date(now.getFullYear(), now.getMonth()+12, 1, 0, 0, 0);1524 globalToLoadedLimit.setMilliseconds(0);1525 globalBeginFuture = new Date(globalToLoadedLimit.getTime());1526 globalBeginFuture.setDate(globalBeginFuture.getDate()+14);1527 globalToLoadedLimitTodo = new Date(now.getFullYear(), now.getMonth()+12, 1, 0, 0, 0);1528 globalToLoadedLimitTodo.setMilliseconds(0);1529 }1530 if(globalSettings.enablekbnavigation.value!==false)1531 initKbTodoNavigation();1532 initFullCalendar();1533 initTodoList();1534 $('#SystemCalDavZAP .fc-header-title').css('width', $('#main_h_placeholder').width()-$('#SystemCalDavZAP .fc-header-left').outerWidth()-$('#SystemCalDavZAP .fc-header-right').outerWidth());1535 $('#ResourceCalDAVList, #ResourceCalDAVTODOList').css('bottom',(globalSettings.timezonesupport.value ? 20 : 0));1536 $('#alertBox').css('left', ($(window).width()/2)-($('#alertBox').width()/2));1537 }1538 if(isAvaible('CardDavMATE'))1539 {1540 // set ABListTableLayout1541 globalRefAbListTableHeader = $('#ABListTable').find('.ablist_table_header');1542 var colgroups = $('#ABListTable').find('colgroup');1543 for(var i=0; i<getDataColumnCount(); i++) {1544 globalRefAbListTableHeader.append('<th>');1545 colgroups.append('<col>');1546 }1547 globalRefAbListTableHeader.children().slice(globalFixedContactDataColumnsCount).each(function(ind) {1548 $(this).text(getDataColumnLabelAtIndex(ind));1549 });1550 globalRefABListTableCols=$('#ABListTable').find('colgroup').first().children();1551 globalRefABListInnerTableCols=$('#ABListTableInner').find('colgroup').children();1552 $('#ABListTable').find('.ablist_table_container').children().attr('colspan', getDataColumnCount()+globalFixedContactDataColumnsCount);1553 globalRefABListTable.children('.ablist_header').children().attr('colspan', getDataColumnCount()+globalFixedContactDataColumnsCount);1554 if(!globalOrigABListHeader) {1555 globalOrigABListHeader=globalRefABListTable.children('.ablist_header').remove();1556 }1557 if(!globalOrigABListItem) {1558 globalOrigABListItem=globalRefABListTable.children('.ablist_item').remove();1559 }1560 if(globalSettings.enablekbnavigation.value!==false)1561 initKbAddrNavigation();1562 applyAddrSettings(globalTranslVcardTemplate);1563 applyAddrSettings($('#vCardEditor'));1564 }1565 if(isAvaible('Projects'))1566 if(globalSettings.enablekbnavigation.value!==false)1567 initKbProjectNavigation();1568 settingsLoaded=true;1569 if(!isAvaible(globalSettings.defaultactiveapp.value))1570 globalActiveApp = globalAvailableAppsArray[0];1571 else1572 globalActiveApp = globalSettings.defaultactiveapp.value;1573}1574function checkForLoadedCollections(inputSettings)1575{1576 var val='', triggerSync=true;1577 globalLoadedCollectionsNumber=0;1578 globalLoadedCollectionsCount=0;1579 if(globalSettingsSaving=='event')1580 {1581 hideUnloadedCollections('event');1582 val = inputSettings.loadedcalendarcollections.value;1583 if(val.length>0)1584 globalLoadedCollectionsNumber+=$(val).not(globalSettings.loadedcalendarcollections.value).length;1585 else1586 globalLoadedCollectionsNumber++;1587 if($(globalSettings.loadedcalendarcollections.value).not(val).length>0)1588 {1589 if(globalLoadedCollectionsNumber==0)1590 {1591 triggerSync=false;1592 globalFirstHideLoader=false;1593 }1594 var unloadArray = $(globalSettings.loadedcalendarcollections.value).not(val);1595 unloadCalDAVCollection(unloadArray.toArray(),true);1596 }1597 if(triggerSync)1598 addLoadCalDAVCollection(val, true);1599 globalSettings.loadedcalendarcollections.value = val;1600 }1601 else if(globalSettingsSaving=='todo')1602 {1603 hideUnloadedCollections('todo');1604 val = inputSettings.loadedtodocollections.value;1605 if(val.length>0)1606 globalLoadedCollectionsNumber+=$(val).not(globalSettings.loadedtodocollections.value).length;1607 else1608 globalLoadedCollectionsNumber++;1609 if($(globalSettings.loadedtodocollections.value).not(val).length>0)1610 {1611 if(globalLoadedCollectionsNumber==0)1612 {1613 triggerSync=false;1614 globalFirstHideLoader=false;1615 }1616 var unloadArray = $(globalSettings.loadedtodocollections.value).not(val);1617 unloadCalDAVCollection(unloadArray.toArray(),false);1618 }1619 if(triggerSync)1620 addLoadCalDAVCollection(val, false);1621 globalSettings.loadedtodocollections.value = val;1622 }1623 else if(globalSettingsSaving=='addressbook')1624 {1625 hideUnloadedCardDAVCollections();1626 val = inputSettings.loadedaddressbookcollections.value;1627 if(val.length>0)1628 globalLoadedCollectionsNumber+=$(val).not(globalSettings.loadedaddressbookcollections.value).length;1629 else1630 globalLoadedCollectionsNumber++;1631 if($(globalSettings.loadedaddressbookcollections.value).not(val).length>0)1632 {1633 if(globalLoadedCollectionsNumber==0)1634 {1635 triggerSync=false;1636 globalFirstHideLoader=false;1637 }1638 var unloadArray = $(globalSettings.loadedaddressbookcollections.value).not(val);1639 unloadCardDAVCollection(unloadArray.toArray());1640 }1641 if(triggerSync)1642 addLoadCardDAVCollection(val)1643 globalSettings.loadedaddressbookcollections.value = val;1644 }1645 if(triggerSync)1646 ifLoadCollections();1647}1648function checkBeforeClose(isFormSave)1649{1650 if((isAvaible('CalDavZAP') && globalCalDAVInitLoad) || (isAvaible('CardDavMATE') && globalCardDAVInitLoad))1651 return false;1652 var old_settings=JSON.stringify(globalSettings);1653 var settings=saveSettings(isFormSave);1654 var new_settings = JSON.stringify(settings);1655 if(old_settings == new_settings)1656 return false;1657 for(var i=0;i<globalAccountSettings.length;i++)1658 if(globalAccountSettings[i].href.indexOf(globalLoginUsername)!=-1 && globalAccountSettings[i].settingsAccount)1659 {1660 netSaveSettings(globalAccountSettings[i], settings, isFormSave,false);1661 break;1662 }1663}1664function isEachResourceLoaded()1665{1666 var loaded = true;1667 for(var i=0; i< globalAccountSettings.length; i++)1668 if(typeof globalAccountSettings[i].errorLoaded!='undefined' && globalAccountSettings[i].errorLoaded!=null && globalAccountSettings[i].errorLoaded===true)1669 loaded=false;1670 return loaded;1671}1672window.onload=globalMain;1673window.onkeydown=function(event)1674{1675 switch(event.which) {1676 case 13:1677 if(!isUserLogged)1678 $('#Login').find('[data-type="system_login"]').trigger('click');1679 break;1680 case 27:1681 if(globalActiveApp=='CalDavZAP' && $('#CAEvent').is(':visible') && $('#EventDisabler').is(':hidden'))1682 $('#closeButton').trigger('click');1683 if(globalActiveApp=='Projects' && $('#ProjectEventForm').is(':visible') && $('#ProjectsDisabler').is(':hidden'))1684 $('#cancelActivity').trigger('click');1685 if($('.sp-container').is(':visible'))1686 $('html').trigger('click');1687 break;1688 default:1689 break;1690 }1691};1692// called only once (after tha page is loaded)1693function globalMainCardDAV()1694{1695 $(window).resize(function(evt){1696 if(evt.target!=window)1697 return;1698 var columnLengths = [];1699 for(var i=0; i<getDataColumnCount(); i++) {1700 columnLengths.push([]);1701 }1702 globalRefABListTable.children('.ablist_item:visible').each(function() {1703 $(this).children().slice(globalFixedContactDataColumnsCount).each(function(ind) {1704 columnLengths[ind].push($(this).text().length);1705 });1706 });1707 setDataColumnsWidth(columnLengths);1708 $('.ablist_table_wrapper').css('max-height', $('#ABList').innerHeight() - $('.ablist_table_header').outerHeight() - 1);1709 checkContactFormScrollBar();1710 });1711 // set the initial height to get vertical scrollbars working (used also in $(window).resize(...))1712 $('.ablist_table_wrapper').css('max-height', $('#ABList').innerHeight() - $('.ablist_table_header').outerHeight() - 1);1713 // toggle CardDAV resources1714 $('#ResourceCardDAVToggle').click(function(){1715 var transSpeedResource=70;1716 var isResourceVisible=$('#ResourceCardDAVList').width()>1;1717 var col1=isResourceVisible? 0:224;1718 var col2=isResourceVisible? 0:225;1719 if(isIntegrated)1720 {1721 col2+=50;1722 }1723 $('.resourcesCardDAV_d, #ResourceCardDAVList, #ResourceCardDAVListOverlay').animate({width: col1}, transSpeedResource);1724 $('.collection_d, #SearchBox, #ABList, #ABListOverlay, #AddressbookOverlay').animate({left: col2}, transSpeedResource);1725 });1726 globalRefABList=$('#ABList');1727 globalRefABListTable=$('#ABListTableInner').find('tbody');1728 globalRefAddContact=$('#AddContact');1729 // these are restored after each logout1730 globalOrigCardDAVListTemplate=$('#ResourceCardDAVListTemplate').clone();1731 // clone + cleanup the editor (autocomplete bug in some browsers) + store the reference in globalOrigVcardTemplate1732 var tmp=$('#vCardTemplate').clone();1733 tmp.find('input[type="text"]').val('');1734 tmp.find('textarea').text('');1735 globalOrigVcardTemplate=tmp;1736}1737// called after the page is loaded and after each logout1738function mainCardDAV()1739{1740 globalCardDAVInitLoad=true;1741 // localize templates1742 // + store translated templates (globalTranl*)1743 // + initialize placeholder plugin1744 localizeCardDAV();1745 // cleanup the search field1746 $('[data-type="search"]').val('');1747 // Switch back to global Init (check for supported browser, demo login & password autofill1748 // then performs loadConfig() /netCheckAndCreateConfiguration() or netLoadConfiguration() or loadAllResources()/1749 // init();1750}1751// POZOR! login vola priamo loadConfig() ... nie je tym nahodou predxadzajuca funkcia zbytocna? ... overit!1752// called from loadConfig() and netCheckAndCreateConfiguration() and netLoadConfiguration() and DAVresourceDelegation()1753function runCardDAV()1754{1755 if(!isUserLogged)1756 run();1757// $('#SystemCardDavMATE').animate({opacity : 1},200,function(){1758// /* XXX - System display:none changes1759// $('#SystemCardDavMATE').css('display','block'); */1760// $('#SystemCardDavMATE').css('visibility','visible');1761// });1762 $('#MainLoader').css('left','0px');1763 $('#MainLoader').fadeIn(200);1764 initSearchCardDav();1765}1766function logoutCardDAV()1767{1768 globalAddressbookList.reset();1769 globalResourceCardDAVList.reset();1770 globalAddressbookNumber=0;1771 globalAddressbookNumberCount=0;1772 globalCardDAVCollectionSync=false;1773 globalDefaultAddressbookCollectionActiveAll=false;1774 globalDefaultAddrCollectionLoadAll=false;1775 globalDisableAnimationMessageHiding='';1776 // reset ABList1777 globalRefABListTable.empty();1778 // remove ABList table gutter1779 $('.ablist_table_gutter').remove();1780 // clear old ABList table column widths1781 globalRefABListTableCols.width('');1782 globalRefABListInnerTableCols.width('');1783 // reset ABList table layout1784 globalRefAbListTableHeader.children().slice(globalFixedContactDataColumnsCount).remove();1785 globalRefABListTableCols.slice(globalFixedContactDataColumnsCount).remove();1786 globalRefABListInnerTableCols.slice(globalFixedContactDataColumnsCount).remove();1787 globalRefAbListTableHeader=null;1788 globalRefABListTableCols=null;1789 globalRefABListInnerTableCols=null;1790 // hide update notification1791 $('#SystemCardDavMATE').find('div.update_d').hide();1792 // if the editor is in "edit" state during the logout,1793 // we need to remove all overlays (for next login)1794 $('#ResourceCardDAVListOverlay, #ABListOverlay').fadeOut(2000);1795 $('#SystemCardDavMATE').animate({opacity : 0},200,function(){1796 /* XXX - System display:none changes1797 $('#SystemCardDavMATE').css('display','none');*/1798 $('#SystemCardDavMATE').css('visibility', 'hidden');1799 $('#ABContactColor').css('background-color', '');1800 if($('#ResourceCardDAVList').width()<1)1801 $('#ResourceCardDAVToggle').trigger('click');1802 });1803}1804function setAddressbookNumber()1805{1806 for(var i=0; i<globalResourceCardDAVList.collections.length;i++)1807 if(globalResourceCardDAVList.collections[i].uid!=undefined && globalResourceCardDAVList.collections[i].makeLoaded)1808 globalAddressbookNumber++;...

Full Screen

Full Screen

built-in-definitions.js

Source:built-in-definitions.js Github

copy

Full Screen

1"use strict";2exports.__esModule = true;3exports.StaticProperties = exports.InstanceProperties = exports.BuiltIns = exports.CommonIterators = void 0;4var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins"));5function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }6const define = (name, pure, global = [], meta) => {7 return {8 name,9 pure,10 global,11 meta12 };13};14const pureAndGlobal = (pure, global, minRuntimeVersion = null) => define(global[0], pure, global, {15 minRuntimeVersion16});17const globalOnly = global => define(global[0], null, global);18const pureOnly = (pure, name) => define(name, pure, []);19const ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"];20const CommonIterators = ["es6.string.iterator", ...ArrayNatureIterators];21exports.CommonIterators = CommonIterators;22const PromiseDependencies = ["es6.object.to-string", "es6.promise"];23const BuiltIns = {24 DataView: globalOnly(["es6.typed.data-view"]),25 Float32Array: globalOnly(["es6.typed.float32-array"]),26 Float64Array: globalOnly(["es6.typed.float64-array"]),27 Int8Array: globalOnly(["es6.typed.int8-array"]),28 Int16Array: globalOnly(["es6.typed.int16-array"]),29 Int32Array: globalOnly(["es6.typed.int32-array"]),30 Map: pureAndGlobal("map", ["es6.map", ...CommonIterators]),31 Number: globalOnly(["es6.number.constructor"]),32 Promise: pureAndGlobal("promise", PromiseDependencies),33 RegExp: globalOnly(["es6.regexp.constructor"]),34 Set: pureAndGlobal("set", ["es6.set", ...CommonIterators]),35 Symbol: pureAndGlobal("symbol", ["es6.symbol"]),36 Uint8Array: globalOnly(["es6.typed.uint8-array"]),37 Uint8ClampedArray: globalOnly(["es6.typed.uint8-clamped-array"]),38 Uint16Array: globalOnly(["es6.typed.uint16-array"]),39 Uint32Array: globalOnly(["es6.typed.uint32-array"]),40 WeakMap: pureAndGlobal("weak-map", ["es6.weak-map", ...CommonIterators]),41 WeakSet: pureAndGlobal("weak-set", ["es6.weak-set", ...CommonIterators]),42 setImmediate: pureOnly("set-immediate", "web.immediate"),43 clearImmediate: pureOnly("clear-immediate", "web.immediate"),44 parseFloat: pureOnly("parse-float", "es6.parse-float"),45 parseInt: pureOnly("parse-int", "es6.parse-int")46};47exports.BuiltIns = BuiltIns;48const InstanceProperties = {49 __defineGetter__: globalOnly(["es7.object.define-getter"]),50 __defineSetter__: globalOnly(["es7.object.define-setter"]),51 __lookupGetter__: globalOnly(["es7.object.lookup-getter"]),52 __lookupSetter__: globalOnly(["es7.object.lookup-setter"]),53 anchor: globalOnly(["es6.string.anchor"]),54 big: globalOnly(["es6.string.big"]),55 bind: globalOnly(["es6.function.bind"]),56 blink: globalOnly(["es6.string.blink"]),57 bold: globalOnly(["es6.string.bold"]),58 codePointAt: globalOnly(["es6.string.code-point-at"]),59 copyWithin: globalOnly(["es6.array.copy-within"]),60 endsWith: globalOnly(["es6.string.ends-with"]),61 entries: globalOnly(ArrayNatureIterators),62 every: globalOnly(["es6.array.every"]),63 fill: globalOnly(["es6.array.fill"]),64 filter: globalOnly(["es6.array.filter"]),65 finally: globalOnly(["es7.promise.finally", ...PromiseDependencies]),66 find: globalOnly(["es6.array.find"]),67 findIndex: globalOnly(["es6.array.find-index"]),68 fixed: globalOnly(["es6.string.fixed"]),69 flags: globalOnly(["es6.regexp.flags"]),70 flatMap: globalOnly(["es7.array.flat-map"]),71 fontcolor: globalOnly(["es6.string.fontcolor"]),72 fontsize: globalOnly(["es6.string.fontsize"]),73 forEach: globalOnly(["es6.array.for-each"]),74 includes: globalOnly(["es6.string.includes", "es7.array.includes"]),75 indexOf: globalOnly(["es6.array.index-of"]),76 italics: globalOnly(["es6.string.italics"]),77 keys: globalOnly(ArrayNatureIterators),78 lastIndexOf: globalOnly(["es6.array.last-index-of"]),79 link: globalOnly(["es6.string.link"]),80 map: globalOnly(["es6.array.map"]),81 match: globalOnly(["es6.regexp.match"]),82 name: globalOnly(["es6.function.name"]),83 padStart: globalOnly(["es7.string.pad-start"]),84 padEnd: globalOnly(["es7.string.pad-end"]),85 reduce: globalOnly(["es6.array.reduce"]),86 reduceRight: globalOnly(["es6.array.reduce-right"]),87 repeat: globalOnly(["es6.string.repeat"]),88 replace: globalOnly(["es6.regexp.replace"]),89 search: globalOnly(["es6.regexp.search"]),90 small: globalOnly(["es6.string.small"]),91 some: globalOnly(["es6.array.some"]),92 sort: globalOnly(["es6.array.sort"]),93 split: globalOnly(["es6.regexp.split"]),94 startsWith: globalOnly(["es6.string.starts-with"]),95 strike: globalOnly(["es6.string.strike"]),96 sub: globalOnly(["es6.string.sub"]),97 sup: globalOnly(["es6.string.sup"]),98 toISOString: globalOnly(["es6.date.to-iso-string"]),99 toJSON: globalOnly(["es6.date.to-json"]),100 toString: globalOnly(["es6.object.to-string", "es6.date.to-string", "es6.regexp.to-string"]),101 trim: globalOnly(["es6.string.trim"]),102 trimEnd: globalOnly(["es7.string.trim-right"]),103 trimLeft: globalOnly(["es7.string.trim-left"]),104 trimRight: globalOnly(["es7.string.trim-right"]),105 trimStart: globalOnly(["es7.string.trim-left"]),106 values: globalOnly(ArrayNatureIterators)107}; // This isn't present in older @babel/compat-data versions108exports.InstanceProperties = InstanceProperties;109if ("es6.array.slice" in _corejs2BuiltIns.default) {110 InstanceProperties.slice = globalOnly(["es6.array.slice"]);111}112const StaticProperties = {113 Array: {114 from: pureAndGlobal("array/from", ["es6.symbol", "es6.array.from", ...CommonIterators]),115 isArray: pureAndGlobal("array/is-array", ["es6.array.is-array"]),116 of: pureAndGlobal("array/of", ["es6.array.of"])117 },118 Date: {119 now: pureAndGlobal("date/now", ["es6.date.now"])120 },121 JSON: {122 stringify: pureOnly("json/stringify", "es6.symbol")123 },124 Math: {125 // 'Math' was not included in the 7.0.0126 // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616.127 acosh: pureAndGlobal("math/acosh", ["es6.math.acosh"], "7.0.1"),128 asinh: pureAndGlobal("math/asinh", ["es6.math.asinh"], "7.0.1"),129 atanh: pureAndGlobal("math/atanh", ["es6.math.atanh"], "7.0.1"),130 cbrt: pureAndGlobal("math/cbrt", ["es6.math.cbrt"], "7.0.1"),131 clz32: pureAndGlobal("math/clz32", ["es6.math.clz32"], "7.0.1"),132 cosh: pureAndGlobal("math/cosh", ["es6.math.cosh"], "7.0.1"),133 expm1: pureAndGlobal("math/expm1", ["es6.math.expm1"], "7.0.1"),134 fround: pureAndGlobal("math/fround", ["es6.math.fround"], "7.0.1"),135 hypot: pureAndGlobal("math/hypot", ["es6.math.hypot"], "7.0.1"),136 imul: pureAndGlobal("math/imul", ["es6.math.imul"], "7.0.1"),137 log1p: pureAndGlobal("math/log1p", ["es6.math.log1p"], "7.0.1"),138 log10: pureAndGlobal("math/log10", ["es6.math.log10"], "7.0.1"),139 log2: pureAndGlobal("math/log2", ["es6.math.log2"], "7.0.1"),140 sign: pureAndGlobal("math/sign", ["es6.math.sign"], "7.0.1"),141 sinh: pureAndGlobal("math/sinh", ["es6.math.sinh"], "7.0.1"),142 tanh: pureAndGlobal("math/tanh", ["es6.math.tanh"], "7.0.1"),143 trunc: pureAndGlobal("math/trunc", ["es6.math.trunc"], "7.0.1")144 },145 Number: {146 EPSILON: pureAndGlobal("number/epsilon", ["es6.number.epsilon"]),147 MIN_SAFE_INTEGER: pureAndGlobal("number/min-safe-integer", ["es6.number.min-safe-integer"]),148 MAX_SAFE_INTEGER: pureAndGlobal("number/max-safe-integer", ["es6.number.max-safe-integer"]),149 isFinite: pureAndGlobal("number/is-finite", ["es6.number.is-finite"]),150 isInteger: pureAndGlobal("number/is-integer", ["es6.number.is-integer"]),151 isSafeInteger: pureAndGlobal("number/is-safe-integer", ["es6.number.is-safe-integer"]),152 isNaN: pureAndGlobal("number/is-nan", ["es6.number.is-nan"]),153 parseFloat: pureAndGlobal("number/parse-float", ["es6.number.parse-float"]),154 parseInt: pureAndGlobal("number/parse-int", ["es6.number.parse-int"])155 },156 Object: {157 assign: pureAndGlobal("object/assign", ["es6.object.assign"]),158 create: pureAndGlobal("object/create", ["es6.object.create"]),159 defineProperties: pureAndGlobal("object/define-properties", ["es6.object.define-properties"]),160 defineProperty: pureAndGlobal("object/define-property", ["es6.object.define-property"]),161 entries: pureAndGlobal("object/entries", ["es7.object.entries"]),162 freeze: pureAndGlobal("object/freeze", ["es6.object.freeze"]),163 getOwnPropertyDescriptor: pureAndGlobal("object/get-own-property-descriptor", ["es6.object.get-own-property-descriptor"]),164 getOwnPropertyDescriptors: pureAndGlobal("object/get-own-property-descriptors", ["es7.object.get-own-property-descriptors"]),165 getOwnPropertyNames: pureAndGlobal("object/get-own-property-names", ["es6.object.get-own-property-names"]),166 getOwnPropertySymbols: pureAndGlobal("object/get-own-property-symbols", ["es6.symbol"]),167 getPrototypeOf: pureAndGlobal("object/get-prototype-of", ["es6.object.get-prototype-of"]),168 is: pureAndGlobal("object/is", ["es6.object.is"]),169 isExtensible: pureAndGlobal("object/is-extensible", ["es6.object.is-extensible"]),170 isFrozen: pureAndGlobal("object/is-frozen", ["es6.object.is-frozen"]),171 isSealed: pureAndGlobal("object/is-sealed", ["es6.object.is-sealed"]),172 keys: pureAndGlobal("object/keys", ["es6.object.keys"]),173 preventExtensions: pureAndGlobal("object/prevent-extensions", ["es6.object.prevent-extensions"]),174 seal: pureAndGlobal("object/seal", ["es6.object.seal"]),175 setPrototypeOf: pureAndGlobal("object/set-prototype-of", ["es6.object.set-prototype-of"]),176 values: pureAndGlobal("object/values", ["es7.object.values"])177 },178 Promise: {179 all: globalOnly(CommonIterators),180 race: globalOnly(CommonIterators)181 },182 Reflect: {183 apply: pureAndGlobal("reflect/apply", ["es6.reflect.apply"]),184 construct: pureAndGlobal("reflect/construct", ["es6.reflect.construct"]),185 defineProperty: pureAndGlobal("reflect/define-property", ["es6.reflect.define-property"]),186 deleteProperty: pureAndGlobal("reflect/delete-property", ["es6.reflect.delete-property"]),187 get: pureAndGlobal("reflect/get", ["es6.reflect.get"]),188 getOwnPropertyDescriptor: pureAndGlobal("reflect/get-own-property-descriptor", ["es6.reflect.get-own-property-descriptor"]),189 getPrototypeOf: pureAndGlobal("reflect/get-prototype-of", ["es6.reflect.get-prototype-of"]),190 has: pureAndGlobal("reflect/has", ["es6.reflect.has"]),191 isExtensible: pureAndGlobal("reflect/is-extensible", ["es6.reflect.is-extensible"]),192 ownKeys: pureAndGlobal("reflect/own-keys", ["es6.reflect.own-keys"]),193 preventExtensions: pureAndGlobal("reflect/prevent-extensions", ["es6.reflect.prevent-extensions"]),194 set: pureAndGlobal("reflect/set", ["es6.reflect.set"]),195 setPrototypeOf: pureAndGlobal("reflect/set-prototype-of", ["es6.reflect.set-prototype-of"])196 },197 String: {198 at: pureOnly("string/at", "es7.string.at"),199 fromCodePoint: pureAndGlobal("string/from-code-point", ["es6.string.from-code-point"]),200 raw: pureAndGlobal("string/raw", ["es6.string.raw"])201 },202 Symbol: {203 // FIXME: Pure disabled to work around zloirock/core-js#262.204 asyncIterator: globalOnly(["es6.symbol", "es7.symbol.async-iterator"]),205 for: pureOnly("symbol/for", "es6.symbol"),206 hasInstance: pureOnly("symbol/has-instance", "es6.symbol"),207 isConcatSpreadable: pureOnly("symbol/is-concat-spreadable", "es6.symbol"),208 iterator: define("es6.symbol", "symbol/iterator", CommonIterators),209 keyFor: pureOnly("symbol/key-for", "es6.symbol"),210 match: pureAndGlobal("symbol/match", ["es6.regexp.match"]),211 replace: pureOnly("symbol/replace", "es6.symbol"),212 search: pureOnly("symbol/search", "es6.symbol"),213 species: pureOnly("symbol/species", "es6.symbol"),214 split: pureOnly("symbol/split", "es6.symbol"),215 toPrimitive: pureOnly("symbol/to-primitive", "es6.symbol"),216 toStringTag: pureOnly("symbol/to-string-tag", "es6.symbol"),217 unscopables: pureOnly("symbol/unscopables", "es6.symbol")218 }219};...

Full Screen

Full Screen

index.d.ts

Source:index.d.ts Github

copy

Full Screen

1/**2 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.3 *4 * This source code is licensed under the MIT license found in the5 * LICENSE file in the root directory of this source tree.6 *7 */8import type { Global } from '@jest/types';9import bind from './bind';10declare type Global = Global.Global;11declare const install: (g: Global, table: Global.EachTable, ...data: Global.TemplateData) => {12 describe: {13 (title: string, suite: Global.EachTestFn<Global.BlockFn>, timeout?: number | undefined): void;14 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;15 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;16 };17 fdescribe: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;18 fit: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;19 it: {20 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;21 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;22 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;23 concurrent: {24 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;25 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;26 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;27 };28 };29 test: {30 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;31 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;32 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;33 concurrent: {34 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;35 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;36 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;37 };38 };39 xdescribe: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;40 xit: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;41 xtest: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;42};43declare const each: {44 (table: Global.EachTable, ...data: Global.TemplateData): ReturnType<typeof install>;45 withGlobal(g: Global): (table: Global.EachTable, ...data: Global.TemplateData) => {46 describe: {47 (title: string, suite: Global.EachTestFn<Global.BlockFn>, timeout?: number | undefined): void;48 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;49 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;50 };51 fdescribe: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;52 fit: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;53 it: {54 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;55 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;56 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;57 concurrent: {58 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;59 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;60 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;61 };62 };63 test: {64 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;65 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;66 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;67 concurrent: {68 (title: string, test: Global.EachTestFn<Global.TestFn>, timeout?: number | undefined): void;69 only: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;70 skip: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;71 };72 };73 xdescribe: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;74 xit: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;75 xtest: (title: string, test: Global.EachTestFn<Global.TestCallback>, timeout?: number | undefined) => void;76 };77};78export { bind };...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt = require('webpagetest');2wpt.getLocations(function(err, data) {3 if (err) return console.error(err);4 console.log(data);5});6wpt = require('webpagetest');7 if (err) return console.error(err);8 console.log(data);9});10wpt = require('webpagetest');11 if (err) return console.error(err);12 console.log(data);13});14wpt = require('webpagetest');15 if (err) return console.error(err);16 console.log(data);17});18wpt = require('webpagetest');19 if (err) return console.error(err);20 console.log(data);21});22wpt = require('webpagetest');23 if (err) return console.error(err);24 console.log(data);25});26wpt = require('webpagetest');27 if (err) return console.error(err);28 console.log(data);29});

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt = require('webpagetest');2 if (err) return console.log(err);3 console.log(data);4});5wpt = require('webpagetest');6 if (err) return console.log(err);7 console.log(data);8});9wpt = require('webpagetest');10 if (err) return console.log(err);11 console.log(data);12});13wpt = require('webpagetest');14 if (err) return console.log(err);15 console.log(data);16});17wpt = require('webpagetest');18 if (err) return console.log(err);19 console.log(data);20});21wpt = require('webpagetest');22 if (err) return console.log(err);23 console.log(data);24});25wpt = require('webpagetest');26 if (err) return console.log(err);

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2wptools.page('Barack_Obama').then(function(page) {3 console.log(page);4})5var wptools = require('wptools');6var page = new wptools.page('Barack_Obama');7page.then(function(page) {8 console.log(page);9})10var wptools = require('wptools');11var page = new wptools.page('Barack_Obama');12page.then(function(page) {13 console.log(page);14})15var wptools = require('wptools');16var page = new wptools.page('Barack_Obama');17page.then(function(page) {18 console.log(page);19})20var wptools = require('wptools');21var page = new wptools.page('Barack_Obama');22page.then(function(page) {23 console.log(page);24})25var wptools = require('wptools');26var page = new wptools.page('Barack_Obama');27page.then(function(page) {28 console.log(page);29})30var wptools = require('wptools');31var page = new wptools.page('Barack_Obama');32page.then(function(page) {33 console.log(page);34})35var wptools = require('wptools');36var page = new wptools.page('Barack_Obama');37page.then(function(page) {38 console.log(page);39})40var wptools = require('wptools');41var page = new wptools.page('Barack_Obama');42page.then(function(page) {43 console.log(page);44})45var wptools = require('wptools');46var page = new wptools.page('Barack_Obama');47page.then(function(page) {48 console.log(page);49})50var wptools = require('wptools');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.test();3module.exports.test = function() {4 console.log('test');5}6var wpt = require('./wpt.js');7wpt.test();8global.test = function() {9 console.log('test');10}

Full Screen

Using AI Code Generation

copy

Full Screen

1wpt.log("Hello World");2wpt.log("Hello World");3wpt.log("Hello World");4wpt.log("Hello World");5wpt.log("Hello World");6wpt.log("Hello World");7wpt.log("Hello World");8wpt.log("Hello World");

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful