File: index.html

package info (click to toggle)
libjs-jsxc 3.0.0%2Bdfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 16,856 kB
  • ctags: 2,731
  • sloc: makefile: 13; sh: 1
file content (198 lines) | stat: -rw-r--r-- 6,478 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE HTML>
<html>

<head>
   <title>JSXC example application</title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

   <link href="css/bootstrap.min.css" media="all" rel="stylesheet" type="text/css" />

   <!-- require:dependencies -->
   <link href="../build/css/jquery-ui.min.css" media="all" rel="stylesheet" type="text/css" />
   <link href="../build/css/jsxc.css" media="all" rel="stylesheet" type="text/css" />
   <!--  endrequire -->

   <link href="css/example.css" media="all" rel="stylesheet" type="text/css" />

   <!-- require:dependencies -->
   <script src="../build/lib/jquery.min.js"></script>
   <script src="../build/lib/jquery.ui.min.js"></script>
   <script src="../build/lib/jquery.slimscroll.js"></script>
   <script src="../build/lib/jquery.fullscreen.js"></script>
   <script src="../build/lib/jsxc.dep.js"></script>
   <!--  endrequire -->

   <script src="js/bootstrap.min.js"></script>

   <!-- jsxc library -->
   <script src="../build/jsxc.min.js"></script>

   <!-- init script -->
   <script src="js/example.js"></script>

</head>

<body>
   <div class="container" id="content" role="main">

      <div class="row">
         <div class="col-xs-12">
            <h1 class="page-header">JSXC <small>example</small></h1>

            <p>This example demonstrates different types of login methods for <a href="https://www.jsxc.org/">JSXC</a>. You find further information in our <a href="https://github.com/jsxc/jsxc/wiki">wiki</a>.</p>
         </div>
      </div>

      <div class="row">

         <div class="col-xs-12 col-md-4">
            <h3>Dual-Login</h3>

            <p>You should use this method if you have already a login in your website.</p>

            <form id="form" method="post" action="login.html" class="form form-horizontal">
               <fieldset>
                  <div class="form-group">
                     <label for="username" class="col-xs-4 control-label">Username:</label>
                     <div class="col-xs-8">
                        <input type="text" id="username" name="username" class="form-control" />
                     </div>
                  </div>

                  <div class="form-group">
                     <label for="password" class="col-xs-4 control-label">Password:</label>
                     <div class="col-xs-8">
                        <input type="password" id="password" name="password" class="form-control" />
                     </div>
                  </div>

                  <div class="form-group">
                     <div class="col-xs-offset-4 col-xs-8">
                        <button type="submit" class="submit btn btn-primary">Log in chat and submit</button>
                        <button class="logout btn btn-default" style="display:none;">Log out</button>
                     </div>
                  </div>

               </fieldset>
            </form>

            <pre>&lt;form id="form"&gt;
  &lt;input type="text" id="username" /&gt;
  &lt;input type="password" id="password" /&gt;
  &lt;input type="submit" value="Submit" /&gt;
&lt;/form&gt;

&lt;button id="logout"&gt;Logout&lt;/button&gt;</pre>

            <pre>jsxc.init({
  loginForm: {
    form: '#form',
    jid: '#username',
    pass: '#password'
  },
  logoutElement: $('#logout'),
  loadSettings: function() {
    return xmpp: {
      url: '/http-bind/',
      domain: 'localhost',
      resource: 'example',
      overwrite: true,
      onlogin: true
    };
  },
  root: '/jsxc/'
});</pre>

         </div>

         <div class="col-xs-12 col-md-4">
            <h3>AJAX Login</h3>

            <p>Do you want to login directly within your script? Choose this type.

               <form id="form2" class="form form-horizontal">
                  <fieldset>
                     <div class="alert alert-warning col-xs-12" role="alert">
                        <strong>Warning!</strong> Your username or password is wrong!
                     </div>

                     <div class="form-group">
                        <label for="username2" class="col-xs-4 control-label">Username:</label>
                        <div class="col-xs-8">
                           <input type="text" id="username2" class="form-control" />
                        </div>
                     </div>

                     <div class="form-group">
                        <label for="password2" class="col-xs-4 control-label">Password:</label>
                        <div class="col-xs-8">
                           <input type="password" id="password2" class="form-control" />
                        </div>
                     </div>

                     <div class="form-group">
                        <div class="col-xs-offset-4 col-xs-8">
                           <button type="submit" id="submit2" class="submit btn btn-primary" data-loading-text="Logging in...">Log in chat</button>
                           <button class="logout btn btn-default">Log out</button>
                        </div>
                     </div>
                  </fieldset>
               </form>

               <pre>&lt;input type="text" id="username" /&gt;
&lt;input type="password" id="password" /&gt;
&lt;button id="submit"&gt;Log in&lt;/button&gt;</pre>

               <pre>jsxc.init({
  xmpp: {
    url: '/http-bind/'
  },
  root: '/jsxc/'
});

$('#submit').click(function(){
  var username = $('#username').val();
  var password = $('#password').val();

  var jid = username + '@localhost';

  jsxc.xmpp.login(jid , password);
});
</pre>
         </div>

         <div class="col-xs-12 col-md-4">
            <h3>Box Login</h3>

            <p>Do you look for a discrete login method? Choose this.</p>

            <div class="form" id="form3">
               <button class="submit btn btn-primary">Open Box</button>
               <button class="logout btn btn-default">Log out</button>
            </div>

            <pre>&lt;button id="button"&gt;Open Box&lt;/button&gt;</pre>

            <pre>jsxc.init({
  loadSettings: function() {
    return xmpp: {
      url: '/http-bind/',
      domain: 'localhost',
      resource: 'example',
      overwrite: true,
      onlogin: true
    };
  },
  root: '/jsxc/'
});

$('#button').click(jsxc.gui.showLoginBox);</pre>
         </div>

      </div>
   </div>
</body>

</html>