From ec14a7c7ef2cc01b0c36ddaf896acb07dc67dcff Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 21 May 2018 17:33:32 -0400 Subject: [PATCH] Merge pull request #37944 from AutomaticFrenzy/patch/irv-jquery Remove second copy of jQuery used only by IRV polls --- code/modules/admin/create_poll.dm | 2 +- code/modules/client/asset_cache.dm | 7 ++++++- code/modules/mob/dead/new_player/new_player.dm | 1 + code/modules/mob/dead/new_player/poll.dm | 4 ++-- html/IRV/jquery-1.10.2.min.js | 6 ------ 5 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 html/IRV/jquery-1.10.2.min.js diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index b1cda46ece..90fd6c66c9 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -73,7 +73,7 @@ if(!option) return option = sanitizeSQL(option) - var/default_percentage_calc + var/default_percentage_calc = 0 if(polltype != POLLTYPE_IRV) switch(alert("Should this option be included by default when poll result percentages are generated?",,"Yes","No","Cancel")) if("Yes") diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index d3c09b2348..28a3ec23b9 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -467,7 +467,12 @@ GLOBAL_LIST_EMPTY(asset_datums) /datum/asset/simple/IRV assets = list( "jquery-ui.custom-core-widgit-mouse-sortable-min.js" = 'html/IRV/jquery-ui.custom-core-widgit-mouse-sortable-min.js', - "jquery-1.10.2.min.js" = 'html/IRV/jquery-1.10.2.min.js' + ) + +/datum/asset/group/IRV + children = list( + /datum/asset/simple/jquery, + /datum/asset/simple/IRV ) /datum/asset/simple/changelog diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index c6cc8a70ac..9de78d307d 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -234,6 +234,7 @@ if(POLLTYPE_IRV) if (!href_list["IRVdata"]) to_chat(src, "No ordering data found. Please try again or contact an administrator.") + return var/list/votelist = splittext(href_list["IRVdata"], ",") if (!vote_on_irv_poll(pollid, votelist)) to_chat(src, "Vote failed, please try again or contact an administrator.") diff --git a/code/modules/mob/dead/new_player/poll.dm b/code/modules/mob/dead/new_player/poll.dm index d10e32a887..ce710e5186 100644 --- a/code/modules/mob/dead/new_player/poll.dm +++ b/code/modules/mob/dead/new_player/poll.dm @@ -211,7 +211,7 @@ src << browse(null ,"window=playerpolllist") src << browse(output,"window=playerpoll;size=500x250") if(POLLTYPE_IRV) - var/datum/asset/irv_assets = get_asset_datum(/datum/asset/simple/IRV) + var/datum/asset/irv_assets = get_asset_datum(/datum/asset/group/IRV) irv_assets.send(src) var/datum/DBQuery/query_irv_get_votes = SSdbcore.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") @@ -267,7 +267,7 @@ - +