{"size": 2464, "ext": "js", "max_stars_repo_path": "src/AppBundle/Resources/public/vendors/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js", "max_stars_repo_name": "SamuelCampo/Prohogar-bolsa-de-empleo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/AppBundle/Resources/public/vendors/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js", "max_issues_repo_name": "SamuelCampo/Prohogar-bolsa-de-empleo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/AppBundle/Resources/public/vendors/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js", "max_forks_repo_name": "SamuelCampo/Prohogar-bolsa-de-empleo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 72.4705882353, "max_line_length": 775, "alphanum_fraction": 0.518262987}
tinymce.PluginManager.add("insertdatetime", function (e) {
    function t(t, a) {
        function n(e, t) {
            if (e = "" + e, e.length < t)for (var a = 0; a < t - e.length; a++)e = "0" + e;
            return e
        }

        return a = a || new Date, t = t.replace("%D", "%m/%d/%Y"), t = t.replace("%r", "%I:%M:%S %p"), t = t.replace("%Y", "" + a.getFullYear()), t = t.replace("%y", "" + a.getYear()), t = t.replace("%m", n(a.getMonth() + 1, 2)), t = t.replace("%d", n(a.getDate(), 2)), t = t.replace("%H", "" + n(a.getHours(), 2)), t = t.replace("%M", "" + n(a.getMinutes(), 2)), t = t.replace("%S", "" + n(a.getSeconds(), 2)), t = t.replace("%I", "" + ((a.getHours() + 11) % 12 + 1)), t = t.replace("%p", "" + (a.getHours() < 12 ? "AM" : "PM")), t = t.replace("%B", "" + e.translate(m[a.getMonth()])), t = t.replace("%b", "" + e.translate(c[a.getMonth()])), t = t.replace("%A", "" + e.translate(d[a.getDay()])), t = t.replace("%a", "" + e.translate(i[a.getDay()])), t = t.replace("%%", "%")
    }

    function a(a) {
        var n = t(a);
        if (e.settings.insertdatetime_element) {
            var r;
            r = t(/%[HMSIp]/.test(a) ? "%Y-%m-%dT%H:%M" : "%Y-%m-%d"), n = '<time datetime="' + r + '">' + n + "</time>";
            var i = e.dom.getParent(e.selection.getStart(), "time");
            if (i)return void e.dom.setOuterHTML(i, n)
        }
        e.insertContent(n)
    }

    var n, r, i = "Sun Mon Tue Wed Thu Fri Sat Sun".split(" "), d = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "), c = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), m = "January February March April May June July August September October November December".split(" "), u = [];
    e.addCommand("mceInsertDate", function () {
        a(e.getParam("insertdatetime_dateformat", e.translate("%Y-%m-%d")))
    }), e.addCommand("mceInsertTime", function () {
        a(e.getParam("insertdatetime_timeformat", e.translate("%H:%M:%S")))
    }), e.addButton("insertdatetime", {type: "splitbutton", title: "Insert date/time", onclick: function () {
        a(n || r)
    }, menu: u}), tinymce.each(e.settings.insertdatetime_formats || ["%H:%M:%S", "%Y-%m-%d", "%I:%M:%S %p", "%D"], function (e) {
        r || (r = e), u.push({text: t(e), onclick: function () {
            n = e, a(e)
        }})
    }), e.addMenuItem("insertdatetime", {icon: "date", text: "Insert date/time", menu: u, context: "insert"})
});