mirror of
https://gitflic.ru/project/photopea-v2/photopea-v-2.git
synced 2026-06-20 15:41:13 +00:00
Periodic pull
This commit is contained in:
+275
-105
File diff suppressed because one or more lines are too long
+1654
-1644
File diff suppressed because one or more lines are too long
Binary file not shown.
+16413
-16020
File diff suppressed because one or more lines are too long
@@ -10,6 +10,8 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
var sentFalse = false;
|
||||
var refreshToken = false;
|
||||
var tmpAction, tmpPrms;
|
||||
var clientId = "463342976776-04ub3ijsr7i5qobn8ha32ap6vsaae75a.apps.googleusercontent.com";
|
||||
var scope = "https://www.googleapis.com/auth/drive";
|
||||
var discoveryDocs = "https://www.googleapis.com/discovery/v1/apis/drive/v3/rest";
|
||||
@@ -51,8 +53,16 @@
|
||||
localStorage.setItem("googledriveAccessToken", e.access_token);
|
||||
localStorage.setItem("googledriveAccessTokenValidUntil", Date.now() + e.expires_in * 1000);
|
||||
}
|
||||
if(refreshToken)
|
||||
{
|
||||
refreshToken = false;
|
||||
doAction(tmpAction,tmpPrms);
|
||||
}
|
||||
else
|
||||
{
|
||||
send("ready", true);
|
||||
}
|
||||
}
|
||||
|
||||
function gapiInit() {
|
||||
gapi.client.init({})
|
||||
@@ -117,7 +127,13 @@
|
||||
|
||||
function authorize(action,prms)
|
||||
{
|
||||
sentFalse = false;
|
||||
if(sentFalse) sentFalse = false;
|
||||
else
|
||||
{
|
||||
refreshToken = true;
|
||||
tmpAction = action;
|
||||
tmpPrms = prms;
|
||||
}
|
||||
client.requestAccessToken();
|
||||
}
|
||||
|
||||
@@ -550,9 +566,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
function checkToken()
|
||||
{
|
||||
var until;
|
||||
if(mode == 2) until = localStorage.getItem("googledriveAppFolderAccessTokenValidUntil");
|
||||
else if(mode == 3) until = localStorage.getItem("googledriveFileAccessTokenValidUntil");
|
||||
else until = localStorage.getItem("googledriveAccessTokenValidUntil");
|
||||
if(until && Date.now() < until) { return true; }
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
function doAction(action, prms)
|
||||
{
|
||||
if(action == signOutUser) { signOutUser(); }
|
||||
else if (!checkToken()) { authorize(action, prms); }
|
||||
else if(sentFalse) { authorize(action, prms); }
|
||||
else if(!gapi.client.getToken()) { send("ready", false); sentFalse = true; }
|
||||
else { findFile(action, prms.path.slice(1).split("/"), null, null, prms.buffer); }
|
||||
|
||||
+2088
-1873
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -935,10 +935,11 @@
|
||||
|
||||
.imageset .image, .imageset canvas
|
||||
{
|
||||
border-right: 1px solid rgba(0,0,0,0.2);
|
||||
border-bottom: 1px solid rgba(0,0,0,0.2);
|
||||
/*border-right: 1px solid rgba(0,0,0,0.2);
|
||||
border-bottom: 1px solid rgba(0,0,0,0.2);*/
|
||||
margin: 0 1px 1px 0;
|
||||
cursor: pointer;
|
||||
float:left;
|
||||
vertical-align:middle;
|
||||
}
|
||||
.imageset .selected {
|
||||
outline: 1.5px solid #00aaff;
|
||||
|
||||
@@ -299,7 +299,7 @@
|
||||
function cost0(v) {
|
||||
var age = (Date.now()*0.001 - v[2]) / (60*60*24); // age in days
|
||||
var cst = (v[7]+1) / age; // usages per day
|
||||
var ext = 20*Math.pow(Math.PI,-age*0.15);
|
||||
var ext = 60*Math.pow(Math.PI,-age*0.15);
|
||||
|
||||
return cst+ext;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user