-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77b26a0
commit 3eaa6ea
Showing
3 changed files
with
65 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
function jInsertFieldValue(value, id) { | ||
var $ = jQuery.noConflict(); | ||
var old_value = $("#" + id).val(); | ||
if (old_value != value) { | ||
var $elem = $("#" + id); | ||
$elem.val(value); | ||
$elem.trigger("change"); | ||
if (typeof($elem.get(0).onchange) === "function") { | ||
$elem.get(0).onchange(); | ||
} | ||
jMediaRefreshPreview(id); | ||
} | ||
} | ||
|
||
function jMediaRefreshPreview(id) { | ||
var $ = jQuery.noConflict(); | ||
var value = $("#" + id).val(); | ||
var $img = $("#" + id + "_preview"); | ||
var basepath = $("#" + id).data("basepath"); | ||
|
||
if ($img.length) { | ||
if (value) { | ||
$img.attr("src", basepath + value); | ||
$("#" + id + "_preview_empty").hide(); | ||
$("#" + id + "_preview_img").show() | ||
} else { | ||
$img.attr("src", ""); | ||
$("#" + id + "_preview_empty").show(); | ||
$("#" + id + "_preview_img").hide(); | ||
} | ||
} | ||
} | ||
|
||
function jMediaRefreshPreviewTip(tip) | ||
{ | ||
var $ = jQuery.noConflict(); | ||
var $tip = $(tip); | ||
var $img = $tip.find("img.media-preview"); | ||
|
||
$img.each(function(index, value) { | ||
$tip.find("div.tip").css("max-width", "none"); | ||
var id = $(this).attr("id"); | ||
id = id.substring(0, id.length - "_preview".length); | ||
jMediaRefreshPreview(id); | ||
$tip.show(this); | ||
}); | ||
} | ||
|
||
// JQuery for tooltip for INPUT showing whole image path | ||
function jMediaRefreshImgpathTip(tip, els) | ||
{ | ||
var $ = jQuery.noConflict(); | ||
var $tip = $(tip); | ||
$tip.css("max-width", "none"); | ||
var $imgpath = $(els).val(); | ||
$("#TipImgpath").html($imgpath); | ||
|
||
if ($imgpath.length) { | ||
$tip.show(); | ||
} else { | ||
$tip.hide(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.