PageRenderTime 21ms CodeModel.GetById 2ms app.highlight 10ms RepoModel.GetById 2ms app.codeStats 0ms

/api/widgets/files/enme-js_deps_src_main_resources_req_json_services.js.html

https://bitbucket.org/encuestame/enme-doc
HTML | 1083 lines | 927 code | 156 blank | 0 comment | 0 complexity | 46752d8a0f25f7c0d9f16b2c38ee7030 MD5 | raw file
   1<!DOCTYPE html>
   2<html lang="en">
   3<head>
   4    <meta charset="utf-8">
   5    <title>enme-js&#x2F;deps&#x2F;src&#x2F;main&#x2F;resources&#x2F;req&#x2F;json_services.js - Encuestame Widget API</title>
   6    <link rel="stylesheet" href="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.8.0pr2&#x2F;build&#x2F;cssgrids&#x2F;cssgrids-min.css">
   7    <link rel="stylesheet" href="..&#x2F;assets/vendor/prettify/prettify-min.css">
   8    <link rel="stylesheet" href="..&#x2F;assets/css/main.css" id="site_styles">
   9    <link rel="shortcut icon" type="image/png" href="..&#x2F;assets/favicon.png">
  10    <script src="http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;combo?3.8.0pr2&#x2F;build&#x2F;yui&#x2F;yui-min.js"></script>
  11</head>
  12<body class="yui3-skin-sam">
  13
  14<div id="doc">
  15    <div id="hd" class="yui3-g header">
  16        <div class="yui3-u-3-4">
  17            
  18                <h1><img src="http:&#x2F;&#x2F;api.encuestame.org&#x2F;mail.png" title="Encuestame Widget API"></h1>
  19            
  20        </div>
  21        <div class="yui3-u-1-4 version">
  22            <em>API Docs for: 1.146</em>
  23        </div>
  24    </div>
  25    <div id="bd" class="yui3-g">
  26
  27        <div class="yui3-u-1-4">
  28            <div id="docs-sidebar" class="sidebar apidocs">
  29                <div id="api-list">
  30    <h2 class="off-left">APIs</h2>
  31    <div id="api-tabview" class="tabview">
  32        <ul class="tabs">
  33            <li><a href="#api-classes">Classes</a></li>
  34            <li><a href="#api-modules">Modules</a></li>
  35        </ul>
  36
  37        <div id="api-tabview-filter">
  38            <input type="search" id="api-filter" placeholder="Type to filter APIs">
  39        </div>
  40
  41        <div id="api-tabview-panel">
  42            <ul id="api-classes" class="apis classes">
  43            
  44                <li><a href="..&#x2F;classes/Notifications.Activity.html">Notifications.Activity</a></li>
  45            
  46                <li><a href="..&#x2F;classes/Widget.Comment.html">Widget.Comment</a></li>
  47            
  48                <li><a href="..&#x2F;classes/Widget.Comments.html">Widget.Comments</a></li>
  49            
  50                <li><a href="..&#x2F;classes/Widget.DasboardWrapper.html">Widget.DasboardWrapper</a></li>
  51            
  52                <li><a href="..&#x2F;classes/Widget.enme.html">Widget.enme</a></li>
  53            
  54                <li><a href="..&#x2F;classes/Widget.EnmeMainLayoutWidget.html">Widget.EnmeMainLayoutWidget</a></li>
  55            
  56                <li><a href="..&#x2F;classes/Widget.FolderSelect.html">Widget.FolderSelect</a></li>
  57            
  58                <li><a href="..&#x2F;classes/Widget.Message.html">Widget.Message</a></li>
  59            
  60                <li><a href="..&#x2F;classes/Widget.Notification.html">Widget.Notification</a></li>
  61            
  62                <li><a href="..&#x2F;classes/Widget.NotificationItem.html">Widget.NotificationItem</a></li>
  63            
  64                <li><a href="..&#x2F;classes/Widget.NotificationList.html">Widget.NotificationList</a></li>
  65            
  66                <li><a href="..&#x2F;classes/Widget.NotificationListItem.html">Widget.NotificationListItem</a></li>
  67            
  68                <li><a href="..&#x2F;classes/Widget.Poll.html">Widget.Poll</a></li>
  69            
  70                <li><a href="..&#x2F;classes/Widget.PublishSupport.html">Widget.PublishSupport</a></li>
  71            
  72                <li><a href="..&#x2F;classes/Widget.Suggest.html">Widget.Suggest</a></li>
  73            
  74                <li><a href="..&#x2F;classes/Widget.Table.html">Widget.Table</a></li>
  75            
  76                <li><a href="..&#x2F;classes/Widget.TableRow.html">Widget.TableRow</a></li>
  77            
  78                <li><a href="..&#x2F;classes/Widget.Toaster.html">Widget.Toaster</a></li>
  79            
  80                <li><a href="..&#x2F;classes/Widget.TweetPollList.html">Widget.TweetPollList</a></li>
  81            
  82                <li><a href="..&#x2F;classes/Widget.User.html">Widget.User</a></li>
  83            
  84                <li><a href="..&#x2F;classes/Widget.UserGroup.html">Widget.UserGroup</a></li>
  85            
  86                <li><a href="..&#x2F;classes/Widget.UserPermission.html">Widget.UserPermission</a></li>
  87            
  88                <li><a href="..&#x2F;classes/Widget.UserTableRow.html">Widget.UserTableRow</a></li>
  89            
  90                <li><a href="..&#x2F;classes/Widget.WidgetServices.html">Widget.WidgetServices</a></li>
  91            
  92                <li><a href="..&#x2F;classes/Widgets.AbstractValidator.html">Widgets.AbstractValidator</a></li>
  93            
  94                <li><a href="..&#x2F;classes/Widgets.Answer.html">Widgets.Answer</a></li>
  95            
  96                <li><a href="..&#x2F;classes/Widgets.AnswerItem.html">Widgets.AnswerItem</a></li>
  97            
  98                <li><a href="..&#x2F;classes/Widgets.EmailValidator.html">Widgets.EmailValidator</a></li>
  99            
 100                <li><a href="..&#x2F;classes/Widgets.Hashtag.html">Widgets.Hashtag</a></li>
 101            
 102                <li><a href="..&#x2F;classes/Widgets.HashtagItem.html">Widgets.HashtagItem</a></li>
 103            
 104                <li><a href="..&#x2F;classes/Widgets.HelpContextual.html">Widgets.HelpContextual</a></li>
 105            
 106                <li><a href="..&#x2F;classes/Widgets.PasswordValidator.html">Widgets.PasswordValidator</a></li>
 107            
 108                <li><a href="..&#x2F;classes/Widgets.PublishSocialStatus.html">Widgets.PublishSocialStatus</a></li>
 109            
 110                <li><a href="..&#x2F;classes/Widgets.RealNameValidator.html">Widgets.RealNameValidator</a></li>
 111            
 112                <li><a href="..&#x2F;classes/Widgets.SignUp.html">Widgets.SignUp</a></li>
 113            
 114                <li><a href="..&#x2F;classes/Widgets.SuggestItem.html">Widgets.SuggestItem</a></li>
 115            
 116                <li><a href="..&#x2F;classes/Widgets.TweetPoll.html">Widgets.TweetPoll</a></li>
 117            
 118                <li><a href="..&#x2F;classes/Widgets.TweetpollListDetail.html">Widgets.TweetpollListDetail</a></li>
 119            
 120                <li><a href="..&#x2F;classes/Widgets.TweetPollPublishInfo.html">Widgets.TweetPollPublishInfo</a></li>
 121            
 122                <li><a href="..&#x2F;classes/Widgets.UsernameValidator.html">Widgets.UsernameValidator</a></li>
 123            
 124            </ul>
 125
 126            <ul id="api-modules" class="apis modules">
 127            
 128                <li><a href="..&#x2F;modules/Activity.html">Activity</a></li>
 129            
 130                <li><a href="..&#x2F;modules/Admon.html">Admon</a></li>
 131            
 132                <li><a href="..&#x2F;modules/Comment.html">Comment</a></li>
 133            
 134                <li><a href="..&#x2F;modules/Dashboard.html">Dashboard</a></li>
 135            
 136                <li><a href="..&#x2F;modules/Data.html">Data</a></li>
 137            
 138                <li><a href="..&#x2F;modules/ENME.html">ENME</a></li>
 139            
 140                <li><a href="..&#x2F;modules/Folders.html">Folders</a></li>
 141            
 142                <li><a href="..&#x2F;modules/Notifications.html">Notifications</a></li>
 143            
 144                <li><a href="..&#x2F;modules/Poll.html">Poll</a></li>
 145            
 146                <li><a href="..&#x2F;modules/Publish.html">Publish</a></li>
 147            
 148                <li><a href="..&#x2F;modules/Services.html">Services</a></li>
 149            
 150                <li><a href="..&#x2F;modules/SignUp.html">SignUp</a></li>
 151            
 152                <li><a href="..&#x2F;modules/Suggest.html">Suggest</a></li>
 153            
 154                <li><a href="..&#x2F;modules/Suggestion.html">Suggestion</a></li>
 155            
 156                <li><a href="..&#x2F;modules/TweetPoll.html">TweetPoll</a></li>
 157            
 158                <li><a href="..&#x2F;modules/Tweetpoll.html">Tweetpoll</a></li>
 159            
 160                <li><a href="..&#x2F;modules/TweetPoll.Answer.html">TweetPoll.Answer</a></li>
 161            
 162                <li><a href="..&#x2F;modules/TweetPoll.AnswerItem.html">TweetPoll.AnswerItem</a></li>
 163            
 164                <li><a href="..&#x2F;modules/TweetPoll.Hashtag.html">TweetPoll.Hashtag</a></li>
 165            
 166                <li><a href="..&#x2F;modules/TweetPoll.HashtagItem.html">TweetPoll.HashtagItem</a></li>
 167            
 168                <li><a href="..&#x2F;modules/TweetpollListDetail.html">TweetpollListDetail</a></li>
 169            
 170                <li><a href="..&#x2F;modules/UI.html">UI</a></li>
 171            
 172            </ul>
 173        </div>
 174    </div>
 175</div>
 176
 177            </div>
 178        </div>
 179        <div class="yui3-u-3-4">
 180                <div id="api-options">
 181        Show:
 182        <label for="api-show-inherited">
 183            <input type="checkbox" id="api-show-inherited" checked>
 184            Inherited
 185        </label>
 186
 187        <label for="api-show-protected">
 188            <input type="checkbox" id="api-show-protected">
 189            Protected
 190        </label>
 191
 192        <label for="api-show-private">
 193            <input type="checkbox" id="api-show-private">
 194            Private
 195        </label>
 196        <label for="api-show-deprecated">
 197            <input type="checkbox" id="api-show-deprecated">
 198            Deprecated
 199        </label>
 200
 201    </div>
 202
 203
 204            <div class="apidocs">
 205                <div id="docs-main">
 206                    <div class="content">
 207                        <h1 class="file-heading">File: enme-js&#x2F;deps&#x2F;src&#x2F;main&#x2F;resources&#x2F;req&#x2F;json_services.js</h1>
 208
 209<div class="file">
 210    <pre class="code prettyprint linenums">
 211&#x2F;&#x2F;dojo.provide(&quot;encuestame.org.core.commons&quot;);
 212&#x2F;&#x2F;
 213&#x2F;&#x2F;dojo.require(&quot;encuestame.org.core.commons.error.ErrorConexionHandler&quot;);
 214&#x2F;&#x2F;dojo.require(&quot;encuestame.org.core.commons.error.ErrorHandler&quot;);
 215&#x2F;&#x2F;dojo.require(&quot;dijit.Dialog&quot;);
 216&#x2F;&#x2F;dojo.require(&quot;dojo.cookie&quot;);
 217
 218&#x2F;&#x2F;
 219var ENME = {
 220    config : function() {
 221      return &quot;&quot;;
 222    },
 223    getMessage : function(){
 224      return &quot;text&quot;;
 225    }
 226};
 227
 228&#x2F;&#x2F;
 229
 230encuestame = {};
 231encuestame.activity = {};
 232encuestame.service = {};
 233encuestame.service.offline = false;
 234encuestame.service.timeout = ENME.config(&#x27;delay&#x27;);
 235encuestame.contextDefault = ENME.config(&#x27;contextPath&#x27;);
 236encuestame.signin = encuestame.contextDefault+&quot;&#x2F;signin&quot;;
 237
 238&#x2F;**
 239 * JSON GET call.
 240 * @param {String} url
 241 * @param {Object} params
 242 * @param {Function} load
 243 * @param {Function} error
 244 * @param {Boolean} logginHandler
 245 *&#x2F;
 246encuestame.service.xhrGet = function(url, params, load, error, logginHandler) {
 247    if (logginHandler == null) {
 248        logginHandler = true;
 249    }
 250    var defaultError = function(error, ioargs){
 251        console.debug(&quot;default error &quot;, error);
 252    };
 253    if(error == null){
 254      error = defaultError;
 255      console.error(&quot;default error&quot;);
 256    }
 257    if (load == null || url == null || params == null) {
 258        console.error(&quot;error params required.&quot;);
 259    } else {
 260        dojo.xhrGet({
 261            url : url,
 262            handleAs : &quot;json&quot;,
 263            failOk : true, &#x2F;&#x2F;Indicates whether a request should be allowed to fail
 264            &#x2F;&#x2F;(and therefore no console error message in the event of a failure)
 265            timeout : encuestame.service.timeout,
 266            content: params,
 267            load: load,
 268            preventCache: true,
 269            error: function(error, ioargs) {
 270                console.info(&quot;error function&quot;, ioargs);
 271              },
 272            handle: function(response, ioargs) {}
 273          });
 274    }
 275};
 276
 277&#x2F;**
 278 * JSON GET call.
 279 * @param {String} url
 280 * @param {Object} params
 281 * @param {Function} load
 282 * @param {Function} error
 283 * @param {Boolean} logginHandler
 284 *&#x2F;
 285encuestame.service.xhrGet = function(url, params, load, error, logginHandler) {
 286    if (logginHandler == null) {
 287        logginHandler = true;
 288    }
 289    var defaultError = function(error, ioargs){
 290        console.debug(&quot;default error &quot;, error);
 291    };
 292    if(error == null){
 293      error = defaultError;
 294      console.error(&quot;default error&quot;);
 295    }
 296    if (load == null || url == null || params == null) {
 297        console.error(&quot;error params required.&quot;);
 298    } else {
 299        dojo.xhrGet({
 300            url : url,
 301            handleAs : &quot;json&quot;,
 302            failOk : true, &#x2F;&#x2F;Indicates whether a request should be allowed to fail
 303            &#x2F;&#x2F;(and therefore no console error message in the event of a failure)
 304            timeout : encuestame.service.timeout,
 305            content: params,
 306            load: load,
 307            preventCache: true,
 308            error: function(error, ioargs) {
 309                console.info(&quot;error function&quot;, ioargs);
 310                var message = &quot;&quot;;
 311                console.info(ioargs.xhr.status, error);
 312                &#x2F;&#x2F;if dialog is missing or is hide.
 313                if (encuestame.error.dialog == null || !encuestame.error.dialog.open) {
 314                    switch (ioargs.xhr.status) {
 315                    case 403:
 316                        var jsonError = dojo.fromJson(ioargs.xhr.responseText);
 317                        console.info(&quot;queryObject&quot;, jsonError);
 318                        message = &quot;Application does not have permission for this action&quot;;
 319                        if(!logginHandler){
 320                            encuestame.error.denied(message);
 321                        } else {
 322                            if (!jsonError.session || jsonERror.anonymousUser) {
 323                                console.info(&quot;session is expired&quot;);
 324                                encuestame.error.session(encuestame.error.messages.session);
 325                            }
 326                        }
 327                        break;
 328                    case 0:
 329                        message = &quot;A network error occurred. Check that you are connected to the internet.&quot;;
 330                        encuestame.error.conexion(message);
 331                        break;
 332                    default:
 333                        message = &quot;An unknown error occurred&quot;;
 334                        encuestame.error.unknown(message, ioargs.xhr.status);
 335                    }
 336                }
 337              },
 338            handle: function(response, ioargs) {
 339                &#x2F;&#x2F;encuestame.filter.response(response);
 340                var message = &quot;&quot;;
 341                console.info(ioargs.xhr.status, error);
 342                switch (ioargs.xhr.status) {
 343                case 200:
 344                    message = &quot;Good request.&quot;;
 345                    &#x2F;&#x2F;if (encuestame.error.dialog != null) {
 346                     &#x2F;&#x2F;   encuestame.error.clear();
 347                    &#x2F;&#x2F;}
 348                    break;
 349                case 404:
 350                    message = &quot;The page you requested was not found.&quot;;
 351                    &#x2F;&#x2F;encuestame.error.createDialog(message, message);
 352                    break;
 353                case 400:
 354                    message = &quot;Bad Request&quot;;
 355                    &#x2F;&#x2F;encuestame.error.createDialog(message, message);
 356                    break;
 357                case 500:
 358                    break;
 359                    message = &quot;Service temporarily unavailable.&quot;;
 360                    &#x2F;&#x2F;encuestame.error.createDialog(message, message);
 361                    break;
 362                case 407:
 363                    message = &quot;You need to authenticate with a proxy.&quot;;
 364                    &#x2F;&#x2F;encuestame.error.createDialog(message, message);
 365                    break;
 366                case 0:
 367                    message = &quot;A network error occurred. Check that you are connected to the internet.&quot;;
 368                    &#x2F;&#x2F;encuestame.error.conexion(message);
 369                    break;
 370                default:
 371                    message = &quot;An unknown error occurred&quot;;
 372                    &#x2F;&#x2F;encuestame.error.unknown(message, ioargs.xhr.status);
 373                }
 374              }
 375          });
 376    }
 377};
 378
 379encuestame.shortUrlProvider = [
 380                    {code:&quot;googl&quot;,label:&quot;http:&#x2F;&#x2F;googl.com&quot;},
 381                    {code:&quot;tinyurl&quot;,label:&quot;http:&#x2F;&#x2F;tinyurl.com&quot;},
 382                    {code:&quot;bitly&quot;,label:&quot;http:&#x2F;&#x2F;bit.ly&#x2F;&quot;}
 383                   ];
 384
 385encuestame.error = {};
 386encuestame.error.debug = true;
 387encuestame.error.dialog = null;
 388
 389encuestame.utilities = {};
 390encuestame.utilities.vote = 1;
 391encuestame.utilities.GRADINENT_CLASS = &quot;gradient-gray&quot;;
 392encuestame.utilities.HIDDEN_CLASS = &quot;hidden&quot;;
 393
 394&#x2F;*
 395 * create a username profile link.
 396 *&#x2F;
 397&#x2F;&#x2F; encuestame.utilities.usernameLink = function(username) {
 398&#x2F;&#x2F;     var url = encuestame.contextDefault;
 399&#x2F;&#x2F;     if (username) {
 400&#x2F;&#x2F;         url = url.concat(&quot;&#x2F;profile&#x2F;&quot;);
 401&#x2F;&#x2F;         url = url.concat(username);
 402&#x2F;&#x2F;         return url;
 403&#x2F;&#x2F;     } else {
 404&#x2F;&#x2F;         url = url.concat(&quot;&#x2F;404&quot;);
 405&#x2F;&#x2F;         return url;
 406&#x2F;&#x2F;     }
 407&#x2F;&#x2F; };
 408
 409&#x2F;**
 410 * Create a no results message node.
 411 *&#x2F;
 412encuestame.utilities.noResults = function(classCSS) {
 413    var norR = dojo.create(&quot;div&quot;);
 414    dojo.addClass(norR, &quot;no-results&quot;);
 415    if (classCSS != null) {
 416        dojo.addClass(norR, classCSS);
 417    }
 418    norR.innerHTML = encuestame.constants.messageCodes[&quot;024&quot;];
 419    return norR;
 420};
 421
 422encuestame.utilities.randomString = function() {
 423    var text = &quot;&quot;;
 424    var possible = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&quot;;
 425    for( var i=0; i &lt; 5; i++ )
 426        text += possible.charAt(Math.floor(Math.random() * possible.length));
 427    return text;
 428};
 429
 430&#x2F;**
 431 * Checking if a string is empty, null or undefined.
 432 * @param string value
 433 *&#x2F;
 434encuestame.utilities.isEmpty = function(str) {
 435     return (!str || 0 === str.length);
 436};
 437
 438encuestame.utilities.url = {};
 439
 440&#x2F;*
 441 * summary :: build hashtag url
 442 *    hashtagName : hashtag name;
 443 *&#x2F;
 444encuestame.utilities.url.hashtag  = function(hashtagName) {
 445    if (hashtagName) {
 446        var url = encuestame.contextDefault;
 447        url = url.concat(&quot;&#x2F;tag&#x2F;&quot;);
 448        url = url.concat(hashtagName);
 449        url = url.concat(&quot;&#x2F;&quot;);
 450        return url;
 451    } else {
 452        throw new Error(&quot;hashtag name is required&quot;);
 453    }
 454};
 455
 456&#x2F;*
 457 * clear dialog.
 458 *&#x2F;
 459encuestame.error.clear = function(){
 460    console.info(&quot;clean&quot;, encuestame.error.dialog);
 461    if (encuestame.error.dialog != null){
 462        console.info(&quot;hidding dialog&quot;);
 463        encuestame.error.dialog.hide();
 464    }
 465};
 466
 467&#x2F;*
 468 * denied dialog.
 469 *&#x2F;
 470encuestame.error.denied = function(error){
 471    var div = dojo.doc.createElement(&#x27;div&#x27;);
 472    var h3 = dojo.doc.createElement(&#x27;h3&#x27;);
 473        h3.innerHTML = error;
 474        var p = dojo.doc.createElement(&#x27;p&#x27;);
 475        p.innerHTML = status;
 476        div.appendChild(h3);
 477        div.appendChild(p);
 478    encuestame.error.createDialog(&quot;Opps, What&#x27;s happening?&quot;, div);
 479};
 480
 481&#x2F;*
 482 * unknow error dialog.
 483 *&#x2F;
 484encuestame.error.unknown = function(error, status){
 485    var div = dojo.doc.createElement(&#x27;div&#x27;);
 486    var h3 = dojo.doc.createElement(&#x27;h3&#x27;);
 487        h3.innerHTML = error;
 488        var p = dojo.doc.createElement(&#x27;p&#x27;);
 489        p.innerHTML = status;
 490        div.appendChild(h3);
 491        div.appendChild(p);
 492    encuestame.error.createDialog(&quot;Opps, What&#x27;s happening?&quot;, div, true);
 493};
 494
 495&#x2F;*
 496 * conexion error.
 497 *&#x2F;
 498encuestame.error.conexion = function(message){
 499    var div = dojo.doc.createElement(&#x27;div&#x27;);
 500    var h3 = dojo.doc.createElement(&#x27;h3&#x27;);
 501    h3.innerHTML = message;
 502    div.appendChild(h3);
 503    encuestame.error.createDialog(&quot;Network Issues&quot;, div, true);
 504};
 505
 506&#x2F;*
 507 * expired sesion dialog.
 508 *&#x2F;
 509encuestame.error.session = function(message){
 510    var div = dojo.doc.createElement(&#x27;div&#x27;);
 511    var h3 = dojo.doc.createElement(&#x27;h3&#x27;);
 512    h3.innerHTML = message;
 513    var widgetButton = new dijit.form.Button({
 514        label: &quot;Sign In&quot;,
 515        onClick: dojo.hitch(this, function(event) {
 516            dojo.stopEvent(event);
 517            document.location.href = encuestame.signin;
 518        })
 519    });
 520    div.appendChild(h3);
 521    div.appendChild(widgetButton.domNode);
 522    encuestame.error.createDialog(&quot;Not logged in&quot;, div, true);
 523};
 524
 525&#x2F;*
 526 * Create New Error Dialog.
 527 *&#x2F;
 528encuestame.error.createDialog = function(title, content, addcloseButton){
 529    &#x2F;&#x2F;var node = dojo.byId(&quot;errorHandler&quot;);
 530    console.error(&quot;error dialog &quot;+title, content);
 531&#x2F;&#x2F;    if(node != null){
 532&#x2F;&#x2F;        if (encuestame.error.dialog != null){
 533&#x2F;&#x2F;             encuestame.error.dialog.open ? encuestame.error.dialog.hide() : &quot;&quot;;
 534&#x2F;&#x2F;        } else {
 535&#x2F;&#x2F;        }
 536&#x2F;&#x2F;        dojo.empty(node);
 537&#x2F;&#x2F;        &#x2F;&#x2F;close button validation
 538&#x2F;&#x2F;        addcloseButton = addcloseButton == null ? false : addcloseButton;
 539&#x2F;&#x2F;        encuestame.error.dialog = new dijit.Dialog({
 540&#x2F;&#x2F;              title: title,
 541&#x2F;&#x2F;              content: content,
 542&#x2F;&#x2F;              style: &quot;width: 480px; height: 100px;&quot;
 543&#x2F;&#x2F;          });
 544&#x2F;&#x2F;        if(addcloseButton){
 545&#x2F;&#x2F;            var widgetButton = new dijit.form.Button({
 546&#x2F;&#x2F;                label: &quot;Close&quot;,
 547&#x2F;&#x2F;                onClick: dojo.hitch(this, function(event) {
 548&#x2F;&#x2F;                    dojo.stopEvent(event);
 549&#x2F;&#x2F;                    encuestame.error.dialog.hide();
 550&#x2F;&#x2F;                })
 551&#x2F;&#x2F;            });
 552&#x2F;&#x2F;            var content = encuestame.error.dialog.content;
 553&#x2F;&#x2F;            content.appendChild(widgetButton.domNode);
 554&#x2F;&#x2F;        }
 555&#x2F;&#x2F;        console.debug(&quot;dialog&quot;, encuestame.error.dialog);
 556&#x2F;&#x2F;        node.appendChild(encuestame.error.dialog.domNode);
 557&#x2F;&#x2F;        encuestame.error.dialog.show();
 558&#x2F;&#x2F;    } else {
 559&#x2F;&#x2F;        console.error(&quot;no error handler dialog found&quot;);
 560&#x2F;&#x2F;    }
 561};
 562
 563encuestame.error.messages = {};
 564encuestame.error.messages.denied = &quot;Application does not have permission for this action&quot;;
 565encuestame.error.messages.session = &quot;Your session has expired, please sign in to contiue.&quot;;
 566
 567encuestame.filter = {};
 568
 569&#x2F;**
 570 * {&quot;error&quot;:{&quot;message&quot;:&quot;Access is denied&quot;}}
 571 *&#x2F;
 572encuestame.filter.response = function(response){
 573    console.info(&quot;encuestame.filter.response&quot;, response);
 574    &#x2F;&#x2F;no permissions or session
 575    if(response == undefined){
 576        &#x2F;&#x2F;no response
 577
 578    }else if (response.error.message != undefined &amp;&amp; response.success == undefined ) {
 579        encuestame.session.getSession();
 580    } else if(response.success == undefined ) {
 581        console.info(&quot;sucess response no existe&quot;);
 582    }
 583};
 584
 585encuestame.session = {};
 586encuestame.session.getSession = function(){
 587    &#x2F;&#x2F;JSESSIONID=dh3u2xvj7fwd1llbddl33dhcq; path=&#x2F;encuestame; domain=demo2.encuestame.org
 588    var sessionCookie = dojo.cookie(&quot;JSESSIONID&quot;);
 589    if(sessionCookie == undefined){
 590        encuestame.error.session(encuestame.error.messages.denied);
 591    } else {
 592        console.info(&quot;session is valid&quot;);
 593    }
 594};
 595
 596encuestame.status = [&#x27;SUCCESS&#x27;,&#x27;FAILED&#x27;, &#x27;STAND_BY&#x27;, &#x27;RE_SCHEDULED&#x27;, &#x27;RE_SEND&#x27;];
 597
 598encuestame.surveys = [&#x27;TWEETPOLL&#x27;, &#x27;POLl&#x27;, &#x27;SURVEY&#x27;, &#x27;HASHTAG&#x27;];
 599
 600encuestame.social = {};
 601
 602encuestame.social.shortPicture = function(provider){
 603     var url = encuestame.contextDefault + &quot;&#x2F;resources&#x2F;images&#x2F;social&#x2F;&quot;+provider.toLowerCase()
 604               +&quot;&#x2F;enme_icon_&quot;+provider.toLowerCase()+&quot;.png&quot;;
 605     return url;
 606};
 607
 608encuestame.notification = {};
 609encuestame.notification.load = {};
 610encuestame.notification.load.limit = 100;
 611
 612&#x2F;&#x2F; encuestame.notification.buildURLDescription = function(type, description, url) {
 613&#x2F;&#x2F;     var multi = dojo.doc.createElement(&quot;div&quot;);
 614&#x2F;&#x2F;     var a = dojo.doc.createElement(&quot;a&quot;);
 615&#x2F;&#x2F;     a.target = &quot;_blank&quot;;
 616&#x2F;&#x2F;     if (type == &quot;TWEETPOLL_PUBLISHED&quot;) {
 617&#x2F;&#x2F;         multi.innerHTML = description+ &quot;&lt;br&#x2F;&gt; &quot;;
 618&#x2F;&#x2F;         a.href = encuestame.contextDefault + url;
 619&#x2F;&#x2F;         a.innerHTML = &quot;See details here.&quot;;
 620&#x2F;&#x2F;     } else if (type == &quot;SOCIAL_MESSAGE_PUBLISHED&quot;) {
 621&#x2F;&#x2F;         multi.innerHTML = &quot;&quot;;
 622&#x2F;&#x2F;         a.href = url;
 623&#x2F;&#x2F;         a.innerHTML = description;
 624&#x2F;&#x2F;     }
 625&#x2F;&#x2F;     multi.appendChild(a);
 626&#x2F;&#x2F;     return multi;
 627&#x2F;&#x2F; };
 628
 629encuestame.session.activity = {};
 630
 631encuestame.session.activity.name = &quot;enme-ac&quot;;
 632encuestame.session.activity.notification = {t:0,n:0};
 633
 634&#x2F;*
 635 * Return activity cookie.
 636 *&#x2F;
 637encuestame.session.activity.cookie = function(){
 638    var sessionCookie = dojo.cookie(encuestame.session.activity.name);
 639    if(!sessionCookie) {
 640        &#x2F;&#x2F;new cookie.
 641        encuestame.session.update(encuestame.session.activity.name,
 642                encuestame.session.activity.notification);
 643        sessionCookie = dojo.cookie(encuestame.session.activity.name);
 644    }
 645    return dojo.fromJson(sessionCookie);
 646};
 647
 648&#x2F;*
 649 * Update notification cookie info.
 650 *&#x2F;
 651encuestame.session.activity.updateNot = function(t,n) {
 652    var cokienotification = encuestame.session.activity.cookie();
 653    if (cokienotification) {
 654        cokienotification.t = t;
 655        cokienotification.n = n;
 656        encuestame.session.update(encuestame.session.activity.name, cokienotification);
 657    }
 658};
 659
 660&#x2F;*
 661 *  Creates the cookie with default values.
 662 *&#x2F;
 663encuestame.session.update = function(name, data){
 664    dojo.cookie(
 665        name,
 666        dojo.toJson(data),
 667        {path:&#x27;&#x2F;&#x27;}
 668    );
 669};
 670
 671
 672encuestame.date = {};
 673encuestame.date.timeFormat = &quot;hh:mm:ss&quot;;
 674encuestame.date.dateFormat = &quot;M&#x2F;d&#x2F;yy&quot;;
 675encuestame.date.getFormatTime = function(date, fmt){
 676    return dojo.date.locale.format(date, {
 677        selector: &quot;date&quot;,
 678        datePattern: fmt
 679    });
 680}
 681
 682&#x2F;**
 683 * Json Post Call.
 684 *&#x2F;
 685encuestame.service.xhrPost = function(url, form, load, error, formEnabled) {
 686    &#x2F;&#x2F;default error.
 687    var defaultError = function(error, ioargs){
 688        console.error(&quot;default error &quot;, error);
 689    };
 690    if(error == null){
 691      error = defaultError;
 692    }
 693    console.debug(&quot;Form POST &quot;, form);
 694    if(load == null || url == null || form == null){
 695        console.error(&quot;error params required.&quot;);
 696    } else {
 697        var xhrArgs = {
 698                url: url,
 699                timeout : encuestame.service.timeout,
 700                handleAs: &quot;json&quot;,
 701                failOk : true, &#x2F;&#x2F;Indicates whether a request should be allowed to fail
 702                &#x2F;&#x2F;(and therefore no console error message in the event of a failure)
 703                load: load,
 704                preventCache: true,
 705                error: error
 706            };
 707        if (formEnabled) {
 708            dojo.mixin(xhrArgs, { form: form });
 709        } else {
 710            dojo.mixin(xhrArgs, { postData: form });
 711        }
 712        var deferred = dojo.xhrPost(xhrArgs);
 713    }
 714};
 715
 716encuestame.service.handler = {};
 717
 718
 719&#x2F;**
 720 * JSON GET call.
 721 * @param {String} url
 722 * @param {Object} params
 723 * @param {Function} load
 724 * @param {Function} error
 725 * @param {Boolean} logginHandler
 726 *&#x2F;
 727encuestame.service.GET = function(url, params, load, error, loadingFunction) {
 728      dojo.deprecated(&quot;Use URL Services&quot;);
 729      var innerLoad = dojo.hitch(this, function(data) {
 730        loadingFunction == null ? &quot;&quot; : loadingFunction.end();
 731        if (dojo.isFunction(load)) {
 732          load(data);
 733        }
 734      });
 735      &#x2F;&#x2F; initialize the loading
 736        loadingFunction == null ? &quot;&quot; : loadingFunction.init();
 737        var argsGet = {
 738                url : url,
 739            handleAs : &quot;json&quot;,
 740            failOk : true, &#x2F;&#x2F;Indicates whether a request should be allowed to fail
 741            &#x2F;&#x2F; (and therefore no console error message in the event of a failure)
 742            timeout : encuestame.service.timeout,
 743            content: params,
 744            load: innerLoad,
 745            preventCache: true,
 746            error: error,
 747            handle : encuestame.service.handler.serviceHander
 748       }
 749       dojo.xhrGet(argsGet);
 750};
 751
 752&#x2F;**
 753 * xhr POST param.
 754 *&#x2F;
 755encuestame.service.xhrPostParam = function(url, params, load, error, formEnabled, loadingFunction) {
 756   dojo.deprecated(&quot;Use URL Services&quot;);
 757    &#x2F;&#x2F;validate form param.
 758    formEnabled = formEnabled == null ? true : formEnabled;
 759    &#x2F;&#x2F;default error.
 760    var defaultError = function(error, ioargs) {
 761        console.error(&quot;default error &quot;, error);
 762    };
 763    if (error == null) {
 764      error = defaultError;
 765    }
 766    &#x2F;&#x2F;get the xhr encapsulated error message.
 767    errorWrapper = function (errorText, xhrError) {
 768      if (typeof(xhrError === &quot;object&quot;)){
 769        var responseText = dojo.fromJson(xhrError.xhr.response);
 770        error(responseText.error.message);
 771      } else {
 772        error(errorText || &quot;undefined error&quot;);
 773      }
 774    };
 775    &#x2F;&#x2F;console.debug(&quot;Form POST &quot;, form);
 776    if (load == null || url == null || params == null){
 777        console.error(&quot;error params required.&quot;);
 778    } else {
 779      var innerLoad = function(data) {
 780        loadingFunction == null ? &quot;&quot; : loadingFunction.end();
 781        load(data);
 782      };
 783      &#x2F;&#x2F;load = innerLoad(load);
 784        var xhrArgs = {
 785            url: url,
 786            postData: dojo.objectToQuery(params),
 787            handleAs: &quot;json&quot;,
 788            &#x2F;&#x2F;headers: { &quot;Content-Type&quot;: &quot;application&#x2F;json&quot;, &quot;Accept&quot;: &quot;application&#x2F;json&quot; },
 789            load: innerLoad,
 790            preventCache: true,
 791            error: errorWrapper
 792        };
 793        &#x2F;&#x2F;initialize the loading
 794        loadingFunction == null ? &quot;&quot; : loadingFunction.init();
 795        &#x2F;&#x2F;make the call
 796        var deferred = dojo.xhrPost(xhrArgs);
 797    }
 798};
 799
 800
 801&#x2F;*
 802 * get context widget.
 803 *&#x2F;
 804encuestame.contextWidget = function() {
 805        &#x2F;&#x2F;return encuestame.contextDefault;
 806  return &quot;encuestame&#x2F;&quot;;
 807};
 808
 809encuestame.contextDefault = &quot;encuestame&#x2F;&quot;;
 810
 811encuestame.service.list = {};
 812encuestame.service.list.userList = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;users.json&quot;;
 813encuestame.service.list.getNotifications = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;notifications&#x2F;list.json&quot;;
 814encuestame.service.list.getAllNotifications = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;notifications&#x2F;all&#x2F;list.json&quot;;
 815encuestame.service.list.changeStatusNotification = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;notifications&#x2F;readed.json&quot;;
 816encuestame.service.list.removeNotification = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;remove-notification.json&quot;;
 817encuestame.service.list.userInfo = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;user-info.json&quot;;
 818encuestame.service.list.createUser = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;create-user.json&quot;;
 819encuestame.service.list.profile = {};
 820encuestame.service.list.profile.my = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;settings&#x2F;profile&#x2F;my.json&quot;;
 821encuestame.service.list.upgradeProfile = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;user&#x2F;profile&#x2F;upgrade.json&quot;;
 822&#x2F;&#x2F;settings update
 823encuestame.service.list.updateProfile = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;settings&#x2F;profile&#x2F;update.json&quot;;
 824encuestame.service.list.updateUsername = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;settings&#x2F;profile&#x2F;username&#x2F;update.json&quot;;
 825encuestame.service.list.updateEmail = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;settings&#x2F;profile&#x2F;email&#x2F;update.json&quot;;
 826encuestame.service.list.updatePicture = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;settings&#x2F;profile&#x2F;picture&#x2F;update.json&quot;;
 827
 828encuestame.service.list.listPermissions = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;list-permissions.json&quot;;
 829encuestame.service.list.listUserPermissions = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;list-user-permissions.json&quot;;
 830encuestame.service.list.addPermission = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;add-permission.json&quot;;
 831encuestame.service.list.removePermission = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;remove-permission.json&quot;;
 832&#x2F;&#x2F;Hashtag Service
 833encuestame.service.list.hashtags = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;hashtags.json&quot;;
 834encuestame.service.list.ranking = {};
 835encuestame.service.list.ranking.hashtag = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;hashtags&#x2F;stats&#x2F;ranking.json&quot;;
 836encuestame.service.list.range = {};
 837encuestame.service.list.range.hashtag =  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;hashtags&#x2F;stats&#x2F;button&#x2F;range.json&quot;;
 838&#x2F;*
 839 * Get Hashtag action.
 840 * @param type could be &#x2F; hashtag, tweetpoll, poll.
 841 * @param action could be &#x2F; remove &#x2F; add
 842 *&#x2F;
 843encuestame.service.list.hashtagsAction = {};
 844encuestame.service.list.hashtagsAction.getAction = function(&#x2F;* string *&#x2F; type,  &#x2F;* string *&#x2F;action) {
 845    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;hashtag&#x2F;&quot;+ type+&quot;&#x2F;&quot;+action+&quot;.json&quot;;
 846};
 847encuestame.service.list.cloud = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;hashtags&#x2F;cloud.json&quot;;
 848
 849&#x2F;&#x2F;Social Services
 850encuestame.service.list.allSocialAccount = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;social&#x2F;accounts.json&quot;;
 851
 852&#x2F;&#x2F;tweetpoll service
 853encuestame.service.list.publishTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;publish.json&quot;;
 854encuestame.service.list.listTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;search.json&quot;;
 855encuestame.service.list.changeTweetPollStatus = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;change-open-status-tweetpoll.json&quot;;
 856encuestame.service.list.resumeliveResultsTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;resumeliveResults-tweetpoll.json&quot;;
 857encuestame.service.list.captchaTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;captcha-tweetpoll.json&quot;;
 858encuestame.service.list.favouriteTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;favourite-tweetpoll.json&quot;;
 859encuestame.service.list.liveResultsTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;liveResults-tweetpoll.json&quot;;
 860encuestame.service.list.notificationTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;notification-tweetpoll.json&quot;;
 861encuestame.service.list.repeatedTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;repeated-tweetpoll.json&quot;;
 862encuestame.service.list.VotesTweetPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;chart&#x2F;tweetpoll&#x2F;votes.json&quot;;
 863
 864encuestame.service.list.tweetpoll = {};
 865encuestame.service.list.tweetpoll.answer = {};
 866encuestame.service.list.tweetpoll.answer.getVotes = function(username, id){
 867    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;tweetpoll&#x2F;&quot;+username+&quot;&#x2F;answer&#x2F;&quot;+id+&quot;&#x2F;votes.json&quot;;
 868};
 869
 870&#x2F;*
 871 * Poll Services
 872 *&#x2F;
 873encuestame.service.list.poll = {};
 874encuestame.service.list.listPoll = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;poll&#x2F;search.json&quot;;
 875encuestame.service.list.poll.create = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;poll&#x2F;create.json&quot;;
 876encuestame.service.list.poll.publish = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;poll&#x2F;publish.json&quot;;
 877encuestame.service.list.poll.detail = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;poll&#x2F;detail.json&quot;;
 878encuestame.service.list.poll.setParameter = function(&#x2F;* string *&#x2F; type) {
 879    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;poll&#x2F;&quot;+type+&quot;-poll.json&quot;;
 880};
 881encuestame.service.list.poll.getVotes = function(username) {
 882    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;&quot;+username+&quot;&#x2F;poll&#x2F;votes.json&quot;;
 883};
 884
 885&#x2F;**
 886 * Comment Services.
 887 *&#x2F;
 888encuestame.service.comments = {};
 889encuestame.service.comments.list = function(type) {
 890    return encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;comment&#x2F;comments&#x2F;&quot;+ type +&quot;.json&quot;;
 891};
 892encuestame.service.comments.search = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;comment&#x2F;search.json&quot;;
 893encuestame.service.comments.like = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;comment&#x2F;like_vote.json&quot;;
 894encuestame.service.comments.dislike = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;comment&#x2F;dislike_vote.json&quot;;
 895encuestame.service.comments.create = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;comment&#x2F;create.json&quot;;
 896
 897encuestame.service.list.rate = {};
 898encuestame.service.list.rate.comments = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;comment&#x2F;rate&#x2F;top.json&quot;;
 899encuestame.service.list.rate.profile = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;frontend&#x2F;topusers.json&quot;;
 900encuestame.service.list.rate.stats = function(type) {
 901    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;frontend&#x2F;&quot;+type+&quot;&#x2F;stats.json&quot;;
 902};
 903encuestame.service.list.generic = {};
 904encuestame.service.list.generic.stats = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;stats&#x2F;generic.json&quot;;
 905encuestame.service.list.rate.buttons =	encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;hashtags&#x2F;stats&#x2F;button.json&quot;;
 906
 907&#x2F;**
 908 * Vote services.
 909 *&#x2F;
 910encuestame.service.list.votes = {};
 911encuestame.service.list.getTweetPollVotes = function(username, id){
 912    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;&quot;+username+&quot;&#x2F;tweetpoll&#x2F;&quot;+id+&quot;&#x2F;votes.json&quot;;
 913};
 914&#x2F;**
 915 * Vote on Home
 916 * @param username the source of the vote, could be anonymous
 917 *&#x2F;
 918encuestame.service.list.votes.home = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;frontend&#x2F;home&#x2F;vote.json&quot;;
 919encuestame.service.list.addAnswer = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;answer&#x2F;add.json&quot;;
 920encuestame.service.list.removeAnswer = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;tweetpoll&#x2F;answer&#x2F;remove.json&quot;;
 921&#x2F;&#x2F;group services
 922encuestame.service.list.groupCreate = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;groups&#x2F;createGroup.json&quot;;
 923encuestame.service.list.updateCreate = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;groups&#x2F;updateGroup.json&quot;;
 924encuestame.service.list.updateCreate = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;groups&#x2F;removeGroup.json&quot;;
 925encuestame.service.list.loadGroups = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;groups&#x2F;groups.json&quot;;
 926encuestame.service.list.assingGroups = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;admon&#x2F;groups&#x2F;assingToUser.json&quot;;
 927
 928encuestame.service.list.checkProfile = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;user&#x2F;account&#x2F;validate.json&quot;;
 929
 930
 931encuestame.service.publicService = {};
 932encuestame.service.publicService.validate = {};
 933encuestame.service.publicService.validate.username = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;public&#x2F;validator&#x2F;username.json&quot;;
 934encuestame.service.publicService.validate.email = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;public&#x2F;validator&#x2F;email.json&quot;;
 935encuestame.service.publicService.validate.realName = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;public&#x2F;validator&#x2F;realName.json&quot;;
 936
 937&#x2F;&#x2F;settings social
 938encuestame.service.social = {};
 939encuestame.service.social.links = {};
 940encuestame.service.social.links.loadByType = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;public&#x2F;social&#x2F;links&#x2F;published.json&quot;;
 941encuestame.service.social.action = {};
 942
 943encuestame.service.social.action.defaultState = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;social&#x2F;actions&#x2F;account&#x2F;default.json&quot;;
 944encuestame.service.social.action.remove = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;social&#x2F;actions&#x2F;account&#x2F;remove.json&quot;;
 945
 946encuestame.service.social.facebook = {};
 947encuestame.service.social.linkedIn = {};
 948
 949&#x2F;&#x2F;search.
 950encuestame.service.search = {};
 951encuestame.service.search.suggest = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;search&#x2F;quick-suggest.json&quot;;
 952
 953encuestame.service.stream = {};
 954encuestame.service.stream = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;frontend&#x2F;stream.json&quot;;
 955
 956encuestame.service.folder = {};
 957
 958encuestame.service.folder.create = function(type) {
 959    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;folder&#x2F;&quot;+type+&quot;&#x2F;create.json&quot;;
 960};
 961encuestame.service.folder.update = function(type) {
 962    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;folder&#x2F;&quot;+type+&quot;&#x2F;update.json&quot;;
 963};
 964encuestame.service.folder.remove = function(type) {
 965    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;folder&#x2F;&quot;+type+&quot;&#x2F;remove.json&quot;;
 966};
 967encuestame.service.folder.move = function(type) {
 968    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;folder&#x2F;&quot;+type+&quot;&#x2F;move.json&quot;;
 969};
 970
 971encuestame.service.folder.list = function(type) {
 972    return  encuestame.contextWidget()+&quot;&#x2F;api&#x2F;survey&#x2F;folder&#x2F;&quot;+type+&quot;&#x2F;list.json&quot;;
 973};
 974encuestame.service.stream = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;frontend&#x2F;stream.json&quot;;
 975encuestame.service.dashboard = {};
 976encuestame.service.dashboard.create = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;dashboard&#x2F;create-dashboard.json&quot;;
 977encuestame.service.dashboard.list = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;dashboard&#x2F;list.json&quot;;
 978encuestame.service.dashboard.select = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;dashboard&#x2F;select.json&quot;;
 979encuestame.service.gadget = {};
 980encuestame.service.gadget.directory = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;gadgets&#x2F;directory.json&quot;;
 981encuestame.service.gadget.list = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;gadgets&#x2F;list.json&quot;;
 982encuestame.service.gadget.move = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;dashboard&#x2F;move-gadget.json&quot;;
 983encuestame.service.gadget.add = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;gadgets&#x2F;add.json&quot;;
 984encuestame.service.gadget.load = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;dashboard&#x2F;gadget&#x2F;load.json&quot;;
 985encuestame.service.gadget.remove = encuestame.contextWidget()+&quot;&#x2F;api&#x2F;common&#x2F;dashboard&#x2F;gadget&#x2F;remove.json&quot;;
 986
 987&#x2F;&#x2F;short url service.
 988&#x2F;&#x2F;encuestame.service.short = {};
 989&#x2F;&#x2F;encuestame.service.short.google = &quot;&#x2F;api&#x2F;short&#x2F;url&#x2F;google.json&quot;;
 990&#x2F;&#x2F;encuestame.service.short.tinyurl = &quot;&#x2F;api&#x2F;short&#x2F;url&#x2F;tinyurl.json&quot;;
 991
 992encuestame.constants = {};
 993encuestame.constants.passwordExcludes = [];
 994encuestame.constants.imageSizes = {
 995    thumbnail : &quot;thumbnail&quot;,
 996    defaultType : &quot;default&quot;,
 997    profile : &quot;profile&quot;,
 998    preview : &quot;preview&quot;,
 999    web : &quot;web&quot;
1000};
1001
1002encuestame.messages = {};
1003
1004&#x2F;&#x2F; publish a message on main frame.
1005&#x2F;*
1006 * MESSAGE: &quot;message&quot;,
1007            WARNING: &quot;warning&quot;,
1008            ERROR: &quot;error&quot;,
1009            FATAL: &quot;fatal&quot;
1010 *&#x2F;
1011encuestame.messages.pubish = function(message, type, duration) {
1012    &#x2F;&#x2F;console.info(&quot;encuestame.messages.pubish&quot;, message);
1013    &#x2F;&#x2F;console.info(&quot;encuestame.messages.pubish&quot;, type);
1014    &#x2F;&#x2F;console.info(&quot;encuestame.messages.pubish&quot;, duration);
1015    dojo.publish(&#x27;&#x2F;encuestame&#x2F;message&#x2F;publish&#x27;, [{ message: message, type: type, duration: duration}]);
1016};
1017
1018encuestame.modalbox = {};
1019
1020
1021encuestame.constants.errorCodes = {
1022    &quot;002&quot; : &quot;Enter your first and last name.&quot;,
1023    &quot;003&quot; : &quot;Whats your email address?&quot;,
1024    &quot;006&quot; : &quot;Doesn&#x27;t look like a valid email.&quot;,
1025    &quot;007&quot; : &quot;An email is required!&quot;,
1026    &quot;008&quot; : &quot;This email is already registered&quot;,
1027    &quot;012&quot; : &quot;Password is too obvious.&quot;,
1028    &quot;013&quot; : &quot;Password is not secure enough.&quot;,
1029    &quot;014&quot; : &quot;Password must be at least 6 characters. No whitespace.&quot;,
1030    &quot;015&quot; : &quot;Password cannot be blank!&quot;,
1031    &quot;017&quot; : &quot;This username is already taken!&quot;,
1032    &quot;018&quot; : &quot;Invalid username!&quot;,
1033    &quot;019&quot; : &quot;A username is required!&quot;,
1034    &quot;020&quot; : &quot;Your Tweet contains more than 140 characters. You will have to be more ingenious.&quot;,
1035    &quot;021&quot; : &quot;Your Tweet no contains required answers, imagine a sky without clouds?&quot;,
1036    &quot;022&quot; : &quot;You need at least 1 social account to publish your beautiful creation.&quot;,
1037    &quot;023&quot; : &quot;Ops, something is wrong.&quot;,
1038    &quot;024&quot; : &quot;Please, save your tweetpoll first&quot;
1039};
1040
1041encuestame.constants.warningCodes = {
1042    &quot;001&quot; : &quot;Warning message to define&quot;
1043};
1044
1045encuestame.constants.messageCodes = {
1046    &quot;001&quot; : &quot;Name looks great&quot;,
1047    &quot;004&quot; : &quot;We will email you a confirmation.&quot;,
1048    &quot;005&quot; : &quot;Validating...&quot;,
1049    &quot;007&quot; : &quot;An email is required!&quot;,
1050    &quot;008&quot; : &quot;This email is already registered&quot;,
1051    &quot;009&quot; : &quot;Password is perfect!&quot;,
1052    &quot;010&quot; : &quot;Password is okay.&quot;,
1053    &quot;011&quot; : &quot;Password could be more secure.&quot;,
1054    &quot;016&quot; : &quot;Don&#x27;t worry, you can change it later.&quot;,
1055    &quot;020&quot; : &quot;&quot;,
1056    &quot;021&quot; : &quot;Drag your gadget here !!&quot;,
1057    &quot;022&quot; : &quot;Be the first to comment on this publication.&quot;,
1058    &quot;023&quot; : &quot;Updated Successfully&quot;,
1059    &quot;024&quot; : &quot;Sorry, no results found&quot;,
1060    &quot;025&quot; : &quot;Publishing your tweets, please wait ...&quot;
1061 };
1062
1063encuestame.constants.version = { version : &quot;1.143&quot;};
1064
1065    </pre>
1066</div>
1067
1068                    </div>
1069                </div>
1070            </div>
1071        </div>
1072    </div>
1073</div>
1074<script src="..&#x2F;assets/vendor/prettify/prettify-min.js"></script>
1075<script>prettyPrint();</script>
1076<script src="..&#x2F;assets/js/yui-prettify.js"></script>
1077<script src="..&#x2F;assets/../api.js"></script>
1078<script src="..&#x2F;assets/js/api-filter.js"></script>
1079<script src="..&#x2F;assets/js/api-list.js"></script>
1080<script src="..&#x2F;assets/js/api-search.js"></script>
1081<script src="..&#x2F;assets/js/apidocs.js"></script>
1082</body>
1083</html>