PageSourceSearch

https://www.goo-net.com/js/lib/util/Convert.js?171128

js goo-net.com collected 2026-10-01 10:29:54 UTC 1,331 bytes, 56 lines download raw bytes

1
2/**
3 * JavaScript 共通関数
4 * Javascript環境下で共通で扱えそうな関数群
5 *
6 */
7
8// 変数の強豪対策
9if (typeof Convert === "undefined"){
10
11    var Convert = function()
12    {
13        // コンストラクタ
14    };
15
16
17    // 各種関数
18
19    /**
20     * getClassValue
21     * 指定されたクラス名から連想配列でvalueを返す
22     * valueが設定されていないものは連想配列として生成しない
23     * 変数[id] = value
24     *
25     * @param String class_name
26     * @return Array
27     */
28    Convert.getClassValue = function(class_name)
29    {
30        var result = new Array();
31        $("." + class_name).each( function(){
32            if($(this).val() && $(this).attr("id")) {
33                result[$(this).attr("id")] = $(this).val();
34            }
35        });
36
37        return result;
38    }
39
40    /**
41     * setClassValue
42     * 指定されたクラスのidのタグにvalueを挿入する
43     * 指定されたクラスにidがない場合は挿入しない
44     *
45     * @param Array ary_value, String class_name
46     */
47    Convert.setClassValue = function(ary_value, class_name)
48    {
49        $("." + class_name).each( function(){
50            if(ary_value[$(this).attr("id")]) {
51                $(this).val(ary_value[$(this).attr("id")]);
52            }
53        });
54    }
55
56}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.