summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2010-05-13 21:51:24 +0000
committerLester Caine <lester@lsces.co.uk>2010-05-13 21:51:24 +0000
commitcc0d794cd663666f5774504d9674893601dbd1aa (patch)
tree7eb165edd459da4f11886a5fa9a7121e351379e3 /scripts
parent6aa4653a5745d096485a68dbe6b73836427a300d (diff)
downloadliberty-cc0d794cd663666f5774504d9674893601dbd1aa.tar.gz
liberty-cc0d794cd663666f5774504d9674893601dbd1aa.tar.bz2
liberty-cc0d794cd663666f5774504d9674893601dbd1aa.zip
Basic javascript for image area tagging function. This needs to be combined with mimetaggedimage plugin
Diffstat (limited to 'scripts')
-rw-r--r--scripts/imagetag.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/imagetag.js b/scripts/imagetag.js
new file mode 100644
index 0000000..20c658e
--- /dev/null
+++ b/scripts/imagetag.js
@@ -0,0 +1,28 @@
+function updateForm(){
+ $("#width").val($("#drag").attr("offsetWidth"));
+ $("#height").val($("#drag").attr("offsetHeight"));
+ $("#top").val($("#drag").attr("offsetTop"));
+ $("#left").val($("#drag").attr("offsetLeft"));
+}
+$(document).ready(function(){
+ updateForm();
+ $("#drag").resizable({
+ stop: function() {
+ updateForm();
+ }
+ });
+ $("#drag").draggable({
+ containment: 'parent',
+ stop: function() {
+ updateForm();
+ }
+ });
+ $(".tag").hover(
+ function () {
+ $(this).addClass("tagOn");
+ },
+ function () {
+ $(this).removeClass("tagOn");
+ }
+ );
+}); \ No newline at end of file