Lines 976-981
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
976 |
}); |
976 |
}); |
977 |
} |
977 |
} |
978 |
|
978 |
|
|
|
979 |
function changeEditor() { |
980 |
if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return; |
981 |
|
982 |
Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} ); |
983 |
|
984 |
if ( state.backend == 'catalog' ) { |
985 |
window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID; |
986 |
} else if ( state.backend == 'new' ) { |
987 |
window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl'; |
988 |
} else { |
989 |
humanMsg.displayAlert( _("Cannot open this record in the basic editor"), { className: 'humanError' } ); |
990 |
} |
991 |
} |
992 |
|
979 |
$(".macro_shared").change(function(){ |
993 |
$(".macro_shared").change(function(){ |
980 |
if(this.checked){ |
994 |
if(this.checked){ |
981 |
saveMacro(true); |
995 |
saveMacro(true); |
Lines 987-992
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
987 |
// END Macro functions |
1001 |
// END Macro functions |
988 |
|
1002 |
|
989 |
$(document).ready( function() { |
1003 |
$(document).ready( function() { |
|
|
1004 |
|
990 |
// Editor setup |
1005 |
// Editor setup |
991 |
editor = new MARCEditor( { |
1006 |
editor = new MARCEditor( { |
992 |
onCursorActivity: function() { |
1007 |
onCursorActivity: function() { |
Lines 1223-1240
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
Link Here
|
1223 |
return false; |
1238 |
return false; |
1224 |
} ); |
1239 |
} ); |
1225 |
|
1240 |
|
1226 |
$( '#switch-editor' ).click( function() { |
1241 |
$( '#toggleEditor' ).change( function() { |
1227 |
if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return; |
1242 |
changeEditor(); |
1228 |
|
1243 |
}); |
1229 |
Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} ); |
|
|
1230 |
|
1244 |
|
1231 |
if ( state.backend == 'catalog' ) { |
1245 |
$( '#switch-editor' ).click( function() { |
1232 |
window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID; |
1246 |
changeEditor(); |
1233 |
} else if ( state.backend == 'new' ) { |
|
|
1234 |
window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl'; |
1235 |
} else { |
1236 |
humanMsg.displayAlert( _("Cannot open this record in the basic editor"), { className: 'humanError' } ); |
1237 |
} |
1238 |
} ); |
1247 |
} ); |
1239 |
|
1248 |
|
1240 |
$( '#show-advanced-search' ).click( function() { |
1249 |
$( '#show-advanced-search' ).click( function() { |