Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-07-31-15-53-16
[civicrm-core.git] / templates / CRM / Badge / Form / Layout.js
1 // http://civicrm.org/licensing
2 cj(function ($) {
3 function openKCFinder(field) {
4 window.KCFinder = {
5 callBack: function(url) {
6 field.val(url);
7 window.KCFinder = null;
8 }
9 };
10
11 window.open(CRM.kcfinderPath + 'kcfinder/browse.php?cms=civicrm&type=images', 'kcfinder_textbox',
12 'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
13 'resizable=1, scrollbars=0, width=800, height=600'
14 );
15 }
16
17 $('input[id^="image_"]').click(function(){
18 openKCFinder($(this));
19 });
20
21 $('.clear-image').click(function(){
22 $('#' + $(this).attr('imgname')).val('');
23 return false;
24 });
25 });