Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LIMS-1552] Remove old jQuery version #861

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions client/src/js/vendor/jquery/jquery-1.9.1.min.js

This file was deleted.

46 changes: 2 additions & 44 deletions client/src/js/views/log.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['marionette', 'views/dialog', 'utils'], function(Marionette, DialogView, utils) {
define(['marionette', 'views/dialog'], function(Marionette, DialogView) {

return DialogView.extend({
className: 'fixedwidth',
Expand Down Expand Up @@ -50,48 +50,6 @@ define(['marionette', 'views/dialog', 'utils'], function(Marionette, DialogView,
var m = h.match(/^Content-Type\:\s*(.*?)$/mi)
var mimeType = m[1] || 'image/png'

var blob = new Blob([this.response], { type: mimeType })

// inject sign handler
// Note this uses an old jquery copied from src into assets dir
var sh = '<script src="/assets/js/jquery-1.9.1.min.js"></script>\n\
<script type="text/javascript">\n\
$(document).ready(function() {\n\
var app = { apiurl: "'+app.apiurl+'", prop: "'+app.prop+'"}\n\
app.token = sessionStorage.getItem(\'token\')\n\
var root = "'+self.url.replace(/\?token=.*/, '')+'"\n\
var ajax = function(options) {\n\
options.data.prop = app.prop\n\
if (app.token) {\n\
options.beforeSend = function(request){\n\
request.setRequestHeader(\'Authorization\', \'Bearer \' + app.token);\n\
}\n\
}\n\
return $.ajax.call(this, options)\n\
}\n\
var Backbone = { ajax: ajax }\n\
var sign = '+utils.sign.toString()+'\n\
$("a").click(function(e) {\n\
var is_relative_to_page = function(href) {\n\
return href.match(/^\\/|(http:|https:|ftp:|mailto:|javascript:)/) === null;\n\
}\n\
var is_routable = function(href) {\n\
return href.indexOf("#") === -1 && is_relative_to_page(href);\n\
}\n\
var href = $(this).attr("href")\n\
if (!is_routable(href)) return true\n\
e.preventDefault()\n\
var url = root+\'/\'+href\n\
\sign({\n\
url: url,\n\
callback: function(resp) {\n\
window.location = url+\'?token=\'+resp.token\n\
}\n\
})\n\
})\n\
});\n\
</script>'

if (mimeType == 'application/pdf' || mimeType == 'image/png') {
var url = URL.createObjectURL(new Blob([this.response], { type: mimeType }))
self.iframe[0].src = url
Expand All @@ -104,7 +62,7 @@ define(['marionette', 'views/dialog', 'utils'], function(Marionette, DialogView,
if (mimeType.indexOf('text/plain') > -1) text = '<pre>'+escapeHTMLTags(text)+'</pre>'

doc.open()
doc.write(sh+text)
doc.write(text)
doc.close()
}

Expand Down
5 changes: 0 additions & 5 deletions client/touchscreen/js/vendor/jquery/jquery-1.9.1.min.js

This file was deleted.

5 changes: 0 additions & 5 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ module.exports = (env, argv) => ({
from: 'js/config.json',
to: path.resolve(__dirname, 'assets/js/')
},
{
context: path.resolve(__dirname, 'src'),
from: 'js/vendor/jquery/jquery-1.9.1.min.js',
to: path.resolve(__dirname, 'assets/js/')
},
{
context: path.resolve(__dirname, 'src'),
from: 'files/**',
Expand Down
Loading