PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/war/src/main/webapp/js/admin/about.js

http://github.com/b3log/b3log-solo
JavaScript | 58 lines | 29 code | 2 blank | 27 comment | 2 complexity | bda1af5a1e02b5295032df0a115ea9ca MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1
 1/*
 2 * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
 3 *
 4 * Licensed under the Apache License, Version 2.0 (the "License");
 5 * you may not use this file except in compliance with the License.
 6 * You may obtain a copy of the License at
 7 *
 8 *     http://www.apache.org/licenses/LICENSE-2.0
 9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/**
17 *  about for admin
18 *
19 * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
20 * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
21 * @version 1.0.0.3, Jan 7, 2012
22 */
23
24/* about ???? */
25admin.about = {
26    init: function () {
27        $.ajax({
28            url: "http://rhythm.b3log.org/version/solo/latest/" + Label.version,
29            type: "GET",
30            cache: false,
31            dataType:"jsonp",
32            error: function() {
33            // alert("Error loading articles from Rhythm");
34            },
35            success: function(data, textStatus) {
36                var version = data.soloVersion;
37                if (version === Label.version) {
38                    $("#aboutLatest").text(Label.upToDateLabel);
39                } else {
40                    $("#aboutLatest").html(Label.outOfDateLabel +
41                        "<a href='" + data.soloDownload + "'>" + version + "</a>");
42                }
43                $("#loadMsg").text("");
44            }
45        });
46    }
47};
48
49/*
50 * ??? admin ???? 
51 */
52admin.register["about"] = {
53    "obj": admin.about,
54    "init": admin.about.init,
55    "refresh": function () {
56        $("#loadMsg").text("");
57    }
58}