Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted indentation from tabs to spaces.
- Loading branch information
Thomas von Deyen
committed
May 14, 2012
1 parent
b354d63
commit b029b2c
Showing
120 changed files
with
5,023 additions
and
5,036 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
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 |
---|---|---|
@@ -1,65 +1,65 @@ | ||
var AlchemyCrm = {}; | ||
(function($) { | ||
|
||
AlchemyCrm = { | ||
AlchemyCrm = { | ||
|
||
toggleLabel : function(link, hidetext, showtext) { | ||
if ($(link).text() === showtext) { | ||
$(link).text(hidetext); | ||
} else { | ||
$(link).text(showtext); | ||
} | ||
}, | ||
toggleLabel : function(link, hidetext, showtext) { | ||
if ($(link).text() === showtext) { | ||
$(link).text(hidetext); | ||
} else { | ||
$(link).text(showtext); | ||
} | ||
}, | ||
|
||
removeContactGroupFilter : function(element, id, count) { | ||
$(element).parent().parent('.filter').remove(); | ||
$( | ||
'#filter_container' | ||
).append( | ||
'<input type="hidden" name="contact_group[filters_attributes]['+count+'][_destroy]" value=1>' | ||
).append( | ||
'<input type="hidden" name="contact_group[filters_attributes]['+count+'][id]" value='+id+'>' | ||
); | ||
}, | ||
removeContactGroupFilter : function(element, id, count) { | ||
$(element).parent().parent('.filter').remove(); | ||
$( | ||
'#filter_container' | ||
).append( | ||
'<input type="hidden" name="contact_group[filters_attributes]['+count+'][_destroy]" value=1>' | ||
).append( | ||
'<input type="hidden" name="contact_group[filters_attributes]['+count+'][id]" value='+id+'>' | ||
); | ||
}, | ||
|
||
teasablesFilter : function(value) { | ||
var teasables = $('#teasable_elements .teasable_page'); | ||
if (value === '') { | ||
teasables.each(function(t) { t.show(); }); | ||
} | ||
else { | ||
teasables.each(function(el) { | ||
if (el.attr('id').replace('teasable_page_', '') != value) { | ||
el.hide(); | ||
} else { | ||
el.show(); | ||
} | ||
}); | ||
} | ||
}, | ||
teasablesFilter : function(value) { | ||
var teasables = $('#teasable_elements .teasable_page'); | ||
if (value === '') { | ||
teasables.each(function(t) { t.show(); }); | ||
} | ||
else { | ||
teasables.each(function(el) { | ||
if (el.attr('id').replace('teasable_page_', '') != value) { | ||
el.hide(); | ||
} else { | ||
el.show(); | ||
} | ||
}); | ||
} | ||
}, | ||
|
||
text_view_active : false, | ||
text_view_active : false, | ||
|
||
togglePreviewFrame : function(btn, text_url, html_url) { | ||
var $frame = $('iframe#alchemyPreviewWindow'); | ||
var $btn = $(btn).parent(); | ||
var $spin = $('#preview_load_info'); | ||
$frame.load(function() { | ||
$spin.hide(); | ||
}); | ||
if (AlchemyCrm.text_view_active) { | ||
$frame.attr('src', html_url); | ||
AlchemyCrm.text_view_active = false; | ||
$btn.removeClass('active'); | ||
} else { | ||
$frame.attr('src', text_url); | ||
AlchemyCrm.text_view_active = true; | ||
$btn.addClass('active'); | ||
} | ||
$spin.show(); | ||
return false; | ||
} | ||
togglePreviewFrame : function(btn, text_url, html_url) { | ||
var $frame = $('iframe#alchemyPreviewWindow'); | ||
var $btn = $(btn).parent(); | ||
var $spin = $('#preview_load_info'); | ||
$frame.load(function() { | ||
$spin.hide(); | ||
}); | ||
if (AlchemyCrm.text_view_active) { | ||
$frame.attr('src', html_url); | ||
AlchemyCrm.text_view_active = false; | ||
$btn.removeClass('active'); | ||
} else { | ||
$frame.attr('src', text_url); | ||
AlchemyCrm.text_view_active = true; | ||
$btn.addClass('active'); | ||
} | ||
$spin.show(); | ||
return false; | ||
} | ||
|
||
} | ||
} | ||
|
||
})(jQuery); |
Oops, something went wrong.