<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;

namespace AjaxControlToolkit {

    public static class ToolkitScriptMappings {

        static readonly string[] _scripts = new[] {
            Constants.BaseScriptName,
            Constants.CommonScriptName,
            Constants.TextBoxWatermarkScriptName
        };

        public static string[] GetScriptPaths() {
            return _scripts.Select(name => FormatScriptPath(name, false)).ToArray();
        }

        public static void Register() {
            foreach(var script in _scripts) {
                AddDefinition(script);
            }
        }

        static void AddDefinition(string script) {
            ScriptManager.ScriptResourceMapping.AddDefinition(
                script + Constants.JsPostfix,
                typeof(ToolkitScriptMappings).Assembly,
                new ScriptResourceDefinition() {
                    Path = FormatScriptPath(script, false)
                    // DebugPath = FormatScriptPath(script, true) - bundling does not work with debug scripts
                }
            );
        }

        static string FormatScriptPath(string script, bool isDebug) {
            return "~/Scripts/AjaxControlToolkit/" + script + (isDebug ? Constants.DebugJsPostfix : Constants.JsPostfix);
        }
    }

}<commit_msg>place debug and release scripts into different folders to make Bundling work<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;

namespace AjaxControlToolkit {

    // Usage:
    //
    // Application_Start:
    // ToolkitScriptMappings.Register();
    // BundleTable.Bundles.Add(new ScriptBundle("~/bundles/AjaxControlToolki").Include(ToolkitScriptMappings.GetScriptPaths()));
    // 
    // ScriptManager:
    // <asp:ScriptReference Path="~/bundles/AjaxControlToolkit" />

    public static class ToolkitScriptMappings {

        static readonly string[] _scripts = new[] {
            Constants.BaseScriptName,
            Constants.CommonScriptName,
            Constants.TextBoxWatermarkScriptName
        };

        public static string[] GetScriptPaths() {
            return _scripts.Select(name => FormatScriptPath(name, false)).ToArray();
        }

        public static void Register() {
            foreach(var script in _scripts) {
                AddDefinition(script);
            }
        }

        static void AddDefinition(string script) {
            ScriptManager.ScriptResourceMapping.AddDefinition(
                script + Constants.JsPostfix,
                typeof(ToolkitScriptMappings).Assembly,
                new ScriptResourceDefinition() {
                    Path = FormatScriptPath(script, false),
                    DebugPath = FormatScriptPath(script, true)
                }
            );
        }

        static string FormatScriptPath(string script, bool isDebug) {
            return "~/Scripts/AjaxControlToolkit/" 
                + (isDebug ? "Debug" : "Release") + "/" 
                + script 
                + (isDebug ? Constants.DebugJsPostfix : Constants.JsPostfix);
        }
    }

}
{'fraction_non_alphanumeric': 0.08898706216472073, 'fraction_numerical': 0.0, 'mean_word_length': 2.0628019323671496, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821731', 'n_tokens_mistral': 805, 'n_tokens_neox': 758, 'n_words': 163}