<commit_before>/* ************************************************************************

  feedreader

  Copyright:
    2009 Deutsche Telekom AG, Germany, http://telekom.com

 ************************************************************************ */

/**
 * Answers View
 */
qx.Class.define("feedreader.view.Answers", 
{
  extend : unify.view.RemoteView,
  type : "singleton",

  members : 
  {
    // overridden
    getTitle : function(type, param) {
      return "Answers";
    },
    
    
    _getBusinessObject : function() {
      return feedreader.business.Answers.getInstance();
    },

    
    // overridden
    _createView : function() 
    {
      var layer = new unify.ui.Layer(this);
      var titlebar = new unify.ui.TitleBar(this);
      layer.add(titlebar);
      
      var content = new unify.ui.Content;
      content.add("Answers");
      layer.add(content);

      return layer;
    }
  }
});
<commit_msg>Worked on answers layout/server reaction<commit_after>/* ************************************************************************

  feedreader

  Copyright:
    2009 Deutsche Telekom AG, Germany, http://telekom.com

 ************************************************************************ */

/**
 * Answers View
 */
qx.Class.define("feedreader.view.Answers", 
{
  extend : unify.view.RemoteView,
  type : "singleton",

  members : 
  {
    // overridden
    getTitle : function(type, param) {
      return "Answers";
    },
    
    
    _getBusinessObject : function() {
      return feedreader.business.Answers.getInstance();
    },
    
    _getServiceName : function() {
      return "answers";
    },
    
    _errorHandler : function(kind) {
      alert("Error: " + kind);
    },
    
    _getServiceParams : function() 
    {
      var field = document.getElementById("answersSearch");
      if (!field) {
        return;
      }
      
      return {
        query : "'" + field.value + "'"
      };
    },
    
    
    _hasServiceRequestParams : function()
    {
      var field = document.getElementById("answersSearch");
      return field && field.value.length > 0;
    },
    
    
    _renderData : function(data)
    {
      var questions = data.query.results.Question;
      var entries = questions.map(function(entry) {
        return "<li>" + entry.Subject + " (" + entry.NumAnswers + " answers)</li>"; 
      });
      document.getElementById("answerResults").innerHTML = "<ul>" + entries + "</ul>";
      
    },
    

    
    // overridden
    _createView : function() 
    {
      var layer = new unify.ui.Layer(this);
      var titlebar = new unify.ui.TitleBar(this);
      layer.add(titlebar);
      
      var content = new unify.ui.Content;
      content.add("<h3>Answers</h3><input type='search' id='answersSearch'/><div class='button' exec='refresh'>Refresh</div><div id='answerResults'></div>");
      layer.add(content);

      return layer;
    }
  }
});

{'fraction_non_alphanumeric': 0.22716387273349298, 'fraction_numerical': 0.00376325692781389, 'mean_word_length': 2.561510353227771, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5526122', 'n_tokens_mistral': 887, 'n_tokens_neox': 821, 'n_words': 148}