From 295dae217626d3d6907c562edfd131fea68c8f07 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Sep 2010 06:55:12 +0800 Subject: [PATCH 01/17] added user_rest module --- modules/user_rest/helpers/user_rest.php | 53 +++++++++++++++++++++++++ modules/user_rest/module.info | 3 ++ 2 files changed, 56 insertions(+) create mode 100644 modules/user_rest/helpers/user_rest.php create mode 100644 modules/user_rest/module.info diff --git a/modules/user_rest/helpers/user_rest.php b/modules/user_rest/helpers/user_rest.php new file mode 100644 index 00000000..4acd0d25 --- /dev/null +++ b/modules/user_rest/helpers/user_rest.php @@ -0,0 +1,53 @@ +url); + + return array( + "url" => $request->url, + "entity" => array( + "display_name" => $user->display_name() + ) + ); + } + + + static function resolve($id) { + $user = identity::lookup_user($id); + + if (!self::_can_view_profile_pages($user)) { + throw new Kohana_404_Exception(); + } + return $user; + } + + + static function _can_view_profile_pages($user) { + if (!$user->loaded()) { + return false; + } + + if ($user->id == identity::active_user()->id) { + // You can always view your own profile + return true; + } + + switch (module::get_var("gallery", "show_user_profiles_to")) { + case "admin_users": + return identity::active_user()->admin; + + case "registered_users": + return !identity::active_user()->guest; + + case "everybody": + return true; + + default: + // Fail in private mode on an invalid setting + return false; + } + } +} + + ?> \ No newline at end of file diff --git a/modules/user_rest/module.info b/modules/user_rest/module.info new file mode 100644 index 00000000..05b00468 --- /dev/null +++ b/modules/user_rest/module.info @@ -0,0 +1,3 @@ +name = "REST User Resource" +description = "Provides access to user names via the RESTful API" +version = 1.1 From 4b13015a761b044bc9972465e65aaa8709fff0bd Mon Sep 17 00:00:00 2001 From: hukoeth Date: Sun, 12 Sep 2010 02:44:29 +0800 Subject: [PATCH 02/17] Version 4: - Bugfix: Tag annotation weren't saved - admin option: disable user search for guest user - Removed the term "user" from frontend - Autocomplete now works for username and user's full name - Increased initial size of annotation --- .../controllers/admin_photoannotation.php | 6 +-- .../controllers/photoannotation.php | 41 ++++++++++--------- .../helpers/photoannotation.php | 6 +-- .../helpers/photoannotation_block.php | 4 +- modules/photoannotation/js/jquery.annotate.js | 4 +- .../photoannotation/js/jquery.annotate.min.js | 2 +- .../photoannotation_highlight_block.html.php | 4 +- .../photoannotation_user_search.html.php | 4 +- 8 files changed, 36 insertions(+), 35 deletions(-) diff --git a/modules/photoannotation/controllers/admin_photoannotation.php b/modules/photoannotation/controllers/admin_photoannotation.php index bdcd71be..dc7436f6 100755 --- a/modules/photoannotation/controllers/admin_photoannotation.php +++ b/modules/photoannotation/controllers/admin_photoannotation.php @@ -43,7 +43,7 @@ class Admin_Photoannotation_Controller extends Admin_Controller { //Load the target user $targetuser = ORM::factory("user", $form->targetuser->value); if (!$targetuser->loaded()) { - message::error(t("The specified user could not be found")); + message::error(t("The specified person could not be found")); url::redirect("admin/photoannotation/converter"); } //Load all existing tag annotations @@ -280,12 +280,12 @@ class Admin_Photoannotation_Controller extends Admin_Controller { ->checked(module::get_var("photoannotation", "shownotes", false)); $group->checkbox("fullname")->label(t("Show full name of a user instead of the username on annotations (username will be dispayed for users without a full name).")) ->checked(module::get_var("photoannotation", "fullname", false)); - $group = $form->group("notifications")->label(t("Notification and user cloud settings")); + $group = $form->group("notifications")->label(t("Notification and people cloud settings")); $group->checkbox("nonotifications")->label(t("Disable user notifications.")) ->checked(module::get_var("photoannotation", "nonotifications", false)); $group->checkbox("notificationoptout")->label(t("Notify users by default (only applies to new users and user who have not saved their profile after installing this module).")) ->checked(module::get_var("photoannotation", "notificationoptout", false)); - $group->checkbox("allowguestsearch")->label(t("Show user cloud and allow user search for guests.")) + $group->checkbox("allowguestsearch")->label(t("Show people cloud and allow people search for guests.")) ->checked(module::get_var("photoannotation", "allowguestsearch", false)); $group = $form->group("newtagmail")->label(t("Customize the mail sent to users when a user annotation is created")); $group->input("newtagsubject")->label(t("Subject")) diff --git a/modules/photoannotation/controllers/photoannotation.php b/modules/photoannotation/controllers/photoannotation.php index 1431a311..48f71da9 100644 --- a/modules/photoannotation/controllers/photoannotation.php +++ b/modules/photoannotation/controllers/photoannotation.php @@ -20,7 +20,7 @@ class photoannotation_Controller extends Controller { public function showuser() { if (identity::active_user()->guest && !module::get_var("photoannotation", "allowguestsearch", false)) { - message::error(t("You have to log in to perform a user search.")); + message::error(t("You have to log in to perform a people search.")); url::redirect(url::site()); return; } @@ -88,7 +88,7 @@ class photoannotation_Controller extends Controller { if ($user_id != "") { $getuser = photoannotation::getuser($user_id); if (!$getuser->found) { - message::error(t("Could not find user %user.", array("user" => $user_id))); + message::error(t("Could not find anyone with the name %user.", array("user" => $user_id))); url::redirect($redir_uri); return; } @@ -112,18 +112,18 @@ class photoannotation_Controller extends Controller { $tag->save(); $tag_data = $tag->id; } else { - $tag_data = -1; + $tag_data = ""; } //Save annotation if ($annotate_id == "new") { //This is a new annotation - if ($user_id > -1) { //Save user + if ($user_id != "") { //Save user photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - } elseif ($tag_data > -1) { //Conversion user -> face - photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - } elseif ($item_title != "") { //Conversion user -> note + } elseif ($tag_data != "") { //Save face + photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); + } elseif ($item_title != "") { //Save note photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - } else { //Somethings wrong - message::error(t("Please select a User or Tag or specify a Title.")); + } else { //Something's wrong + message::error(t("Please select a person or tag or specify a title.")); url::redirect($redir_uri); return; } @@ -133,16 +133,16 @@ class photoannotation_Controller extends Controller { $updateduser = ORM::factory("items_user") //load the existing user ->where("id", "=", $annotate_id) ->find(); - if ($user_id > -1) { //Conversion user -> user + if ($user_id != "") { //Conversion user -> user photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - } elseif ($tag_data > -1) { //Conversion user -> face + } elseif ($tag_data != "") { //Conversion user -> face photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); $updateduser->delete(); //delete old user } elseif ($item_title != "") { //Conversion user -> note photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); $updateduser->delete(); //delete old user } else { //Somethings wrong - message::error(t("Please select a User or Tag or specify a Title.")); + message::error(t("Please select a person or tag or specify a title.")); url::redirect($redir_uri); return; } @@ -151,16 +151,16 @@ class photoannotation_Controller extends Controller { $updatedface = ORM::factory("items_face") //load the existing user ->where("id", "=", $annotate_id) ->find(); - if ($user_id > -1) { //Conversion face -> user + if ($user_id != "") { //Conversion face -> user photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); $updatedface->delete(); //delete old face - } elseif ($tag_data > -1) { //Conversion face -> face + } elseif ($tag_data != "") { //Conversion face -> face photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id); } elseif ($item_title != "") { //Conversion face -> note photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); $updatedface->delete(); //delete old face } else { //Somethings wrong - message::error(t("Please select a User or Tag or specify a Title.")); + message::error(t("Please select a person or tag or specify a title.")); url::redirect($redir_uri); return; } @@ -169,22 +169,22 @@ class photoannotation_Controller extends Controller { $updatednote = ORM::factory("items_note") //load the existing user ->where("id", "=", $annotate_id) ->find(); - if ($user_id > -1) { //Conversion note -> user + if ($user_id != "") { //Conversion note -> user photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); $updatednote->delete(); //delete old note - } elseif ($tag_data > -1) { //Conversion note -> face + } elseif ($tag_data != "") { //Conversion note -> face photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); $updatednote->delete(); //delete old note } elseif ($item_title != "") { //Conversion note -> note photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id); } else { //Somethings wrong - message::error(t("Please select a User or Tag or specify a Title.")); + message::error(t("Please select a person or tag or specify a title.")); url::redirect($redir_uri); return; } break; default: - message::error(t("Please select a User or Tag or specify a Title.")); + message::error(t("Please select a person or tag or specify a title.")); url::redirect($redir_uri); return; } @@ -235,7 +235,8 @@ class photoannotation_Controller extends Controller { $user_part = ltrim(end($user_parts)); $user_list = ORM::factory("user") ->where("name", "LIKE", "{$user_part}%") - ->order_by("name", "ASC") + ->or_where("full_name", "LIKE", "{$user_part}%") + ->order_by("full_name", "ASC") ->limit($limit) ->find_all(); foreach ($user_list as $user) { diff --git a/modules/photoannotation/helpers/photoannotation.php b/modules/photoannotation/helpers/photoannotation.php index 13ec4078..f43e66fc 100644 --- a/modules/photoannotation/helpers/photoannotation.php +++ b/modules/photoannotation/helpers/photoannotation.php @@ -43,9 +43,9 @@ class photoannotation_Core { static function get_user_search_form($form_id) { $form = new Forge("photoannotation/showuser/{$item->id}", "", "post", array("id" => $form_id, "class" => "g-short-form")); - $label = t("Type user name"); + $label = t("Search for a person"); - $group = $form->group("showuser")->label("Search for a user"); + $group = $form->group("showuser")->label("Search for a person"); $group->input("name")->label($label)->id("name"); $group->submit("")->value(t("Search")); return $form; @@ -282,4 +282,4 @@ class photoannotation_Core { static function annotation_count($user_id) { return ORM::factory("items_user")->where("user_id", "=", $user_id)->count_all(); } -} \ No newline at end of file +} diff --git a/modules/photoannotation/helpers/photoannotation_block.php b/modules/photoannotation/helpers/photoannotation_block.php index 6facc671..d0e89e0a 100644 --- a/modules/photoannotation/helpers/photoannotation_block.php +++ b/modules/photoannotation/helpers/photoannotation_block.php @@ -29,7 +29,7 @@ class photoannotation_block_Core { case "photoannotation": $block = new Block(); $block->css_id = "g-photoannotation"; - $block->title = t("Users"); + $block->title = t("People"); $block->content = new View("photoannotation_block.html"); $block->content->cloud = photoannotation::cloud(30); $block->content->form = photoannotation::get_user_search_form("g-user-cloud-form"); @@ -37,4 +37,4 @@ class photoannotation_block_Core { } return $block; } -} \ No newline at end of file +} diff --git a/modules/photoannotation/js/jquery.annotate.js b/modules/photoannotation/js/jquery.annotate.js index 4125bbc0..fc5492bc 100644 --- a/modules/photoannotation/js/jquery.annotate.js +++ b/modules/photoannotation/js/jquery.annotate.js @@ -209,8 +209,8 @@ newNote.noteid = "new"; newNote.top = 30; newNote.left = 30; - newNote.width = 30; - newNote.height = 30; + newNote.width = 60; + newNote.height = 60; newNote.text = ""; newNote.description = ""; newNote.notetype = ""; diff --git a/modules/photoannotation/js/jquery.annotate.min.js b/modules/photoannotation/js/jquery.annotate.min.js index 9c9cdd6b..97746cf4 100644 --- a/modules/photoannotation/js/jquery.annotate.min.js +++ b/modules/photoannotation/js/jquery.annotate.min.js @@ -1 +1 @@ -(function($){$.fn.annotateImage=function(options){var opts=$.extend({},$.fn.annotateImage.defaults,options);var image=this;this.image=this;this.mode='view';this.getUrl=opts.getUrl;this.saveUrl=opts.saveUrl;this.deleteUrl=opts.deleteUrl;this.deleteUrl=opts.deleteUrl;this.editable=opts.editable;this.useAjax=opts.useAjax;this.tags=opts.tags;this.notes=opts.notes;this.labels=opts.labels;this.csrf=opts.csrf;this.cssaclass=opts.cssaclass;this.rtlsupport=opts.rtlsupport;this.users=opts.users;this.canvas=$('
');this.canvas.children('.image-annotate-edit').hide();this.canvas.children('.image-annotate-view').hide();this.image.after(this.canvas);this.canvas.height(this.height());this.canvas.width(this.width());this.canvas.css('background-image','url("'+this.attr('src')+'")');this.canvas.children('.image-annotate-view, .image-annotate-edit').height(this.height());this.canvas.children('.image-annotate-view, .image-annotate-edit').width(this.width());this.canvas.hover(function(){if($(this).children('.image-annotate-edit').css('display')=='none'){$(this).children('.image-annotate-view').show()}},function(){$(this).children('.image-annotate-view').hide();$(this).children('.image-annotate-note').hide()});this.canvas.children('.image-annotate-view').hover(function(){$(this).show()},function(){$(this).hide();$(this).children('.image-annotate-note').hide()});if(this.useAjax){$.fn.annotateImage.ajaxLoad(this)}else{$.fn.annotateImage.load(this,this.labels,this.editable,this.csrf,this.deleteUrl,this.tags,this.saveUrl,this.cssaclass,this.rtlsupport,this.users)}if($('#g-photoannotation-link').length!==0){this.button=$('#g-photoannotation-link');this.button.click(function(){$.fn.annotateImage.add(image,opts.tags,opts.labels,opts.saveUrl,opts.csrf,opts.rtlsupport,opts.users)})}this.hide();return this};$.fn.annotateImage.defaults={getUrl:'your-get.rails',saveUrl:'your-save.rails',deleteUrl:'your-delete.rails',editable:true,useAjax:true,tags:new Array(),notes:new Array()};$.fn.annotateImage.clear=function(image){for(var i=0;i'+labels[8]+'');ok.click(function(){var form=$('#image-annotate-edit-form form');var text=$('#image-annotate-text').val();$.fn.annotateImage.appendPosition(form,editable);image.mode='view';form.submit();editable.destroy()});editable.form.append(ok)};$.fn.annotateImage.createCancelButton=function(editable,image,rtlsupport,labels){var cancel=$(''+labels[9]+'');cancel.click(function(){editable.destroy();image.mode='view';location.reload()});editable.form.append(cancel)};$.fn.annotateImage.saveAsHtml=function(image,target){var element=$(target);var html="";for(var i=0;i'};$.fn.annotateEdit=function(image,note,tags,labels,saveUrl,csrf,rtlsupport,users){this.image=image;if(note){this.note=note}else{var newNote=new Object();newNote.noteid="new";newNote.top=30;newNote.left=30;newNote.width=30;newNote.height=30;newNote.text="";newNote.description="";newNote.notetype="";newNote.internaltext="";this.note=newNote}var area=image.canvas.children('.image-annotate-edit').children('.image-annotate-edit-area');this.area=area;this.area.css('height',this.note.height+'px');this.area.css('width',this.note.width+'px');this.area.css('left',this.note.left+'px');this.area.css('top',this.note.top+'px');image.canvas.children('.image-annotate-view').hide();image.canvas.children('.image-annotate-edit').show();var selectedtag="";var notetitle="";var username="";var selecteduser="";if(this.note.notetype=="face"){selectedtag=this.note.text}else if(this.note.notetype=="user"){username=this.note.internaltext}else{notetitle=this.note.text}var form=$('
'+labels[12]+'
'+labels[4]+'
'+labels[4]+'
'+labels[2]+'
');this.form=form;$('body').append(this.form);$("#photoannotation-form").ready(function(){var url=tags;$("input#image-annotate-tag-text").autocomplete(url,{max:30,multiple:false,cacheLength:1});var urlusers=users;$("input#photoannotation-user-list").autocomplete(urlusers,{max:30,multiple:false,cacheLength:1})});$("input#image-annotate-tag-text").keyup(function(){if($("input#image-annotate-tag-text").val()!=""){$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#image-annotate-text").keyup(function(){if($("input#image-annotate-text").val()!=""){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#photoannotation-user-list").keyup(function(){if($("select#photoannotation-user-list").val()!="-1"){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("")}});this.form.css('left',this.area.offset().left+'px');this.form.css('top',(parseInt(this.area.offset().top)+parseInt(this.area.height())+7)+'px');area.resizable({handles:'all',start:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}}).draggable({containment:image.canvas,drag:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}});return this};$.fn.annotateEdit.prototype.destroy=function(){this.image.canvas.children('.image-annotate-edit').hide();this.area.resizable('destroy');this.area.draggable('destroy');this.area.css('height','');this.area.css('width','');this.area.css('left','');this.area.css('top','');this.form.remove()};$.fn.annotateView=function(image,note,tags,labels,editable,csrf,deleteUrl,saveUrl,cssaclass,rtlsupport,users){this.image=image;this.note=note;this.area=$('
');image.canvas.children('.image-annotate-view').prepend(this.area);if(editable){this.delarea=$('
');this.editarea=$('
');image.canvas.children('.image-annotate-view').prepend(this.delarea);image.canvas.children('.image-annotate-view').prepend(this.editarea);this.delarea.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');var confdialog='
'+labels[3]+'
';$('body').append(confdialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[5]]=function(){var delform=$(this).attr("rel");$("form#"+delform).submit()};btns[labels[6]]=function(){location.reload()};$('#image-annotate-conf-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[7],close:function(event,ui){location.reload()},buttons:btns})});var form=this;this.editarea.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');form.edit(tags,labels,saveUrl,csrf,rtlsupport,users)});this.delarea.hide();this.editarea.hide()}var notedescription="";if(note.description!=""){notedescription="
"+note.description}this.form=$('
'+note.text+notedescription+'
');this.form.hide();image.canvas.children('.image-annotate-view').append(this.form);this.form.children('span.actions').hide();this.setPosition(rtlsupport);var annotation=this;this.area.hover(function(){annotation.show();if(annotation.delarea!=undefined){annotation.delarea.show();annotation.editarea.show()}},function(){annotation.hide();if(annotation.delarea!=undefined){annotation.delarea.hide();annotation.editarea.hide()}});var legendspan="#photoannotation-legend-"+this.note.notetype+"-"+this.note.noteid;if($(legendspan).length>0){$(legendspan).hover(function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;$(legendsarea).children('.image-annotate-view').show();$(".image-annotate-view").show();$(legendsarea).show();annotation.show()},function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;annotation.hide();$(legendsarea).children('.image-annotate-view').hide();$(".image-annotate-view").hide()})}if(editable){this.delarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()});this.editarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()})}if(note.url!=""&¬e.url!=null){this.area.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');window.location=note.url})}};$.fn.annotateView.prototype.setPosition=function(rtlsupport){this.area.children('div').height((parseInt(this.note.height)-2)+'px');this.area.children('div').width((parseInt(this.note.width)-2)+'px');this.area.css('left',(this.note.left)+'px');this.area.css('top',(this.note.top)+'px');this.form.css('left',(this.note.left)+'px');this.form.css('top',(parseInt(this.note.top)+parseInt(this.note.height)+7)+'px');if(this.delarea!=undefined){this.delarea.children('div').height('14px');this.delarea.children('div').width('14px');this.delarea.css('top',(this.note.top)+'px');this.editarea.children('div').height('14px');this.editarea.children('div').width('14px');if(rtlsupport==''){this.delarea.css('left',(this.note.left+parseInt(this.note.width))+'px');this.editarea.css('left',(this.note.left+parseInt(this.note.width))+'px')}else{this.delarea.css('left',(this.note.left-16)+'px');this.editarea.css('left',(this.note.left-16)+'px')}this.editarea.css('top',(this.note.top+16)+'px')}};$.fn.annotateView.prototype.show=function(){this.form.fadeIn(250);if(!this.note.editable){this.area.addClass('image-annotate-area-hover')}else{this.area.addClass('image-annotate-area-editable-hover')}};$.fn.annotateView.prototype.hide=function(){this.form.fadeOut(250);this.area.removeClass('image-annotate-area-hover');this.area.removeClass('image-annotate-area-editable-hover')};$.fn.annotateView.prototype.destroy=function(){this.area.remove();this.form.remove()};$.fn.annotateView.prototype.edit=function(tags,labels,saveUrl,csrf,rtlsupport,users){if(this.image.mode=='view'){this.image.mode='edit';var annotation=this;var editable=new $.fn.annotateEdit(this.image,this.note,tags,labels,saveUrl,csrf,rtlsupport,users);$.fn.annotateImage.createSaveButton(editable,this.image,annotation,rtlsupport,labels);$.fn.annotateImage.createCancelButton(editable,this.image,rtlsupport,labels)}};$.fn.annotateImage.appendPosition=function(form,editable){var areaFields=$(''+''+''+''+'');form.append(areaFields)};$.fn.annotateView.prototype.resetPosition=function(editable,text){this.form.html(text);this.form.hide();this.area.children('div').height(editable.area.height()+'px');this.area.children('div').width((editable.area.width()-2)+'px');this.area.css('left',(editable.area.position().left)+'px');this.area.css('top',(editable.area.position().top)+'px');this.form.css('left',(editable.area.position().left)+'px');this.form.css('top',(parseInt(editable.area.position().top)+parseInt(editable.area.height())+7)+'px');this.note.top=editable.area.position().top;this.note.left=editable.area.position().left;this.note.height=editable.area.height();this.note.width=editable.area.width();this.note.text=text;this.note.id=editable.note.id;this.editable=true}})(jQuery); +(function($){$.fn.annotateImage=function(options){var opts=$.extend({},$.fn.annotateImage.defaults,options);var image=this;this.image=this;this.mode='view';this.getUrl=opts.getUrl;this.saveUrl=opts.saveUrl;this.deleteUrl=opts.deleteUrl;this.deleteUrl=opts.deleteUrl;this.editable=opts.editable;this.useAjax=opts.useAjax;this.tags=opts.tags;this.notes=opts.notes;this.labels=opts.labels;this.csrf=opts.csrf;this.cssaclass=opts.cssaclass;this.rtlsupport=opts.rtlsupport;this.users=opts.users;this.canvas=$('
');this.canvas.children('.image-annotate-edit').hide();this.canvas.children('.image-annotate-view').hide();this.image.after(this.canvas);this.canvas.height(this.height());this.canvas.width(this.width());this.canvas.css('background-image','url("'+this.attr('src')+'")');this.canvas.children('.image-annotate-view, .image-annotate-edit').height(this.height());this.canvas.children('.image-annotate-view, .image-annotate-edit').width(this.width());this.canvas.hover(function(){if($(this).children('.image-annotate-edit').css('display')=='none'){$(this).children('.image-annotate-view').show()}},function(){$(this).children('.image-annotate-view').hide();$(this).children('.image-annotate-note').hide()});this.canvas.children('.image-annotate-view').hover(function(){$(this).show()},function(){$(this).hide();$(this).children('.image-annotate-note').hide()});if(this.useAjax){$.fn.annotateImage.ajaxLoad(this)}else{$.fn.annotateImage.load(this,this.labels,this.editable,this.csrf,this.deleteUrl,this.tags,this.saveUrl,this.cssaclass,this.rtlsupport,this.users)}if($('#g-photoannotation-link').length!==0){this.button=$('#g-photoannotation-link');this.button.click(function(){$.fn.annotateImage.add(image,opts.tags,opts.labels,opts.saveUrl,opts.csrf,opts.rtlsupport,opts.users)})}this.hide();return this};$.fn.annotateImage.defaults={getUrl:'your-get.rails',saveUrl:'your-save.rails',deleteUrl:'your-delete.rails',editable:true,useAjax:true,tags:new Array(),notes:new Array()};$.fn.annotateImage.clear=function(image){for(var i=0;i'+labels[8]+'');ok.click(function(){var form=$('#image-annotate-edit-form form');var text=$('#image-annotate-text').val();$.fn.annotateImage.appendPosition(form,editable);image.mode='view';form.submit();editable.destroy()});editable.form.append(ok)};$.fn.annotateImage.createCancelButton=function(editable,image,rtlsupport,labels){var cancel=$(''+labels[9]+'');cancel.click(function(){editable.destroy();image.mode='view';location.reload()});editable.form.append(cancel)};$.fn.annotateImage.saveAsHtml=function(image,target){var element=$(target);var html="";for(var i=0;i'};$.fn.annotateEdit=function(image,note,tags,labels,saveUrl,csrf,rtlsupport,users){this.image=image;if(note){this.note=note}else{var newNote=new Object();newNote.noteid="new";newNote.top=30;newNote.left=30;newNote.width=60;newNote.height=60;newNote.text="";newNote.description="";newNote.notetype="";newNote.internaltext="";this.note=newNote}var area=image.canvas.children('.image-annotate-edit').children('.image-annotate-edit-area');this.area=area;this.area.css('height',this.note.height+'px');this.area.css('width',this.note.width+'px');this.area.css('left',this.note.left+'px');this.area.css('top',this.note.top+'px');image.canvas.children('.image-annotate-view').hide();image.canvas.children('.image-annotate-edit').show();var selectedtag="";var notetitle="";var username="";var selecteduser="";if(this.note.notetype=="face"){selectedtag=this.note.text}else if(this.note.notetype=="user"){username=this.note.internaltext}else{notetitle=this.note.text}var form=$('
'+labels[12]+'
'+labels[4]+'
'+labels[4]+'
'+labels[2]+'
');this.form=form;$('body').append(this.form);$("#photoannotation-form").ready(function(){var url=tags;$("input#image-annotate-tag-text").autocomplete(url,{max:30,multiple:false,cacheLength:1});var urlusers=users;$("input#photoannotation-user-list").autocomplete(urlusers,{max:30,multiple:false,cacheLength:1})});$("input#image-annotate-tag-text").keyup(function(){if($("input#image-annotate-tag-text").val()!=""){$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#image-annotate-text").keyup(function(){if($("input#image-annotate-text").val()!=""){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#photoannotation-user-list").keyup(function(){if($("select#photoannotation-user-list").val()!="-1"){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("")}});this.form.css('left',this.area.offset().left+'px');this.form.css('top',(parseInt(this.area.offset().top)+parseInt(this.area.height())+7)+'px');area.resizable({handles:'all',start:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}}).draggable({containment:image.canvas,drag:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}});return this};$.fn.annotateEdit.prototype.destroy=function(){this.image.canvas.children('.image-annotate-edit').hide();this.area.resizable('destroy');this.area.draggable('destroy');this.area.css('height','');this.area.css('width','');this.area.css('left','');this.area.css('top','');this.form.remove()};$.fn.annotateView=function(image,note,tags,labels,editable,csrf,deleteUrl,saveUrl,cssaclass,rtlsupport,users){this.image=image;this.note=note;this.area=$('
');image.canvas.children('.image-annotate-view').prepend(this.area);if(editable){this.delarea=$('
');this.editarea=$('
');image.canvas.children('.image-annotate-view').prepend(this.delarea);image.canvas.children('.image-annotate-view').prepend(this.editarea);this.delarea.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');var confdialog='
'+labels[3]+'
';$('body').append(confdialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[5]]=function(){var delform=$(this).attr("rel");$("form#"+delform).submit()};btns[labels[6]]=function(){location.reload()};$('#image-annotate-conf-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[7],close:function(event,ui){location.reload()},buttons:btns})});var form=this;this.editarea.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');form.edit(tags,labels,saveUrl,csrf,rtlsupport,users)});this.delarea.hide();this.editarea.hide()}var notedescription="";if(note.description!=""){notedescription="
"+note.description}this.form=$('
'+note.text+notedescription+'
');this.form.hide();image.canvas.children('.image-annotate-view').append(this.form);this.form.children('span.actions').hide();this.setPosition(rtlsupport);var annotation=this;this.area.hover(function(){annotation.show();if(annotation.delarea!=undefined){annotation.delarea.show();annotation.editarea.show()}},function(){annotation.hide();if(annotation.delarea!=undefined){annotation.delarea.hide();annotation.editarea.hide()}});var legendspan="#photoannotation-legend-"+this.note.notetype+"-"+this.note.noteid;if($(legendspan).length>0){$(legendspan).hover(function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;$(legendsarea).children('.image-annotate-view').show();$(".image-annotate-view").show();$(legendsarea).show();annotation.show()},function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;annotation.hide();$(legendsarea).children('.image-annotate-view').hide();$(".image-annotate-view").hide()})}if(editable){this.delarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()});this.editarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()})}if(note.url!=""&¬e.url!=null){this.area.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');window.location=note.url})}};$.fn.annotateView.prototype.setPosition=function(rtlsupport){this.area.children('div').height((parseInt(this.note.height)-2)+'px');this.area.children('div').width((parseInt(this.note.width)-2)+'px');this.area.css('left',(this.note.left)+'px');this.area.css('top',(this.note.top)+'px');this.form.css('left',(this.note.left)+'px');this.form.css('top',(parseInt(this.note.top)+parseInt(this.note.height)+7)+'px');if(this.delarea!=undefined){this.delarea.children('div').height('14px');this.delarea.children('div').width('14px');this.delarea.css('top',(this.note.top)+'px');this.editarea.children('div').height('14px');this.editarea.children('div').width('14px');if(rtlsupport==''){this.delarea.css('left',(this.note.left+parseInt(this.note.width))+'px');this.editarea.css('left',(this.note.left+parseInt(this.note.width))+'px')}else{this.delarea.css('left',(this.note.left-16)+'px');this.editarea.css('left',(this.note.left-16)+'px')}this.editarea.css('top',(this.note.top+16)+'px')}};$.fn.annotateView.prototype.show=function(){this.form.fadeIn(250);if(!this.note.editable){this.area.addClass('image-annotate-area-hover')}else{this.area.addClass('image-annotate-area-editable-hover')}};$.fn.annotateView.prototype.hide=function(){this.form.fadeOut(250);this.area.removeClass('image-annotate-area-hover');this.area.removeClass('image-annotate-area-editable-hover')};$.fn.annotateView.prototype.destroy=function(){this.area.remove();this.form.remove()};$.fn.annotateView.prototype.edit=function(tags,labels,saveUrl,csrf,rtlsupport,users){if(this.image.mode=='view'){this.image.mode='edit';var annotation=this;var editable=new $.fn.annotateEdit(this.image,this.note,tags,labels,saveUrl,csrf,rtlsupport,users);$.fn.annotateImage.createSaveButton(editable,this.image,annotation,rtlsupport,labels);$.fn.annotateImage.createCancelButton(editable,this.image,rtlsupport,labels)}};$.fn.annotateImage.appendPosition=function(form,editable){var areaFields=$(''+''+''+''+'');form.append(areaFields)};$.fn.annotateView.prototype.resetPosition=function(editable,text){this.form.html(text);this.form.hide();this.area.children('div').height(editable.area.height()+'px');this.area.children('div').width((editable.area.width()-2)+'px');this.area.css('left',(editable.area.position().left)+'px');this.area.css('top',(editable.area.position().top)+'px');this.form.css('left',(editable.area.position().left)+'px');this.form.css('top',(parseInt(editable.area.position().top)+parseInt(editable.area.height())+7)+'px');this.note.top=editable.area.position().top;this.note.left=editable.area.position().left;this.note.height=editable.area.height();this.note.width=editable.area.width();this.note.text=text;this.note.id=editable.note.id;this.editable=true}})(jQuery); diff --git a/modules/photoannotation/views/photoannotation_highlight_block.html.php b/modules/photoannotation/views/photoannotation_highlight_block.html.php index 6e7b48e9..f8658f13 100644 --- a/modules/photoannotation/views/photoannotation_highlight_block.html.php +++ b/modules/photoannotation/views/photoannotation_highlight_block.html.php @@ -59,7 +59,7 @@ } if ($legend_users != "") { $legend_users = trim($legend_users, ", "); - $legend_users = t("Users on this photo: ") . $legend_users; + $legend_users = t("People on this photo: ") . $legend_users; } foreach ($existingFaces as $oneFace) { $oneTag = ORM::factory("tag", $oneFace->tag_id); @@ -110,7 +110,7 @@ $legend_display = $legend_users . "
" . $legend_faces . "
" . $legend_notes; $legend_display = str_replace("

", "
", $legend_display); } - $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("User:") ."','". t("No user selected") ."','". t("Select one of the following") ."' ],"; + $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."' ],"; ?> "; return $v; } } diff --git a/modules/photoannotation/js/jquery.annotate.js b/modules/photoannotation/js/jquery.annotate.js index fc5492bc..809f91ad 100644 --- a/modules/photoannotation/js/jquery.annotate.js +++ b/modules/photoannotation/js/jquery.annotate.js @@ -31,7 +31,8 @@ this.canvas = $('
'); this.canvas.children('.image-annotate-edit').hide(); this.canvas.children('.image-annotate-view').hide(); - this.image.after(this.canvas); + $('#g-photo').after(this.canvas); + //this.image.after(this.canvas); // Give the canvas and the container their size and background this.canvas.height(this.height()); @@ -142,28 +143,84 @@ // Create/prepare the editable note elements var editable = new $.fn.annotateEdit(image, null, tags, labels, saveUrl, csrf, rtlsupport, users); - $.fn.annotateImage.createSaveButton(editable, image, null, rtlsupport, labels); + $.fn.annotateImage.createSaveButton(editable, image, null, rtlsupport, labels, saveUrl); $.fn.annotateImage.createCancelButton(editable, image, rtlsupport, labels); } }; - $.fn.annotateImage.createSaveButton = function(editable, image, note, rtlsupport, labels) { + $.fn.annotateImage.createSaveButton = function(editable, image, note, rtlsupport, labels, saveUrl) { /// /// Creates a Save button on the editable note. /// var ok = $('' + labels[8] + ''); ok.click(function() { - var form = $('#image-annotate-edit-form form'); - var text = $('#image-annotate-text').val(); - $.fn.annotateImage.appendPosition(form, editable); - image.mode = 'view'; + var form = $('#image-annotate-edit-form form'); + $.fn.annotateImage.appendPosition(form, editable) + $.ajax({ + url: saveUrl, + type: 'POST', + data: form.serialize(), + error: function(e) { + var errordialog = '
' + labels[13] + '
'; + $('body').append(errordialog); + var btns = {}; + if (rtlsupport == "") { + diagclass = "inmage-annotate-dialog"; + } else { + diagclass = "inmage-annotate-dialog-rtl"; + } + btns[labels[14]] = function(){ + $('#image-annotate-error-dialog').remove(); + }; + $('#image-annotate-error-dialog').dialog({ + modal: true, + resizable: false, + dialogClass: diagclass, + title: labels[13], + close: function(event, ui) { $('#image-annotate-error-dialog').remove(); }, + width: 450, + buttons: btns + }); + }, + success: function(data) { + if (data.result == "error") { + var errordialog = '
' + data.message + '
'; + $('body').append(errordialog); + var btns = {}; + if (rtlsupport == "") { + diagclass = "inmage-annotate-dialog"; + } else { + diagclass = "inmage-annotate-dialog-rtl"; + } + btns[labels[14]] = function(){ + $('#image-annotate-error-dialog').remove(); + }; + $('#image-annotate-error-dialog').dialog({ + modal: true, + resizable: false, + dialogClass: diagclass, + title: labels[13], + close: function(event, ui) { $('#image-annotate-error-dialog').remove(); }, + width: 450, + buttons: btns + }); + } else { + //@todo: save new annotation / update existing annotation + //success + } + //if (data.annotation_id != undefined) { + // editable.note.id = data.annotation_id; + //} + }, + dataType: "json" + }); + image.mode = 'view'; - form.submit(); - - editable.destroy(); + editable.destroy(); + }); - editable.form.append(ok); + editable.form.append(ok); }; $.fn.annotateImage.createCancelButton = function(editable, image, rtlsupport, labels) { @@ -174,7 +231,6 @@ cancel.click(function() { editable.destroy(); image.mode = 'view'; - location.reload(); }); editable.form.append(cancel); }; @@ -242,7 +298,7 @@ } else { notetitle = this.note.text; } - var form = $('
' + labels[12] + '
' + labels[4] + '
' + labels[4] + '
' + labels[2] + '
'); + var form = $('
' + labels[12] + '
' + labels[4] + '
' + labels[4] + '
' + labels[2] + '
'); this.form = form; $('body').append(this.form); $("#photoannotation-form").ready(function() { @@ -351,16 +407,12 @@ image.canvas.children('.image-annotate-view').prepend(this.area); if (editable) { - this.delarea = $('
'); + this.delarea = $('
'); this.editarea = $('
'); image.canvas.children('.image-annotate-view').prepend(this.delarea); image.canvas.children('.image-annotate-view').prepend(this.editarea); this.delarea.bind('click',function () { - var alink = $(cssaclass); - alink.unbind(); - alink.attr ('href', '#'); - alink.removeAttr ('rel'); - var confdialog = '
' + labels[3] + '
'; + var confdialog = '
' + labels[3] + '
'; $('body').append(confdialog); var btns = {}; if (rtlsupport == "") { @@ -368,23 +420,55 @@ } else { diagclass = "inmage-annotate-dialog-rtl"; } - btns[labels[5]] = function(){ var delform = $(this).attr("rel"); $("form#" + delform).submit(); }; - btns[labels[6]] = function(){ location.reload(); }; + btns[labels[5]] = function(){ + var delform = $("#" + $(this).attr("rel") + "-del-form"); + $.ajax({ + url: deleteUrl, + type: 'POST', + data: delform.serialize(), + error: function(e) { + var errordialog = '
' + labels[15] + '
'; + $('body').append(errordialog); + var btns = {}; + if (rtlsupport == "") { + diagclass = "inmage-annotate-dialog"; + } else { + diagclass = "inmage-annotate-dialog-rtl"; + } + btns[labels[14]] = function(){ + $('#image-annotate-error-dialog').remove(); + }; + $('#image-annotate-error-dialog').dialog({ + modal: true, + resizable: false, + dialogClass: diagclass, + title: labels[13], + close: function(event, ui) { $('#image-annotate-error-dialog').remove(); }, + width: 450, + buttons: btns + }); + }, + success: function(data) { + if (data.result == "success") { + $("#" + data.annotationid).remove(); + } + }, + dataType: "json" + }); + $('#image-annotate-conf-dialog').remove(); + }; + btns[labels[6]] = function(){ $('#image-annotate-conf-dialog').remove(); }; $('#image-annotate-conf-dialog').dialog({ modal: true, resizable: false, dialogClass: diagclass, title: labels[7], - close: function(event, ui) { location.reload(); }, + close: function(event, ui) { $('#image-annotate-conf-dialog').remove(); }, buttons: btns }); }); var form = this; this.editarea.bind('click',function () { - var alink = $(cssaclass); - alink.unbind(); - alink.attr ('href', '#'); - alink.removeAttr ('rel'); form.edit(tags, labels, saveUrl, csrf, rtlsupport, users); }); this.delarea.hide(); @@ -453,10 +537,6 @@ // Edit a note feature if (note.url != "" && note.url != null) { this.area.bind('click',function () { - var alink = $(cssaclass); - alink.unbind(); - alink.attr ('href', '#'); - alink.removeAttr ('rel'); window.location = note.url; }); } @@ -529,23 +609,11 @@ // Create/prepare the editable note elements var editable = new $.fn.annotateEdit(this.image, this.note, tags, labels, saveUrl, csrf, rtlsupport, users); - $.fn.annotateImage.createSaveButton(editable, this.image, annotation, rtlsupport, labels); + $.fn.annotateImage.createSaveButton(editable, this.image, annotation, rtlsupport, labels, saveUrl); $.fn.annotateImage.createCancelButton(editable, this.image, rtlsupport, labels); } }; - $.fn.annotateImage.appendPosition = function(form, editable) { - /// - /// Appends the annotations coordinates to the given form that is posted to the server. - /// - var areaFields = $('' + - '' + - '' + - '' + - ''); - form.append(areaFields); - }; - $.fn.annotateView.prototype.resetPosition = function(editable, text) { /// /// Sets the position of an annotation. @@ -571,4 +639,16 @@ this.editable = true; }; + $.fn.annotateImage.appendPosition = function(form, editable) { + /// + /// Appends the annotations coordinates to the given form that is posted to the server. + /// + var areaFields = $('' + + '' + + '' + + '' + + ''); + form.append(areaFields); + } + })(jQuery); diff --git a/modules/photoannotation/views/photoannotation_highlight_block.html.php b/modules/photoannotation/views/photoannotation_highlight_block.html.php index 814bc600..aafe8e12 100644 --- a/modules/photoannotation/views/photoannotation_highlight_block.html.php +++ b/modules/photoannotation/views/photoannotation_highlight_block.html.php @@ -107,7 +107,7 @@ } } $legend_display = $legend_users . $legend_faces . $legend_notes; - $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."' ],"; + $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."' ],"; ?> "; + $v .= "\n"; return $v; } } diff --git a/modules/photoannotation/js/jquery.annotate.js b/modules/photoannotation/js/jquery.annotate.js index 4058b3c6..56c78b39 100644 --- a/modules/photoannotation/js/jquery.annotate.js +++ b/modules/photoannotation/js/jquery.annotate.js @@ -26,13 +26,13 @@ this.cssaclass = opts.cssaclass; this.rtlsupport = opts.rtlsupport; this.users = opts.users; + anchor = $('.g-fullsize-link'); // Add the canvas - this.canvas = $('
'); + this.canvas = $('
'); this.canvas.children('.image-annotate-edit').hide(); this.canvas.children('.image-annotate-view').hide(); $('#g-photo').after(this.canvas); - //this.image.after(this.canvas); // Give the canvas and the container their size and background this.canvas.height(this.height()); @@ -45,10 +45,12 @@ this.canvas.hover(function() { if ($(this).children('.image-annotate-edit').css('display') == 'none') { $(this).children('.image-annotate-view').show(); + $("#photoannotation-fullsize").show(); } }, function() { $(this).children('.image-annotate-view').hide(); $(this).children('.image-annotate-note').hide(); + $("#photoannotation-fullsize").hide(); }); this.canvas.children('.image-annotate-view').hover(function() { @@ -76,7 +78,11 @@ // Hide the original this.hide(); - + $('#g-photo').hide(); + $('.image-annotate-canvas').show(); + $(".g-resize").remove(); + $("#photoannotation-fullsize").append($('.g-fullsize-link:first')); + $('.g-fullsize-link').append($('.g-fullsize-link:first').attr('title')); return this; }; @@ -156,7 +162,7 @@ ok.click(function() { var form = $('#image-annotate-edit-form form'); - $.fn.annotateImage.appendPosition(form, editable) + $.fn.annotateImage.appendPosition(form, editable); $.ajax({ url: saveUrl, type: 'POST', @@ -206,20 +212,25 @@ buttons: btns }); } else { - var test = saveUrl; - var newnote = new array(); - newnote.description = data.description; - newnote.editable = true; - newnote.height = data.height; - newnote.internaltext = data.internaltext; - newnote.left = data.left; - newnote.noteid = data.noteid; - newnote.notetype = data.notetype; - newnote.text = data.text; - newnote.top = data.top; - newnote.url = data.url; - newnote.width = data.width; - $.fn.annotateView(!image, newnote, !image.tags, !image.labels, !image.editable, !image.csrf, !image.deleteUrl, !image.saveUrl, !image.cssaclass, !image.rtlsupport, !image.users); + if (data.annotationid != "") { + $("#" + data.annotationid).remove(); + $("#" + data.annotationid + "-edit").remove(); + $("#" + data.annotationid + "-delete").remove(); + $("#" + data.annotationid + "-note").remove(); + } + editable.description = data.description; + editable.editable = data.editable; + editable.height = data.height; + editable.internaltext = data.internaltext; + editable.left = data.left; + editable.noteid = data.noteid; + editable.notetype = data.notetype; + editable.text = data.text; + editable.top = data.top; + editable.url = data.url; + editable.width = data.width; + note = new $.fn.annotateView(image, editable, image.tags, image.labels, image.editable, image.csrf, image.deleteUrl, image.saveUrl, image.cssaclass, image.rtlsupport, image.users); + //@todo: save new annotation / update existing annotation //success } @@ -421,8 +432,8 @@ image.canvas.children('.image-annotate-view').prepend(this.area); if (editable) { - this.delarea = $('
'); - this.editarea = $('
'); + this.delarea = $('
'); + this.editarea = $('
'); image.canvas.children('.image-annotate-view').prepend(this.delarea); image.canvas.children('.image-annotate-view').prepend(this.editarea); this.delarea.bind('click',function () { @@ -465,6 +476,9 @@ success: function(data) { if (data.result == "success") { $("#" + data.annotationid).remove(); + $("#" + data.annotationid + "-edit").remove(); + $("#" + data.annotationid + "-delete").remove(); + $("#" + data.annotationid + "-note").remove(); } }, dataType: "json" @@ -494,7 +508,7 @@ if (note.description != "") { notedescription = "
" + note.description; } - this.form = $('
' + note.text + notedescription + '
'); + this.form = $('
' + note.text + notedescription + '
'); this.form.hide(); image.canvas.children('.image-annotate-view').append(this.form); this.form.children('span.actions').hide(); @@ -573,6 +587,7 @@ this.delarea.css('top', (this.note.top) + 'px'); this.editarea.children('div').height('14px'); this.editarea.children('div').width('14px'); + this.editarea.css('top', (this.note.top + 16) + 'px'); if (rtlsupport == '') { this.delarea.css('left', (this.note.left + parseInt(this.note.width)) + 'px'); this.editarea.css('left', (this.note.left + parseInt(this.note.width)) + 'px'); @@ -580,7 +595,6 @@ this.delarea.css('left', (this.note.left - 16) + 'px'); this.editarea.css('left', (this.note.left - 16) + 'px'); } - this.editarea.css('top', (this.note.top + 16) + 'px'); } }; @@ -663,6 +677,6 @@ '' + ''); form.append(areaFields); - } + }; })(jQuery); diff --git a/modules/photoannotation/js/jquery.annotate.min.js b/modules/photoannotation/js/jquery.annotate.min.js index 97746cf4..d05f8a25 100644 --- a/modules/photoannotation/js/jquery.annotate.min.js +++ b/modules/photoannotation/js/jquery.annotate.min.js @@ -1 +1 @@ -(function($){$.fn.annotateImage=function(options){var opts=$.extend({},$.fn.annotateImage.defaults,options);var image=this;this.image=this;this.mode='view';this.getUrl=opts.getUrl;this.saveUrl=opts.saveUrl;this.deleteUrl=opts.deleteUrl;this.deleteUrl=opts.deleteUrl;this.editable=opts.editable;this.useAjax=opts.useAjax;this.tags=opts.tags;this.notes=opts.notes;this.labels=opts.labels;this.csrf=opts.csrf;this.cssaclass=opts.cssaclass;this.rtlsupport=opts.rtlsupport;this.users=opts.users;this.canvas=$('
');this.canvas.children('.image-annotate-edit').hide();this.canvas.children('.image-annotate-view').hide();this.image.after(this.canvas);this.canvas.height(this.height());this.canvas.width(this.width());this.canvas.css('background-image','url("'+this.attr('src')+'")');this.canvas.children('.image-annotate-view, .image-annotate-edit').height(this.height());this.canvas.children('.image-annotate-view, .image-annotate-edit').width(this.width());this.canvas.hover(function(){if($(this).children('.image-annotate-edit').css('display')=='none'){$(this).children('.image-annotate-view').show()}},function(){$(this).children('.image-annotate-view').hide();$(this).children('.image-annotate-note').hide()});this.canvas.children('.image-annotate-view').hover(function(){$(this).show()},function(){$(this).hide();$(this).children('.image-annotate-note').hide()});if(this.useAjax){$.fn.annotateImage.ajaxLoad(this)}else{$.fn.annotateImage.load(this,this.labels,this.editable,this.csrf,this.deleteUrl,this.tags,this.saveUrl,this.cssaclass,this.rtlsupport,this.users)}if($('#g-photoannotation-link').length!==0){this.button=$('#g-photoannotation-link');this.button.click(function(){$.fn.annotateImage.add(image,opts.tags,opts.labels,opts.saveUrl,opts.csrf,opts.rtlsupport,opts.users)})}this.hide();return this};$.fn.annotateImage.defaults={getUrl:'your-get.rails',saveUrl:'your-save.rails',deleteUrl:'your-delete.rails',editable:true,useAjax:true,tags:new Array(),notes:new Array()};$.fn.annotateImage.clear=function(image){for(var i=0;i'+labels[8]+'');ok.click(function(){var form=$('#image-annotate-edit-form form');var text=$('#image-annotate-text').val();$.fn.annotateImage.appendPosition(form,editable);image.mode='view';form.submit();editable.destroy()});editable.form.append(ok)};$.fn.annotateImage.createCancelButton=function(editable,image,rtlsupport,labels){var cancel=$(''+labels[9]+'');cancel.click(function(){editable.destroy();image.mode='view';location.reload()});editable.form.append(cancel)};$.fn.annotateImage.saveAsHtml=function(image,target){var element=$(target);var html="";for(var i=0;i'};$.fn.annotateEdit=function(image,note,tags,labels,saveUrl,csrf,rtlsupport,users){this.image=image;if(note){this.note=note}else{var newNote=new Object();newNote.noteid="new";newNote.top=30;newNote.left=30;newNote.width=60;newNote.height=60;newNote.text="";newNote.description="";newNote.notetype="";newNote.internaltext="";this.note=newNote}var area=image.canvas.children('.image-annotate-edit').children('.image-annotate-edit-area');this.area=area;this.area.css('height',this.note.height+'px');this.area.css('width',this.note.width+'px');this.area.css('left',this.note.left+'px');this.area.css('top',this.note.top+'px');image.canvas.children('.image-annotate-view').hide();image.canvas.children('.image-annotate-edit').show();var selectedtag="";var notetitle="";var username="";var selecteduser="";if(this.note.notetype=="face"){selectedtag=this.note.text}else if(this.note.notetype=="user"){username=this.note.internaltext}else{notetitle=this.note.text}var form=$('
'+labels[12]+'
'+labels[4]+'
'+labels[4]+'
'+labels[2]+'
');this.form=form;$('body').append(this.form);$("#photoannotation-form").ready(function(){var url=tags;$("input#image-annotate-tag-text").autocomplete(url,{max:30,multiple:false,cacheLength:1});var urlusers=users;$("input#photoannotation-user-list").autocomplete(urlusers,{max:30,multiple:false,cacheLength:1})});$("input#image-annotate-tag-text").keyup(function(){if($("input#image-annotate-tag-text").val()!=""){$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#image-annotate-text").keyup(function(){if($("input#image-annotate-text").val()!=""){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#photoannotation-user-list").keyup(function(){if($("select#photoannotation-user-list").val()!="-1"){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("")}});this.form.css('left',this.area.offset().left+'px');this.form.css('top',(parseInt(this.area.offset().top)+parseInt(this.area.height())+7)+'px');area.resizable({handles:'all',start:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}}).draggable({containment:image.canvas,drag:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}});return this};$.fn.annotateEdit.prototype.destroy=function(){this.image.canvas.children('.image-annotate-edit').hide();this.area.resizable('destroy');this.area.draggable('destroy');this.area.css('height','');this.area.css('width','');this.area.css('left','');this.area.css('top','');this.form.remove()};$.fn.annotateView=function(image,note,tags,labels,editable,csrf,deleteUrl,saveUrl,cssaclass,rtlsupport,users){this.image=image;this.note=note;this.area=$('
');image.canvas.children('.image-annotate-view').prepend(this.area);if(editable){this.delarea=$('
');this.editarea=$('
');image.canvas.children('.image-annotate-view').prepend(this.delarea);image.canvas.children('.image-annotate-view').prepend(this.editarea);this.delarea.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');var confdialog='
'+labels[3]+'
';$('body').append(confdialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[5]]=function(){var delform=$(this).attr("rel");$("form#"+delform).submit()};btns[labels[6]]=function(){location.reload()};$('#image-annotate-conf-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[7],close:function(event,ui){location.reload()},buttons:btns})});var form=this;this.editarea.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');form.edit(tags,labels,saveUrl,csrf,rtlsupport,users)});this.delarea.hide();this.editarea.hide()}var notedescription="";if(note.description!=""){notedescription="
"+note.description}this.form=$('
'+note.text+notedescription+'
');this.form.hide();image.canvas.children('.image-annotate-view').append(this.form);this.form.children('span.actions').hide();this.setPosition(rtlsupport);var annotation=this;this.area.hover(function(){annotation.show();if(annotation.delarea!=undefined){annotation.delarea.show();annotation.editarea.show()}},function(){annotation.hide();if(annotation.delarea!=undefined){annotation.delarea.hide();annotation.editarea.hide()}});var legendspan="#photoannotation-legend-"+this.note.notetype+"-"+this.note.noteid;if($(legendspan).length>0){$(legendspan).hover(function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;$(legendsarea).children('.image-annotate-view').show();$(".image-annotate-view").show();$(legendsarea).show();annotation.show()},function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;annotation.hide();$(legendsarea).children('.image-annotate-view').hide();$(".image-annotate-view").hide()})}if(editable){this.delarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()});this.editarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()})}if(note.url!=""&¬e.url!=null){this.area.bind('click',function(){var alink=$(cssaclass);alink.unbind();alink.attr('href','#');alink.removeAttr('rel');window.location=note.url})}};$.fn.annotateView.prototype.setPosition=function(rtlsupport){this.area.children('div').height((parseInt(this.note.height)-2)+'px');this.area.children('div').width((parseInt(this.note.width)-2)+'px');this.area.css('left',(this.note.left)+'px');this.area.css('top',(this.note.top)+'px');this.form.css('left',(this.note.left)+'px');this.form.css('top',(parseInt(this.note.top)+parseInt(this.note.height)+7)+'px');if(this.delarea!=undefined){this.delarea.children('div').height('14px');this.delarea.children('div').width('14px');this.delarea.css('top',(this.note.top)+'px');this.editarea.children('div').height('14px');this.editarea.children('div').width('14px');if(rtlsupport==''){this.delarea.css('left',(this.note.left+parseInt(this.note.width))+'px');this.editarea.css('left',(this.note.left+parseInt(this.note.width))+'px')}else{this.delarea.css('left',(this.note.left-16)+'px');this.editarea.css('left',(this.note.left-16)+'px')}this.editarea.css('top',(this.note.top+16)+'px')}};$.fn.annotateView.prototype.show=function(){this.form.fadeIn(250);if(!this.note.editable){this.area.addClass('image-annotate-area-hover')}else{this.area.addClass('image-annotate-area-editable-hover')}};$.fn.annotateView.prototype.hide=function(){this.form.fadeOut(250);this.area.removeClass('image-annotate-area-hover');this.area.removeClass('image-annotate-area-editable-hover')};$.fn.annotateView.prototype.destroy=function(){this.area.remove();this.form.remove()};$.fn.annotateView.prototype.edit=function(tags,labels,saveUrl,csrf,rtlsupport,users){if(this.image.mode=='view'){this.image.mode='edit';var annotation=this;var editable=new $.fn.annotateEdit(this.image,this.note,tags,labels,saveUrl,csrf,rtlsupport,users);$.fn.annotateImage.createSaveButton(editable,this.image,annotation,rtlsupport,labels);$.fn.annotateImage.createCancelButton(editable,this.image,rtlsupport,labels)}};$.fn.annotateImage.appendPosition=function(form,editable){var areaFields=$(''+''+''+''+'');form.append(areaFields)};$.fn.annotateView.prototype.resetPosition=function(editable,text){this.form.html(text);this.form.hide();this.area.children('div').height(editable.area.height()+'px');this.area.children('div').width((editable.area.width()-2)+'px');this.area.css('left',(editable.area.position().left)+'px');this.area.css('top',(editable.area.position().top)+'px');this.form.css('left',(editable.area.position().left)+'px');this.form.css('top',(parseInt(editable.area.position().top)+parseInt(editable.area.height())+7)+'px');this.note.top=editable.area.position().top;this.note.left=editable.area.position().left;this.note.height=editable.area.height();this.note.width=editable.area.width();this.note.text=text;this.note.id=editable.note.id;this.editable=true}})(jQuery); +(function($){$.fn.annotateImage=function(options){var opts=$.extend({},$.fn.annotateImage.defaults,options);var image=this;this.image=this;this.mode='view';this.getUrl=opts.getUrl;this.saveUrl=opts.saveUrl;this.deleteUrl=opts.deleteUrl;this.deleteUrl=opts.deleteUrl;this.editable=opts.editable;this.useAjax=opts.useAjax;this.tags=opts.tags;this.notes=opts.notes;this.labels=opts.labels;this.csrf=opts.csrf;this.cssaclass=opts.cssaclass;this.rtlsupport=opts.rtlsupport;this.users=opts.users;anchor=$('.g-fullsize-link');this.canvas=$('
');this.canvas.children('.image-annotate-edit').hide();this.canvas.children('.image-annotate-view').hide();$('#g-photo').after(this.canvas);this.canvas.height(this.height());this.canvas.width(this.width());this.canvas.css('background-image','url("'+this.attr('src')+'")');this.canvas.children('.image-annotate-view, .image-annotate-edit').height(this.height());this.canvas.children('.image-annotate-view, .image-annotate-edit').width(this.width());this.canvas.hover(function(){if($(this).children('.image-annotate-edit').css('display')=='none'){$(this).children('.image-annotate-view').show();$("#photoannotation-fullsize").show()}},function(){$(this).children('.image-annotate-view').hide();$(this).children('.image-annotate-note').hide();$("#photoannotation-fullsize").hide()});this.canvas.children('.image-annotate-view').hover(function(){$(this).show()},function(){$(this).hide();$(this).children('.image-annotate-note').hide()});if(this.useAjax){$.fn.annotateImage.ajaxLoad(this)}else{$.fn.annotateImage.load(this,this.labels,this.editable,this.csrf,this.deleteUrl,this.tags,this.saveUrl,this.cssaclass,this.rtlsupport,this.users)}if($('#g-photoannotation-link').length!==0){this.button=$('#g-photoannotation-link');this.button.click(function(){$.fn.annotateImage.add(image,opts.tags,opts.labels,opts.saveUrl,opts.csrf,opts.rtlsupport,opts.users)})}this.hide();$('#g-photo').hide();$('.image-annotate-canvas').show();$(".g-resize").remove();$("#photoannotation-fullsize").append($('.g-fullsize-link:first'));$('.g-fullsize-link').append($('.g-fullsize-link:first').attr('title'));return this};$.fn.annotateImage.defaults={getUrl:'your-get.rails',saveUrl:'your-save.rails',deleteUrl:'your-delete.rails',editable:true,useAjax:true,tags:new Array(),notes:new Array()};$.fn.annotateImage.clear=function(image){for(var i=0;i'+labels[8]+'');ok.click(function(){var form=$('#image-annotate-edit-form form');$.fn.annotateImage.appendPosition(form,editable);$.ajax({url:saveUrl,type:'POST',data:form.serialize(),error:function(e){var errordialog='
'+labels[13]+'
';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})},success:function(data){if(data.result=="error"){var errordialog='
'+data.message+'
';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})}else{if(data.annotationid!=""){$("#"+data.annotationid).remove();$("#"+data.annotationid+"-edit").remove();$("#"+data.annotationid+"-delete").remove();$("#"+data.annotationid+"-note").remove()}editable.description=data.description;editable.editable=data.editable;editable.height=data.height;editable.internaltext=data.internaltext;editable.left=data.left;editable.noteid=data.noteid;editable.notetype=data.notetype;editable.text=data.text;editable.top=data.top;editable.url=data.url;editable.width=data.width;note=new $.fn.annotateView(image,editable,image.tags,image.labels,image.editable,image.csrf,image.deleteUrl,image.saveUrl,image.cssaclass,image.rtlsupport,image.users)}},dataType:"json"});image.mode='view';editable.destroy()});editable.form.append(ok)};$.fn.annotateImage.createCancelButton=function(editable,image,rtlsupport,labels){var cancel=$(''+labels[9]+'');cancel.click(function(){editable.destroy();image.mode='view'});editable.form.append(cancel)};$.fn.annotateImage.saveAsHtml=function(image,target){var element=$(target);var html="";for(var i=0;i'};$.fn.annotateEdit=function(image,note,tags,labels,saveUrl,csrf,rtlsupport,users){this.image=image;if(note){this.note=note}else{var newNote=new Object();newNote.noteid="new";newNote.top=30;newNote.left=30;newNote.width=60;newNote.height=60;newNote.text="";newNote.description="";newNote.notetype="";newNote.internaltext="";this.note=newNote}var area=image.canvas.children('.image-annotate-edit').children('.image-annotate-edit-area');this.area=area;this.area.css('height',this.note.height+'px');this.area.css('width',this.note.width+'px');this.area.css('left',this.note.left+'px');this.area.css('top',this.note.top+'px');image.canvas.children('.image-annotate-view').hide();image.canvas.children('.image-annotate-edit').show();var selectedtag="";var notetitle="";var username="";var selecteduser="";if(this.note.notetype=="face"){selectedtag=this.note.text}else if(this.note.notetype=="user"){username=this.note.internaltext}else{notetitle=this.note.text}var form=$('
'+labels[12]+'
'+labels[4]+'
'+labels[4]+'
'+labels[2]+'
');this.form=form;$('body').append(this.form);$("#photoannotation-form").ready(function(){var url=tags;$("input#image-annotate-tag-text").autocomplete(url,{max:30,multiple:false,cacheLength:1});var urlusers=users;$("input#photoannotation-user-list").autocomplete(urlusers,{max:30,multiple:false,cacheLength:1})});$("input#image-annotate-tag-text").keyup(function(){if($("input#image-annotate-tag-text").val()!=""){$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#image-annotate-text").keyup(function(){if($("input#image-annotate-text").val()!=""){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("");$("input#photoannotation-user-list").text("")}});$("input#photoannotation-user-list").keyup(function(){if($("select#photoannotation-user-list").val()!="-1"){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-tag-text").text("");$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#image-annotate-text").text("")}});this.form.css('left',this.area.offset().left+'px');this.form.css('top',(parseInt(this.area.offset().top)+parseInt(this.area.height())+7)+'px');area.resizable({handles:'all',start:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}}).draggable({containment:image.canvas,drag:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}});return this};$.fn.annotateEdit.prototype.destroy=function(){this.image.canvas.children('.image-annotate-edit').hide();this.area.resizable('destroy');this.area.draggable('destroy');this.area.css('height','');this.area.css('width','');this.area.css('left','');this.area.css('top','');this.form.remove()};$.fn.annotateView=function(image,note,tags,labels,editable,csrf,deleteUrl,saveUrl,cssaclass,rtlsupport,users){this.image=image;this.note=note;this.area=$('
');image.canvas.children('.image-annotate-view').prepend(this.area);if(editable){this.delarea=$('
');this.editarea=$('
');image.canvas.children('.image-annotate-view').prepend(this.delarea);image.canvas.children('.image-annotate-view').prepend(this.editarea);this.delarea.bind('click',function(){var confdialog='
'+labels[3]+'
';$('body').append(confdialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[5]]=function(){var delform=$("#"+$(this).attr("rel")+"-del-form");$.ajax({url:deleteUrl,type:'POST',data:delform.serialize(),error:function(e){var errordialog='
'+labels[15]+'
';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})},success:function(data){if(data.result=="success"){$("#"+data.annotationid).remove();$("#"+data.annotationid+"-edit").remove();$("#"+data.annotationid+"-delete").remove();$("#"+data.annotationid+"-note").remove()}},dataType:"json"});$('#image-annotate-conf-dialog').remove()};btns[labels[6]]=function(){$('#image-annotate-conf-dialog').remove()};$('#image-annotate-conf-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[7],close:function(event,ui){$('#image-annotate-conf-dialog').remove()},buttons:btns})});var form=this;this.editarea.bind('click',function(){form.edit(tags,labels,saveUrl,csrf,rtlsupport,users)});this.delarea.hide();this.editarea.hide()}var notedescription="";if(note.description!=""){notedescription="
"+note.description}this.form=$('
'+note.text+notedescription+'
');this.form.hide();image.canvas.children('.image-annotate-view').append(this.form);this.form.children('span.actions').hide();this.setPosition(rtlsupport);var annotation=this;this.area.hover(function(){annotation.show();if(annotation.delarea!=undefined){annotation.delarea.show();annotation.editarea.show()}},function(){annotation.hide();if(annotation.delarea!=undefined){annotation.delarea.hide();annotation.editarea.hide()}});var legendspan="#photoannotation-legend-"+this.note.notetype+"-"+this.note.noteid;if($(legendspan).length>0){$(legendspan).hover(function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;$(legendsarea).children('.image-annotate-view').show();$(".image-annotate-view").show();$(legendsarea).show();annotation.show()},function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;annotation.hide();$(legendsarea).children('.image-annotate-view').hide();$(".image-annotate-view").hide()})}if(editable){this.delarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()});this.editarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()})}if(note.url!=""&¬e.url!=null){this.area.bind('click',function(){window.location=note.url})}};$.fn.annotateView.prototype.setPosition=function(rtlsupport){this.area.children('div').height((parseInt(this.note.height)-2)+'px');this.area.children('div').width((parseInt(this.note.width)-2)+'px');this.area.css('left',(this.note.left)+'px');this.area.css('top',(this.note.top)+'px');this.form.css('left',(this.note.left)+'px');this.form.css('top',(parseInt(this.note.top)+parseInt(this.note.height)+7)+'px');if(this.delarea!=undefined){this.delarea.children('div').height('14px');this.delarea.children('div').width('14px');this.delarea.css('top',(this.note.top)+'px');this.editarea.children('div').height('14px');this.editarea.children('div').width('14px');this.editarea.css('top',(this.note.top+16)+'px');if(rtlsupport==''){this.delarea.css('left',(this.note.left+parseInt(this.note.width))+'px');this.editarea.css('left',(this.note.left+parseInt(this.note.width))+'px')}else{this.delarea.css('left',(this.note.left-16)+'px');this.editarea.css('left',(this.note.left-16)+'px')}}};$.fn.annotateView.prototype.show=function(){this.form.fadeIn(250);if(!this.note.editable){this.area.addClass('image-annotate-area-hover')}else{this.area.addClass('image-annotate-area-editable-hover')}};$.fn.annotateView.prototype.hide=function(){this.form.fadeOut(250);this.area.removeClass('image-annotate-area-hover');this.area.removeClass('image-annotate-area-editable-hover')};$.fn.annotateView.prototype.destroy=function(){this.area.remove();this.form.remove()};$.fn.annotateView.prototype.edit=function(tags,labels,saveUrl,csrf,rtlsupport,users){if(this.image.mode=='view'){this.image.mode='edit';var annotation=this;var editable=new $.fn.annotateEdit(this.image,this.note,tags,labels,saveUrl,csrf,rtlsupport,users);$.fn.annotateImage.createSaveButton(editable,this.image,annotation,rtlsupport,labels,saveUrl);$.fn.annotateImage.createCancelButton(editable,this.image,rtlsupport,labels)}};$.fn.annotateView.prototype.resetPosition=function(editable,text){this.form.html(text);this.form.hide();this.area.children('div').height(editable.area.height()+'px');this.area.children('div').width((editable.area.width()-2)+'px');this.area.css('left',(editable.area.position().left)+'px');this.area.css('top',(editable.area.position().top)+'px');this.form.css('left',(editable.area.position().left)+'px');this.form.css('top',(parseInt(editable.area.position().top)+parseInt(editable.area.height())+7)+'px');this.note.top=editable.area.position().top;this.note.left=editable.area.position().left;this.note.height=editable.area.height();this.note.width=editable.area.width();this.note.text=text;this.note.id=editable.note.id;this.editable=true};$.fn.annotateImage.appendPosition=function(form,editable){var areaFields=$(''+''+''+''+'');form.append(areaFields)}})(jQuery); \ No newline at end of file diff --git a/modules/photoannotation/views/photoannotation_highlight_block.html.php b/modules/photoannotation/views/photoannotation_highlight_block.html.php index aafe8e12..9b200d95 100644 --- a/modules/photoannotation/views/photoannotation_highlight_block.html.php +++ b/modules/photoannotation/views/photoannotation_highlight_block.html.php @@ -107,7 +107,7 @@ } } $legend_display = $legend_users . $legend_faces . $legend_notes; - $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."' ],"; + $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."','". t("View fullsize") ."' ],"; ?> - - ". $legend_display ."
" ?> - + ". $legend_display ."
" ?> From a20e33785f987a3ec0fd828ac5ad80d9b1d710fa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Sep 2010 13:45:49 -0400 Subject: [PATCH 13/17] Initial commit of NoFFMPEG. --- modules/noffmpeg/helpers/movie.php | 137 ++++++++++++++++++ .../noffmpeg/images/missing_movie - Copy.png | Bin 0 -> 8474 bytes modules/noffmpeg/images/missing_movie.png | Bin 0 -> 8228 bytes modules/noffmpeg/module.info | 3 + 4 files changed, 140 insertions(+) create mode 100644 modules/noffmpeg/helpers/movie.php create mode 100644 modules/noffmpeg/images/missing_movie - Copy.png create mode 100644 modules/noffmpeg/images/missing_movie.png create mode 100644 modules/noffmpeg/module.info diff --git a/modules/noffmpeg/helpers/movie.php b/modules/noffmpeg/helpers/movie.php new file mode 100644 index 00000000..801796b8 --- /dev/null +++ b/modules/noffmpeg/helpers/movie.php @@ -0,0 +1,137 @@ +id", "", "post", array("id" => "g-edit-movie-form")); + $form->hidden("from_id")->value($movie->id); + $group = $form->group("edit_item")->label(t("Edit Movie")); + $group->input("title")->label(t("Title"))->value($movie->title) + ->error_messages("required", t("You must provide a title")) + ->error_messages("length", t("Your title is too long")); + $group->textarea("description")->label(t("Description"))->value($movie->description); + $group->input("name")->label(t("Filename"))->value($movie->name) + ->error_messages( + "conflict", t("There is already a movie, photo or album with this name")) + ->error_messages("no_slashes", t("The movie name can't contain a \"/\"")) + ->error_messages("no_trailing_period", t("The movie name can't end in \".\"")) + ->error_messages("illegal_data_file_extension", t("You cannot change the movie file extension")) + ->error_messages("required", t("You must provide a movie file name")) + ->error_messages("length", t("Your movie file name is too long")); + $group->input("slug")->label(t("Internet Address"))->value($movie->slug) + ->error_messages( + "conflict", t("There is already a movie, photo or album with this internet address")) + ->error_messages( + "not_url_safe", + t("The internet address should contain only letters, numbers, hyphens and underscores")) + ->error_messages("required", t("You must provide an internet address")) + ->error_messages("length", t("Your internet address is too long")); + + module::event("item_edit_form", $movie, $form); + + $group = $form->group("buttons")->label(""); + $group->submit("")->value(t("Modify")); + + return $form; + } + + static function extract_frame($input_file, $output_file) { + $ffmpeg = self::find_ffmpeg(); + if (empty($ffmpeg)) { + // BEGIN rWatcher Edit. + copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file); + //throw new Exception("@todo MISSING_FFMPEG"); + // END rWatcher Edit. + } + + $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . + " -an -ss 00:00:03 -an -r 1 -vframes 1" . + " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; + exec($cmd); + + clearstatcache(); // use $filename parameter when PHP_version is 5.3+ + if (filesize($output_file) == 0) { + // Maybe the movie is shorter, fall back to the first frame. + $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . + " -an -an -r 1 -vframes 1" . + " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; + exec($cmd); + + clearstatcache(); + if (filesize($output_file) == 0) { + throw new Exception("@todo FFMPEG_FAILED"); + } + } + } + + static function find_ffmpeg() { + if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { + $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null); + + putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") . + ":/usr/local/bin:/opt/local/bin:/opt/bin"); + if (function_exists("exec")) { + $ffmpeg_path = exec("which ffmpeg"); + } + + module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); + } + return $ffmpeg_path; + } + + + /** + * Return the width, height, mime_type and extension of the given movie file. + */ + static function get_file_metadata($file_path) { + $ffmpeg = self::find_ffmpeg(); + if (empty($ffmpeg)) { + // BEGIN rWatcher Edit. + $pi = pathinfo($file_path); + $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. + $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? + "video/mp4" : "video/x-flv"; + return array(320, 240, $mime_type, $extension); + //throw new Exception("@todo MISSING_FFMPEG"); + // END rWatcher Edit. + } + + $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($file_path) . " 2>&1"; + $result = `$cmd`; + if (preg_match("/Stream.*?Video:.*?(\d+)x(\d+)/", $result, $regs)) { + list ($width, $height) = array($regs[1], $regs[2]); + } else { + list ($width, $height) = array(0, 0); + } + + $pi = pathinfo($file_path); + $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. + $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? + "video/mp4" : "video/x-flv"; + + return array($width, $height, $mime_type, $extension); + } + +} diff --git a/modules/noffmpeg/images/missing_movie - Copy.png b/modules/noffmpeg/images/missing_movie - Copy.png new file mode 100644 index 0000000000000000000000000000000000000000..fdc97779a64dc9d872d8c882f85f80dd54a99ae5 GIT binary patch literal 8474 zcmXw92|Uy9AKzw}+blr54<%%TbUTYs zlD08sn~`I#vAOwg>-YD1&G)tEdA`r{c|M=_`~CSm-|w)l$5B$^%HjY3K+4gnY6`Bd;O;EUGI)&M|N`vKwP3EubZVfLP3r>+Ht-S)i^0I>GI<`KYz%HSYrfI2t7K%+CpC#L!b zD2$O&>M(7XM(3`q&#<|q{y`#{LL~K*28M`4GLipBBJvtZ1El^TB6(nQb8B;RlT4wm zt*vitY;u>Dd6$jNO=3TV!(HCk+~R#(Sy^3Q-&kH*U0PmQHOuCWU0vHC_xH1A=Ld%9L-bKHWtcobU0PZmq%pb6t5n9=^xVSw z#^&+8&M7Kg(nkq5X-Jk!=VORIBi4w2Z;Gjn-$okSun zEw53AhUXVJ1B1g$%c~?ZWnhRl$6j1tU#AQX^CC1lF}=uLSy7ZIQzGWus_bz^#Nkv=xb!yqr_yj7Xw(*qRh`sNm~e`s`KW_e|u zNFF5jQ)Xu8sUv@;re_C-XuRvz=GMqK>(2yhV{3~wGdDdmKS*T^3^CXXOH+l<|0~u zSCy50Y-lJd(gFz=(*V#0r1;N6APs=CmMlD~ zYMSD#D6<2<-qr1MZE8zV3=R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$$%^C>8A+8Z)29V_T4h(GBx^=77`Z!yxR5 literal 0 HcmV?d00001 diff --git a/modules/noffmpeg/module.info b/modules/noffmpeg/module.info new file mode 100644 index 00000000..c11f0853 --- /dev/null +++ b/modules/noffmpeg/module.info @@ -0,0 +1,3 @@ +name = "NoFFMPEG" +description = "Allow video uploads on systems without FFMPEG." +version = 1 From b65b7778aeaba453679098ce05633dea1534e283 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 14 Sep 2010 13:49:07 -0400 Subject: [PATCH 14/17] Fixed the thumbnail. --- .../noffmpeg/images/missing_movie - Copy.png | Bin 8474 -> 0 bytes modules/noffmpeg/images/missing_movie.png | Bin 8228 -> 8474 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 modules/noffmpeg/images/missing_movie - Copy.png diff --git a/modules/noffmpeg/images/missing_movie - Copy.png b/modules/noffmpeg/images/missing_movie - Copy.png deleted file mode 100644 index fdc97779a64dc9d872d8c882f85f80dd54a99ae5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8474 zcmXw92|Uy9AKzw}+blr54<%%TbUTYs zlD08sn~`I#vAOwg>-YD1&G)tEdA`r{c|M=_`~CSm-|w)l$5B$^%HjY3K+4gnY6`Bd;O;EUGI)&M|N`vKwP3EubZVfLP3r>+Ht-S)i^0I>GI<`KYz%HSYrfI2t7K%+CpC#L!b zD2$O&>M(7XM(3`q&#<|q{y`#{LL~K*28M`4GLipBBJvtZ1El^TB6(nQb8B;RlT4wm zt*vitY;u>Dd6$jNO=3TV!(HCk+~R#(Sy^3Q-&kH*U0PmQHOuCWU0vHC_xH1A=Ld%9L-bKHWtcobU0PZmq%pb6t5n9=^xVSw z#^&+8&M7Kg(nkq5X-Jk!=VORIBi4w2Z;Gjn-$okSun zEw53AhUXVJ1B1g$%c~?ZWnhRl$6j1tU#AQX^CC1lF}=uLSy7ZIQzGWus_bz^#Nkv=xb!yqr_yj7Xw(*qRh`sNm~e`s`KW_e|u z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g/images/missing_movie.png | Bin 8474 -> 0 bytes modules/noffmpeg/module.info | 3 - 3 files changed, 140 deletions(-) delete mode 100644 modules/noffmpeg/helpers/movie.php delete mode 100644 modules/noffmpeg/images/missing_movie.png delete mode 100644 modules/noffmpeg/module.info diff --git a/modules/noffmpeg/helpers/movie.php b/modules/noffmpeg/helpers/movie.php deleted file mode 100644 index 801796b8..00000000 --- a/modules/noffmpeg/helpers/movie.php +++ /dev/null @@ -1,137 +0,0 @@ -id", "", "post", array("id" => "g-edit-movie-form")); - $form->hidden("from_id")->value($movie->id); - $group = $form->group("edit_item")->label(t("Edit Movie")); - $group->input("title")->label(t("Title"))->value($movie->title) - ->error_messages("required", t("You must provide a title")) - ->error_messages("length", t("Your title is too long")); - $group->textarea("description")->label(t("Description"))->value($movie->description); - $group->input("name")->label(t("Filename"))->value($movie->name) - ->error_messages( - "conflict", t("There is already a movie, photo or album with this name")) - ->error_messages("no_slashes", t("The movie name can't contain a \"/\"")) - ->error_messages("no_trailing_period", t("The movie name can't end in \".\"")) - ->error_messages("illegal_data_file_extension", t("You cannot change the movie file extension")) - ->error_messages("required", t("You must provide a movie file name")) - ->error_messages("length", t("Your movie file name is too long")); - $group->input("slug")->label(t("Internet Address"))->value($movie->slug) - ->error_messages( - "conflict", t("There is already a movie, photo or album with this internet address")) - ->error_messages( - "not_url_safe", - t("The internet address should contain only letters, numbers, hyphens and underscores")) - ->error_messages("required", t("You must provide an internet address")) - ->error_messages("length", t("Your internet address is too long")); - - module::event("item_edit_form", $movie, $form); - - $group = $form->group("buttons")->label(""); - $group->submit("")->value(t("Modify")); - - return $form; - } - - static function extract_frame($input_file, $output_file) { - $ffmpeg = self::find_ffmpeg(); - if (empty($ffmpeg)) { - // BEGIN rWatcher Edit. - copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file); - //throw new Exception("@todo MISSING_FFMPEG"); - // END rWatcher Edit. - } - - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . - " -an -ss 00:00:03 -an -r 1 -vframes 1" . - " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; - exec($cmd); - - clearstatcache(); // use $filename parameter when PHP_version is 5.3+ - if (filesize($output_file) == 0) { - // Maybe the movie is shorter, fall back to the first frame. - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . - " -an -an -r 1 -vframes 1" . - " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; - exec($cmd); - - clearstatcache(); - if (filesize($output_file) == 0) { - throw new Exception("@todo FFMPEG_FAILED"); - } - } - } - - static function find_ffmpeg() { - if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { - $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null); - - putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") . - ":/usr/local/bin:/opt/local/bin:/opt/bin"); - if (function_exists("exec")) { - $ffmpeg_path = exec("which ffmpeg"); - } - - module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); - } - return $ffmpeg_path; - } - - - /** - * Return the width, height, mime_type and extension of the given movie file. - */ - static function get_file_metadata($file_path) { - $ffmpeg = self::find_ffmpeg(); - if (empty($ffmpeg)) { - // BEGIN rWatcher Edit. - $pi = pathinfo($file_path); - $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. - $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? - "video/mp4" : "video/x-flv"; - return array(320, 240, $mime_type, $extension); - //throw new Exception("@todo MISSING_FFMPEG"); - // END rWatcher Edit. - } - - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($file_path) . " 2>&1"; - $result = `$cmd`; - if (preg_match("/Stream.*?Video:.*?(\d+)x(\d+)/", $result, $regs)) { - list ($width, $height) = array($regs[1], $regs[2]); - } else { - list ($width, $height) = array(0, 0); - } - - $pi = pathinfo($file_path); - $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. - $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? - "video/mp4" : "video/x-flv"; - - return array($width, $height, $mime_type, $extension); - } - -} diff --git a/modules/noffmpeg/images/missing_movie.png b/modules/noffmpeg/images/missing_movie.png deleted file mode 100644 index fdc97779a64dc9d872d8c882f85f80dd54a99ae5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8474 zcmXw92|Uy9AKzw}+blr54<%%TbUTYs zlD08sn~`I#vAOwg>-YD1&G)tEdA`r{c|M=_`~CSm-|w)l$5B$^%HjY3K+4gnY6`Bd;O;EUGI)&M|N`vKwP3EubZVfLP3r>+Ht-S)i^0I>GI<`KYz%HSYrfI2t7K%+CpC#L!b zD2$O&>M(7XM(3`q&#<|q{y`#{LL~K*28M`4GLipBBJvtZ1El^TB6(nQb8B;RlT4wm zt*vitY;u>Dd6$jNO=3TV!(HCk+~R#(Sy^3Q-&kH*U0PmQHOuCWU0vHC_xH1A=Ld%9L-bKHWtcobU0PZmq%pb6t5n9=^xVSw z#^&+8&M7Kg(nkq5X-Jk!=VORIBi4w2Z;Gjn-$okSun zEw53AhUXVJ1B1g$%c~?ZWnhRl$6j1tU#AQX^CC1lF}=uLSy7ZIQzGWus_bz^#Nkv=xb!yqr_yj7Xw(*qRh`sNm~e`s`KW_e|u zNFF5jQ)Xu8sUv@;re_C-XuRvz=GMqK>(2yhV{3~wGdDdmKS*T^3^CXXOH+l<|0~u zSCy50Y-lJd(gFz=(*V#0r1;N6APs=CmMlD~ zYMSD#D6<2<-qr1MZE8zV3=R$+o|>9^?F)!Cefk@Ad}@-Yg)ssji|s`0N`9s4-~YQ; z40hbb9t7K|`YhJ8wn&T#I|t|4G6=tP^H;_|w>a5l3;Rt^$%uv5D2*2R(%=e$0W z2MBydgP^~&)ZCQo?{n_jZ1O*qy0oAwn+vt&r7nSLheE@5K~2Y}Ee8(0g#){~cImvy ztDI`@>#FFq7D>Hx$;a9GS13vh381r+%A;KgTbCSzgH`nX(N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Jf*1l zUlG3uS=U&Od-%8bhY(pEbFW!(LpxutC5&(GHo?(S`Grao;=8u{!{VscY%RVjTjTK5 zJ!uxM|KasCPFu!RB}0H+J6xJq$0@_Vlc%$w%Ed;0jK5Zf;nK!n`*yYcp9cmz6!>xl^wZb5)o`HE7H3bLq=Z$rF|;14ykU@-SplBXqo za6M5WZLn^{8|0ffmzD|MKAT6<0aY(8vSuK4Cl!4T)90|^E0vOOFtkgr{(B81r$DQV z%G^QKExa%Zit-Of3b!N3RiA%>AsQ_B&oFilaprT)t<2PYAsMj8=kXYaYxIF*cg+gG zbs6_TXV0R0UrNn=|MgF%4mvnV%-AZ@lQ|eAE)<(T6{DADSVa z{s--|#5-3AMn5Y>Z;931Qji|YY{KNM7;7E(LfyKtITBM8xBvNS0s*b4E~C2H!!tw` z4$S`SY~)-1DTMJ(7!-iCQ)^5Ddlq8SHPD8cA9u)+XZA|H;rR*j7=^i1US^5LX7m=? zZr|?awmkvqCjYW%R|UXLwG9(wp)t}^X#1ob^e#UpwA8?vX9ykYtfTX+bcVKPOAV-R z{$Vao7)i4?@B{#TwBu7B@!ll*P8;2U!&4h>$?=e4gfoke>1FmxEq*Hoyu7=jfw_CX z%v7Us_;3TI?T4C@rWrpbl6es^jF~@-Ug>uVzlMhoKgh%9cmiq~8q6efy7Th}V+%sp zY+<}d`_bTWn1{#hrJb^&+mV1<$joQzJt`6Fg<|{{m)rs1N6_K}9B!%+q^_O@!+Zjq v-=8YMvqI>T_g&d4NoiWruzDT Date: Tue, 14 Sep 2010 14:00:07 -0400 Subject: [PATCH 16/17] Second attempt at commiting NoFFMPEG. --- modules/noffmpeg/helpers/movie.php | 137 ++++++++++++++++++++++ modules/noffmpeg/images/missing_movie.png | Bin 0 -> 8474 bytes modules/noffmpeg/module.info | 3 + 3 files changed, 140 insertions(+) create mode 100644 modules/noffmpeg/helpers/movie.php create mode 100644 modules/noffmpeg/images/missing_movie.png create mode 100644 modules/noffmpeg/module.info diff --git a/modules/noffmpeg/helpers/movie.php b/modules/noffmpeg/helpers/movie.php new file mode 100644 index 00000000..801796b8 --- /dev/null +++ b/modules/noffmpeg/helpers/movie.php @@ -0,0 +1,137 @@ +id", "", "post", array("id" => "g-edit-movie-form")); + $form->hidden("from_id")->value($movie->id); + $group = $form->group("edit_item")->label(t("Edit Movie")); + $group->input("title")->label(t("Title"))->value($movie->title) + ->error_messages("required", t("You must provide a title")) + ->error_messages("length", t("Your title is too long")); + $group->textarea("description")->label(t("Description"))->value($movie->description); + $group->input("name")->label(t("Filename"))->value($movie->name) + ->error_messages( + "conflict", t("There is already a movie, photo or album with this name")) + ->error_messages("no_slashes", t("The movie name can't contain a \"/\"")) + ->error_messages("no_trailing_period", t("The movie name can't end in \".\"")) + ->error_messages("illegal_data_file_extension", t("You cannot change the movie file extension")) + ->error_messages("required", t("You must provide a movie file name")) + ->error_messages("length", t("Your movie file name is too long")); + $group->input("slug")->label(t("Internet Address"))->value($movie->slug) + ->error_messages( + "conflict", t("There is already a movie, photo or album with this internet address")) + ->error_messages( + "not_url_safe", + t("The internet address should contain only letters, numbers, hyphens and underscores")) + ->error_messages("required", t("You must provide an internet address")) + ->error_messages("length", t("Your internet address is too long")); + + module::event("item_edit_form", $movie, $form); + + $group = $form->group("buttons")->label(""); + $group->submit("")->value(t("Modify")); + + return $form; + } + + static function extract_frame($input_file, $output_file) { + $ffmpeg = self::find_ffmpeg(); + if (empty($ffmpeg)) { + // BEGIN rWatcher Edit. + copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file); + //throw new Exception("@todo MISSING_FFMPEG"); + // END rWatcher Edit. + } + + $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . + " -an -ss 00:00:03 -an -r 1 -vframes 1" . + " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; + exec($cmd); + + clearstatcache(); // use $filename parameter when PHP_version is 5.3+ + if (filesize($output_file) == 0) { + // Maybe the movie is shorter, fall back to the first frame. + $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . + " -an -an -r 1 -vframes 1" . + " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; + exec($cmd); + + clearstatcache(); + if (filesize($output_file) == 0) { + throw new Exception("@todo FFMPEG_FAILED"); + } + } + } + + static function find_ffmpeg() { + if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { + $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null); + + putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") . + ":/usr/local/bin:/opt/local/bin:/opt/bin"); + if (function_exists("exec")) { + $ffmpeg_path = exec("which ffmpeg"); + } + + module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); + } + return $ffmpeg_path; + } + + + /** + * Return the width, height, mime_type and extension of the given movie file. + */ + static function get_file_metadata($file_path) { + $ffmpeg = self::find_ffmpeg(); + if (empty($ffmpeg)) { + // BEGIN rWatcher Edit. + $pi = pathinfo($file_path); + $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. + $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? + "video/mp4" : "video/x-flv"; + return array(320, 240, $mime_type, $extension); + //throw new Exception("@todo MISSING_FFMPEG"); + // END rWatcher Edit. + } + + $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($file_path) . " 2>&1"; + $result = `$cmd`; + if (preg_match("/Stream.*?Video:.*?(\d+)x(\d+)/", $result, $regs)) { + list ($width, $height) = array($regs[1], $regs[2]); + } else { + list ($width, $height) = array(0, 0); + } + + $pi = pathinfo($file_path); + $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. + $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? + "video/mp4" : "video/x-flv"; + + return array($width, $height, $mime_type, $extension); + } + +} diff --git a/modules/noffmpeg/images/missing_movie.png b/modules/noffmpeg/images/missing_movie.png new file mode 100644 index 0000000000000000000000000000000000000000..fd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plBXqo za6M5WZLn^{8|0ffmzD|MKAT6<0aY(8vSuK4Cl!4T)90|^E0vOOFtkgr{(B81r$DQV z%G^QKExa%Zit-Of3b!N3RiA%>AsQ_B&oFilaprT)t<2PYAsMj8=kXYaYxIF*cg+gG zbs6_TXV0R0UrNn=|MgF%4mvnV%-AZ@lQ|eAE)<(T6{DADSVa z{s--|#5-3AMn5Y>Z;931Qji|YY{KNM7;7E(LfyKtITBM8xBvNS0s*b4E~C2H!!tw` z4$S`SY~)-1DTMJ(7!-iCQ)^5Ddlq8SHPD8cA9u)+XZA|H;rR*j7=^i1US^5LX7m=? zZr|?awmkvqCjYW%R|UXLwG9(wp)t}^X#1ob^e#UpwA8?vX9ykYtfTX+bcVKPOAV-R z{$Vao7)i4?@B{#TwBu7B@!ll*P8;2U!&4h>$?=e4gfoke>1FmxEq*Hoyu7=jfw_CX z%v7Us_;3TI?T4C@rWrpbl6es^jF~@-Ug>uVzlMhoKgh%9cmiq~8q6efy7Th}V+%sp zY+<}d`_bTWn1{#hrJb^&+mV1<$joQzJt`6Fg<|{{m)rs1N6_K}9B!%+q^_O@!+Zjq v-=8YMvqI>T_g&d4NoiWruzDT Date: Thu, 16 Sep 2010 23:32:00 -0400 Subject: [PATCH 17/17] Added a library for determining FLV height and width. --- modules/noffmpeg/helpers/movie.php | 15 +- modules/noffmpeg/libraries/FLVMetaData.php | 194 +++++++++++++++++++++ 2 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 modules/noffmpeg/libraries/FLVMetaData.php diff --git a/modules/noffmpeg/helpers/movie.php b/modules/noffmpeg/helpers/movie.php index 801796b8..40d0940a 100644 --- a/modules/noffmpeg/helpers/movie.php +++ b/modules/noffmpeg/helpers/movie.php @@ -23,6 +23,9 @@ * * Note: by design, this class does not do any permission checking. */ + +include MODPATH . "noffmpeg/libraries/MP4Info.php"; + class movie_Core { static function get_edit_form($movie) { $form = new Forge("movies/update/$movie->id", "", "post", array("id" => "g-edit-movie-form")); @@ -113,7 +116,17 @@ class movie_Core { $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? "video/mp4" : "video/x-flv"; - return array(320, 240, $mime_type, $extension); + $vid_width = 320; + $vid_height = 240; + if (strtolower($extension) == "flv") { + $flvinfo = new FLVMetaData($file_path); + $info = $flvinfo->getMetaData(); + if (($info["width"] != "") && ($info["height"] != "")) { + $vid_width = $info["width"]; + $vid_height = $info["height"]; + } + } + return array($vid_width, $vid_height, $mime_type, $extension); //throw new Exception("@todo MISSING_FFMPEG"); // END rWatcher Edit. } diff --git a/modules/noffmpeg/libraries/FLVMetaData.php b/modules/noffmpeg/libraries/FLVMetaData.php new file mode 100644 index 00000000..bfd8e435 --- /dev/null +++ b/modules/noffmpeg/libraries/FLVMetaData.php @@ -0,0 +1,194 @@ +. + * + * @author Amin Saeedi, + * @copyright Copyright (c) 2009, Amin Saeedi + * @version 1.0 + * + */ +class FLVMetaData { + private $buffer; + private $metaData; + private $fileName; + private $typeFlagsAudio; + private $typeFlagsVideo; + + public $VCidMap = array( + 2=>"Sorenson H.263", + 3=>"Screen Video", + 4=>"VP6", + 5=>"VP6 with Alpha channel", + ); //Video Codec ID(s) + + public $ACidMap = array( + "Linear PCM, platform endian", + "ADPCM", + "MP3", + "Linear PCM, little endian", + "Nellymoser 16-kHz Mono", + "Nellymoser 8-kHz Mono", + "Nellymoser", + "G.711 A-law logarithmic PCM", + "G.711 mu-law logarithmic PCM", + "reserved", + "AAC", + "Speex", + 14=>"MP3 8-Khz", + 15=>"Device-specific sound" + ); //Audio Codec ID(s) + +/** + * CONSTRUCTOR : initialize class members + * + * @param string $flv : flv file path + */ + public function __construct($flv) { + $this->fileName = $flv; + $this->metaData = array( + "duration"=>null, + "size"=>null, + "framerate"=>null, + "width"=>null, + "height"=>null, + "videodatarate"=>null, + "audiodatarate"=>null, + "audiodelay"=>null, + "audiosamplesize"=>null, + "audiosamplerate"=>null, + "audiocodecid"=>null, + "videocodecid"=>null, + "version"=>null, + "headersize"=>0 + ); + } + +/** + * Gets metadata of FLV file + * + * @return array $this->metaData : matadata of FLV + */ + public function getMetaData(){ + if(!file_exists($this->fileName)){ + echo "Error! {$this->fileName} does not exist.
"; + return false; + } + if(!is_readable($this->fileName)){ + echo "Error! Could not read the file. Check the file permissions.
"; + return false; + } + $f = @fopen($this->fileName,"rb"); + if(!$f){ + echo "Unknown Error! Could not read the file.
"; + return; + } + $signature = fread($f,3); + if($signature != "FLV"){ + echo "Error! Wrong file format."; + return false; + } + $this->metaData["version"] = ord(fread($f,1)); + $this->metaData["size"] = filesize($this->fileName); + + $flags = ord(fread($f,1)); + $flags = sprintf("%'04b", $flags); + $this->typeFlagsAudio = substr($flags, 1, 1); + $this->typeFlagsVideo = substr($flags, 3, 1); + + for ($i=0; $i < 4; $i++) { + $this->metaData["headersize"] += ord(fread($f,1)) ; + } + + $this->buffer = fread($f, 400); + fclose($f); + if(strpos($this->buffer, "onMetaData") === false){ + echo "Error! No MetaData Exists."; + return false; + } + + foreach($this->metaData as $k=>$v){ + $this->parseBuffer($k); + } + return $this->metaData; + } + +/** + * Takes a field name of metadata, retrieve it's value and set it in $this->metaData + * + * @param string $fieldName : matadata field name + */ + private function parseBuffer($fieldName){ + $fieldPos = strpos($this->buffer, $fieldName); //get the field position + if($fieldPos !== false){ + $pos = $fieldPos + strlen($fieldName) + 1; + $buffer = substr($this->buffer,$pos); + + $d = ""; + for($i=0; $i < 8;$i++){ + $d .= sprintf("%08b", ord(substr($buffer,$i,1))); + } + + $total = self::bin2Double($d); + $this->metaData[$fieldName] = $total; + } + } + +/** + * Calculates double-precision value of given binary string + * (IEEE Standard 754 - Floating Point Numbers) + * + * @param string binary data $strBin + * @return Float calculated double-precision number + */ + public static function bin2Double($strBin){ + $sb = substr($strBin, 0, 1); // first bit is sign bit + $exponent = substr($strBin, 1, 11); // 11 bits exponent + $fraction = "1".substr($strBin, 12, 52); //52 bits fraction (1.F) + + $s = pow(-1, bindec($sb)); + $dec = pow(2, (bindec($exponent) - 1023)); //Decode exponent + + if($dec == 2047){ + if($fraction == 0){ + if($s==0){ + echo "Infinity"; + }else{ + echo "-Infinity"; + } + }else{ + echo "NaN"; + } + } + + if($dec > 0 && $dec < 2047){ + $t = 1; + for($i=1 ; $i <= 53; $i++){ + $t += ((int)substr($fraction, $i, 1)) * pow(2, -$i); //decode significand + } + $total = $s * $t * $dec ; + return $total; + } + return false; + } +} +?>