广州市综治平台后端
xusd
2025-06-07 36306491396230522fa20585c2621a7fc899849a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
/* Update Helper (c) 2008-2009 Tobie Langel
 *
 * Requires Prototype >= 1.6.0
 *
 * Update Helper is distributable under the same terms as Prototype
 * (MIT-style license). For details, see the Prototype web site:
 * http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/
 
var UpdateHelper = Class.create({
    logLevel: 0,
    MessageTemplate: new Template('Update Helper: #{message}\n#{stack}'),
    Regexp:          new RegExp("@" + window.location.protocol + ".*?\\d+\\n", "g"),
 
    initialize: function(deprecatedMethods) {
        var notify = function(message, type) {
            this.notify(message, type);
        }.bind(this);   // Late binding to simplify testing.
 
        deprecatedMethods.each(function(d) {
            var condition = d.condition,
                type      = d.type || 'info',
                message   = d.message,
                namespace = d.namespace,
                method    = d.methodName;
 
            namespace[method] = (namespace[method] || function() {}).wrap(function(proceed) {
                var args = $A(arguments).splice(1);
                if (!condition || condition.apply(this, args)) notify(message, type);
                return proceed.apply(proceed, args);
            });
        });
        Element.addMethods();
    },
 
    notify: function(message, type) {
        switch(type) {
            case 'info':
                if (this.logLevel > UpdateHelper.Info) return false;
            case 'warn':
                if (this.logLevel > UpdateHelper.Warn) return false;
            default:
                if (this.logLevel > UpdateHelper.Error) return false;
        }
        this.log(this.MessageTemplate.evaluate({
            message: message,
            stack: this.getStack()
        }), type);
        return true;
    },
 
    getStack: function() {
        try {
            throw new Error("stack");
        } catch(e) {
            var match = (e.stack || '').match(this.Regexp);
            if (match) {
                return match.reject(function(path) {
                    return (/(prototype|unittest|update_helper)\.js/).test(path);
                }).join("\n");
            } else { return ''; }
        }
    },
 
    log: function(message, type) {
        if (type == 'error') console.error(message);
        else if (type == 'warn') console.warn(message);
        else console.log(message);
    }
});
 
Object.extend(UpdateHelper, {
    Info:  0,
    Warn:  1,
    Error: 2
});
 
 
//= require "update_helper"
 
/* UpdateHelper for Prototype <%= PROTOTYPE_VERSION %> (c) 2008-2009 Tobie Langel
 *
 * UpdateHelper for Prototype is freely distributable under the same
 * terms as Prototype (MIT-style license).
 * For details, see the Prototype web site: http://www.prototypejs.org/
 *
 * Include this file right below prototype.js. All messages
 * will be logged to the console.
 *
 * Note: You can tune the level of warning by redefining
 * prototypeUpdateHelper.logLevel with one of the appropriate constansts
 * (UpdateHelper.Info, UpdateHelper.Warn or UpdateHelper.Error), e.g.:
 *
 *     prototypeUpdateHelper.logLevel = UpdateHelper.Warn;
 *
 * This, for example, will prevent deprecation messages from being logged.
 *
 *              THIS SCRIPT DOES NOT WORK IN INTERNET EXPLORER
 *--------------------------------------------------------------------------*/
 
var prototypeUpdateHelper = new UpdateHelper([
    {
        methodName: 'display',
        namespace: Toggle,
        message: 'Toggle.display has been deprecated, please use Element.toggle instead.'
    },
 
    {
        methodName: 'show',
        namespace: Element.Methods,
        message: 'Passing an arbitrary number of elements to Element.show is no longer supported.\n' +
        'Use [id_1, id_2, ...].each(Element.show) or $(id_1, id_2, ...).invoke("show") instead.',
        type: 'error',
        condition: function() { return arguments.length > 1 && !Object.isNumber(arguments[1]) }
    },
 
    {
        methodName: 'hide',
        namespace: Element.Methods,
        message: 'Passing an arbitrary number of elements to Element.hide is no longer supported.\n' +
        'Use [id_1, id_2, ...].each(Element.hide) or $(id_1, id_2, ...).invoke("hide") instead.',
        type: 'error',
        condition: function() { return arguments.length > 1 && !Object.isNumber(arguments[1]) }
    },
 
    {
        methodName: 'toggle',
        namespace: Element.Methods,
        message: 'Passing an arbitrary number of elements to Element.toggle is no longer supported.\n' +
        'Use [id_1, id_2, ...].each(Element.toggle) or $(id_1, id_2, ...).invoke("toggle") instead.',
        type: 'error',
        condition: function() { return arguments.length > 1 && !Object.isNumber(arguments[1]) }
    },
 
    {
        methodName: 'clear',
        namespace: Form.Element.Methods,
        message: 'Passing an arbitrary number of elements to Field.clear is no longer supported.\n' +
        'Use [id_1, id_2, ...].each(Form.Element.clear) or $(id_1, id_2, ...).invoke("clear") instead.',
        type: 'error',
        condition: function() { return arguments.length > 1 && !Object.isNumber(arguments[1]) }
    },
 
    {
        methodName: 'present',
        namespace: Form.Element.Methods,
        message: 'Passing an arbitrary number of elements to Field.present is no longer supported.\n' +
        'Use [id_1, id_2, ...].each(Form.Element.present) or $(id_1, id_2, ...).invoke("present") instead.',
        type: 'error',
        condition: function() { return arguments.length > 1 && !Object.isNumber(arguments[1]) }
    },
 
    {
        methodName: 'childOf',
        namespace: Element.Methods,
        message: 'Element#childOf has been deprecated, please use Element#descendantOf instead.'
    },
 
    {
        methodName: 'Before',
        namespace: Insertion,
        message: 'Insertion.Before has been deprecated, please use Element#insert instead.'
    },
 
    {
        methodName: 'Top',
        namespace: Insertion,
        message: 'Insertion.Top has been deprecated, please use Element#insert instead.'
    },
 
    {
        methodName: 'Bottom',
        namespace: Insertion,
        message: 'Insertion.Bottom has been deprecated, please use Element#insert instead.'
    },
 
    {
        methodName: 'After',
        namespace: Insertion,
        message: 'Insertion.After has been deprecated, please use Element#insert instead.'
    },
 
    {
        methodName: 'prepare',
        namespace: Position,
        message: 'Position.prepare has been deprecated.'
    },
 
    {
        methodName: 'within',
        namespace: Position,
        message: 'Position.within has been deprecated.'
    },
 
    {
        methodName: 'withinIncludingScrolloffsets',
        namespace: Position,
        message: 'Position.withinIncludingScrolloffsets has been deprecated.'
    },
 
    {
        methodName: 'overlap',
        namespace: Position,
        message: 'Position.overlap has been deprecated.'
    },
 
    {
        methodName: 'cumulativeOffset',
        namespace: Position,
        message: 'Position.cumulativeOffset has been deprecated, please use Element#cumulativeOffset instead.'
    },
 
    {
        methodName: 'positionedOffset',
        namespace: Position,
        message: 'Position.positionedOffset has been deprecated, please use Element#positionedOffset instead.'
    },
 
    {
        methodName: 'absolutize',
        namespace: Position,
        message: 'Position.absolutize has been deprecated, please use Element#absolutize instead.'
    },
 
    {
        methodName: 'relativize',
        namespace: Position,
        message: 'Position.relativize has been deprecated, please use Element#relativize instead.'
    },
 
    {
        methodName: 'realOffset',
        namespace: Position,
        message: 'Position.realOffset has been deprecated, please use Element#cumulativeScrollOffset instead.'
    },
 
    {
        methodName: 'offsetParent',
        namespace: Position,
        message: 'Position.offsetParent has been deprecated, please use Element#getOffsetParent instead.'
    },
 
    {
        methodName: 'page',
        namespace: Position,
        message: 'Position.page has been deprecated, please use Element#viewportOffset instead.'
    },
 
    {
        methodName: 'clone',
        namespace: Position,
        message: 'Position.clone has been deprecated, please use Element#clonePosition instead.'
    },
 
    {
        methodName: 'initialize',
        namespace: Element.ClassNames.prototype,
        message: 'Element.ClassNames has been deprecated.'
    },
 
    {
        methodName: 'classNames',
        namespace: Element.Methods,
        message: 'Element#classNames has been deprecated.\n' +
        'If you need to access CSS class names as an array, try: $w(element.classname).'
    },
 
    {
        methodName: 'setStyle',
        namespace: Element.Methods,
        message: 'Use of uncamelized style-property names is no longer supported.\n' +
        'Use either camelized style-property names or a regular CSS string instead (see online documentation).',
        type: 'error',
        condition: function(element, style) {
            return !Object.isString(style) && Object.keys(style).join('').include('-');
        }
    },
 
    {
        methodName: 'getElementsByClassName',
        namespace: document,
        message: 'document.getElementsByClassName has been deprecated, please use $$ instead.'
    },
 
    {
        methodName: 'getElementsByClassName',
        namespace: Element.Methods,
        message: 'Element#getElementsByClassName has been deprecated, please use Element#select instead.'
    },
 
    {
        methodName: 'immediateDescendants',
        namespace: Element.Methods,
        message: 'Element#immediateDescendants has been deprecated, please use Element#childElements instead.'
    },
 
    {
        methodName: 'getElementsBySelector',
        namespace: Element.Methods,
        message: 'Element#getElementsBySelector has been deprecated, please use Element#select instead.'
    },
 
    {
        methodName: 'toQueryString',
        namespace: Hash,
        message: 'Hash.toQueryString has been deprecated.\n' +
        'Use the instance method Hash#toQueryString or Object.toQueryString instead.'
    },
 
    {
        methodName: 'toJSON',
        namespace: Hash,
        message: 'Hash.toJSON has been removed.\n' +
        'Use the instance method Hash#toJSON or Object.toJSON instead.',
        type: 'error'
    },
 
    {
        methodName: 'remove',
        namespace: Hash.prototype,
        message: 'Hash#remove is no longer supported, use Hash#unset instead.\n' +
        'Please note that Hash#unset only accepts one argument.',
        type: 'error'
    },
 
    {
        methodName: 'merge',
        namespace: Hash.prototype,
        message: 'Hash#merge is no longer destructive and now operates on a clone of the Hash instance.\n' +
        'If you need a destructive merge, use Hash#update instead.',
        type: 'warn'
    },
 
    {
        methodName: 'reduce',
        namespace: Array.prototype,
        message: 'Array#reduce is no longer supported.\n' +
        'This is due to an infortunate naming collision with Mozilla\'s own implementation of Array#reduce which differs completely from Prototype\'s implementation (it\'s in fact similar to Prototype\'s Array#inject).\n' +
        'Mozilla\'s Array#reduce is already implemented in Firefox 3 (as part of JavaScript 1.8) and is about to be standardized in EcmaScript 3.1.',
        type: 'error'
    },
 
    {
        methodName: 'unloadCache',
        namespace: Event,
        message: 'Event.unloadCache has been deprecated.',
        type: 'error'
    },
 
    {
        methodName: 'create',
        namespace: Class,
        message: 'The class API has been fully revised and now allows for mixins and inheritance.\n' +
        'You can find more about it here: http://prototypejs.org/learn/class-inheritance',
        condition: function() { return !arguments.length }
    },
 
    {
        methodName: 'initialize',
        namespace: Selector.prototype,
        message: 'The Selector class has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'findElements',
        namespace: Selector.prototype,
        message: 'Selector#findElements has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'match',
        namespace: Selector.prototype,
        message: 'Selector#match has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'toString',
        namespace: Selector.prototype,
        message: 'Selector#toString has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'inspect',
        namespace: Selector.prototype,
        message: 'Selector#inspect has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'matchElements',
        namespace: Selector,
        message: 'Selector.matchElements has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'findElement',
        namespace: Selector,
        message: 'Selector.findElement has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    },
 
    {
        methodName: 'findChildElements',
        namespace: Selector,
        message: 'Selector.findChildElements has been deprecated. Please use the new Prototype.Selector API instead.',
        type: 'warn'
    }
]);
 
// Special casing for Hash.
 
(function() {
    var __properties = Object.keys(Hash.prototype).concat(['_object', '__properties']);
 
    var messages = {
        setting: new Template("Directly setting a property on an instance of Hash is no longer supported.\n" +
            "Please use Hash#set('#{property}', #{value}) instead."),
        getting: new Template("Directly accessing a property of an instance of Hash is no longer supported.\n" +
            "Please use Hash#get('#{property}') instead.")
    };
 
    function notify(property, value) {
        var message = messages[arguments.length == 1 ? 'getting' : 'setting'].evaluate({
            property: property,
            value: Object.inspect(value)
        });
        prototypeUpdateHelper.notify(message, 'error');
    }
 
    function defineSetters(obj, prop) {
        storeProperties(obj);
        if (obj.__properties.include(prop)) return;
        obj.__properties.push(prop);
        obj.__defineGetter__(prop, function() {
            checkProperties(this);
            notify(prop);
        });
        obj.__defineSetter__(prop, function(value) {
            checkProperties(this);
            notify(prop, value);
        });
    }
 
    function checkProperties(hash) {
        storeProperties(hash);
        var current = Object.keys(hash);
        if (current.length == hash.__properties.length)
            return;
        current.each(function(prop) {
            if (hash.__properties.include(prop)) return;
            notify(prop, hash[prop]);
            defineSetters(hash, prop);
        });
    }
 
    function storeProperties(h) {
        if (typeof h.__properties === 'undefined')
            h.__properties = __properties.clone();
        return h;
    }
 
    Hash.prototype.set = Hash.prototype.set.wrap(function(proceed, property, value) {
        defineSetters(this, property);
        return proceed(property, value);
    });
 
    $w('merge update').each(function(name) {
        Hash.prototype[name] = Hash.prototype[name].wrap(function(proceed, object) {
            for (var prop in object) defineSetters(this, prop);
            return proceed(object);
        });
    });
 
    $H(Hash.prototype).each(function(method) {
        var key = method.key;
        if (!Object.isFunction(method.value) || key == 'initialize') return;
        Hash.prototype[key] = Hash.prototype[key].wrap(function(proceed) {
            checkProperties(this);
            return proceed.apply(proceed, $A(arguments).splice(1));
        });
    });
 
    Hash.prototype.initialize = Hash.prototype.initialize.wrap(function(proceed, object) {
        storeProperties(this);
        for (var prop in object) defineSetters(this, prop);
        proceed(object);
    });
})();