Skip to content

Commit

Permalink
Merge pull request civicrm#25 from yashodha/shortcode
Browse files Browse the repository at this point in the history
worked on shortcode for petitions(CRM-12818)
  • Loading branch information
colemanw committed Jul 18, 2013
2 parents 2206374 + 8f83bdb commit 86fcc03
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 82 deletions.
14 changes: 13 additions & 1 deletion civicrm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jQuery(function ($) {

var component = $("#add_civicomponent_id").val();
var shortcode = '[civicrm component="' + component + '"';

switch (component) {
case 'contribution':
shortcode += ' id="' + $("#add_contributepage_id").val() + '"';
Expand All @@ -26,6 +25,9 @@ jQuery(function ($) {
break;
case 'user-dashboard':
break;
case 'petition':
shortcode += ' id="' + $("#add_petition_id").val() + '"';
break;
}
shortcode += ']';
window.send_to_editor(shortcode);
Expand All @@ -37,20 +39,30 @@ jQuery(function ($) {
$('#contribution-section, #component-section').show();
$('#profile-section, #profile-mode-section').hide();
$('#event-section, #action-section-event').hide();
$('#petition-section').hide();
break;
case 'event':
$('#contribution-section').hide();
$('#profile-section, #profile-mode-section').hide();
$('#event-section, #component-section, #action-section-event').show();
$('#petition-section').hide();
break;
case 'profile':
$('#contribution-section, #component-section').hide();
$('#profile-section, #profile-mode-section').show();
$('#event-section, #action-section-event').hide();
$('#petition-section').hide();
break;
case 'petition':
$('#contribution-section, #component-section').hide();
$('#profile-section, #profile-mode-section').hide();
$('#event-section, #action-section-event').hide();
$('#petition-section').show();
break;
default:
$('#contribution-section, #event-section, #component-section, #action-section-event').hide();
$('#profile-section, #profile-mode-section').hide();
$('#petition-section').hide();
break;
}
});
Expand Down
Loading

0 comments on commit 86fcc03

Please sign in to comment.