view changes
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
} else if (command === "[reset]") {
|
||||
return [];
|
||||
} else if (command[0] === "-") {
|
||||
return tags.reject(function(x) {return x == command.substr(1, 100)})
|
||||
return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)});
|
||||
} else {
|
||||
tags.push(command)
|
||||
return tags;
|
||||
@@ -44,13 +44,13 @@
|
||||
|
||||
Danbooru.TagScript.run = function(post_id, tag_script) {
|
||||
var commands = this.parse(tag_script);
|
||||
var post = Post.posts.get(post_id);
|
||||
var old_tags = post.tags.join(" ");
|
||||
var post = $("#p_" + post_id);
|
||||
var old_tags = post.data("tags");
|
||||
|
||||
$.each(commands, function(i, x) {
|
||||
post.tags = Danbooru.TagScript.process(post.tags, x);
|
||||
post.data("tags", Danbooru.TagScript.process(post.data("tags"), x));
|
||||
})
|
||||
|
||||
Danbooru.Post.update(post_id, {"post[old_tags]": old_tags, "post[tags]": post.tags.join(" ")});
|
||||
Danbooru.Post.update(post_id, {"post[old_tags]": old_tags, "post[tags]": post.data("tags")});
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
var img = $("#image-preview img");
|
||||
if (img) {
|
||||
var height = img.attr("height");
|
||||
@@ -7,7 +7,7 @@ $(document).ready(function() {
|
||||
var ratio = 400.0 / height;
|
||||
img.attr("height", height * ratio);
|
||||
img.attr("width", width * ratio);
|
||||
$("#scale").val("Scaled " + parseInt(100 * ratio) + "%");
|
||||
$("#scale").html("Scaled " + parseInt(100 * ratio) + "%");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -34,4 +34,14 @@
|
||||
|
||||
return all;
|
||||
}
|
||||
|
||||
Danbooru.reject = function(array, f) {
|
||||
var filtered = [];
|
||||
$.each(array, function(i, x) {
|
||||
if (!f(x)) {
|
||||
filtered.push(x);
|
||||
}
|
||||
});
|
||||
return filtered;
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user