nm3clol-archived-russellcou.../mirror/www.russellcountyva.us/812078035.js

5 lines
1.9 KiB
JavaScript

var CommunityVoiceResourcesHome=GetJson("/CommunityVoice/Localization"),CommunityVoiceResourcesIdea=GetJson("/Admin/CommunityVoice/Idea/Localization");$(document).ready(function(){$.ajaxSetup({cache:!1})});function LoadLeaderboard(a){var b=$("#initiativeID").val();if(null==b||""==b)b=0;$(".section.leaderboard").load("/CommunityVoice/Leaderboard?showAllTime\x3d"+a+"\x26initiativeID\x3d"+b)}function ShowErrorExplanation(a){a=$(".explanation."+a);a.parent().addClass("error");a.show()}
function HideErrorExplanation(a){a=$(".explanation."+a);a.parent().removeClass("error");a.hide()}function ValidateContent(a,b){var c=!0;$.ajax({url:"/SiteProperties/InappropriateWords?text\x3d"+a,type:"post",async:!1,success:function(a){!0==a.Result?(ShowErrorExplanation(b),c=!1):HideErrorExplanation(b)},error:function(a,b,c){alert("Error: "+a.statusText+"\nStatus: "+a.status)}});return c}function TextControlSpellCheckerSource(a){this._$control=a}
TextControlSpellCheckerSource.prototype={get_text:function(){return this._$control.val()},set_text:function(a){this._$control.val(a)}};function TagSpellCheckerSource(a){this._$tagElem=a}
TagSpellCheckerSource.prototype={get_text:function(){return this._$tagElem.text()},set_text:function(a){if(this._$tagElem.text()!=a){var b=this._$tagElem.val(),c=this._$tagElem;$.ajax({url:"/CommunityVoice/SearchTag/",type:"post",data:{tag:a},success:function(d){0<d.length?changeText(c,d[0].value,d[0].key,b):changeText(c,a,a,b)},error:function(a,b,c){alert("Error: "+a.statusText+"\nStatus: "+a.status)}})}}};
function spellCheckControlsAndTags(a,b,c){var d=[];a.each(function(){d[d.length]=new TextControlSpellCheckerSource($(this))});b.each(function(){$(this).find("option").each(function(){d[d.length]=new TagSpellCheckerSource($(this))})});a=new Telerik.Web.UI.Spell.MultipleHtmlElementsSource(d);c.set_clientTextSource(a);c.startSpellCheck()}function changeText(a,b,c,d){a=a.parent();a.trigger("removeItem",[{value:d}]);a.trigger("addItem",[{title:b,value:c}])};