var destination = h.split("-")[0];\r
FileBrowser.id = h.split("-")[1];\r
FileBrowser.event = FileBrowser.event + "." + destination;\r
- if (destination == "comment") {\r
+ if (destination === "comment") {\r
// Get the comment textimput field\r
var commentElm = document.getElementById("comment-edit-text-" + FileBrowser.id);\r
}\r
};\r
\r
- console.log("FileBrowser:", nickname, type,FileBrowser.event, FileBrowser.id );\r
+ console.log("FileBrowser: " + nickname, type, FileBrowser.event, FileBrowser.id);\r
\r
FileBrowser.postLoad();\r
\r
- $(".error a.close").on("click", function(e) {\r
+ $(".error .close").on("click", function(e) {\r
e.preventDefault();\r
$(".error").addClass("hidden");\r
});\r
e.preventDefault();\r
\r
var embed = "";\r
- if (FileBrowser.type == "image") {\r
- embed = "[url="+this.dataset.link+"][img]"+this.dataset.img+"[/img][/url]";\r
+ if (FileBrowser.type === "image") {\r
+ embed = "[url=" + this.dataset.link + "][img]" + this.dataset.img + "[/img][/url]";\r
}\r
- if (FileBrowser.type == "file") {\r
+ if (FileBrowser.type === "file") {\r
// attachment links are "baseurl/attach/id"; we need id\r
- embed = "[attachment]"+this.dataset.link.split("/").pop()+"[/attachment]";\r
+ embed = "[attachment]" + this.dataset.link.split("/").pop() + "[/attachment]";\r
}\r
\r
// Delete prefilled Text of the comment input\r
// work as expected (we need a way to wait until commentOpenUI would be finished).\r
// As for now we insert pieces of this function here\r
if ((commentElm !== null) && (typeof commentElm !== "undefined")) {\r
- if (commentElm.value == "") {\r
+ if (commentElm.value === "") {\r
$("#comment-edit-text-" + FileBrowser.id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");\r
$("#comment-edit-submit-wrapper-" + FileBrowser.id).show();\r
$("#comment-edit-text-" + FileBrowser.id).attr('tabindex','9');\r
}\r
\r
}\r
+\r
console.log(FileBrowser.event, this.dataset.filename, embed, FileBrowser.id);\r
+\r
parent.$("body").trigger(FileBrowser.event, [\r
this.dataset.filename,\r
embed,\r
//AjaxUpload for images\r
var image_uploader = new window.AjaxUpload(\r
'upload-image',\r
- { action: 'wall_upload/'+FileBrowser.nickname+'?response=json&album=' + albumname,\r
+ { action: 'wall_upload/' + FileBrowser.nickname + '?response=json&album=' + albumname,\r
name: 'userfile',\r
responseType: 'json',\r
- onSubmit: function(file,ext) {\r
+ onSubmit: function(file, ext) {\r
$(".fbrowser-content").hide();\r
$(".fbrowser .profile-rotator-wrapper").show();\r
$(".error").addClass('hidden');\r
},\r
onComplete: function(file,response) {\r
- if (response['error']!= undefined) {\r
+ if (response['error'] != undefined) {\r
$(".error span").html(response['error']);\r
$(".error").removeClass('hidden');\r
$(".fbrowser .profile-rotator-wrapper").hide();\r
+ $(".fbrowser-content").show();\r
return;\r
}\r
\r
'upload-file',\r
{ action: 'wall_attach/' + FileBrowser.nickname + '?response=json',\r
name: 'userfile',\r
- onSubmit: function(file,ext) {\r
+ onSubmit: function(file, ext) {\r
$(".fbrowser-content").hide();\r
$(".fbrowser .profile-rotator-wrapper").show();\r
$(".error").addClass('hidden');\r
$(".error span").html(response['error']);\r
$(".error").removeClass('hidden');\r
$('#profile-rotator').hide();\r
+ $(".fbrowser-content").show();\r
return;\r
}\r
\r
$(".fbrowser .fbswitcher [data-mode=" + FileBrowser.type + "]").addClass("active");\r
// We need to add the AjaxUpload to the button\r
FileBrowser.uploadButtons();\r
- \r
},\r
\r
// Load new content (e.g. change photo album)\r
$(".fbrowser .profile-rotator-wrapper").show();\r
\r
// load new content to fbrowser window\r
- $(".fbrowser").load(url, function(responseText, textStatus){\r
+ $(".fbrowser").load(url, function(responseText, textStatus) {\r
$(".profile-rotator-wrapper").hide();\r
if (textStatus === 'success') {\r
$(".fbrowser_content").show();\r
initGallery: function() {\r
$(".fbrowser.image .fbrowser-content-container").justifiedGallery({\r
'rowHeight': 80,\r
- 'margins': 3,\r
+ 'margins': 4,\r
'border': 0\r
});\r
}\r