<?xml version="1.0" encoding="UTF-8"?>
<Module>
    <ModulePrefs 
     title="__MSG_status_gadget__"
     description="What are you up to? Let everyone know by updating your status or pulling in other updates from Twitter, Facebook or Pownce."
     thumbnail="http://storage.ning.com/topology/rest/1.0/file/get/3915025345?profile=original"
     directory_title="__MSG_status_gadget__"
     screenshot="http://os.ning.com/apps/status/gfx/screenshot.png"
     title_url="http://os.ning.com/apps/status/gadget.php"
     author="Ning"
     author_email="ninghelp@ning.com"
     author_affiliation="Ning, Inc."
     author_location="Palo Alto, CA, USA" >
        <Locale messages="http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/locale/ALL_ALL.xml"/> 
        <Locale lang="en" messages="http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/locale/ALL_ALL.xml"/> 
        <Locale lang="pt" messages="http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/locale/pt_BR.xml"/> 
        <Require feature="opensocial-0.7"/>
        <Require feature="dynamic-height"/>
        <Require feature="settitle"/>
        <Require feature="views" />
        <Require feature="skins" />
	<Optional feature="ning" />
    </ModulePrefs>
    <Content type="html" view="default,canvas,profile,home">
        <![CDATA[
        <script>
            appUrl = 'http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status'
        </script>
        <script>var viewer
var owner
var env
var network
var config = {
    number:5,
    feed:''
}

//Not everyone has firebug... c'mon, go get it http://getfirebug.com
if (!console) {
  var console = {}
  console.log = function(text){
    return
  }
}

/* returns the style reference for a given css rule */
function getStyle (cssrule) {
    for (var i in document.styleSheets) {
        var styleRules = (document.styleSheets[i].rules) ? document.styleSheets[i].rules :
                         (document.styleSheets[i].cssRules) ? document.styleSheets[i].cssRules : [];
        for (var j=0; j<styleRules.length; j++){
            if (styleRules[j].selectorText.toUpperCase() == cssrule.toUpperCase()) {
                return styleRules[j];
            }
        }
    }
    return null;
}

/* Applies the skin from the Open Social container */
function updateCSS() {
    var bgColor     = gadgets.skins.getProperty(gadgets.skins.Property.BG_COLOR);
    var fontColor   = gadgets.skins.getProperty(gadgets.skins.Property.FONT_COLOR);
    var anchorColor = gadgets.skins.getProperty(gadgets.skins.Property.ANCHOR_COLOR);
    var gadgetStyle = getStyle('.gadget');
    var gadgetLinks = getStyle('.gadget a');
    var gadgetButtons = getStyle('input.button');
    gadgetStyle.style.color = fontColor;
    gadgetStyle.style.backgroundColor = bgColor;
    gadgetLinks.style.color = anchorColor;
    gadgetButtons.style.backgroundColor = anchorColor;
    var buttonContrast = Contrast.test(anchorColor, '#222222');
    if (buttonContrast == true) {
      gadgetButtons.style.color = '#222222';
    } else {
      gadgetButtons.style.color = '#FFFFFF';
    }
}

/*
  Color Contrast | Andrew Waer 
  Origins: http://juicystudio.com/services/colourcontrast.php

  Usage:
 
  // Contrast test for two colors
  // returns passing score OR false if test fails
  Contrast.test('#ffffff', '#000000');

  // find best match from one or two color sets
  // returns array containing two hex values OR false if no match
  Contrast.match('#ffffff', ['#000000', '#336699']);
  Contrast.match(['#ffffff', '#000000', '#336699']);
  Contrast.match(['#ffffff','#ffffcc'], ['#000000', '#336699']);
*/

var Contrast = function()
{
  // private functions and properties
  var _private =
  {
    min : { 
      'brightness': 125, 
      'difference': 500 
    },
    brightness : function(rgb1, rgb2){
      var b1 = ((rgb1.r * 299) + (rgb1.g * 587) + (rgb1.b * 114)) / 1000;
      var b2 = ((rgb2.r * 299) + (rgb2.g * 587) + (rgb2.b * 114)) / 1000;
      return Math.abs(Math.round(b1-b2));
    },
    difference : function(rgb1, rgb2){
      var diff = (Math.max(rgb1.r, rgb2.r) - Math.min(rgb1.r, rgb2.r)) + 
                 (Math.max(rgb1.g, rgb2.g) - Math.min(rgb1.g, rgb2.g)) + 
                 (Math.max(rgb1.b, rgb2.b) - Math.min(rgb1.b, rgb2.b));
      return Math.abs(Math.round(diff));
    },
    rgb : function(hex){
      hex = hex.replace('#','');
      var rgb = {
        r: parseInt(hex[0] + hex[1], 16),
        g: parseInt(hex[2] + hex[3], 16),
        b: parseInt(hex[4] + hex[5], 16)
      };
      return rgb;
    }
  };
  // public functions and properties
  var _public =
  {
    test : function(hex1, hex2){
      var rgb1 = _private.rgb(hex1);
      var rgb2 = _private.rgb(hex2);
      var brightness = _private.brightness(rgb1, rgb2);
      var difference = _private.difference(rgb1, rgb2);
      return (
        brightness >= _private.min.brightness && difference >= _private.min.difference
          ? ((brightness - _private.min.brightness) + (difference - _private. min.difference))
          : false
      );
    },
    match : function(hex1, hex2){
      var total_score, i, j;

      if (typeof hex1 == 'string') {hex1 = [hex1];}
      if (typeof hex2 == 'string') {hex2 = [hex2];}
      var best_match = { 
        score: 0,
        hex1:  null,
        hex2:  null
      };
      if (hex2 == null){
        for (i=0; i<hex1.length; i++){
          for (j=0; j<hex1.length; j++){
            total_score = _public.test(hex1[i], hex1[j]);
            if (total_score > best_match.score){
              best_match.score = total_score;
              best_match.hex1 = hex1[i];
              best_match.hex2 = hex1[j];
            }
          }
        }
      } 
      else {
        for (i=0; i<hex1.length; i++){
          for (j=0; j<hex2.length; j++){
            total_score = _public.test(hex1[i], hex2[j]);
            if (total_score > best_match.score){
              best_match.score = total_score;
              best_match.hex1 = hex1[i];
              best_match.hex2 = hex2[j];
            }
          }
        }
      }
      return (
        best_match.score > 0
        ? [ best_match.hex1, best_match.hex2 ]
        : false
      );
    }
  };
  return _public;
}();

/**
 * Request information about the gadget owner and viewer
 */
function requestInfo(callback) {
  var req = opensocial.newDataRequest();
  req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER), "owner");
  req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER), "viewer");
  req.send(callback);
}

function getInfoCB(arg) {
  if (arg.hadError()) {
    alert("There seems to be an error. Please contact the Help Center at http://help.ning.com.");
  } else {
    network = arg.getField(ning.app.Field.SUB_DOMAIN);
    network += ".ning.com";
  }  
}

function loadConfig(){
    var req = opensocial.newDataRequest();
    env = opensocial.getEnvironment();

    if (gadgets.util.hasFeature("ning")) {
         ning.app.getInfo(getInfoCB);
    } else {
         network = env.getDomain();
    }
   
    var fields = [ "updatesPerPage", "externalFeed"];
    req.add(req.newFetchPersonAppDataRequest(opensocial.DataRequest.PersonId.OWNER, fields), "owner_data");
    req.send(configLoaded);    
}

function configLoaded(response) {
    if (response.get("owner_data").hadError()) {
        alert('error loading configuration')
    } else {
        var data = response.get("owner_data").getData();
        var n = 0
        var f = ''
        if (data[owner.getId()]) {
            n = data[owner.getId()].updatesPerPage
            var select = document.getElementById('n_updates')
            for (var i=0; i < select.options.length; i++) {
                if ((select.options.item(i)) && (select.options.item(i).value == n)) {
                    select.options.item(i).setAttribute('selected', 'true')
                    break
                }
            }
            f = data[owner.getId()].externalFeed
            if (f != undefined ) { document.getElementById('external-feed').value = f }
            config.number = n
            config.feed = f
        }
        loadList(n, f)
        if(viewer.isOwner()){
            document.getElementById('admin-bar').style.display = 'block'
            document.getElementById('statusupdateform').style.display = "block"
            gadgets.window.adjustHeight()
        }
    }
    gadgets.window.adjustHeight()
};

function updateConfig(){
    var select = document.getElementById('n_updates')
    var updatesPerPage = select.options[select.selectedIndex].value
    var externalFeed = document.getElementById('external-feed').value
    var req = opensocial.newDataRequest();
    req.add(
        req.newUpdatePersonAppDataRequest("OWNER", "updatesPerPage", updatesPerPage),
        "set_data");
    req.add(
        req.newUpdatePersonAppDataRequest("OWNER", "externalFeed", externalFeed),
        "set_data");
    req.send(onConfigUpdated);
    return false
}

function onConfigUpdated(response)  {
    if (response.get("set_data").hadError()) {
      alert('Error updating config')
    } else {
        var select = document.getElementById('n_updates')
        var updatesPerPage = select.options[select.selectedIndex].value
        var externalFeed = document.getElementById('external-feed').value
        config.number = updatesPerPage
        config.feed = externalFeed
        loadList(updatesPerPage, externalFeed)
        toggleSettings()
    }
};



function loadList(numUpdates, feed) {
    if (!numUpdates) numUpdates = config.number
    if (feed == undefined) feed = config.feed
    document.getElementById('external-feed').value = feed
    config.feed = feed
    var url = appUrl+'/gadget.php';
    var params = {};
    var postdata = {
        action : 'list',
        external_feed: feed,
        begin: 0,
        end: numUpdates,
        container: network,
        user_id: owner.getId()
    };
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
    gadgets.io.makeRequest(url+'?t='+ new Date().getTime()+'&'+gadgets.io.encodeValues(postdata), listLoaded, params);
}

function listLoaded(ret) {
    var htmlout = ''
    var list = document.getElementById('statuslist')
    if(ret.errors && ret.errors.length>0){
        htmlout = 'Error - ' + ret.errors[0]
    } else {
        if (ret.data.result != 'success') {
            htmlout = '<li>' + ret.data.result + '</li>'
        } else {
            for ( var i=0; i < ret.data.list.length; i++) {
                htmlout += '<li class="status'+ (ret.data.list[i].service ? (' external '+ret.data.list[i].service) : '') +'">' + ret.data.list[i].title + '<span class="timestamp">' + elapsed_time(ret.data.list[i].timestamp) + '</span>'
                if (viewer.isOwner()) {
                    htmlout += '<span class="statusitem-admin-actions"> <a href="#" class="delete-link" id="delete-'+ ret.data.list[i].id +'" onclick="return deleteStatusClick(this);">'+new gadgets.Prefs().getMsg("delete")+'</a></span>'
                }
                htmlout += '</li>'
            }
            if (ret.data.list.length == 0){
                htmlout = '<li>There are no status updates yet.</li>'
            }
        }
    }
    list = document.getElementById('statuslist')
    if (ret.data.list.length > 0){ 
        link = document.getElementById('rsslink');
        var container = network;
        var user_id = owner.getId();
        link.innerHTML = '<a class="rss" href="'+ appUrl +'/gadget.php?action=list&fmt=rss&container='+escape(container)+'&user_id='+escape(user_id)+'&external_feed='+escape(config.feed)+'" target="_blank">RSS</a>';
        list.parentNode.appendChild(link)
        
    }
    list.innerHTML = htmlout
    gadgets.window.adjustHeight()
}

function init() {
    updateCSS();
    gadgets.window.adjustHeight();
    requestInfo(function (data) {
        viewer = data.get("viewer").getData();
        owner  = data.get("owner").getData();
        loadConfig()
        displayFooter()
    })
}

function displayFooter(){
    var whichfooter = (env.getDomain().indexOf('ning.com') == -1 ) ? 'others' : 'ning';
    var footer = document.getElementById(whichfooter + '-footer')
    if (footer) { footer.style.display = 'block' }
}


function toggleSettings(){
    var settings = document.getElementById('settingsform')
    var statusupdate = document.getElementById('statusupdate')
    var editlink = document.getElementById('edit-link')
    if(settings.style.display == 'none') {
        editlink.innerHTML = "Cancel"
        settings.style.display = 'block'
        statusupdate.style.display = 'none'
    } else {
        editlink.innerHTML = "Settings"
        settings.style.display = 'none'
        statusupdate.style.display = 'block'
    }
    gadgets.window.adjustHeight()
    return false
}

/**
 * Validate the form and send the request for a new status update if ok
 */
function submitStatus(){
    //@TODO check the license
    // if (!document.getElementById('license-checkbox').checked) {
    //     alert('you must set a license')
    //     return false
    // }
    var status_text = document.getElementById('updatefield').value;
    
    if (status_text.length > 140) { return false }
    var url = appUrl + '/gadget.php'
    var params = {};
    var postdata = {
        action : 'create',
        viewer_id : viewer.getId(),
        status_textarea : status_text
    };
    
    params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
    params[gadgets.io.RequestParameters.POST_DATA] = gadgets.io.encodeValues(postdata);

console.log("before makeRequest in submitStatus");
    gadgets.io.makeRequest(url, statusSubmitted, params);
console.log("after makeRequest in submitStatus");
    
    return false
}

function statusSubmitted(ret) {
    if(ret.errors && ret.errors.length>0){
        //@TODO localize this text
        var confirmationmsg = "There was an error when posting your update to the gadget server \
        and it will not be logged in your gadget stream. Do you want to proceed anyways and post \
        the update to your network activity stream only?"
        if (confirm(confirmationmsg)) {
            var status_text =  document.getElementById('updatefield').value;
            postActivity(status_text);
        }
    } else {
console.log("in statusSubmitted");
console.log(ret.data.result);
console.log(ret.data);
        if(ret.data.result == 'created') {
            var status_text = ret.data.query.status_textarea;
            loadList()
            postActivity(status_text);
            document.getElementById('updatefield').value = ''
        } else {
            alert('Error: '+ret.data.result)
        }
    }
}

/*
 * Creates an activity item in the user's stream if that permission was
 * granted to the app
 */
function postActivity(text) {  
   var params = {};  
   params[opensocial.Activity.Field.TITLE] = text;
   var activity = opensocial.newActivity(params); 
   opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH, onActivityPosted);
};        

/** The parameter passed to the callback is an opensocial.ResponseItem that
 * indicates whether the activity creation request succeeded.
 */
function onActivityPosted(status) {
  if (status && status.hadError()){
    alert("Error creating activity");
  } else {
    // alert("Activity successfully created.");
  }
};

function deleteStatusClick(aelement) {
    var id = aelement.id.substring('delete-'.length, aelement.id.length)
    var url = appUrl+'/gadget.php';
    var params = {};
    var postdata = {
        action : 'delete',
        id : id
    };

    params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
    params[gadgets.io.RequestParameters.POST_DATA] = gadgets.io.encodeValues(postdata);
    gadgets.io.makeRequest(url, deleteStatusClickResponse, params);
}

function deleteStatusClickResponse(ret) {
    if(ret.errors && ret.errors.length>0){
        alert('Error - ' + ret.errors[0])
    } else {
        if(ret.data.result == 'deleted') {
            loadList()
        } else {
            alert('Error: '+ret.data.result)
        }
    }
};

function updateCharCount() {
    var status_text = document.getElementById('updatefield').value;
    var limit_display = document.getElementById('char-limit')
    var post_publish_btn = document.getElementById('post_publish')
    limit_display.innerHTML = (140 - status_text.length)
    if (status_text.length > 140) {
        limit_display.style.fontWeight = 'bold';
        post_publish_btn.setAttribute('disabled', 'true' );
    } else {
        limit_display.style.fontWeight = 'normal';
        post_publish_btn.removeAttribute('disabled');
    }
}

function elapsed_time(date) {
    if(!date) return "";
    d = new Date();
    d.setTime(date*1000);
    var diff = (new Date().getTime()) - d.getTime();
    if (diff <= 0) {
        return (new gadgets.Prefs().getMsg('JUST_NOW'));
    } else if (diff < 60*1000) {
        var seconds = Math.floor(diff/1000);
        return seconds + ((seconds==1) ? ' __MSG_SECOND_AGO__' : ' __MSG_SECONDS_AGO__');
    } else if (diff < 3600*1000) {
        var minutes = Math.floor(diff/1000/60);
        return minutes + ((minutes==1) ? ' __MSG_MINUTE_AGO__' : ' __MSG_MINUTES_AGO__');
    } else if (diff < 86400*1000) {
        var hours = Math.floor(diff/1000/60/60);
        var minutes = Math.floor((diff - 60*60*hours)/60*1000);
        return hours + ((hours==1) ? ' __MSG_HOUR_AGO__' : ' __MSG_HOURS_AGO__');
    } else if (diff < 3600*48) {
        return '__MSG_1_DAY_AGO__';
    } else {
        return (d.getMonth()+1)+'/'+d.getDate()+
        ((d.getFullYear() == new Date().getFullYear()) ? '' : ('/'+d.getFullYear()));
    }
}

gadgets.util.registerOnLoadHandler(init);
</script>
        <style>.gadget {
    /* is replaced when the skin is applied */
    background-color: #ccc;
    color: #999;
    padding:1px;
    padding-bottom:10px;
}
.gadget a {
    /* is replaced when the skin is applied */
    color: #00f;
}

#admin-bar {
    text-align: right; 
}

a.edit, .edit {
    background:url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/set_actions.gif) no-repeat 0 -192px;
    padding-left:17px;
}

.primary-action{
}

.footer {
    clear:left;
    text-align:center;
}

.timestamp {
margin-left:1em;
opacity:.5;
}

li {
    list-style:none;
}

.status {
    margin-top:10px;
    margin-bottom:0px;
    border-bottom:thin dotted;
    padding-bottom:5px;
}

.status.external {
    background-repeat:no-repeat;
    padding-left:20px;
}

.status.external.twitter_com { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/twitter-icon.png); }
.status.external.facebook_com { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/facebook-icon.png); }
.status.external.pownce_com { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/pownce-icon.png); }
.status.external.jaiku_com { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/jaiku-icon.png); }
.status.external.identi_ca { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/identica-icon.png); }
.status.external.plurk_com { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/plurk-icon.png); }
.status.external.friendfeed_com { background-image : url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/friendfeed-icon.png); }

.help-caption{
}

#external-feed{
    width:98%;
}

.statusitem-admin-actions{
}
h3 {
font-weight:bold;
}

#statusupdate small{
}

#char-limit {
    float:right;
    margin-top:-1.2em;
}

#updatefield {
    height:3em;
    width:98%;
}

a.delete-link{
    float:right;
	width:10px; 
	height:10px;
	padding:3px;
	text-indent:-9999px;
    background:transparent url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/delete.png) no-repeat center center;
}

.rss {
    background:url(http://os.ning.com/local/home/xncore/playground/597/907/os/apps/status/gfx/set_tools.gif) no-repeat 0 -28px; 
    padding-left:17px;
}

/* Typography */
.gadget {font-size:12px !important;}
h1 {font-size:1.4em}
h2 {font-size:1.3em}
h3 {font-size:1.2em}
h4 {font-size:1.1em}
h1, h2, h3, h4, p {margin:.25em 0 .75em;}
input.text, select {margin:0 0 .75em;}

/* Spacing */
ul, ol, li {margin-left:0;padding-left:0;}
p.buttongroup {
	margin:0.5em 0;
	padding-top:.7em;
	border-top:1px solid #ccc;
	text-align:right;
	clear:both;
	overflow:visible !important;
}

a.button,
input.button {
	display:inline-block;
	width:auto;
	border:1px solid #aaa;
	font-size:1em;
	text-decoration:none;
	color:#333;
	overflow:visible;
	white-space:nowrap;
	line-height:1em!important;
	padding:.35em .6em .45em;
}
/* ff2 */
a.button, x:-moz-any-link {
  padding:.28em .53em .226em;
}
input.button, x:-moz-any-link {
	padding:.2em .3em .15em;
}
/* ff3 */
a.button, x:-moz-any-link, x:default {
  padding:.4em .532em .34em;
}
input.button, x:-moz-any-link, x:default {
	padding:.21em .3em .16em;
}
/* ie: */
a.button {
  *margin-bottom:-.3em;
	*padding:.3em .57em;
}
input.button {
	*padding:.2em .5em .1em;
}</style>
        ]]>
    </Content>
    <Content type="html" view="default,profile,home"><![CDATA[<div class="gadget"><div id="admin-bar" style="display:none;"><a class="edit" href="#" onclick="return toggleSettings()" id="edit-link">Settings</a></div>
<div id="statusupdate">
    <form  id="statusupdateform" style="display:none;" onsubmit="return submitStatus()">
        <p> 
            <textarea name="status_textarea" value="" id="updatefield" onkeyup="updateCharCount()"></textarea>
        </p>
        <p class="buttongroup">
            <input type="submit" class="primary-action button" name="post_action_publish" id="post_publish" value="__MSG_update_status__" />
            <span id="char-limit" title="Remaining characters"></span>
        </p>
    </form>
    <ul id="statuslist">
        <li>loading…</li>
    </ul>
    <p id="rsslink"></p>
</div>
<form id="settingsform" method="POST" style="display:none;">
    <h4>__MSG_how_many_updates__</h4>
    <select id="n_updates">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="5">5</option>
        <option value="10">10</option>
        <option value="20">20</option>
    </select>
    <h4>__MSG_include_status_from_another__</h4>
    <p>__MSG_the_other_services_updates_will_be_mixed__</p>
    <input type="text" id="external-feed" value="" />
    <p class="help-caption">Supported services include Twitter, Facebook, Identi.ca, Pownce and Jaiku</p>
    <p class="buttongroup">
        <input type="submit" value="Save" class="primary-action button" onclick="return updateConfig();" />
        <input type="button" value="Cancel" onclick="return toggleSettings()" class="button" />
        
    </p>
</form>
</div>]]></Content><Content type="html" view="canvas"><![CDATA[<div class="gadget"><div id="admin-bar" style="display:none;"><a class="edit" href="#" onclick="return toggleSettings()" id="edit-link">Settings</a></div>
<div id="statusupdate">
    <form  id="statusupdateform" style="display:none;" onsubmit="return submitStatus()">
        <p> 
            <textarea name="status_textarea" value="" id="updatefield" onkeyup="updateCharCount()"></textarea>
        </p>
        <p class="buttongroup">
            <input type="submit" class="primary-action button" name="post_action_publish" id="post_publish" value="__MSG_update_status__" />
            <span id="char-limit" title="Remaining characters"></span>
        </p>
    </form>
    <ul id="statuslist">
        <li>loading…</li>
    </ul>
    <p id="rsslink"></p>
</div>
<form id="settingsform" method="POST" style="display:none;">
    <h4>__MSG_how_many_updates__</h4>
    <select id="n_updates">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="5">5</option>
        <option value="10">10</option>
        <option value="20">20</option>
    </select>
    <h4>__MSG_include_status_from_another__</h4>
    <p>__MSG_the_other_services_updates_will_be_mixed__</p>
    <input type="text" id="external-feed" value="" />
    <p class="help-caption">Supported services include Twitter, Facebook, Identi.ca, Pownce and Jaiku</p>
    <p class="buttongroup">
        <input type="submit" value="Save" class="primary-action button" onclick="return updateConfig();" />
        <input type="button" value="Cancel" onclick="return toggleSettings()" class="button" />
        
    </p>
</form>
</div>]]></Content><Content type="html" view="canvas"><![CDATA[<div class="gadget"><p id="ning-footer" class="footer" style="display:none;"></p>

<p id="others-footer" class="footer" style="display:none;"> 
    __MSG_brought_to_you_by__ <a href="http://www.ning.com" target="_blank">__MSG_ning__</a>
    | <a href="http://about.ning.com/applicationstos.php" target="_blank">__MSG_terms_of_use__</a>
</p>
</div>]]></Content></Module>
