Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohamedin committed Jan 2, 2024
2 parents 9e8defd + 600b23e commit d99277f
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 46 deletions.
2 changes: 1 addition & 1 deletion js/editor.js

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions l10n/ca.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,63 @@
OC.L10N.register(
"drawio",
{
"Versions plugin is not enabled" : "El connector de versions no està habilitat",
"You can not open a folder" : "No podeu obrir una carpeta",
"Invalid fileId/revId supplied." : "S'ha proporcionat un identificador de fitxer/revId no vàlid.",
"An internal server error occurred." : "S'ha produït un error intern del servidor.",
"Invalid fileId supplied." : "S'ha proporcionat un identificador de fitxer no vàlid.",
"This file is too big to be opened. Please download the file instead." : "Aquest fitxer és massa gran per a obrir-lo. Baixeu el fitxer.",
"Cannot read the file." : "No es pot llegir el fitxer.",
"Invalid fileId/shareToken supplied." : "S'ha proporcionat un identificador de fitxer/shareToken no vàlid.",
"File not found." : "No s'ha trobat el fitxer.",
"The file is locked." : "El fitxer està blocat.",
"You can not write to a folder" : "No podeu escriure a una carpeta",
"The file you are working on was updated in the meantime." : "El fitxer en el qual esteu treballant s'ha actualitzat mentrestant.",
"Could not write to file." : "No s’ha pogut escriure al fitxer.",
"Insufficient permissions" : "Permisos insuficients",
"File content not supplied" : "Contingut del fitxer no subministrat",
"File etag not supplied" : "Fitxer etag no subministrat",
"You cannot write to this path" : "No pots escriure en aquest camí",
"Incorrect parameters" : "Paràmetres incorrectes",
"The required folder was not found" : "No s'ha trobat la carpeta necessària",
"You don't have enough permission to create file" : "No teniu prou permís per crear un fitxer",
"Can't create file" : "No es pot crear el fitxer",
"Draw.io app not configured! Please contact admin." : "L'aplicació Draw.io no està configurada! Poseu-vos en contacte amb l'administrador.",
"Draw.io" : "Draw.io",
"Draw.io integration app" : "Aplicació d'integració Draw.io",
"Integrates draw.io diagrams editor with Nextcloud" : "Integra l'editor de diagrames draw.io amb Nextcloud",
"FileId is empty" : "FileId està buit",
"Loading, please wait." : "S'està carregant. Espereu.",
"Error loading the file" : "S'ha produït un error en carregar el fitxer",
"New draw.io Diagram" : "Nou diagrama draw.io",
"New draw.io Whiteboard" : "Nova pissarra de draw.io",
"Open in Draw.io" : "Obre a Draw.io",
"Error: Creating a new file failed." : "Error: no s'ha pogut crear un fitxer nou.",
"Edit in Draw.io" : "Edició a Draw.io",
"draw.io Configuration error:" : "Error de configuració de draw.io:",
"Saving..." : "S'està desant...",
"Settings have been successfully saved" : "Els paràmetres s'han desat correctament",
"Error when trying to connect" : "Error en intentar connectar-se",
"Auto" : "Automàtic",
"Draw.io URL" : "URL de Draw.io",
"Note: To enable realtime collaboration, leave blank or enter (https://embed.diagrams.net)" : "Nota: per habilitar la col·laboració en temps real, deixeu-lo en blanc o introduïu (https://embed.diagrams.net)",
"Theme:" : "Tema:",
"Classic" : "Clàssic",
"Modern" : "Modern",
"Minimal" : "Mínim",
"Atlas" : "Atles",
"Dark" : "Fosc",
"Yes" : "Sí",
"No" : "No",
"Language" : "Llengua",
"Activate offline mode in Draw.io?" : "Vols activar el mode fora de línia a Draw.io?",
"When the \"offline mode\" is active, this disables all remote operations and features to protect the users privacy. Draw.io will then also only be in English, even if you set a different language manually." : "Quan el \"mode fora de línia\" està actiu, desactiva totes les operacions i funcions remotes per protegir la privadesa dels usuaris. Draw.io també estarà només en anglès, fins i tot si configureu una llengua diferent manualment.",
"Activate autosave?" : "Vols activar el desat automàtic?",
"Note: To enable realtime collaboration, autosave must be active." : "Nota: Per habilitar la col·laboració en temps real, l'autodesat ha d'estar actiu.",
"Enable libraries?" : "Vols habilitar les biblioteques?",
"Enable diagram previews?" : "Vols habilitar les visualitzacions prèvies del diagrama?",
"Note: Disable previews to save storage space used to store diagram preview images" : "Nota: inhabilitar les previsualitzacions per estalviar espai d'emmagatzematge utilitzat per emmagatzemar imatges de visualització prèvia del diagrama",
"draw.io Configuration" : "Configuració draw.io",
"Save" : "Desa"
},
"nplurals=2; plural=(n != 1);");
42 changes: 42 additions & 0 deletions l10n/ca.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,61 @@
{ "translations": {
"Versions plugin is not enabled" : "El connector de versions no està habilitat",
"You can not open a folder" : "No podeu obrir una carpeta",
"Invalid fileId/revId supplied." : "S'ha proporcionat un identificador de fitxer/revId no vàlid.",
"An internal server error occurred." : "S'ha produït un error intern del servidor.",
"Invalid fileId supplied." : "S'ha proporcionat un identificador de fitxer no vàlid.",
"This file is too big to be opened. Please download the file instead." : "Aquest fitxer és massa gran per a obrir-lo. Baixeu el fitxer.",
"Cannot read the file." : "No es pot llegir el fitxer.",
"Invalid fileId/shareToken supplied." : "S'ha proporcionat un identificador de fitxer/shareToken no vàlid.",
"File not found." : "No s'ha trobat el fitxer.",
"The file is locked." : "El fitxer està blocat.",
"You can not write to a folder" : "No podeu escriure a una carpeta",
"The file you are working on was updated in the meantime." : "El fitxer en el qual esteu treballant s'ha actualitzat mentrestant.",
"Could not write to file." : "No s’ha pogut escriure al fitxer.",
"Insufficient permissions" : "Permisos insuficients",
"File content not supplied" : "Contingut del fitxer no subministrat",
"File etag not supplied" : "Fitxer etag no subministrat",
"You cannot write to this path" : "No pots escriure en aquest camí",
"Incorrect parameters" : "Paràmetres incorrectes",
"The required folder was not found" : "No s'ha trobat la carpeta necessària",
"You don't have enough permission to create file" : "No teniu prou permís per crear un fitxer",
"Can't create file" : "No es pot crear el fitxer",
"Draw.io app not configured! Please contact admin." : "L'aplicació Draw.io no està configurada! Poseu-vos en contacte amb l'administrador.",
"Draw.io" : "Draw.io",
"Draw.io integration app" : "Aplicació d'integració Draw.io",
"Integrates draw.io diagrams editor with Nextcloud" : "Integra l'editor de diagrames draw.io amb Nextcloud",
"FileId is empty" : "FileId està buit",
"Loading, please wait." : "S'està carregant. Espereu.",
"Error loading the file" : "S'ha produït un error en carregar el fitxer",
"New draw.io Diagram" : "Nou diagrama draw.io",
"New draw.io Whiteboard" : "Nova pissarra de draw.io",
"Open in Draw.io" : "Obre a Draw.io",
"Error: Creating a new file failed." : "Error: no s'ha pogut crear un fitxer nou.",
"Edit in Draw.io" : "Edició a Draw.io",
"draw.io Configuration error:" : "Error de configuració de draw.io:",
"Saving..." : "S'està desant...",
"Settings have been successfully saved" : "Els paràmetres s'han desat correctament",
"Error when trying to connect" : "Error en intentar connectar-se",
"Auto" : "Automàtic",
"Draw.io URL" : "URL de Draw.io",
"Note: To enable realtime collaboration, leave blank or enter (https://embed.diagrams.net)" : "Nota: per habilitar la col·laboració en temps real, deixeu-lo en blanc o introduïu (https://embed.diagrams.net)",
"Theme:" : "Tema:",
"Classic" : "Clàssic",
"Modern" : "Modern",
"Minimal" : "Mínim",
"Atlas" : "Atles",
"Dark" : "Fosc",
"Yes" : "",
"No" : "No",
"Language" : "Llengua",
"Activate offline mode in Draw.io?" : "Vols activar el mode fora de línia a Draw.io?",
"When the \"offline mode\" is active, this disables all remote operations and features to protect the users privacy. Draw.io will then also only be in English, even if you set a different language manually." : "Quan el \"mode fora de línia\" està actiu, desactiva totes les operacions i funcions remotes per protegir la privadesa dels usuaris. Draw.io també estarà només en anglès, fins i tot si configureu una llengua diferent manualment.",
"Activate autosave?" : "Vols activar el desat automàtic?",
"Note: To enable realtime collaboration, autosave must be active." : "Nota: Per habilitar la col·laboració en temps real, l'autodesat ha d'estar actiu.",
"Enable libraries?" : "Vols habilitar les biblioteques?",
"Enable diagram previews?" : "Vols habilitar les visualitzacions prèvies del diagrama?",
"Note: Disable previews to save storage space used to store diagram preview images" : "Nota: inhabilitar les previsualitzacions per estalviar espai d'emmagatzematge utilitzat per emmagatzemar imatges de visualització prèvia del diagrama",
"draw.io Configuration" : "Configuració draw.io",
"Save" : "Desa"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
2 changes: 1 addition & 1 deletion l10n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ OC.L10N.register(
"When the \"offline mode\" is active, this disables all remote operations and features to protect the users privacy. Draw.io will then also only be in English, even if you set a different language manually." : "Wenn der \"Offline-Modus\" aktiv ist, werden alle Remote-Operationen und -Funktionen deaktiviert, um die Privatsphäre der Benutzer zu schützen. Draw.io ist dann auch nur auf Englisch, auch wenn du manuell eine andere Sprache einstellst.",
"Activate autosave?" : "Automatisches Speichern aktivieren?",
"Note: To enable realtime collaboration, autosave must be active." : "Hinweis: Um die Zusammenarbeit in Echtzeit zu ermöglichen, muss die automatische Speicherung aktiviert sein.",
"Enable libraries?" : "Bibliotheken aktivieren?",
"Enable libraries?" : "Diagrammvorschau aktivieren?",
"Enable diagram previews?" : "Diagrammvorschau aktivieren?",
"Note: Disable previews to save storage space used to store diagram preview images" : "Hinweis: Deaktiviere Vorschauen, um Speicherplatz zu sparen, der zum Speichern von Diagrammvorschaubildern verwendet wird",
"draw.io Configuration" : "draw.io Konfiguration:",
Expand Down
2 changes: 1 addition & 1 deletion l10n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"When the \"offline mode\" is active, this disables all remote operations and features to protect the users privacy. Draw.io will then also only be in English, even if you set a different language manually." : "Wenn der \"Offline-Modus\" aktiv ist, werden alle Remote-Operationen und -Funktionen deaktiviert, um die Privatsphäre der Benutzer zu schützen. Draw.io ist dann auch nur auf Englisch, auch wenn du manuell eine andere Sprache einstellst.",
"Activate autosave?" : "Automatisches Speichern aktivieren?",
"Note: To enable realtime collaboration, autosave must be active." : "Hinweis: Um die Zusammenarbeit in Echtzeit zu ermöglichen, muss die automatische Speicherung aktiviert sein.",
"Enable libraries?" : "Bibliotheken aktivieren?",
"Enable libraries?" : "Diagrammvorschau aktivieren?",
"Enable diagram previews?" : "Diagrammvorschau aktivieren?",
"Note: Disable previews to save storage space used to store diagram preview images" : "Hinweis: Deaktiviere Vorschauen, um Speicherplatz zu sparen, der zum Speichern von Diagrammvorschaubildern verwendet wird",
"draw.io Configuration" : "draw.io Konfiguration:",
Expand Down
1 change: 1 addition & 0 deletions l10n/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ OC.L10N.register(
"An internal server error occurred." : "Terjadi kesalahan server internal.",
"This file is too big to be opened. Please download the file instead." : "Berkas ini terlalu besar untuk dibuka. Sebagai gantinya, silakan unduh berkas ini.",
"Cannot read the file." : "Tidak dapat membaca berkas.",
"File not found." : "Berkas tidak ditemukan.",
"The file is locked." : "Berkas terkunci",
"You can not write to a folder" : "Anda tidak dapat menulis pada folder",
"Could not write to file." : "Tidak dapat menulis pada berkas.",
Expand Down
1 change: 1 addition & 0 deletions l10n/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"An internal server error occurred." : "Terjadi kesalahan server internal.",
"This file is too big to be opened. Please download the file instead." : "Berkas ini terlalu besar untuk dibuka. Sebagai gantinya, silakan unduh berkas ini.",
"Cannot read the file." : "Tidak dapat membaca berkas.",
"File not found." : "Berkas tidak ditemukan.",
"The file is locked." : "Berkas terkunci",
"You can not write to a folder" : "Anda tidak dapat menulis pada folder",
"Could not write to file." : "Tidak dapat menulis pada berkas.",
Expand Down
50 changes: 49 additions & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ import '@nextcloud/dialogs/dist/index.css'

OCA.DrawIO.EditFile = function (editWindow, origin, autosave, isWB, previews, configObj)
{
var autosaveEnabled = autosave === 'yes';
var autosaveEnabled = autosave;
var fileId = $('#iframeEditor').data('id');
var shareToken = $('#iframeEditor').data('sharetoken');
var currentFile = null;
Expand Down Expand Up @@ -496,3 +496,51 @@ import '@nextcloud/dialogs/dist/index.css'
};

})(OCA);

$(function () {
var drawioData = JSON.parse(atob($('#drawioData').text()));

if (drawioData['error'])
{
OCA.DrawIO.DisplayError(drawioData['error']);
}
else
{
var iframe = document.getElementById('iframeEditor');
var originUrl = drawioData['drawioUrl'];
var drawIoUrl = drawioData['drawioUrl'] + drawioData['frame_params'];
var autosave = drawioData['finalAutosave'] == 'yes';
var isWB = drawioData['isWB'] == 'true';
var previews = drawioData['drawioPreviews'] == 'yes';

if (drawioData['drawioDarkMode'] == 'auto')
{
try
{
var darkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
var themeName = OCA.Theming.enabledThemes[0];

if ((!themeName || themeName === 'default') && darkMode)
{
drawIoUrl += '&dark=1';
}
else if (themeName && themeName.indexOf('dark') !== -1)
{
drawIoUrl += '&dark=1';
}
}
catch (e){}
}

var config = {};

try
{
config = JSON.parse(drawioData['drawioConfig']);
}
catch (e){}

OCA.DrawIO.EditFile(iframe.contentWindow, originUrl, autosave, isWB, previews, config);
iframe.setAttribute('src', drawIoUrl);
}
});
48 changes: 6 additions & 42 deletions templates/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,50 +32,14 @@
}

$frame_params .= "&spin=1&proto=json&p=nxtcld&keepmodified=1";

$_["frame_params"] = $frame_params;
$_["finalAutosave"] = $finalAutosave;

$drawioData = base64_encode(json_encode($_));
?>

<div id="app-content">

<iframe id="iframeEditor" data-id="<?php p($_["fileId"]) ?>" data-sharetoken="<?php p($_["shareToken"]) ?>" width="100%" height="100%" align="top" frameborder="0" name="iframeEditor" onmousewheel="" allowfullscreen=""></iframe>

<script type="text/javascript" nonce="<?php p(base64_encode($_["requesttoken"])) ?>" defer>
window.addEventListener('DOMContentLoaded', function() {
<?php if (!empty($_['error'])) { ?>
OCA.DrawIO.DisplayError("<?php p($_['error']) ?>");
<?php } else { ?>
var iframe = document.getElementById("iframeEditor");
var originUrl = "<?php p($_['drawioUrl']); ?>";
var drawIoUrl = "<?php p($_['drawioUrl']); print_unescaped($frame_params); ?>"
var autosave = "<?php p($finalAutosave); ?>";
var isWB = <?php p($_['isWB']); ?>;
var previews = <?php p($_['drawioPreviews'] == 'yes'? 'true' : 'false'); ?>;

<?php if ($_["drawioDarkMode"] == "auto") { ?>
try
{
var darkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
var themeName = OCA.Theming.enabledThemes[0];

if ((!themeName || themeName === 'default') && darkMode)
{
drawIoUrl += '&dark=1';
}
else if (themeName && themeName.indexOf('dark') !== -1)
{
drawIoUrl += '&dark=1';
}
}
catch (e){}
<?php } ?>
var config = {};
try
{
config = JSON.parse('<?php print_unescaped(str_replace("'", "\\'", $_["drawioConfig"])); ?>');
}
catch (e){}
OCA.DrawIO.EditFile(iframe.contentWindow, originUrl, autosave, isWB, previews, config);
iframe.setAttribute('src', drawIoUrl);
<?php } ?>
});
</script>
<div style="display: none" id="drawioData"><?php print_unescaped($drawioData) ?></div>
</div>

0 comments on commit d99277f

Please sign in to comment.