padding: 1em 1em 0 1em;
}
-#side-annotations p.akap {
+#side-annotations .akap {
font-size: 16px;
font-family: "Georgia", "Times New Roman", serif;
line-height: 1.5em;
margin-bottom: 1em;
+ position: relative;
+}
+
+#side-annotations .src {
+ font-family: monospace;
+ font-size: 10px;
+ font-weight: 400;
+ line-height: 13px;
+ position: absolute;
+ top: 0;
+ bottom: -.5em;
+ display:none;
+ background: white;
+ border: 1px solid #888;
+ width: 100%;
+}
+
+#side-annotations .akap:hover .src {
+ display: block;
}
/* =========== */
for (var i=0; i<annos.length; i++)
{
- text = serializer.serializeToString(annos[i]).replace(/<(\/?)pe[^>]*>/g, "<$1akap>");
+ xml_text = serializer.serializeToString(annos[i]).replace(/^<pe[^>]*>|<\/pe>$/g, "");
xml2html({
- xml: text,
- success: function(elem){
- elem.txt = $(elem).text().trim();
- anno_list.push(elem);
- counter--;
-
- if (!counter) {
- anno_list.sort(function(a, b){return (a.txt < b.txt) ? -1 : (a.txt > b.txt ? 1 : 0)});
- self.$annos.append(anno_list);
- self.$annos.show();
+ xml: "<akap>" + xml_text + "</akap>",
+ success: function(xml_text){
+ return function(elem){
+ elem.sortby = $(elem).text().trim();
+ $(elem).append("<div class='src'>"+ xml_text.replace("&", "&", "g").replace("<", "<", "g") +"</div>")
+ anno_list.push(elem);
+ counter--;
+
+ if (!counter) {
+ anno_list.sort(function(a, b){return a.sortby.localeCompare(b.sortby);});
+ self.$annos.append(anno_list);
+ self.$annos.show();
+ }
}
- },
+ }(xml_text),
error: function(text) {
$.unblockUI();
self.$error.html(text);