39 lines
17 KiB
JavaScript
39 lines
17 KiB
JavaScript
var CommunityVoiceResourcesInitiative=GetJson("/Admin/CommunityVoice/Initiative/Localization");$.fn.ValueToCSV=function(){return $(this).map(function(){return this.value}).get().join()};
|
|
$(function(){$(".sidebar .buttons .saveChanges").click(function(){ValidateFields()&&(document.aspnetForm.action="/Admin/CommunityVoice/Initiative/Edit",document.aspnetForm.submit())});$(".sidebar .buttons .saveAndSubmit").click(function(){ValidateFields()&&(document.aspnetForm.action="/Admin/CommunityVoice/Initiative/Edit?submit\x3dtrue",document.aspnetForm.submit())});$(".sidebar .buttons .saveAndPublish").click(function(){ValidateFields()&&(document.aspnetForm.action="/Admin/CommunityVoice/Initiative/Edit?publish\x3dtrue",
|
|
document.aspnetForm.submit())})});function ValidateFields(){return""==$("#CategoryName").val()?(alert(CommunityVoiceResourcesInitiative.InitiativeNameTooShort),!1):255<$("textarea[name\x3dDescription]").val().length?(alert(CommunityVoiceResourcesInitiative.InitiativeDescriptionTooLong),!1):!0}
|
|
$(document).ready(function(){$.ajaxSetup({cache:!1});"undefined"!=typeof LiveEditMenu&&(LiveEditMenu.callBack=ReloadCommunityVoice);document.getElementById("ysnLiveEditShowAllItemsAndCategoriesKAMs")&&document.getElementById("ysnLiveEditShowAllItemsAndCategoriesKAMs").checked?$(".liveEditControl").show():$(".liveEditControl").hide()});
|
|
function SaveInitiative(c,a){var m="",f="",l="",p="",n="",y="false";ValidateFields()&&($('input[name\x3d"txtGroupViewList"]:checked').each(function(){m=m+","+$(this).val()}),m=m.substring(1),$('input[name\x3d"txtGroupReadOnlyList"]:checked').each(function(){f=f+","+$(this).val()}),f=f.substring(1),$('input[name\x3d"txtGroupAuthorList"]:checked').each(function(){l=l+","+$(this).val()}),l=l.substring(1),$('input[name\x3d"txtGroupPublishList"]:checked').each(function(){p=p+","+$(this).val()}),p=p.substring(1),
|
|
$('input[name\x3d"txtGroupOwnerList"]:checked').each(function(){n=n+","+$(this).val()}),n=n.substring(1),$('input[name\x3d"ShowArchive"]').is(":checked")&&(y="true"),y={CategoryID:$("#CommunityVoiceCategoryID").val(),CategoryName:$("#CategoryName").val(),Description:$("#txtDescription").val(),ShowArchive:y,txtGroupViewList:m,txtGroupReadOnlyList:f,txtGroupAuthorList:l,txtGroupPublishList:p,txtGroupOwnerList:n,publish:c,submit:a,IconID:$("#iconID").val()},$.ajax({url:"/Admin/CommunityVoice/Initiative/LiveEdit",
|
|
type:"post",data:y,success:function(a){ReloadCommunityVoice();closeCpModal()},error:function(a,c,f){blockMenuSpawn=!1;alert("Error: "+a.statusText+"\nStatus: "+a.status)}}))}function ReloadCommunityVoice(){$(".listing.initiatives .list").load("/CommunityVoice/InitiativeList")}function changePage(c,a){loadIdeaPageList(a,$("#paginationOption").val())}
|
|
function loadIdeaPageList(c,a){var m=$("#divIdeaList"),f="",f=$(".listing.ideas .tabs li.active").text().toLowerCase();"newest"==f&&(f="Date");f=0<actionUrlIdeaList.indexOf("searchPhrase\x3d")?actionUrlIdeaList.replace("/Admin","")+"\x26page\x3d"+c:actionUrlIdeaList+"\x26Tab\x3d"+f+"\x26MineFilter\x3d"+$("#MineFilter").val()+"\x26page\x3d"+c+"\x26noOfItemsPerPage\x3d"+a;""!=f&&redrawPanel(f,m,"get")}
|
|
function redrawPanel(c,a,m,f){$.ajax({url:c,type:m,cache:!1,data:{currentComment:f},success:function(c){c.ErrorMessage?alert(c.ErrorMessage):a.html(c)},beforeSend:function(){ajaxPostBackStart("Loading")},complete:function(){ajaxPostBackEnd()}})}
|
|
(function(c){c.fn.bxSlider=function(a){function m(a,b,d,e){var f=[],h=d,g=!1;"backward"==e&&(a=c.makeArray(a),a.reverse());for(;0<h;)c.each(a,function(a,v){if(0<h)g?(f.push(c(this).clone()),h--):a==b&&(g=!0,f.push(c(this).clone()),h--);else return!1});return f}function f(a,b){if("left"==b)var d=c(".pager",g).eq(a).position().left;else"top"==b&&(d=c(".pager",g).eq(a).position().top);return d}function l(){!a.infiniteLoop&&a.hideControlOnEnd&&(b==I?c(".bx-prev",g).hide():c(".bx-prev",g).show(),b==A?
|
|
c(".bx-next",g).hide():c(".bx-next",g).show())}function p(b,d,e,f){q=c('\x3ca href\x3d"" class\x3d"bx-start"\x3e\x3c/a\x3e');J="text"==b?d:'\x3cimg src\x3d"'+d+'" /\x3e';K="text"==e?f:'\x3cimg src\x3d"'+f+'" /\x3e';a.autoControlsSelector?c(a.autoControlsSelector).append(q):(g.append('\x3cdiv class\x3d"bx-auto"\x3e\x3c/div\x3e'),c(".bx-auto",g).html(q));q.click(function(){a.ticker?c(this).hasClass("stop")?h.stopTicker():c(this).hasClass("start")&&h.startTicker():c(this).hasClass("stop")?h.stopShow(!0):
|
|
c(this).hasClass("start")&&h.startShow(!0);return!1})}function n(){var v=c("img",d.eq(b)).attr("title");""!=v?a.captionsSelector?c(a.captionsSelector).html(v):c(".bx-captions",g).html(v):a.captionsSelector?c(a.captionsSelector).html("\u00a0"):c(".bx-captions",g).html("\u00a0")}function y(b){var e=d.length;1<a.moveSlideQty&&(e=0!=d.length%a.moveSlideQty?Math.ceil(d.length/a.moveSlideQty):d.length/a.moveSlideQty);var f="";if(a.buildPager)for(b=0;b<e;b++)f+=a.buildPager(b,d.eq(b*a.moveSlideQty));else if("full"==
|
|
b)for(b=1;b<=e;b++)f+='\x3ca href\x3d"" class\x3d"pager-link pager-'+b+'"\x3e'+b+"\x3c/a\x3e";else"short"==b&&(f='\x3cspan class\x3d"bx-pager-current"\x3e'+(a.startingSlide+1)+"\x3c/span\x3e "+a.pagerShortSeparator+' \x3cspan class\x3d"bx-pager-total"\x3e'+d.length+"\x3c/span\x3e");a.pagerSelector?(c(a.pagerSelector).append(f),w=c(a.pagerSelector)):(e=c('\x3cdiv class\x3d"bx-pager"\x3e\x3c/div\x3e'),e.append(f),"top"==a.pagerLocation?g.prepend(e):"bottom"==a.pagerLocation&&g.append(e),w=c(".bx-pager",
|
|
g));w.children().click(function(){if("full"==a.pagerType){var b=w.children().index(this);1<a.moveSlideQty&&(b*=a.moveSlideQty);h.goToSlide(b)}return!1})}function R(b,d,e,f){var l=c('\x3ca href\x3d"" class\x3d"bx-next"\x3e\x3c/a\x3e'),k=c('\x3ca href\x3d"" class\x3d"bx-prev"\x3e\x3c/a\x3e');"text"==b?l.html(d):l.html('\x3cimg src\x3d"'+d+'" /\x3e');"text"==e?k.html(f):k.html('\x3cimg src\x3d"'+f+'" /\x3e');a.prevSelector?c(a.prevSelector).append(k):g.append(k);a.nextSelector?c(a.nextSelector).append(l):
|
|
g.append(l);l.click(function(){h.goToNextSlide();return!1});k.click(function(){h.goToPreviousSlide();return!1})}function z(d){"full"==a.pagerType&&a.pager?(c("a",w).removeClass(a.pagerActiveClass),c("a",w).eq(d).addClass(a.pagerActiveClass)):"short"==a.pagerType&&a.pager&&c(".bx-pager-current",w).html(b+1)}function N(){d.not(":eq("+b+")").fadeTo(a.speed,0).css("zIndex",98);d.eq(b).css("zIndex",99).fadeTo(a.speed,1,function(){k=!1;jQuery.browser.msie&&d.eq(b).get(0).style.removeAttribute("filter");
|
|
a.onAfterSlide(b,d.length,d.eq(b))})}function S(){e.hover(function(){r&&h.stopTicker(!1)},function(){r&&h.startTicker(!1)})}function T(){g.find(".bx-window").hover(function(){r&&h.stopShow(!1)},function(){r&&h.startShow(!1)})}function x(b,d,c){"horizontal"==a.mode?"next"==a.tickerDirection?e.animate({left:"-\x3d"+d+"px"},c,"linear",function(){e.css("left",b);x(b,s,a.tickerSpeed)}):"prev"==a.tickerDirection&&e.animate({left:"+\x3d"+d+"px"},c,"linear",function(){e.css("left",b);x(b,s,a.tickerSpeed)}):
|
|
"vertical"==a.mode&&("next"==a.tickerDirection?e.animate({top:"-\x3d"+d+"px"},c,"linear",function(){e.css("top",b);x(b,t,a.tickerSpeed)}):"prev"==a.tickerDirection&&e.animate({top:"+\x3d"+d+"px"},c,"linear",function(){e.css("top",b);x(b,t,a.tickerSpeed)}))}function U(){a.auto?a.infiniteLoop?"next"==a.autoDirection?B=setInterval(function(){h.goToNextSlide(!1)},a.pause):"prev"==a.autoDirection&&(B=setInterval(function(){h.goToPreviousSlide(!1)},a.pause)):"next"==a.autoDirection?B=setInterval(function(){b+=
|
|
a.moveSlideQty;b>A&&(b%=d.length);h.goToSlide(b,!1)},a.pause):"prev"==a.autoDirection&&(B=setInterval(function(){b-=a.moveSlideQty;0>b&&(negativeOffset=b%d.length,b=0==negativeOffset?0:d.length+negativeOffset);h.goToSlide(b,!1)},a.pause)):a.ticker&&(a.tickerSpeed*=10,c(".pager",g).each(function(a){s+=c(this).width();t+=c(this).height()}),"prev"==a.tickerDirection&&"horizontal"==a.mode?e.css("left","-"+(s+D)+"px"):"prev"==a.tickerDirection&&"vertical"==a.mode&&e.css("top","-"+(t+E)+"px"),"horizontal"==
|
|
a.mode?(L=parseInt(e.css("left")),x(L,s,a.tickerSpeed)):"vertical"==a.mode&&(M=parseInt(e.css("top")),x(M,t,a.tickerSpeed)),a.tickerHover&&S())}function V(){if("horizontal"==a.mode||"vertical"==a.mode){var b=m(d,0,a.moveSlideQty,"backward");c.each(b,function(a){e.prepend(c(this))});b=m(d,0,d.length+a.moveSlideQty-1-(d.length-a.displaySlideQty),"forward");a.infiniteLoop&&c.each(b,function(a){e.append(c(this))})}}a=c.extend({mode:"horizontal",infiniteLoop:!0,hideControlOnEnd:!1,controls:!0,speed:500,
|
|
easing:"swing",pager:!1,pagerSelector:null,pagerType:"full",pagerLocation:"bottom",pagerShortSeparator:"/",pagerActiveClass:"pager-active",nextText:"next",nextImage:"",nextSelector:null,prevText:"prev",prevImage:"",prevSelector:null,captions:!1,captionsSelector:null,auto:!1,autoDirection:"next",autoControls:!1,autoControlsSelector:null,autoStart:!0,autoHover:!1,autoDelay:0,pause:3E3,startText:"start",startImage:"",stopText:"stop",stopImage:"",ticker:!1,tickerSpeed:5E3,tickerDirection:"next",tickerHover:!1,
|
|
wrapperClass:"bx-wrapper",startingSlide:0,displaySlideQty:1,moveSlideQty:1,randomStart:!1,onBeforeSlide:function(){},onAfterSlide:function(){},onLastSlide:function(){},onFirstSlide:function(){},onNextSlide:function(){},onPrevSlide:function(){},buildPager:null},a);var h=this,e="",d="",g="",F="",P="",G="",O="",Q="",w="",B="",q="",J="",K="",r=!0,C=0,u=0,b=0,D=0,E=0,s=0,t=0,L=0,M=0,k=!1,I=0,A=d.length-1;this.goToSlide=function(c,g){if(!k){k=!0;b=c;a.onBeforeSlide(b,d.length,d.eq(b));"undefined"==typeof g&&
|
|
(g=!0);g&&a.auto&&h.stopShow(!0);slide=c;if(slide==I)a.onFirstSlide(b,d.length,d.eq(b));if(slide==A)a.onLastSlide(b,d.length,d.eq(b));"horizontal"==a.mode?e.animate({left:"-"+f(slide,"left")+"px"},a.speed,a.easing,function(){k=!1;a.onAfterSlide(b,d.length,d.eq(b))}):"vertical"==a.mode?e.animate({top:"-"+f(slide,"top")+"px"},a.speed,a.easing,function(){k=!1;a.onAfterSlide(b,d.length,d.eq(b))}):"fade"==a.mode&&N();l();1<a.moveSlideQty&&(c=Math.floor(c/a.moveSlideQty));z(c);n()}};this.goToNextSlide=
|
|
function(c){"undefined"==typeof c&&(c=!0);c&&a.auto&&h.stopShow(!0);if(a.infiniteLoop)k||(k=!0,g=!1,b+=a.moveSlideQty,b>A&&(b%=d.length,g=!0),a.onNextSlide(b,d.length,d.eq(b)),a.onBeforeSlide(b,d.length,d.eq(b)),"horizontal"==a.mode?e.animate({left:"-\x3d"+a.moveSlideQty*G+"px"},a.speed,a.easing,function(){k=!1;g&&e.css("left","-"+f(b,"left")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"vertical"==a.mode?e.animate({top:"-\x3d"+a.moveSlideQty*u+"px"},a.speed,a.easing,function(){k=!1;g&&e.css("top",
|
|
"-"+f(b,"top")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"fade"==a.mode&&N(),1<a.moveSlideQty?z(Math.ceil(b/a.moveSlideQty)):z(b),n());else if(!k){var g=!1;b+=a.moveSlideQty;b<=A?(l(),a.onNextSlide(b,d.length,d.eq(b)),h.goToSlide(b)):b-=a.moveSlideQty}};this.goToPreviousSlide=function(v){"undefined"==typeof v&&(v=!0);v&&a.auto&&h.stopShow(!0);if(a.infiniteLoop)k||(k=!0,H=!1,b-=a.moveSlideQty,0>b&&(negativeOffset=b%d.length,b=0==negativeOffset?0:d.length+negativeOffset,H=!0),a.onPrevSlide(b,d.length,
|
|
d.eq(b)),a.onBeforeSlide(b,d.length,d.eq(b)),"horizontal"==a.mode?e.animate({left:"+\x3d"+a.moveSlideQty*G+"px"},a.speed,a.easing,function(){k=!1;H&&e.css("left","-"+f(b,"left")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"vertical"==a.mode?e.animate({top:"+\x3d"+a.moveSlideQty*u+"px"},a.speed,a.easing,function(){k=!1;H&&e.css("top","-"+f(b,"top")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"fade"==a.mode&&N(),1<a.moveSlideQty?z(Math.ceil(b/a.moveSlideQty)):z(b),n());else if(!k){var H=!1;b-=a.moveSlideQty;
|
|
0>b&&(b=0,a.hideControlOnEnd&&c(".bx-prev",g).hide());l();a.onPrevSlide(b,d.length,d.eq(b));h.goToSlide(b)}};this.goToFirstSlide=function(a){"undefined"==typeof a&&(a=!0);h.goToSlide(I,a)};this.goToLastSlide=function(){if("undefined"==typeof a)var a=!0;h.goToSlide(A,a)};this.getCurrentSlide=function(){return b};this.getSlideCount=function(){return d.length};this.stopShow=function(b){clearInterval(B);"undefined"==typeof b&&(b=!0);b&&a.autoControls&&(q.html(J).removeClass("stop").addClass("start"),
|
|
r=!1)};this.startShow=function(b){"undefined"==typeof b&&(b=!0);U();b&&a.autoControls&&(q.html(K).removeClass("start").addClass("stop"),r=!0)};this.stopTicker=function(b){e.stop();"undefined"==typeof b&&(b=!0);b&&a.ticker&&(q.html(J).removeClass("stop").addClass("start"),r=!1)};this.startTicker=function(b){if("horizontal"==a.mode){if("next"==a.tickerDirection){b=parseInt(e.css("left"));var c=s+b+d.eq(0).width()}else"prev"==a.tickerDirection&&(b=-parseInt(e.css("left")),c=b-d.eq(0).width());var f=
|
|
c*a.tickerSpeed/s;x(L,c,f)}else"vertical"==a.mode&&("next"==a.tickerDirection?(c=parseInt(e.css("top")),c=t+c+d.eq(0).height()):"prev"==a.tickerDirection&&(c=-parseInt(e.css("top")),c-=d.eq(0).height()),f=c*a.tickerSpeed/t,x(M,c,f),"undefined"==typeof b&&(b=!0),b&&a.ticker&&(q.html(K).removeClass("start").addClass("stop"),r=!0))};this.initShow=function(){e=c(this);e.clone();d=e.children();g="";F=e.children(":first");P=F.width();C=0;G=F.outerWidth();u=0;O=F.outerWidth()*a.displaySlideQty;Q=F.outerHeight()*
|
|
a.displaySlideQty;k=!1;w="";E=D=b=0;K=J=q=B="";r=!0;I=M=L=t=s=0;A=d.length-1;d.each(function(a){c(this).outerHeight()>u&&(u=c(this).outerHeight());c(this).outerWidth()>C&&(C=c(this).outerWidth())});if(a.randomStart){var f=Math.floor(Math.random()*d.length);b=f;D=G*(a.moveSlideQty+f);E=u*(a.moveSlideQty+f)}else b=a.startingSlide,D=G*(a.moveSlideQty+a.startingSlide),E=u*(a.moveSlideQty+a.startingSlide);V(a.startingSlide);"horizontal"==a.mode?(e.wrap('\x3cdiv class\x3d"'+a.wrapperClass+'" style\x3d"width:'+
|
|
O+'px; position:relative;"\x3e\x3c/div\x3e').wrap('\x3cdiv class\x3d"bx-window" style\x3d"position:relative; overflow:hidden; width:'+O+'px;"\x3e\x3c/div\x3e').css({width:"999999px",position:"relative",left:"-"+D+"px"}),e.children().css({width:P,"float":"left",listStyle:"none"}),g=e.parent().parent(),d.addClass("pager")):"vertical"==a.mode?(e.wrap('\x3cdiv class\x3d"'+a.wrapperClass+'" style\x3d"width:'+C+'px; position:relative;"\x3e\x3c/div\x3e').wrap('\x3cdiv class\x3d"bx-window" style\x3d"width:'+
|
|
C+"px; height:"+Q+'px; position:relative; overflow:hidden;"\x3e\x3c/div\x3e').css({height:"999999px",position:"relative",top:"-"+E+"px"}),e.children().css({listStyle:"none",height:u}),g=e.parent().parent(),d.addClass("pager")):"fade"==a.mode&&(e.wrap('\x3cdiv class\x3d"'+a.wrapperClass+'" style\x3d"width:'+C+'px; position:relative;"\x3e\x3c/div\x3e').wrap('\x3cdiv class\x3d"bx-window" style\x3d"height:'+u+"px; width:"+C+'px; position:relative; overflow:hidden;"\x3e\x3c/div\x3e'),e.children().css({listStyle:"none",
|
|
position:"absolute",top:0,left:0,zIndex:98}),g=e.parent().parent(),d.not(":eq("+b+")").fadeTo(0,0),d.eq(b).css("zIndex",99));a.captions&&null==a.captionsSelector&&g.append('\x3cdiv class\x3d"bx-captions"\x3e\x3c/div\x3e');a.pager&&!a.ticker&&("full"==a.pagerType?y("full"):"short"==a.pagerType&&y("short"));a.controls&&!a.ticker&&(""!=a.nextImage?(nextContent=a.nextImage,nextType="image"):(nextContent=a.nextText,nextType="text"),""!=a.prevImage?(prevContent=a.prevImage,prevType="image"):(prevContent=
|
|
a.prevText,prevType="text"),R(nextType,nextContent,prevType,prevContent));if(a.auto||a.ticker)a.autoControls&&(""!=a.startImage?(startContent=a.startImage,startType="image"):(startContent=a.startText,startType="text"),""!=a.stopImage?(stopContent=a.stopImage,stopType="image"):(stopContent=a.stopText,stopType="text"),p(startType,startContent,stopType,stopContent)),a.autoStart?setTimeout(function(){h.startShow(!0)},a.autoDelay):h.stopShow(!0),a.autoHover&&!a.ticker&&T();1<a.moveSlideQty?z(Math.ceil(b/
|
|
a.moveSlideQty)):z(b);l();a.captions&&n();a.onAfterSlide(b,d.length,d.eq(b))};this.destroyShow=function(){clearInterval(B);c(".bx-next, .bx-prev, .bx-pager, .bx-auto",g).remove();e.unwrap().unwrap().removeAttr("style");e.children().removeAttr("style").not(".pager").remove();d.removeClass("pager")};this.reloadShow=function(){h.destroyShow();h.initShow()};this.each(function(){0<c(this).children().length&&h.initShow()});return this};jQuery.fx.prototype.cur=function(){return null==this.elem[this.prop]||
|
|
this.elem.style&&null!=this.elem.style[this.prop]?parseFloat(jQuery.css(this.elem,this.prop)):this.elem[this.prop]}})(jQuery);window.pageHandleResponsive=!0;
|
|
$.when(window.Pages.rwdReady).done(function(){var c=$(".contentMain"),a=$("div.details"),m=$(".ideaActions"),f=$(".sidebar");toggleClassMedia("minWidth400px",".moduleContentNew:media(this-min-width:400px)");toggleClassMedia("minWidth475px",".moduleContentNew:media(this-min-width:475px)");toggleClassMedia("minWidth575px",".moduleContentNew:media(this-min-width:575px)");toggleClassMedia("minWidth650px",".moduleContentNew:media(this-min-width:680px)");toggleClassMedia("minWidth300px",".sidebar:media(this-min-width:300px)");
|
|
toggleClassMedia("minWidth450px",".sidebar:media(this-min-width:450px)");toggleClassMedia("minWidth600px",".sidebar:media(this-min-width:600px)");toggleClassMedia("maxWidth515px",".moduleContentNew:media(this-max-width:515px)");cpMedia.register(".moduleContentNew:media(this-max-width:680px)",{setup:function(){},match:function(l,p){0==m.length?c.after(f):a.after(f)},unmatch:function(l,p){0==m.length?c.before(f):a.before(f)}});$(".tabs li").click(function(a){a.stopPropagation();$(this).hasClass("tabsDropdown")&&
|
|
($(this).hasClass("active")?$(".tabs li:not(.active)").toggle():($(".tabs li").hide(),$(this).show(),$(this).parent().prepend(this)))});$(document).click(function(){$(".tabsDropdown .tabs li:not(.active)").hide()});cpMedia.register(".moduleContentNew:media(this-max-width:745px)",{setup:function(){},match:function(a,c){$(".moduleContentNew").addClass("tabsDropdown");$(".tabs li").addClass("tabsDropdown");$(".tabs li:not(.active)").hide()},unmatch:function(a,c){$(".moduleContentNew").removeClass("tabsDropdown");
|
|
$(".tabs li").removeClass("tabsDropdown");$(".tabs li:not(.active)").show()}})}); |