Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SPDX-License-Identifier = "BSD-3-Clause"
[[annotations]]
path = ["vendor/jquery/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "JS Foundation and other contributors, <https://js.foundation/>"
SPDX-FileCopyrightText = "OpenJS Foundation and other contributors, <https://openjsf.org/>"
SPDX-License-Identifier = "MIT"

[[annotations]]
Expand Down
32 changes: 19 additions & 13 deletions src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

/* global $, minder, Base64, jsPDF, angular */
/* global minder, Base64, jsPDF, angular */
/*
* $ here is this app's own vendored jQuery (vendor/jquery), loaded by this
* app's own iframe template — not Nextcloud core's deprecated $/jQuery
* global. Referenced via window.$ so eslint's @nextcloud/no-deprecated-globals
* (which only knows about core's global) doesn't flag it.
*/
/* eslint-disable no-console */
/**
* Checks if the page is displayed in an iframe. If not redirect to /.
Expand Down Expand Up @@ -64,7 +70,7 @@ redirectIfNotDisplayedInFrame();
},
initHotkey() {
const self = this
$(document).keydown(function(e) {
window.$(document).keydown(function(e) {
if ((e.ctrlKey || e.metaKey) && e.which === 83) {
self.save()
e.preventDefault()
Expand All @@ -74,22 +80,22 @@ redirectIfNotDisplayedInFrame();
},
bindEvent() {
const self = this
$('#export-png').click(function() {
window.$('#export-png').click(function() {
self.exportPNG()
})
$('#export-svg').click(function() {
window.$('#export-svg').click(function() {
self.exportSVG()
})
$('#export-pdf').click(function() {
window.$('#export-pdf').click(function() {
self.exportPDF()
})
$('#export-markdown').click(function() {
window.$('#export-markdown').click(function() {
self.exportMarkdown()
})
$('#export-text').click(function() {
window.$('#export-text').click(function() {
self.exportText()
})
$('#save-button').click(function() {
window.$('#save-button').click(function() {
self.save()
})
},
Expand Down Expand Up @@ -126,7 +132,7 @@ redirectIfNotDisplayedInFrame();
this.showMessage(msg)
},
updateSaveButtonInfo(msg) {
$('#save-button').html(msg)
window.$('#save-button').html(msg)
},
restoreSaveButtonInfo(time) {
const self = this
Expand Down Expand Up @@ -172,7 +178,7 @@ redirectIfNotDisplayedInFrame();
}, 10000)
},
getAutoSaveStatus() {
const status = $('#autosave-checkbox').is(':checked')
const status = window.$('#autosave-checkbox').is(':checked')
if (window.localStorage) {
localStorage.setItem('apps.files_mindmap.autosave', status)
}
Expand All @@ -185,7 +191,7 @@ redirectIfNotDisplayedInFrame();
status = false
}
}
$('#autosave-checkbox').prop('checked', status)
window.$('#autosave-checkbox').prop('checked', status)
},
loadData() {
const self = this
Expand Down Expand Up @@ -224,11 +230,11 @@ redirectIfNotDisplayedInFrame();

/* When file is readonly, hide autosave checkbox */
if (!window.parent.OCA.FilesMindMap._file.writeable) {
$('#autosave-div').hide()
window.$('#autosave-div').hide()
}
/* When extension cannot write, hide save checkbox */
if (!window.parent.OCA.FilesMindMap._file.supportedWrite) {
$('#save-div').hide()
window.$('#save-div').hide()
}
}, function(msg) {
self._loadStatus = false
Expand Down
2 changes: 1 addition & 1 deletion templates/viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class="btn btn-default export-caption dropdown-toggle"
<kityminder-editor id="viewer" lang="<?=$lang?>" on-init="initEditor(editor, minder)"></kityminder-editor>
</body>

<script nonce="<?=$nonce?>" src="<?php p($urlGenerator->linkTo('files_mindmap', 'vendor/jquery/dist/jquery.js')) ?>?v=<?php p($version) ?>"></script>
<script nonce="<?=$nonce?>" src="<?php p($urlGenerator->linkTo('files_mindmap', 'vendor/jquery/dist/jquery.min.js')) ?>?v=<?php p($version) ?>"></script>
<script nonce="<?=$nonce?>" src="<?php p($urlGenerator->linkTo('files_mindmap', 'vendor/bootstrap/dist/js/bootstrap.js')) ?>?v=<?php p($version) ?>"></script>
<script nonce="<?=$nonce?>" src="<?php p($urlGenerator->linkTo('files_mindmap', 'vendor/angular/angular.js')) ?>?v=<?php p($version) ?>"></script>
<script nonce="<?=$nonce?>" src="<?php p($urlGenerator->linkTo('files_mindmap', 'vendor/angular-bootstrap/ui-bootstrap-tpls.js')) ?>?v=<?php p($version) ?>"></script>
Expand Down
25 changes: 0 additions & 25 deletions vendor/jquery/.bower.json

This file was deleted.

Loading
Loading