/* 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 = ''; $('#story').replaceWith(stories); $('#story_chzn').remove(); $("#story").chosen({no_results_text: ''}); }); }