Skip to content

Commit

Permalink
Fix jQuery Migrate warnings #44
Browse files Browse the repository at this point in the history
  • Loading branch information
stkenny committed Sep 28, 2020
1 parent 4658284 commit 2c25b42
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 52 deletions.
24 changes: 12 additions & 12 deletions src/main/resources/module/scripts/menu-bar-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ RdfExporterMenuBar.rdfExportRows = function(format, ext) {

$('<input />')
.attr("name", "engine")
.attr("value", JSON.stringify(ui.browsingEngine.getJSON()))
.val(JSON.stringify(ui.browsingEngine.getJSON()))
.appendTo(form);
$('<input />')
.attr("name", "project")
.attr("value", theProject.id)
.val(theProject.id)
.appendTo(form);
$('<input />')
.attr("name", "format")
.attr("value", format)
.val(format)
.appendTo(form);

document.body.appendChild(form);
Expand Down Expand Up @@ -151,7 +151,7 @@ function ReconciliationStanbolServiceDialog() {
}

if (validateURI(uri)) {
inputUri.attr("disabled", "disabled");
inputUri.prop("disabled", "disabled");
inputUri.after($('<img src="extension/rdf-extension/images/spinner.gif" width="14" height="14" alt="'+$.i18n('rdf-ext-menu/fetching')+'..." class="validation" id="validation-img" />'));
Refine.wrapCSRF(function(token) {
$.post("command/rdf-extension/addStanbolService",
Expand Down Expand Up @@ -233,21 +233,21 @@ function ReconciliationRdfServiceDialog(){
this._elmts.rdfext_rdf_fullUri.text($.i18n('rdf-ext-rdf/full-uri'));

this._elmts.other_label_chk.click(function(){
if($(this).attr("checked")){
if($(this).prop("checked")){
self._elmts.other_properties.show();
} else {
self._elmts.other_properties.hide();
}
});

this._elmts.file_source_upload.add(this._elmts.file_source_url).bind("click", function(){
var upload = self._elmts.file_source_upload.attr("checked");
var upload = self._elmts.file_source_upload.prop("checked");
if(upload){
self._elmts.file_upload_input.attr("disabled",false);
self._elmts.file_url_input.attr("disabled",true);
self._elmts.file_upload_input.prop("disabled", false);
self._elmts.file_url_input.prop("disabled", true);
} else {
self._elmts.file_upload_input.attr("disabled",true);
self._elmts.file_url_input.attr("disabled",false);
self._elmts.file_upload_input.prop("disabled", true);
self._elmts.file_url_input.prop("disabled", false);
}
});

Expand Down Expand Up @@ -288,7 +288,7 @@ ReconciliationRdfServiceDialog.prototype._footer = function(footer){
return;
}

if (self._elmts.file_source_url.attr('checked')){
if (self._elmts.file_source_url.prop('checked')){
var file_url = self._elmts.file_url_input.val();
var file_format = self._elmts.file_format_input.val();
if(file_url.trim()===""){
Expand Down Expand Up @@ -361,7 +361,7 @@ function ReconciliationSparqlServiceDialog(){
this._elmts.rdfext_sparql_fullUri.text($.i18n('rdf-ext-sparql/full-uri'));

this._elmts.other_label_chk.click(function(){
if($(this).attr("checked")){
if($(this).prop("checked")){
self._elmts.other_properties.show();
}else{
self._elmts.other_properties.hide();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/module/scripts/rdf-data-table-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ RdfDataTableView.previewOnVisibleRows = function(isLiteral, column, title, expre
});

uriPreviewWidget._elmts.expressionPreviewTextarea
.attr("value", uriPreviewWidget.expression)
.val(uriPreviewWidget.expression)
.keyup(function(){
uriPreviewWidget._scheduleUpdate();
})
Expand Down
72 changes: 36 additions & 36 deletions src/main/resources/module/scripts/rdf-schema-alignment-ui-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,17 @@ RdfSchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function(){
var tr = tableColumns.insertRow(tableColumns.rows.length);
var radio = $('<input />')
.attr("type", "radio")
.attr("value",column.name)
.val(column.name)
.attr("name", "rdf-column-radio")
.appendTo(tr.insertCell(0))
.bind("click",function(){
$("#rdf-constant-value-input").attr("disabled","disabled");
$("#rdf-constant-value-input").prop("disabled","disabled");
})
;

var td = tr.insertCell(1);
if (column.name == self._node.columnName) {
radio.attr("checked", "true");
radio.prop("checked", "true");
}
$('<span></span>').text(column.name).appendTo(td);
};
Expand All @@ -388,13 +388,13 @@ RdfSchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function(){
var tr = tableColumns.insertRow(tableColumns.rows.length);
$('<input />')
.attr("type", "radio")
.attr("checked", checked)
.attr("value","")
.prop("checked", checked)
.val("")
.attr("name", "rdf-column-radio")
.attr("id","rdf-row-index-column-radio")
.appendTo(tr.insertCell(0))
.bind("click",function(){
$("#rdf-constant-value-input").attr("disabled","disabled");
$("#rdf-constant-value-input").prop("disabled","disabled");
})
;

Expand All @@ -407,13 +407,13 @@ RdfSchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function(){
var tr = tableColumns.insertRow(tableColumns.rows.length);
$('<input />')
.attr("type", "radio")
.attr("checked", checked)
.attr("value","")
.prop("checked", checked)
.val("")
.attr("name", "rdf-column-radio")
.attr("id","rdf-constant-value-radio")
.appendTo(tr.insertCell(0))
.bind("click",function(){
$("#rdf-constant-value-input").removeAttr("disabled");
$("#rdf-constant-value-input").prop("disabled", false);
})
;

Expand Down Expand Up @@ -443,39 +443,39 @@ RdfSchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function(){


var initInputs = function(){
elmts.rdf_content_lang_input.attr("disabled","disabled");
elmts.rdf_content_type_input.attr("disabled","disabled");
elmts.rdf_content_lang_input.prop("disabled","disabled");
elmts.rdf_content_type_input.prop("disabled","disabled");
//setContentOptions();
if(self._node.nodeType==='resource' || self._node.nodeType==='cell-as-resource'){
elmts.rdf_content_uri_radio.attr("checked",true);
elmts.rdf_content_uri_radio.prop("checked", true);
}else if(self._node.nodeType==='cell-as-literal' || self._node.nodeType==='literal'){
if(self._node.lang){
elmts.rdf_content_lang_radio.attr("checked",true);
elmts.rdf_content_lang_input.removeAttr("disabled").val(self._node.lang);
elmts.rdf_content_lang_radio.prop("checked", true);
elmts.rdf_content_lang_input.prop("disabled", false).val(self._node.lang);
}else{
if(self._node.valueType){
if(self._node.valueType==='http://www.w3.org/2001/XMLSchema#int'){
elmts.rdf_content_int_radio.attr("checked",true);
elmts.rdf_content_int_radio.prop("checked",true);
}else if(self._node.valueType==='http://www.w3.org/2001/XMLSchema#double'){
elmts.rdf_content_non_int_radio.attr("checked",true);
elmts.rdf_content_non_int_radio.prop("checked",true);
}else if(self._node.valueType==='http://www.w3.org/2001/XMLSchema#date'){
elmts.rdf_content_date_radio.attr("checked",true);
elmts.rdf_content_date_radio.prop("checked",true);
}else if(self._node.valueType==='http://www.w3.org/2001/XMLSchema#dateTime'){
elmts.rdf_content_date_time_radio.attr("checked",true);
elmts.rdf_content_date_time_radio.prop("checked",true);
}else if(self._node.valueType==='http://www.w3.org/2001/XMLSchema#boolean'){
elmts.rdf_content_boolean_radio.attr("checked",true);
elmts.rdf_content_boolean_radio.prop("checked",true);
}
else{
elmts.rdf_content_type_radio.attr("checked",true);
elmts.rdf_content_type_input.removeAttr("disabled").val(self._node.valueType);
elmts.rdf_content_type_radio.prop("checked",true);
elmts.rdf_content_type_input.prop("disabled", false).val(self._node.valueType);
}
}else{
elmts.rdf_content_txt_radio.attr("checked",true);
elmts.rdf_content_txt_radio.prop("checked",true);
}
}
}else{
//blank node
elmts.rdf_content_blank_radio.attr("checked",true);
elmts.rdf_content_blank_radio.prop("checked",true);
}

//set cell expression
Expand All @@ -488,28 +488,28 @@ RdfSchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function(){

//click events
elmts.rdf_content_uri_radio.bind("click",function(){
$('input.rdf-text-attributes-input').add("#rdf-content-type-input").attr("disabled","disabled");
$('input.rdf-text-attributes-input').add("#rdf-content-type-input").prop("disabled","disabled");
});

elmts.rdf_content_txt_radio.add(elmts.rdf_content_int_radio[0]).add(elmts.rdf_content_non_int_radio[0])
.add(elmts.rdf_content_date_radio[0]).add(elmts.rdf_content_date_time_radio[0]).add(elmts.rdf_content_blank_radio[0])
.bind("click",function(){
$('#rdf-content-lang-input').add("#rdf-content-type-input").attr("disabled","disabled");
$('#rdf-content-lang-input').add("#rdf-content-type-input").prop("disabled","disabled");
});

elmts.rdf_content_lang_radio.bind("click",function(){
$('#rdf-content-lang-input').removeAttr("disabled");
$('#rdf-content-lang-input').prop("disabled", false);
});

elmts.rdf_content_type_radio.bind("click",function(){
$('#rdf-content-type-input').removeAttr("disabled");
$('#rdf-content-type-input').prop("disabled", false);
});

//edit/preview
elmts.rdf_cell_expr_preview.bind("click",function(e){
e.preventDefault();
var nodeSubtype = $("input[name='rdf-content-radio']:checked")[0].value;
if($("#rdf-constant-value-radio").attr('checked')){
if($("#rdf-constant-value-radio").prop('checked')){
//constant node
var val = $('#rdf-constant-value-input').val();
if(nodeSubtype === 'blank'){
Expand Down Expand Up @@ -546,28 +546,28 @@ RdfSchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function(){
*--------------------------------------------------
*/
var getResultJSON = function() {
var nodeType = $("#rdf-constant-value-radio").attr('checked')?'':'cell-as-';
var nodeType = $("#rdf-constant-value-radio").prop('checked')?'':'cell-as-';
var nodeSubtype = $("input[name='rdf-content-radio']:checked")[0].value;
var node = {
nodeType: nodeType + nodeSubtype
};
if (nodeSubtype === "literal") {
//get language
if($('#rdf-content-lang-radio').attr('checked')){
if($('#rdf-content-lang-radio').prop('checked')){
node.lang = $('#rdf-content-lang-input').val();
}else{
//get value type
if($('#rdf-content-int-radio').attr('checked')){
if($('#rdf-content-int-radio').prop('checked')){
node.valueType = 'http://www.w3.org/2001/XMLSchema#int';
}else if($('#rdf-content-non-int-radio').attr('checked')){
}else if($('#rdf-content-non-int-radio').prop('checked')){
node.valueType = 'http://www.w3.org/2001/XMLSchema#double';
}else if($('#rdf-content-date-radio').attr('checked')){
}else if($('#rdf-content-date-radio').prop('checked')){
node.valueType = 'http://www.w3.org/2001/XMLSchema#date';
}else if($('#rdf-content-date-time-radio').attr('checked')){
}else if($('#rdf-content-date-time-radio').prop('checked')){
node.valueType = 'http://www.w3.org/2001/XMLSchema#dateTime';
}else if($('#rdf-content-boolean-radio').attr('checked')){
}else if($('#rdf-content-boolean-radio').prop('checked')){
node.valueType = 'http://www.w3.org/2001/XMLSchema#boolean';
}else if($('#rdf-content-type-radio').attr('checked')){
}else if($('#rdf-content-type-radio').prop('checked')){
//check custom datatype URI
var val = $('#rdf-content-type-input').val();
if(!val){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ NewPrefixWidget.prototype.show = function(msg,def_prefix, onDone){
return;
}

var force_import = (self._elmts.forceImport.attr('checked') !== undefined);
var force_import = (self._elmts.forceImport.prop('checked') !== undefined);
var dismissBusy;

if(fetchOption === 'file'){
Expand Down Expand Up @@ -119,7 +119,7 @@ NewPrefixWidget.prototype.show = function(msg,def_prefix, onDone){
self._elmts.advancedButton.click(function() {
self._elmts.fetching_options_table.show();
$('#advanced_options_button').hide();
$('#advanced_options_button').attr("disabled", "true");
$('#advanced_options_button').prop("disabled", "true");
});

self._elmts.fetching_options_table
Expand All @@ -128,7 +128,7 @@ NewPrefixWidget.prototype.show = function(msg,def_prefix, onDone){
.click(
function(){
var upload = $(this).val()!=='file';
self._elmts.fetching_options_table.find('.upload_file_inputs').attr('disabled',upload);
self._elmts.fetching_options_table.find('.upload_file_inputs').prop('disabled',upload);
}
);

Expand Down

0 comments on commit 2c25b42

Please sign in to comment.