43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
/* Set the story priview link. */
|
|
function setPreview()
|
|
{
|
|
if(!$('#story').val())
|
|
{
|
|
$('#preview').addClass('hidden');
|
|
}
|
|
else
|
|
{
|
|
storyLink = createLink('story', 'view', "storyID=" + $('#story').val());
|
|
var concat = config.requestType == 'PATH_INFO' ? '?' : '&';
|
|
storyLink = storyLink + concat + 'onlybody=yes';
|
|
$('#preview').removeClass('hidden');
|
|
$('#preview').attr('href', storyLink);
|
|
}
|
|
}
|
|
|
|
$(function()
|
|
{
|
|
$("#story").chosen({no_results_text: noResultsMatch});
|
|
$("#preview").colorbox({width:960, height:550, iframe:true, transition:'none', scrolling:true});
|
|
})
|
|
|
|
/**
|
|
* Set story field.
|
|
*
|
|
* @access public
|
|
* @return void
|
|
*/
|
|
function setStories()
|
|
{
|
|
moduleID = $('#module').val();
|
|
productID = $('#product').val();
|
|
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&moduleID=' + moduleID);
|
|
$.get(link, function(stories)
|
|
{
|
|
if(!stories) stories = '<select id="story" name="story"></select>';
|
|
$('#story').replaceWith(stories);
|
|
$('#story_chzn').remove();
|
|
$("#story").chosen({no_results_text: ''});
|
|
});
|
|
}
|