// jQuery built with "grunt custom:-ajax/script,-ajax/jsonp,-css,-deprecated,-dimensions,-effects,-event,-event/alias,-offset,-wrap,-ready,-deferred,-exports/amd,-sizzle"
// https://github.com/jquery/jquery#how-to-build-your-own-jquery
var $ = require("./lib/jquery.min.js");

var MARGIN = 12;

var page = tabris.create("Page", {
  title: "XMLHttpRequest",
  topLevel: true
});

var createLabel = function(labelText) {
  tabris.create("Label", {
    text: labelText,
    markupEnabled: true,
    layoutData: {left: MARGIN, right: MARGIN, top: [page.children().last() || 0, MARGIN]}
  }).appendTo(page);
};

$.getJSON("http://www.telize.com/geoip", function(json) {
  createLabel("The IP address is: " + json.ip);
  createLabel("Latitude: " + json.latitude);
  createLabel("Longitude: " + json.longitude);
});

page.open();

// jQuery built with "grunt custom:-ajax/script,-ajax/jsonp,-css,-deprecated,-dimensions,-effects,-event,-event/alias,-offset,-wrap,-ready,-deferred,-exports/amd,-sizzle"
// https://github.com/jquery/jquery#how-to-build-your-own-jquery
var $ = require("./lib/jquery.min.js");

var MARGIN = 12;

var page = tabris.create("Page", {
  title: "XMLHttpRequest",
  topLevel: true
});

var createTextView = function(text) {
  tabris.create("TextView", {
    text: text,
    markupEnabled: true,
    layoutData: {left: MARGIN, right: MARGIN, top: [page.children().last() || 0, MARGIN]}
  }).appendTo(page);
};

$.getJSON("http://www.telize.com/geoip", function(json) {
  createTextView("The IP address is: " + json.ip);
  createTextView("Latitude: " + json.latitude);
  createTextView("Longitude: " + json.longitude);
});

page.open();

Rename "Label" to "TextView" in jquery example
Rename "Label" to "TextView" in jquery example

Done to reflect eclipsesource/tabris-js@ca0f105e82a2d27067c9674ecf71a93af2c7b7bd

Change-Id: I1c267e0130809077c1339ba0395da1a7e1c6b281
