Lines 91-146
Link Here
|
91 |
f.authtypecode.value = authtypecode; |
91 |
f.authtypecode.value = authtypecode; |
92 |
f.submit(); |
92 |
f.submit(); |
93 |
}); |
93 |
}); |
94 |
$('#preview').click(function (){ |
94 |
$("#preview").click(function () { |
95 |
var content="<h3>Authority #: [% authid %]</h3><hr>"; |
95 |
var content = "<h3>Authority #: [% authid | html %]</h3><hr>"; |
96 |
content+="<div style='color:#004d99;'>"; |
96 |
content += "<div style=\"color:#004d99;\">"; |
97 |
var line=1; |
97 |
var line = 1; |
98 |
var has_input=0; |
98 |
var has_input = 0; |
99 |
var sf_has_input=0; |
99 |
var sf_has_input = 0; |
100 |
$("#authoritytabs").find("[id^=tag_]").each(function(){ |
100 |
$("#authoritytabs").find("[id^=tag_]").each(function () { |
101 |
//check if tag has content |
101 |
//check if tag has content |
102 |
has_input=0; |
102 |
has_input = 0; |
103 |
$(this).find(".input_marceditor").each(function(){ |
103 |
$(this).find(".input_marceditor").each(function () { |
104 |
if($(this).val()) has_input=1; |
104 |
if ($(this).val()) has_input = 1; |
105 |
}); |
105 |
}); |
106 |
|
106 |
|
107 |
if(has_input){ |
107 |
if (has_input) { |
108 |
line=1; |
108 |
line = 1; |
109 |
//tag |
109 |
//tag |
110 |
var $tag = $(this).find(".tagnum").text(); |
110 |
var $tag = $(this).find(".tagnum").text(); |
111 |
content += $tag.replace("*",") +" "; |
111 |
content += $tag.replace("*", "") + " "; |
112 |
//indicators |
112 |
//indicators |
113 |
$(this).find(".indicator").each(function(){ |
113 |
$(this).find(".indicator").each(function () { |
114 |
if( $(this).val() ) content += $(this).val(); |
114 |
if ($(this).val()) content += $(this).val(); |
115 |
else content += "_"; |
115 |
else content += "_"; |
116 |
}); |
116 |
}); |
117 |
content += " "; |
117 |
content += " "; |
118 |
//subfields |
118 |
//subfields |
119 |
$(this).find(".subfield_line").each(function(){ |
119 |
$(this).find(".subfield_line").each(function () { |
120 |
//check if subfield has content |
120 |
//check if subfield has content |
121 |
sf_has_input=0; |
121 |
sf_has_input = 0; |
122 |
$(this).find(".input_marceditor").each(function(){ |
122 |
$(this).find(".input_marceditor").each(function () { |
123 |
if($(this).val()) sf_has_input=1; |
123 |
if ($(this).val()) sf_has_input = 1; |
124 |
}); |
|
|
125 |
if(sf_has_input){ |
126 |
if(line>1) content += " "; |
127 |
//code |
128 |
$(this).find(".subfieldcode").each(function(){ |
129 |
$(this).find(".flat").each(function(){ |
130 |
if($(this).val()!="00") |
131 |
content += "\$"+$(this).val()+" "; |
132 |
}); |
133 |
}); |
134 |
//value |
135 |
$(this).find(".input_marceditor").each(function(){ |
136 |
content += "<span style='color:#000;'>"+$(this).val()+"</span>"; |
137 |
}); |
124 |
}); |
138 |
content+="</br>"; |
125 |
if (sf_has_input) { |
139 |
line+=1; |
126 |
if (line > 1) content += " "; |
140 |
} |
127 |
//code |
|
|
128 |
$(this).find(".subfieldcode").each(function () { |
129 |
$(this).find(".flat").each(function () { |
130 |
if ($(this).val() != "00") |
131 |
content += "\$" + $(this).val() + " "; |
132 |
}); |
133 |
}); |
134 |
//value |
135 |
$(this).find(".input_marceditor").each(function () { |
136 |
content += "<span style=\"color:#000;\">" + $(this).val() + "</span>"; |
137 |
}); |
138 |
content += "</br>"; |
139 |
line += 1; |
140 |
} |
141 |
}); |
141 |
} |
142 |
} |
142 |
}); |
143 |
}); |
143 |
}); |
144 |
$("#auloadpreview").html( content ); |
|
|
145 |
$("#auEditPreview").modal(); |
146 |
}); |
144 |
}); |
147 |
}); |
145 |
|
148 |
|
146 |
function selectTab( tablink ){ |
149 |
function selectTab( tablink ){ |
Lines 305-311
Link Here
|
305 |
} |
308 |
} |
306 |
</script> |
309 |
</script> |
307 |
[% Asset.css("css/addbiblio.css") | $raw %] |
310 |
[% Asset.css("css/addbiblio.css") | $raw %] |
308 |
|
311 |
<style> |
|
|
312 |
#auloadpreview { font-family: monospace; } |
313 |
</style> |
309 |
</head> |
314 |
</head> |
310 |
<body id="auth_authorities" class="auth"> |
315 |
<body id="auth_authorities" class="auth"> |
311 |
|
316 |
|
312 |
- |
|
|