Automatically search for the next match after single replace, fixes #3384
[redakcja.git] / redakcja / static / js / wiki_img / wikiapi.js
index 219f53f..cac7e48 100644 (file)
                this.revision = $("*[data-key='revision']", meta).text();
                this.readonly = !!$("*[data-key='readonly']", meta).text();
 
                this.revision = $("*[data-key='revision']", meta).text();
                this.readonly = !!$("*[data-key='readonly']", meta).text();
 
+        var diff = $("*[data-key='diff']", meta).text();
+        if (diff) {
+            diff = diff.split(',');
+            if (diff.length == 2 && diff[0] < diff[1])
+                this.diff = diff;
+            else if (diff.length == 1) {
+                diff = parseInt(diff);
+                if (diff != NaN)
+                    this.diff = [diff - 1, diff];
+            }
+        }
+
                this.text = null;
                this.has_local_changes = false;
                this._lock = -1;
                this.text = null;
                this.has_local_changes = false;
                this._lock = -1;
             $sem.append($div);
             $root.append($sem);
         });
             $sem.append($div);
             $root.append($sem);
         });
-        self.setText(XML(serializer.serializeToString(doc)).toXMLString());
+        self.setText(serializer.serializeToString(doc));
     }
 
 
     }