Skip to content

Commit

Permalink
Renaming Wikipedia -> Wiktionary
Browse files Browse the repository at this point in the history
  • Loading branch information
pfhayes committed Feb 8, 2012
1 parent b429df0 commit bc17ec3
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 49 deletions.
10 changes: 5 additions & 5 deletions assets/www/android/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function selectText() {
function sharePage() {
// @fixme if we don't have a page loaded, this menu item should be disabled...
var title = app.getCurrentTitle(),
url = app.getCurrentUrl().replace(/\.m\.wikipedia/, '.wikipedia');
url = app.getCurrentUrl().replace(/\.m\.wiktionary/, '.wiktionary');
window.plugins.share.show(
{
subject: title,
Expand Down Expand Up @@ -137,13 +137,13 @@ function getCurrentPosition() {
PhoneGap.exec(geoNameSuccess, geoNameFailure, "NearMePlugin", "startNearMeActivity", [preferencesDB.get('language')]);
}

function geoNameSuccess(wikipediaUrl) {
if(wikipediaUrl) {
function geoNameSuccess(wiktionaryUrl) {
if(wiktionaryUrl) {
$('#search').addClass('inProgress');
$.ajax({url: "https://en.m.wikipedia.org",
$.ajax({url: "https://en.m.wiktionary.org",
success: function(data) {
if(data) {
app.navigateToPage('https://'+wikipediaUrl)
app.navigateToPage('https://'+wiktionaryUrl)
} else {
noConnectionMsg();
navigator.app.exitApp();
Expand Down
2 changes: 1 addition & 1 deletion assets/www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ window.app = function() {

function setContentLanguage(language) {
preferencesDB.set('language', language);
app.baseURL = 'https://' + language + '.m.wikipedia.org';
app.baseURL = 'https://' + language + '.m.wiktionary.org';
}

function setFontSize(size) {
Expand Down
4 changes: 2 additions & 2 deletions assets/www/js/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ window.chrome = function() {
//PhoneGap.UsePolling = true;

preferencesDB.initializeDefaults(function() {
app.baseURL = 'https://' + preferencesDB.get('language') + '.m.wikipedia.org';
app.baseURL = 'https://' + preferencesDB.get('language') + '.m.wiktionary.org';

// Do localization of the initial interface
$(document).bind("mw-messages-ready", function() {
Expand Down Expand Up @@ -280,7 +280,7 @@ window.chrome = function() {
return;
}

if (url.match(/^https?:\/\/([^\/]+)\.wikipedia\.org\/wiki\//)) {
if (url.match(/^https?:\/\/([^\/]+)\.wiktionary\.org\/wiki\//)) {
// ...and load it through our intermediate cache layer.
app.navigateToPage(url);
} else {
Expand Down
2 changes: 1 addition & 1 deletion assets/www/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ window.appSettings = function() {
var locales = [];

function showSettings(callback) {
var requestUrl = "https://en.wikipedia.org/w/api.php?action=sitematrix&format=json";
var requestUrl = "https://en.wiktionary.org/w/api.php?action=sitematrix&format=json";

if(fontSizes.length == 0) {
fontSizes = [
Expand Down
2 changes: 1 addition & 1 deletion res/values-bs/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Wikipedia</string>
<string name="app_name">Wiktionary</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import android.app.Dialog;
import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.wikipedia;
package org.wiktionary;

public class GeoName {

public GeoName(String wikipediaUrl, String title, String summary,
public GeoName(String wiktionaryUrl, String title, String summary,
double latitude, double longitude) {
super();
this.wikipediaUrl = wikipediaUrl;
this.wiktionaryUrl = wiktionaryUrl;
this.title = title;
this.summary = summary;
this.latitude = latitude;
this.longitude = longitude;
}

private String wikipediaUrl;
private String wiktionaryUrl;
private String title;
private String summary;
private double latitude;
Expand All @@ -39,12 +39,12 @@ public void setLongitude(double longitude) {
this.longitude = longitude;
}

public String getWikipediaUrl() {
return wikipediaUrl;
public String getWiktionaryUrl() {
return wiktionaryUrl;
}

public void setWikipediaUrl(String wikipediaUrl) {
this.wikipediaUrl = wikipediaUrl;
public void setWiktionaryUrl(String wiktionaryUrl) {
this.wiktionaryUrl = wiktionaryUrl;
}

public String getTitle() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import java.util.ArrayList;
import java.util.Iterator;
Expand Down Expand Up @@ -40,8 +40,8 @@ protected void onPreExecute() {
mapView.getOverlays().clear();
}
protected Integer doInBackground(Double... gps) {
WikipediaApp app = (WikipediaApp)getApplicationContext();
app.geonames = RestJsonClient.getWikipediaNearbyLocations(gps[0], gps[1], lang);
WiktionaryApp app = (WiktionaryApp)getApplicationContext();
app.geonames = RestJsonClient.getWiktionaryNearbyLocations(gps[0], gps[1], lang);
if(app.geonames != null) {
for(GeoName g: app.geonames) {
mapOverlays.add(createItemizedOverlay(g));
Expand All @@ -60,7 +60,7 @@ protected void onPostExecute(Integer result) {
}

public GeoName getGeoName(String title) {
WikipediaApp app = (WikipediaApp)getApplicationContext();
WiktionaryApp app = (WiktionaryApp)getApplicationContext();
Iterator<GeoName> it = app.geonames.iterator();
while(it.hasNext()) {
GeoName geoname = it.next();
Expand Down Expand Up @@ -98,7 +98,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.nearme);

WikipediaApp app = (WikipediaApp)getApplicationContext();
WiktionaryApp app = (WiktionaryApp)getApplicationContext();

mapView = (MapView)findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -27,7 +27,7 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
}
if(action.compareTo("startNearMeActivity") == 0) {
try {
Intent intent = new Intent(ctx, Class.forName("org.wikipedia.NearMeActivity"));
Intent intent = new Intent(ctx, Class.forName("org.wiktionary.NearMeActivity"));
intent.putExtra("language", lang);
ctx.startActivityForResult((Plugin) this, intent, GET_GEONAME_URL);
result = new PluginResult(PluginResult.Status.NO_RESULT);
Expand All @@ -44,8 +44,8 @@ public PluginResult execute(String action, JSONArray args, String callbackId) {
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if(requestCode == GET_GEONAME_URL && intent != null) {
if(resultCode == RESULT_OK) {
Log.d("NearMePlugin", intent.getExtras().getString("wikipediaUrl"));
this.success(new PluginResult(PluginResult.Status.OK, intent.getExtras().getString("wikipediaUrl")), callbackId);
Log.d("NearMePlugin", intent.getExtras().getString("wiktionaryUrl"));
this.success(new PluginResult(PluginResult.Status.OK, intent.getExtras().getString("wiktionaryUrl")), callbackId);
}
} else {
this.success(new PluginResult(PluginResult.Status.NO_RESULT), callbackId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -17,12 +17,12 @@

public class RestJsonClient {

public static ArrayList<GeoName> getWikipediaNearbyLocations(
public static ArrayList<GeoName> getWiktionaryNearbyLocations(
double latitude, double longitude, String lang) {
HttpURLConnection urlConnection = null;
ArrayList<GeoName> geoList = new ArrayList<GeoName>();
try {
String requestUrl = "http://ws.geonames.net/findNearbyWikipediaJSON?formatted=true&";
String requestUrl = "http://ws.geonames.net/findNearbyWiktionaryJSON?formatted=true&";
requestUrl += "lat=" + latitude + "&";
requestUrl += "lng=" + longitude + "&";
requestUrl += "username=wikimedia&";
Expand All @@ -48,7 +48,7 @@ public static ArrayList<GeoName> getWikipediaNearbyLocations(
try {
JSONObject geonameObj = geonames.getJSONObject(i);
geoList.add(new GeoName(
geonameObj.getString("wikipediaUrl"), geonameObj
geonameObj.getString("wiktionaryUrl"), geonameObj
.getString("title"), geonameObj
.getString("summary"), geonameObj
.getDouble("lat"), geonameObj
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import org.json.JSONArray;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import java.util.ArrayList;

Expand Down Expand Up @@ -65,8 +65,8 @@ public void onClick(View v) {
dialog.dismiss();
Intent i = new Intent();
Bundle b = new Bundle();
b.putString("wikipediaUrl", geoname.getWikipediaUrl());
Log.d("WikiItemizedOverlay", "Overlay URL "+geoname.getWikipediaUrl());
b.putString("wiktionaryUrl", geoname.getWiktionaryUrl());
Log.d("WikiItemizedOverlay", "Overlay URL "+geoname.getWiktionaryUrl());
i.putExtras(b);
ma.setResult(NearMePlugin.RESULT_OK, i);
ma.finish();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.wikipedia;
package org.wiktionary;

import android.content.SharedPreferences;
import android.os.Bundle;
Expand All @@ -9,17 +9,17 @@

import com.phonegap.DroidGap;

public class WikipediaActivity extends DroidGap {
public class WiktionaryActivity extends DroidGap {
/** Called when the activity is first created. */

public class WikipediaWebViewClient extends GapViewClient {
public WikipediaWebViewClient(DroidGap ctx) {
public class WiktionaryWebViewClient extends GapViewClient {
public WiktionaryWebViewClient(DroidGap ctx) {
super(ctx);
}

//@Override
//public void onLoadResource(WebView view, String url) {
// Log.d("WikipediaWebViewClient", "OnLoadResource "+url);
// Log.d("WiktionaryWebViewClient", "OnLoadResource "+url);
//}

}
Expand All @@ -35,7 +35,7 @@ public void onCreate(Bundle savedInstanceState) {
editor.commit();

super.loadUrl("file:///android_asset/www/index.html");
this.webViewClient = new WikipediaWebViewClient(this);
this.webViewClient = new WiktionaryWebViewClient(this);
this.appView.setWebViewClient(this.webViewClient);

String currentUA = this.appView.getSettings().getUserAgentString();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.wikipedia;
package org.wiktionary;

import java.util.ArrayList;

import android.app.Application;

public class WikipediaApp extends Application {
public class WiktionaryApp extends Application {
public ArrayList<GeoName> geonames;

}
6 changes: 3 additions & 3 deletions tests/qunit/propertiesFileReader-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ test('Escapes', function() {

test('Small sample file', function() {
parseEqual('Small sample file',
"# English-language messages for Wikipedia Mobile app\n" +
"sitename = Wikipedia\n" +
"# English-language messages for Wiktionary Mobile app\n" +
"sitename = Wiktionary\n" +
"spinner-loading = Loading\n" +
"spinner-retrieving = Retrieving content from $1\n" +
"bookmarks-max-warning = You've reached the maximum number of bookmarks.\n" +
Expand All @@ -238,7 +238,7 @@ test('Small sample file', function() {
"bookmark-remove-prompt = Remove $1 from bookmarks?\n" +
"bookmark-removed = $1 has been removed.\n",
{
'sitename': 'Wikipedia',
'sitename': 'Wiktionary',
'spinner-loading': 'Loading',
'spinner-retrieving': 'Retrieving content from $1',
'bookmarks-max-warning': "You've reached the maximum number of bookmarks.",
Expand Down

0 comments on commit bc17ec3

Please sign in to comment.