~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to console/console.js

  • Committer: dilshan_a
  • Date: 2008-01-25 00:20:21 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:295
Added a filesum problem.
Updated paths in test.py and test.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
var hist = new History();
73
73
 
74
 
function make_query_string(pagename, args)
75
 
{
76
 
    var first = true;
77
 
    var qs = pagename;
78
 
    for (key in args)
79
 
    {
80
 
        vals = args[key];
81
 
        // vals can be an array, to make multiple args with the same name
82
 
        // To handle this, make non-array objects into an array, then loop
83
 
        if (!(vals instanceof Array))
84
 
            vals = [vals];
85
 
        for each (val in vals)
86
 
        {
87
 
            if (first)
88
 
            {
89
 
                qs += "?";
90
 
                first = false;
91
 
            }
92
 
            else
93
 
            {
94
 
                qs += "&";
95
 
            }
96
 
            qs += encodeURIComponent(key) + "=" + encodeURIComponent(val);
97
 
        }
98
 
    }
99
 
    return qs;
100
 
}
101
 
 
102
74
function make_post_body(args)
103
75
{
104
 
    var first = true;
105
76
    var qs = '';
106
77
    for (key in args)
107
78
    {
110
81
        // To handle this, make non-array objects into an array, then loop
111
82
        if (!(vals instanceof Array))
112
83
            vals = [vals];
113
 
        for each (val in vals)
 
84
        var i;
 
85
        for (i=0; i<vals.length; i++)
114
86
        {
115
 
            if (first)
116
 
            {
117
 
                first = false;
118
 
            }
119
 
            else
 
87
            if (i > 0)
120
88
            {
121
89
                qs += "&";
122
90
            }
123
 
            qs += encodeURIComponent(key) + "=" + encodeURIComponent(val);
 
91
            qs += encodeURIComponent(key) + "=" + encodeURIComponent(vals[i]);
124
92
        }
125
93
    }
126
94
    return qs;