/*
--------------------------------------------------------------
gm_pdf.js 2007-11-26 pt@gambio
Gambio OHG
http://www.gambio.de
Copyright (c) 2007 Gambio OHG
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
/*
* -> bind functions
*/
$('#colorpicker').ready(function()
{
// -> farbtastic plugin
$('#colorpicker').farbtastic('#color');
// -> manage escaping
$(".close").click(function(){
$("#gm_color_box").hide('normal');
});
// -> manage saving
$(".save").click(function(e)
{
var new_color = $("input#color").val();
var input_ref = $("input#actual").val();
$("#" + input_ref + "_PICKER").css({
"background-color" : new_color
});
$("input#" + input_ref).val(new_color);
$("#gm_color_box").hide('normal');
});
});
/*
* -> get Position
*/
function gm_get_position(event)
{
position = new Array(2);
var left = 0;
var top = 0;
var element_width = $('#gm_color_box').outerWidth();
var element_height = $('#gm_color_box').outerHeight();
var browser_width = $(document).width();
var browser_scroll_top = $(document).scrollTop();
var browser_scroll_left = $(document).scrollLeft();
var browser_height = $(window).height();
if(element_width + event.pageX > browser_width + browser_scroll_left)
{
position['left'] = browser_width + browser_scroll_left - element_width - 30;
}
else
{
position['left'] = event.pageX;
}
if(element_height + event.pageY > browser_height + browser_scroll_top)
{
position['top'] = browser_height + browser_scroll_top - element_height - 10;
}
else
{
position['top'] = event.pageY;
}
return position;
}
/*
* -> load contents
*/
function gm_get_content(action, submenu, submenu_link)
{
// -> show image while loading
$("#gm_box_content").html('<img src="../images/loading.gif" WIDTH="16" HEIGHT="16" BORDER="0" ALT="loading">');
// -> hide the color picker box
$("#gm_color_box").hide('normal');
// -> load contents
$("#gm_box_content").load(
action,
{},
function()
{
if(submenu == 'gm_pdf_content')
{
$("#gm_box_submenu").show('fast');
$("#gm_box_submenu").load(submenu_link);
}
else if(submenu == 'gm_pdf_conf')
{
$("#gm_box_submenu").show('fast');
$("#gm_box_submenu").load(submenu_link);
}
else if(submenu == 'gm_pdf_fonts')
{
$("#gm_box_submenu").hide('fast');
$.each($('#gm_pdf_form').get(0).elements, function(k, ele)
{
$("#" + ele.id + '_PICKER').click(function(e)
{
var position = gm_get_position(e);
$("#gm_color_box").show('normal');
$("input#color").val($("input#" + ele.id).val());
$("input#actual").val(ele.id);
$("#gm_color_box").css(
{
"position" : "absolute",
"top": position['top'] + "px",
"left": position['left'] + "px"
});
$("#color").css(
{
"background-color" : $("input#" + ele.id).val()
});
});
});
}
else
{
$("#gm_box_submenu").hide('fast');
}
}
);
}
/*
* -> update content 'get'
*/
function gm_update_boxes(action, box)
{
$("#gm_status").html('<img src="../images/loading.gif" WIDTH="16" HEIGHT="16" BORDER="0" ALT="loading">');
var getString = '';
$.each(
$('#gm_pdf_form').get(0).elements, function(k, ele)
{
if(ele.id != '' && ele.id.search(/PICKER/) == -1) {
getString = ele.id + "=" + encodeURIComponent(ele.value) + '&' + getString;
}
});
getString = getString.substr(0, getString.length-1);
gm_fadein_boxes(box);
$.ajax(
{
type: "POST",
url: action,
data: getString,
timeout: 2000,
success: function (msg) {
$("#" + box).html(msg);
}
});
}
/*
* -> update content 'post'
*/
function gm_post_boxes(action, box)
{
// -> show image while loading
$("#gm_status").html('<img src="../images/loading.gif" WIDTH="16" HEIGHT="16" BORDER="0" ALT="loading">');
gm_fadein_boxes(box);
$.post(
action,
{
GM_PDF_HEADING_CONDITIONS: $("#GM_PDF_HEADING_CONDITIONS").val(),
GM_PDF_HEADING_WITHDRAWAL: $("#GM_PDF_HEADING_WITHDRAWAL").val(),
GM_PDF_CONDITIONS: $("#GM_PDF_CONDITIONS").val(),
GM_PDF_WITHDRAWAL: $("#GM_PDF_WITHDRAWAL").val()
},
function(data)
{
$("#" + box).html(data);
}
);
}
/*
* -> update color
*/
function gm_update_color(box)
{
$("#" + box + '_PICKER').css(
{
"background-color" : $("input#" + box).val()
});
}
/*
* -> fade out boxes
*/
function gm_fadeout_boxes(box)
{
$("#" + box).fadeOut('normal');
}
/*
* -> hide boxes
*/
function gm_hide_boxes(box)
{
$("#" + box).hide('fast');
}
/*
* -> fade in boxes
*/
function gm_fadein_boxes(box)
{
$("#" + box).fadeIn('normal');
}| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| ClearCache.js | 2013-11-12 20:53 | 1.43 KB | 76129f60960:kunden | -xw-x----- | |
| GMFavMaster.js | 2013-11-12 20:53 | 5.4 KB | 76129f60960:kunden | -xw-x----- | |
| GMLangEdit.js | 2013-11-12 20:53 | 3.36 KB | 76129f60960:kunden | -xw-x----- | |
| GMLeftBoxes.js | 2013-11-12 20:53 | 2.24 KB | 76129f60960:kunden | -xw-x----- | |
| LoadPayPalAdminNotification.js | 2013-11-12 20:53 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| LoadUrl.js | 2013-11-12 20:53 | 1.47 KB | 76129f60960:kunden | -xw-x----- | |
| PayPalApiCheck.js | 2013-11-12 20:53 | 1.21 KB | 76129f60960:kunden | -xw-x----- | |
| ShowLog.js | 2013-11-12 20:53 | 3.69 KB | 76129f60960:kunden | -xw-x----- | |
| gm_bookmarks.js | 2013-11-12 20:53 | 1.87 KB | 76129f60960:kunden | -xw-x----- | |
| gm_counter.js | 2013-11-12 20:53 | 4.15 KB | 76129f60960:kunden | -xw-x----- | |
| gm_ebay.js | 2013-11-12 20:53 | 742 B | 76129f60960:kunden | -xw-x----- | |
| gm_gprint.js.php | 2013-11-12 20:53 | 2.2 KB | 76129f60960:kunden | -xw-x----- | |
| gm_invoicing.js | 2013-11-12 20:53 | 1.2 KB | 76129f60960:kunden | -xw-x----- | |
| gm_logo.js | 2013-11-12 20:53 | 2.14 KB | 76129f60960:kunden | -xw-x----- | |
| gm_modules.js | 2013-11-12 20:53 | 1.17 KB | 76129f60960:kunden | -xw-x----- | |
| gm_orders.js | 2013-11-12 20:53 | 4.41 KB | 76129f60960:kunden | -xw-x----- | |
| gm_pdf.js | 2013-11-12 20:53 | 5.17 KB | 76129f60960:kunden | -xw-x----- | |
| gm_sitemap.js | 2013-11-12 20:53 | 1.54 KB | 76129f60960:kunden | -xw-x----- | |
| gm_style_edit.js | 2013-11-12 20:53 | 2.46 KB | 76129f60960:kunden | -xw-x----- | |
| google_categories_administration.js | 2013-11-12 20:53 | 8.04 KB | 76129f60960:kunden | -xw-x----- | |
| image_mapper.js | 2013-11-12 20:53 | 47.22 KB | 76129f60960:kunden | -xw-x----- | |
| lettr_de.js | 2013-11-12 20:53 | 2.43 KB | 76129f60960:kunden | -xw-x----- | |
| lightbox_google_admin_categories.js | 2013-11-12 20:53 | 13.2 KB | 76129f60960:kunden | -xw-x----- | |
| lightbox_plugin.js | 2013-11-12 20:53 | 5.91 KB | 76129f60960:kunden | -xw-x----- | |