File: jsxc.lib.tab.js.html

package info (click to toggle)
libjs-jsxc 3.4.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 18,704 kB
  • sloc: javascript: 68,510; makefile: 13; sh: 1
file content (111 lines) | stat: -rw-r--r-- 3,576 bytes parent folder | download
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: jsxc.lib.tab.js</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: jsxc.lib.tab.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>/**
 * Provides communication between tabs.
 *
 * @namespace jsxc.tab
 */
jsxc.tab = {
   CONST: {
      MASTER: 'master',
      SLAVE: 'slave'
   },

   exec: function(target, cmd, params) {

      params = Array.prototype.slice.call(arguments, 2);
      if (params.length === 1 &amp;&amp; $.isArray(params[0])) {
         params = params[0];
      }

      if (target === jsxc.tab.CONST[jsxc.master ? 'MASTER' : 'SLAVE']) {
         jsxc.exec(cmd, params);

         if (jsxc.master) {
            return;
         }
      }

      jsxc.storage.setUserItem('_cmd', {
         target: target,
         cmd: cmd,
         params: params,
         rnd: Math.random() // force storage event
      });
   },

   /**
    * Execute command in master tab.
    *
    * @param  {String} cmd Command
    * @param  {String[]} params List of parameters
    */
   execMaster: function() {
      var args = Array.prototype.slice.call(arguments);
      args.unshift(jsxc.tab.CONST.MASTER);

      jsxc.tab.exec.apply(this, args);
   },

   /**
    * Execute command in all slave tabs.
    *
    * @param  {String} cmd Command
    * @param  {String[]} params List of parameters
    */
   execSlave: function() {
      var args = Array.prototype.slice.call(arguments);
      args.unshift(jsxc.tab.CONST.SLAVE);

      jsxc.tab.exec.apply(this, args);
   }
};
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsxc.Message.html">Message</a></li></ul><h3>Namespaces</h3><ul><li><a href="jsxc.html">jsxc</a></li><li><a href="jsxc.fileTransfer.html">fileTransfer</a></li><li><a href="jsxc.gui.html">gui</a></li><li><a href="jsxc.gui.dialog.html">dialog</a></li><li><a href="jsxc.gui.queryActions.html">queryActions</a></li><li><a href="jsxc.gui.roster.html">roster</a></li><li><a href="jsxc.gui.window.html">window</a></li><li><a href="jsxc.muc.html">muc</a></li><li><a href="jsxc.notification.html">notification</a></li><li><a href="jsxc.options.html">options</a></li><li><a href="jsxc.otr.html">otr</a></li><li><a href="jsxc.storage.html">storage</a></li><li><a href="jsxc.tab.html">tab</a></li><li><a href="jsxc.webrtc.html">webrtc</a></li><li><a href="jsxc.xmpp.html">xmpp</a></li><li><a href="jsxc.xmpp.bookmarks.html">bookmarks</a></li><li><a href="jsxc.xmpp.carbons.html">carbons</a></li><li><a href="jsxc.xmpp.chatState.html">chatState</a></li><li><a href="jsxc.xmpp.httpUpload.html">httpUpload</a></li><li><a href="jsxc.xmpp.mam.html">mam</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 10 2019 12:36:11 GMT+0200 (Central European Summer Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>