PageRenderTime 264ms CodeModel.GetById 140ms app.highlight 5ms RepoModel.GetById 116ms app.codeStats 1ms

/src/main/webapp/public/js/common.js

http://thoughtsite.googlecode.com/
JavaScript | 68 lines | 47 code | 6 blank | 15 comment | 12 complexity | b67c0c99f1696324c349eb2c7c18d1dd MD5 | raw file
 1/* Copyright 2010 Google Inc.
 2 * 
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 * 
 7 *      http://www.apache.org/licenses/LICENSE-2.0
 8 * 
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS.
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
14 */
15
16google.setOnLoadCallback(function() {
17    ie.Login.setLoggedinUserCallback('handleUserProfileTab');
18    ie.Login.setLoggedinUserCallback('handleAdminTab');
19    setTimeout('ie.Login.socialLogin()', 1000);
20    $('#keyword').focus(function () {
21        if($('#keyword').val() == 'Enter Search Keyword') {
22            $('#keyword').val('');
23        }
24    });
25    $('#keyword').blur(function () {
26        if($('#keyword').val() == '') {
27            $('#keyword').val('Enter Search Keyword');
28        }
29    });
30    $('#dialog').dialog({
31        autoOpen: false,
32        modal: true
33    });
34    
35    $("#tab-menu").tabs();
36});
37
38function validateSearch() {
39	if('Enter Search Keyword' == $.trim($('#keyword').val())) {
40        $('#keyword').val('');
41    }
42    return true;
43    
44}
45function handleUserProfileTab(isLoggedIn) {
46    if(isLoggedIn) {
47        $('#userProfile').show();
48    }
49    else {
50        $('#userProfile').hide();
51    }
52}
53
54function handleAdminTab(isLoggedIn, role) {
55    if(role != ie.config.ADMIN_ROLE)
56        return;
57    if(isLoggedIn) {
58        $('#admin').show();
59    }
60    else {
61        $('#admin').hide();
62    }
63}
64
65// theme for re captcha
66var RecaptchaOptions = {
67   theme : 'clean'
68};