From 1d0ac9c0301eaeb913ed987de838cb883ff424ad Mon Sep 17 00:00:00 2001 From: Sergey Svistunov Date: Thu, 28 Nov 2024 19:31:23 +0300 Subject: [PATCH] Add image hosting turboimagehost.com --- Data/Favicons/turboimagehost.com.ico | Bin 0 -> 3836 bytes Data/Scripts/imageup.nut | 1 - Data/Scripts/turboimagehost.nut | 191 ++++++++++++++++++ Data/servers.xml | 21 ++ .../Gui/Dialogs/FileFormatCheckErrorDlg.cpp | 3 +- Source/Gui/Dialogs/WizardDlg.cpp | 9 + 6 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 Data/Favicons/turboimagehost.com.ico create mode 100644 Data/Scripts/turboimagehost.nut diff --git a/Data/Favicons/turboimagehost.com.ico b/Data/Favicons/turboimagehost.com.ico new file mode 100644 index 0000000000000000000000000000000000000000..54c813111a2e77bef7b1f089ba40c4c572fcd415 GIT binary patch literal 3836 zcmbVP2QXZ1+djLii|8amtiGZL5rVAVUaT5zk%CPSqC{u4D2b4eCF)AELe!AxD+o(O z304;^+A4{%qJEp?op1j4pMU0`@4IK7>zeCs=bSk+_uLNvfB-6hg@xre!$1I_3jlzu zEI`pv;4&Qm+@|=T&_BA33IN{F1C;zfI+2p=a}oex6sEW+6~FwHB#NPb;~)4H`(?+! z&hc;jt^a!fv4DOz{Wr6+{!{-Q|K}3~|F^LTunGtY2nwYLeE*_dgLuB)rN#1Rm*(fyfF=e0M9<#YXDaQl@{k8;RrL-pk8 zmF~>Ju3JSS?j=t@Jx%?T`6Pd(An&nPlX2s5q7E`#w-4C-2Ne{xO_5OxuLkqx`H4|_z-)Vc5|gv1nsgpZ1ZD2 zoe;7v!XIXN{H~dX@G47mrNlnso!dcc`RL|m&vuF0&gYygkNP|3Bf`a}56P*_>NxT} zDWAZI=Sd7(3wgxc`L6wdBuK{Pru6O$Mmu9NBiEB_R=^69}1KV5y+8wj(>L{QyY zCaEc+Vje?{-wzKap4AK{H}2n(xjJ4xaaW`@nt5omTd4(9Txn9#qfVF%N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5_5^uyB@#9-N3~W zcHM_D+%g9mYUCZMfl_99S9sQijb+YkWypQ5<|h)efwEicUStA!bD^ceWr^;<4SviW z)%X1Buxw?XEGSnsVatWQChN(g8bUMsv6+zCC{q*;k*_X`IejjLbwX(i8(ja05Ow6#{b%c58; zi(K=Z>KCJ{Jm@8?hgD9~!J?kikJqppVD*?YR0gSTM6!#8HrdLvr*PCT$|X52(9WG}Yk*+#xgW-E%jEf9Q4=yp}qb6xH28zgWA>m%AHbggz;-& zd!b&qbr|AQ^gOlGl0;R-$jt9*Im^$EFzqWyX3xYvGz>Ddx`MMC4AM<7M}Vy^Sog58 zgU@-Siq#3R-(B0PO3dxWJ#tSmjP;(5Dpm4`X9c-jwX%2;pfTci5J)~7#UnT<=yFFR zDJ3z_uCwVHNb$pKjdRqR4Z*V4V(cl7NEDa>zqybzMExY$u8KF_RukS=N=I}M#OWG{ zn`>cM-un^wLIRIqPG?o_#_%Xs#G|7S{1@+jA|{;)QR9t~6O(mDKewBx!anpQ*(^Xb z_K2tQe`@t!6c{WM5K@X|fL_7~EZ=*T>xY8Pk=n7U40%CImj;P?4`9G5wLr z$gDdBOE6|Dwj>aj=hCR>6Ej#41uylPP1lzVUIK@l3i|HI2lq{ zMazZ$pCR_^=Em}Si1BY8U!@4MKSS*LK@T3#o`dL?fsP-2a=vi`-$~mii*9v`sRNP) z-$!=bOZ5OMj5>Tk298jP6R<>T!xM1-b!Rz1>b2bNmOP*(H-Us#gI)lDJeU1 div").each(function(index, elem) { + local id = elem.attr("id"); + id = _StrReplace(id, "gall_", ""); + local album = CFolderItem(); + album.setId(id); + album.setTitle(strip(elem.find(".thumbTitle").text())); + list.AddFolderItem(album); + }); + } else { + WriteLog("error", "[TurboImageHost] Failed to load album list, response code = " + nm.responseCode()); + } + + return 1; //success +} + + +function CreateFolder(parentAlbum, album) { + nm.setUrl(BASE_HOST + "index.tu"); + nm.addQueryParam("addalbum", album.getTitle()); + nm.addQueryParam("newalbum", "Create a new gallery"); + if (nm.responseCode() == 200) { + album.setId(id); + album.setViewUrl(link); + } else { + WriteLog("error", "[TurboImageHost] Failed to create album, response code = " + nm.responseCode()); + } + + return 1; +} + +function _GenerateRandomString(length) { + local chars = "abcdefghijklmnopqrstuvwxyz0123456789"; + local result = ""; + for (local i = 0; i < length; i++) { + local pos = Random() % chars.len(); + result += chars.slice(pos, pos+1); + } + return result; +} + +function _GenerateRandomUUID() { + local pattern = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"; + local result = ""; + for (local i = 0; i< pattern.len(); i++){ + if (pattern[i]=='x' || pattern[i]=='y'){ + local r = Random()%16; + local v = (pattern[i] == 'x') ? r : (r & 0x3 | 0x8); + result+= format("%x", v); + } + else{ + result += pattern.slice(i,i+1); + } + } + return result; +} + +function _StrReplace(str, pattern, replace_with) { + local resultStr = str; + local res; + local start = 0; + + while( (res = resultStr.find(pattern,start)) != null ) { + + resultStr = resultStr.slice(0,res) +replace_with+ resultStr.slice(res + pattern.len()); + start = res + replace_with.len(); + } + return resultStr; +} \ No newline at end of file diff --git a/Data/servers.xml b/Data/servers.xml index 1a712c03..624229bb 100644 --- a/Data/servers.xml +++ b/Data/servers.xml @@ -107,6 +107,27 @@ + + + *.jpg,*.jpeg + *.png + *.gif + *.bmp + *.tiff,*.tif + + + + + + + + + + *.jpg,*.jpeg + *.png + *.gif + + diff --git a/Source/Gui/Dialogs/FileFormatCheckErrorDlg.cpp b/Source/Gui/Dialogs/FileFormatCheckErrorDlg.cpp index 9844c9ba..6732a8f7 100644 --- a/Source/Gui/Dialogs/FileFormatCheckErrorDlg.cpp +++ b/Source/Gui/Dialogs/FileFormatCheckErrorDlg.cpp @@ -132,7 +132,8 @@ LRESULT CFileFormatCheckErrorDlg::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hW } } - EndDialog((model_.getCount() - skippedCount) ? IDOK : IDCANCEL); + // EndDialog((model_.getCount() - skippedCount) ? IDOK : IDCANCEL); + EndDialog(wID); return 0; } diff --git a/Source/Gui/Dialogs/WizardDlg.cpp b/Source/Gui/Dialogs/WizardDlg.cpp index 6d0c10bb..b3f9abf8 100644 --- a/Source/Gui/Dialogs/WizardDlg.cpp +++ b/Source/Gui/Dialogs/WizardDlg.cpp @@ -2525,6 +2525,15 @@ bool CWizardDlg::checkFileFormats(const ServerProfileGroup& imageServer, const S if (fileFormatDlg.DoModal() != IDOK) { return false; } + auto n = mainDlg->FileList.GetCount(); + + for (size_t i = 0; i < n; i++) { + if (!mainDlg->FileList.getFile(i)->isSkipped()) { + return true; + } + } + return false; + } /* if (!message.empty()) { GuiTools::LocalizedMessageBox(m_hWnd, U2W(message), TR("Error"), MB_ICONERROR);