Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function isPushNotificationsSupported () {
if (Browser.ios || Browser.ipod || Browser.iphone || Browser.ipad)
return false;
if (Browser.msedge || Browser.msie)
return false;
/* Firefox on Android push notifications not supported until at least 48: https://bugzilla.mozilla.org/show_bug.cgi?id=1206207#c6 */
if (Browser.firefox && Number(Browser.version) < 48 && (Browser.mobile || Browser.tablet)) {
return false;
}
if (Browser.firefox && Number(Browser.version) >= 44)
return true;
if (Browser.safari && Number(Browser.version) >= 7.1)
return true;
// Android Chrome WebView
if (navigator.appVersion.match(/ wv/))
return false;
HammerGestures.prototype._createManager = function(element, type) {
var manager = new Hammer.Manager(element);
// Managers are created with different parameters for different pointer
// types.
if (type === 'mouse') {
manager.add(new Hammer.Pan({ direction: Hammer.DIRECTION_ALL, threshold: 0 }));
}
else if (type === 'touch' || type === 'pen' || type === 'kinect') {
// On touch one wants to have both panning and pinching. The panning
// recognizer needs a threshold to allow the pinch to be recognized.
manager.add(new Hammer.Pan({ direction: Hammer.DIRECTION_ALL, threshold: 20, pointers: 1 }));
if (!(browser.msie && parseFloat(browser.version) < 10)) {
// Do not add pinch to IE8-9 to prevent focus issues which prevent wheel scrolling from
// working.
manager.add(new Hammer.Pinch());
}
}
return manager;
};
function init(options) {
$loading.addClass('is-visible');
const engine = Engine.create();
const viewer = App.create(engine);
const modal = modals.get('artist');
const loadStartTime = new Date().getTime();
modal.events.onOpen.add(handleArtistOpen_);
modal.events.onClose.add(handleArtistClose_);
if (window.location.hash === BIO_HASH) {
modal.open();
}
if (bowser.msie) {
$enterFullscreen.hide();
}
viewer.load(options.sessionSlug).then(sketch => {
const now = new Date().getTime();
const loadEndTime = now - loadStartTime;
var timeToScreen = null;
$loading.removeClass('is-visible');
sketchPlayer = new SketchPlayer(viewer, sketch);
progressBar = new SketchProgressBar($progress, sketchPlayer);
initEvents_();
initSpeed_();
setTimestamp_();
const supportedBrowser = () => {
if (bowser.msie) {
return false;
}
return true;
};
this.$watch('minDate', function(newValue, oldValue) {
if(!newValue)
return;
if(typeof newValue === 'string') {
if(bowser.msie && bowser.version <= 9)
return this.data.date = polyfill.StringDate(newValue);
return this.data.minDate = new Date(newValue);
}
if(newValue == 'Invalid Date' || newValue == 'NaN')
throw new TypeError('Invalid Date');
});
export function signThenEncryptAsync (data, privateKey, recipientId, publicKey) {
if (browser.msie || browser.msedge) {
return new Promise((resolve, reject) => {
try {
resolve(signThenEncrypt(data, privateKey, recipientId, publicKey));
} catch (e) {
reject(e.message);
}
});
} else {
let recipients;
if (Array.isArray(recipientId)) {
recipients = recipientId;
} else {
recipients = [{
recipientId: recipientId,
publicKey: publicKey
export function encryptWithKeyMultiRecipientsAsync (initialData, recipients) {
if (browser.msie || browser.msedge) {
return new Promise((resolve, reject) => {
try {
resolve(encryptWithKeyMultiRecipients(initialData, recipients));
} catch (e) {
reject(e.message);
}
});
} else {
if (recipients.length === 0) {
throwVirgilError('10000', {
error: 'Cannot encrypt data, "recipients" array is empty.'
});
}
recipients = recipients.map((r) => {
return {
export default function () {
return !bowser.msie;
}
FileUploader.prototype.startUploadingFile = function(event){
//this.uploadFileIFrame();
if (browser.msie && browser.version < 10) {
this.uploadFileIFrame();return;
} else {
files = event.target.files;
if(files.length > 0){
this.uploadFileHTML5(files[0]);
}
}
};