<div class="description">{ts}Put in the API method name. You need to enter pieces of full API function name as described in the documentation.{/ts}</div>
<script>
{literal}
+CRM.$(function($) {
function assembleName( ) {
// dunno yet
var apiName = "";
// building prefix
- if( cj('#api_action').val() == '' ) {
- cj('#fname').html( "<em>API name will start appearing here as you type in fields below.</em>" );
+ if( $('#api_action').val() == '' ) {
+ $('#fname').html( "<em>API name will start appearing here as you type in fields below.</em>" );
return;
}
- apiPrefix = 'api'
+ var apiPrefix = 'api'
// building entity
- var apiEntity = cj('#api_entity').val().replace( /([A-Z])/g, function($1) {
- return $1.toLowerCase();
- });
+ var apiEntity = $('#api_entity').val().replace( /([A-Z])/g, function($1) {
+ return $1.toLowerCase();
+ });
// building action
- var apiAction = cj('#api_action').val().replace(/(\_[a-z])/g, function($1) {return $1.toUpperCase().replace('_','');});
+ var apiAction = $('#api_action').val().replace(/(\_[a-z])/g, function($1) {return $1.toUpperCase().replace('_','');});
apiName = apiPrefix + '.' + apiEntity + '.' + apiAction;
- cj('#fname').text( apiName );
+ $('#fname').text( apiName );
}
// bind to different events to build API name live
- cj(document).ready( function() { assembleName() } );
- cj('#api_entity').change( function() { assembleName() } );
- cj('#api_action').keyup( function() { assembleName() } );
+ $('#api_entity').change(assembleName)
+ $('#api_action').change(assembleName).keyup(assembleName);
+ assembleName();
+});
{/literal}
</script>
<td class="label">{$form.wysiwyg_input_format.label}</td>
<td>
{$form.wysiwyg_input_format.html}{literal}
- <script type="text/javascript">cj(document).ready(function () {
- if (cj('#editor_id').val() == 4) {
- cj('#crm-preferences-display-form-block-wysiwyg_input_format').show();
+ <script type="text/javascript">
+ CRM.$(function($) {
+ if ($('#editor_id').val() == 4) {
+ $('#crm-preferences-display-form-block-wysiwyg_input_format').show();
}
- });</script>
+ });
+ </script>
{/literal}
<br/>
<span class="description">
{literal}
<script type="text/javascript">
-cj( document ).ready( function( ) {
+ CRM.$(function($) {
{/literal}{if $customDataSubType}
- CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
- {else}
- CRM.buildCustomData( '{$customDataType}' );
- {/if}
+ CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
+ {else}
+ CRM.buildCustomData( '{$customDataType}' );
+ {/if}
{literal}
-});
+ });
</script>
{/literal}
}, "json" );
}
- cj(document).ready( function( ) {
+ CRM.$(function($) {
showOptionSelect( );
});
{include file="CRM/common/customData.tpl"}
{literal}
<script type="text/javascript">
- cj(document).ready(function() {
- var customDataSubType = cj('#case_type_id').val();
+ CRM.$(function($) {
+ var customDataSubType = $('#case_type_id').val();
if ( customDataSubType ) {
CRM.buildCustomData( {/literal}'{$customDataType}'{literal}, customDataSubType );
} else {
{literal}
<script type="text/javascript">
- cj(document).ready(function() {
+ CRM.$(function($) {
//build data source form block
buildDataSourceFormBlock();
buildSubTypes();
<script type="text/javascript">
{literal}
- cj(document).ready( function() {
- var tabId = cj.fn.dataTableSettings[0].sInstance;
+ CRM.$(function($) {
+ var tabId = $.fn.dataTableSettings[0].sInstance;
- cj('table#'+ tabId).dataTable().fnSettings().aoDrawCallback.push( {
- "fn": function () {
- cj('#'+ tabId +' tr').each( function() {
- drawCommentRows(this.id)
- });
- },
- "sName": "user"
- } );
- });
+ $('table#'+ tabId).dataTable().fnSettings().aoDrawCallback.push( {
+ "fn": function () {
+ $('#'+ tabId +' tr').each( function() {
+ drawCommentRows(this.id)
+ });
+ },
+ "sName": "user"
+ } );
+ });
{/literal}
</script>
<script type="text/javascript">
var pay_later_sel = "input#{$form.is_pay_later.name}";
{literal}
-cj("document").ready(function() {
+CRM.$(function($) {
function refresh() {
- var is_pay_later = cj(pay_later_sel).prop("checked");
- cj(".credit_card_info-group").toggle(!is_pay_later);
- cj(".pay-later-instructions").toggle(is_pay_later);
- cj("div.billingNameInfo-section .description").html(is_pay_later ? "Enter the billing address at which you can be invoiced." : "Enter the name as shown on your credit or debit card, and the billing address for this card.");
+ var is_pay_later = $(pay_later_sel).prop("checked");
+ $(".credit_card_info-group").toggle(!is_pay_later);
+ $(".pay-later-instructions").toggle(is_pay_later);
+ $("div.billingNameInfo-section .description").html(is_pay_later ? "Enter the billing address at which you can be invoiced." : "Enter the name as shown on your credit or debit card, and the billing address for this card.");
}
- cj("input#source").prop('disabled', true);
+ $("input#source").prop('disabled', true);
- cj(pay_later_sel).change(function() {
+ $(pay_later_sel).change(function() {
refresh();
});
- cj(".payment_type-section :radio").change(function() {
- var sel = cj(this).attr("id");
- cj(".check_number-section").toggle(
- cj(this).is(":checked") &&
- cj("label[for="+sel+"]").html() == "{/literal}{ts escape='js'}Check{/ts}{literal}"
+ $(".payment_type-section :radio").change(function() {
+ var sel = $(this).attr("id");
+ $(".check_number-section").toggle(
+ $(this).is(":checked") &&
+ $("label[for="+sel+"]").html() == "{/literal}{ts escape='js'}Check{/ts}{literal}"
);
});
refresh();
{include file="CRM/common/customData.tpl"}
{literal}
<script type="text/javascript">
- cj(document).ready(function() {
+ CRM.$(function($) {
{/literal}
{if $customDataSubType}
CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
displayMessage( true );
}
-cj(document).ready(function() {
+CRM.$(function($) {
//FIX ME: by default load 2 blocks and hide add and delete links
//we should make additional block function more flexible to set max block limit
buildBlocks('Email');
// build blocks only if it is not built
function buildBlocks(element) {
- if (!cj('[id='+ element +'_Block_2]').length) {
+ if (!$('[id='+ element +'_Block_2]').length) {
buildAdditionalBlocks(element, 'CRM_Event_Form_ManageEvent_Location');
}
}
hideAddDeleteLinks('Email');
hideAddDeleteLinks('Phone');
function hideAddDeleteLinks(element) {
- cj('#add'+ element).hide();
- cj('[id='+ element +'_Block_2] a:last').hide();
+ $('#add'+ element).hide();
+ $('[id='+ element +'_Block_2] a:last').hide();
}
- cj('#loc_event_id').change(function() {
- cj.ajax({
+ $('#loc_event_id').change(function() {
+ $.ajax({
url: CRM.url('civicrm/ajax/locBlock', 'reset=1'),
type: 'POST',
- data: {'lbid': cj(this).val()},
+ data: {'lbid': $(this).val()},
dataType: 'json',
success: function(data) {
- var selectLocBlockId = cj('#loc_event_id').val();
+ var selectLocBlockId = $('#loc_event_id').val();
for(i in data) {
if ( i == 'count_loc_used' ) {
if ( ((selectLocBlockId == locBlockId) && data['count_loc_used'] > 1) ||
}
} else {
if (i == 'phone_1_phone_type_id' || i == 'phone_2_phone_type_id') {
- cj('#'+i).select2('val', data[i]);
+ $('#'+i).select2('val', data[i]);
}
else {
- cj('#'+i).val(data[i]);
+ $('#'+i).val(data[i]);
}
}
}
});
function displayMessage( set ) {
- cj(document).ready(function() {
+ CRM.$(function($) {
if ( set ) {
- cj('#locUsedMsg').html( locUsedMsgTxt ).addClass('status');
+ $('#locUsedMsg').html( locUsedMsgTxt ).addClass('status');
} else {
- cj('#locUsedMsg').html( ' ' ).removeClass('status');
+ $('#locUsedMsg').html( ' ' ).removeClass('status');
}
});
}
{literal}
<script type="text/javascript">
- cj(document).ready( function( ) {
- var archiveOption = cj("input[name^='is_archived']:radio");
- cj('#status_unscheduled').change(function() {
- if (cj(this).prop('checked') ) {
+ CRM.$(function($) {
+ var archiveOption = $("input[name^='is_archived']:radio");
+ $('#status_unscheduled').change(function() {
+ if ($(this).prop('checked') ) {
archiveOption.prop({checked: false, disabled: true}).change();
} else {
archiveOption.prop('disabled', false);
}
}).trigger('change');
archiveOption.change(function() {
- if (cj("input[name^='is_archived']:radio:checked").length) {
- cj('#status_unscheduled').prop({checked: false, disabled: true}).change();
+ if ($("input[name^='is_archived']:radio:checked").length) {
+ $('#status_unscheduled').prop({checked: false, disabled: true}).change();
} else {
- cj('#status_unscheduled').prop('disabled', false);
+ $('#status_unscheduled').prop('disabled', false);
}
}).trigger('change');
});
</div>
{literal}
<script type="text/javascript">
-cj(document).ready( function() {
- cj('#adjust-option-type').hide();
-});
-function adjustPayment( ) {
-cj('#adjust-option-type').show();
-cj("#scheduled_amount").removeAttr("READONLY");
-cj("#scheduled_amount").css('background-color', '#ffffff');
-}
+ CRM.$(function($) {
+ $('#adjust-option-type').hide();
+ });
+ function adjustPayment( ) {
+ cj('#adjust-option-type').show();
+ cj("#scheduled_amount").removeAttr("READONLY").css('background-color', '#ffffff');
+ }
</script>
{/literal}
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj(document).on('blur', '.distribute', function() {
+ $(document).on('blur', '.distribute', function() {
var totalAmount = 0;
- cj('.distribute').each(function (){
- if(cj(this).val( ).length > 0){
- totalAmount = parseFloat( totalAmount ) + parseFloat( cj(this).val( ) );
+ $('.distribute').each(function (){
+ if($(this).val( ).length > 0){
+ totalAmount = parseFloat( totalAmount ) + parseFloat( $(this).val( ) );
}
});
- cj('.editPayment').text('$ '+totalAmount);
+ $('.editPayment').text('$ '+totalAmount);
var unlocateAmount = '{/literal}{$total}{literal}';
- cj('.unlocateAmount').text('$ '+(unlocateAmount - totalAmount));
+ $('.unlocateAmount').text('$ '+(unlocateAmount - totalAmount));
});
});
</script>
var pPartiRef = Array( );
var optionSep = '|';
- cj(document).ready( function( ) {
+ CRM.$(function($) {
pricesetParticipantCount( );
allowGroupOnWaitlist(0, pPartiCount);
});
{/if}
{literal}
<script type="text/javascript">
-cj(document).ready(function($) {
+CRM.$(function($) {
{/literal}
var comma = '{$config->monetaryThousandSeparator}';
var dot = '{$config->monetaryDecimalPoint}';
{literal}
<script type="text/javascript">
- cj(document).ready(function() {
- cj('#title').data('initial_value', cj('#title').val());
- });
CRM.$(function($) {
var formName = {/literal}"{$form.formName}"{literal};
+ $('#title').data('initial_value', $('#title').val());
$('#_qf_' + formName + '_submit_save').click (
function(){
if ( $('#is_navigation').prop('checked') && $('#parent_id').val() == '') {