Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,16 @@
;'use strict';screen.mozLockOrientation('portrait');if(document.location.hash==='#activity'){navigator.mozSetMessageHandler('activity',function(activity){function flatten(arr){return arr&&arr.length?arr[0]:null;}
var data=activity.source.data;data.blob=flatten(data.blobs);data.metadata=flatten(data.metadata);data.name=flatten(data.filenames);handleShare(data,function(command,details){switch(command){case'save':activity.postResult({});break;case'cancel':activity.postError('pick cancelled');break;case'error':activity.postError('pick error');break;}});});}
else{window.addEventListener('visibilitychange',function(){if(document.hidden){window.close();}});window.addEventListener('message',function(event){if(event.origin!==window.location.origin){console.error('Couldn\'t recieve message: origins don\'t match',event.origin,window.location.origin);return;}
handleShare(event.data,function(command,details){event.source.postMessage({command:command,details:details},event.origin);window.close();});});}
function handleShare(data,callback){navigator.mozL10n.once(function(){function showError(title,message,okCallback){var okButton={title:'ok',callback:function(){CustomDialog.hide();okCallback();}};CustomDialog.show(title,message,okButton);}
var save=document.getElementById('save');var header=document.getElementById('header');var control=document.getElementById('playpause');var preview=document.getElementById('preview');var songtitle;if(data.metadata&&data.metadata.title){songtitle=data.metadata.title;}
else if(data.name){songtitle=data.name;}
else{songtitle='ringtone-untitled';}
var subtitle='';if(data.metadata&&data.metadata.artist){subtitle=data.metadata.artist;}
document.getElementById('songtitle').textContent=songtitle;document.getElementById('artist').textContent=subtitle;if(data.metadata&&data.metadata.picture){if(!subtitle){document.getElementById('artist').textContent='\u00a0';}
try{var pictureURL=URL.createObjectURL(data.metadata.picture);var picture=document.getElementById('picture');picture.hidden=false;picture.style.backgroundImage='url('+pictureURL+')';}
catch(e){console.error('Couldn\'t set picture:',e);}}
control.addEventListener('click',function(){if(preview.paused){(function(){var hack_activity_property='_hack_hack_shut_up';var hack_settings_property=data[hack_activity_property];if(hack_settings_property){var lock=navigator.mozSettings.createLock();lock.get(hack_settings_property).onsuccess=function(e){var value=e.target.result[hack_settings_property];var o={};o[hack_settings_property]=!value;navigator.mozSettings.createLock().set(o).onsuccess=function(){preview.play();};delete data[hack_activity_property];};}
else{preview.play();}}());}
else{preview.pause();}});preview.src=URL.createObjectURL(data.blob);preview.addEventListener('canplay',function(){save.disabled=false;});preview.addEventListener('error',function(){showError('play-error-title','play-error-desc',callback.bind(null,'error'));});preview.addEventListener('playing',function(){control.classList.add('playing');});preview.addEventListener('pause',function(){control.classList.remove('playing');});header.addEventListener('action',function(){callback('cancel');});save.addEventListener('click',function(){save.disabled=true;document.getElementById('saving-overlay').hidden=false;var info={name:songtitle,subtitle:subtitle,blob:data.blob};window.customRingtones.add(info).then(function(tone){if(document.getElementById('default-switch').checked){return window.systemTones.set('ringtone',tone).then(function(){return{toneID:tone.id,setAsDefault:true};});}
return{toneID:tone.id,setAsDefault:false};}).then(function(details){NotificationHelper.send(songtitle,{bodyL10n:details.setAsDefault?'set-default-tone':'created-tone',closeOnClick:false}).then((notification)=>{notification.close();callback('save',details);});},function(error){console.log('Error saving ringtone',error);showError('save-error-title','save-error-desc',callback.bind(null,'error'));});});});}