Add new global JavaScript reactionType variable
authorJoshua Rüsweg <josh@bastelstu.be>
Sat, 12 May 2018 18:29:51 +0000 (20:29 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Sat, 12 May 2018 18:29:51 +0000 (20:29 +0200)
See #2508

com.woltlab.wcf/templates/headIncludeJavaScript.tpl

index 92dc326366b87db2457a51339a75f91f3c3f8d7b..98d8736afa44af49cdacc7fd54f3b0213a21b19c 100644 (file)
@@ -16,6 +16,8 @@
        var ENABLE_DEVELOPER_TOOLS = {if ENABLE_DEVELOPER_TOOLS}true{else}false{/if};
        var WSC_API_VERSION = {@WSC_API_VERSION};
        
+       var REACTION_TYPES = {@$__wcf->getReactionHandler()->getReactionsJSVariable()};
+       
        {if ENABLE_DEBUG_MODE}
                {* This constant is a compiler option, it does not exist in production. *}
                var COMPILER_TARGET_DEFAULT = {if !VISITOR_USE_TINY_BUILD || $__wcf->user->userID}true{else}false{/if};
@@ -130,7 +132,8 @@ requirejs.config({
                        styleChanger: {if $__wcf->getStyleHandler()->showStyleChanger()}true{else}false{/if}
                });
                
-               User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}', {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}'{else}''{/if});
+User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}', {if $__wcf->user->userID}'{@$__wcf->user->getLink()|encodeJS}';
+               {else}'';{/if})
        });
        
        // prevent jQuery and other libraries from utilizing define()