Hopefully fix whitespace issues.
This commit is contained in:
parent
935e9ab688
commit
4906b57f15
@ -521,9 +521,9 @@ window.chat.chooseAnchor = function(t) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.chat.show = function(name) {
|
window.chat.show = function(name) {
|
||||||
window.isSmartphone
|
window.isSmartphone
|
||||||
? $('#updatestatus').hide()
|
? $('#updatestatus').hide()
|
||||||
: $('#updatestatus').show();
|
: $('#updatestatus').show();
|
||||||
$('#chat, #chatinput').show();
|
$('#chat, #chatinput').show();
|
||||||
$('#map').css('visibility', 'hidden');
|
$('#map').css('visibility', 'hidden');
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ window.debug.console.show = function() {
|
|||||||
// not displaying the map causes bugs in Leaflet
|
// not displaying the map causes bugs in Leaflet
|
||||||
$('#map').css('visibility', 'hidden');
|
$('#map').css('visibility', 'hidden');
|
||||||
$('#chat, #chatinput').show();
|
$('#chat, #chatinput').show();
|
||||||
window.debug.console.create();
|
window.debug.console.create();
|
||||||
$('#chatinput mark').css('cssText', 'color: #bbb !important').text('debug:');
|
$('#chatinput mark').css('cssText', 'color: #bbb !important').text('debug:');
|
||||||
$('#chat > div').hide();
|
$('#chat > div').hide();
|
||||||
$('#debugconsole').show();
|
$('#debugconsole').show();
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
// created to start cleaning up "window" interaction
|
// created to start cleaning up "window" interaction
|
||||||
//
|
//
|
||||||
window.show = function(id) {
|
window.show = function(id) {
|
||||||
switch(id) {
|
switch(id) {
|
||||||
case 'full':
|
case 'full':
|
||||||
window.chat.show('full');
|
window.chat.show('full');
|
||||||
break;
|
break;
|
||||||
case 'compact':
|
case 'compact':
|
||||||
window.chat.show('compact');
|
window.chat.show('compact');
|
||||||
break;
|
break;
|
||||||
case 'public':
|
case 'public':
|
||||||
window.chat.show('public');
|
window.chat.show('public');
|
||||||
break;
|
break;
|
||||||
case 'faction':
|
case 'faction':
|
||||||
window.chat.show('faction');
|
window.chat.show('faction');
|
||||||
break;
|
break;
|
||||||
case 'debug':
|
case 'debug':
|
||||||
window.debug.console.show();
|
window.debug.console.show();
|
||||||
break;
|
break;
|
||||||
case 'map':
|
case 'map':
|
||||||
window.smartphone.mapButton.click();
|
window.smartphone.mapButton.click();
|
||||||
break;
|
break;
|
||||||
case 'info':
|
case 'info':
|
||||||
window.smartphone.sideButton.click();
|
window.smartphone.sideButton.click();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
window.smartphone.mapButton.click();
|
window.smartphone.mapButton.click();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
|
<string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
|
||||||
Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.</string>
|
Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.</string>
|
||||||
<string name="pref_select_iitc">IITC source</string>
|
<string name="pref_select_iitc">IITC source</string>
|
||||||
|
|
||||||
<string name="menu_chat">Chat</string>
|
<string name="menu_chat">Chat</string>
|
||||||
<string name="menu_map">Map</string>
|
<string name="menu_map">Map</string>
|
||||||
<string name="menu_full">Full</string>
|
<string name="menu_full">Full</string>
|
||||||
|
@ -13,16 +13,16 @@
|
|||||||
android:key="pref_about_cat"
|
android:key="pref_about_cat"
|
||||||
android:title="@string/pref_ui_cat">
|
android:title="@string/pref_ui_cat">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_user_zoom"
|
android:key="pref_user_zoom"
|
||||||
android:title="@string/pref_user_zoom"
|
android:title="@string/pref_user_zoom"
|
||||||
android:summary="@string/pref_user_zoom_sum"
|
android:summary="@string/pref_user_zoom_sum"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_user_loc"
|
android:key="pref_user_loc"
|
||||||
android:title="@string/pref_user_loc"
|
android:title="@string/pref_user_loc"
|
||||||
android:summary="@string/pref_user_loc_sum"
|
android:summary="@string/pref_user_loc_sum"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="pref_mics"
|
android:key="pref_mics"
|
||||||
|
@ -48,14 +48,14 @@ public class IITC_Mobile extends Activity {
|
|||||||
// TODO build an async task for url.openStream() in IITC_WebViewClient
|
// TODO build an async task for url.openStream() in IITC_WebViewClient
|
||||||
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||||
StrictMode.setThreadPolicy(policy);
|
StrictMode.setThreadPolicy(policy);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
iitc_view = (IITC_WebView) findViewById(R.id.iitc_webview);
|
iitc_view = (IITC_WebView) findViewById(R.id.iitc_webview);
|
||||||
|
|
||||||
actionBar = this.getActionBar();
|
actionBar = this.getActionBar();
|
||||||
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE);
|
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE);
|
||||||
actionBar.setTitle(getString(R.string.menu_map));
|
actionBar.setTitle(getString(R.string.menu_map));
|
||||||
actionBar.setHomeButtonEnabled(true);
|
actionBar.setHomeButtonEnabled(true);
|
||||||
|
|
||||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
listener = new OnSharedPreferenceChangeListener() {
|
listener = new OnSharedPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -227,7 +227,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
getMenuInflater().inflate(R.menu.main, menu);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,16 +236,16 @@ public class IITC_Mobile extends Activity {
|
|||||||
// Handle item selection
|
// Handle item selection
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
iitc_view.loadUrl("javascript: window.show('map');");
|
iitc_view.loadUrl("javascript: window.show('map');");
|
||||||
actionBar.setTitle(getString(R.string.menu_map));
|
actionBar.setTitle(getString(R.string.menu_map));
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_map:
|
case R.id.menu_map:
|
||||||
iitc_view.loadUrl("javascript: window.show('map');");
|
iitc_view.loadUrl("javascript: window.show('map');");
|
||||||
actionBar.setTitle(getString(R.string.menu_map));
|
actionBar.setTitle(getString(R.string.menu_map));
|
||||||
return true;
|
return true;
|
||||||
case R.id.reload_button:
|
case R.id.reload_button:
|
||||||
this.loadUrl(intel_url);
|
this.loadUrl(intel_url);
|
||||||
actionBar.setTitle(getString(R.string.menu_map));
|
actionBar.setTitle(getString(R.string.menu_map));
|
||||||
return true;
|
return true;
|
||||||
// clear cache
|
// clear cache
|
||||||
case R.id.cache_clear:
|
case R.id.cache_clear:
|
||||||
@ -278,9 +278,9 @@ public class IITC_Mobile extends Activity {
|
|||||||
return true;
|
return true;
|
||||||
// get the users current location and focus it on map
|
// get the users current location and focus it on map
|
||||||
case R.id.locate:
|
case R.id.locate:
|
||||||
iitc_view.loadUrl("javascript: window.show('map');");
|
iitc_view.loadUrl("javascript: window.show('map');");
|
||||||
iitc_view.loadUrl("javascript: window.map.locate({setView : true, maxZoom: 13});");
|
iitc_view.loadUrl("javascript: window.map.locate({setView : true, maxZoom: 13});");
|
||||||
actionBar.setTitle(getString(R.string.menu_map));
|
actionBar.setTitle(getString(R.string.menu_map));
|
||||||
return true;
|
return true;
|
||||||
// start settings activity
|
// start settings activity
|
||||||
case R.id.action_settings:
|
case R.id.action_settings:
|
||||||
@ -289,29 +289,29 @@ public class IITC_Mobile extends Activity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_info:
|
case R.id.menu_info:
|
||||||
iitc_view.loadUrl("javascript: window.show('info');");
|
iitc_view.loadUrl("javascript: window.show('info');");
|
||||||
actionBar.setTitle(getString(R.string.menu_info));
|
actionBar.setTitle(getString(R.string.menu_info));
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_full:
|
case R.id.menu_full:
|
||||||
iitc_view.loadUrl("javascript: window.show('full');");
|
iitc_view.loadUrl("javascript: window.show('full');");
|
||||||
actionBar.setTitle(getString(R.string.menu_full));
|
actionBar.setTitle(getString(R.string.menu_full));
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_compact:
|
case R.id.menu_compact:
|
||||||
iitc_view.loadUrl("javascript: window.show('compact');");
|
iitc_view.loadUrl("javascript: window.show('compact');");
|
||||||
actionBar.setTitle(getString(R.string.menu_compact));
|
actionBar.setTitle(getString(R.string.menu_compact));
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_public:
|
case R.id.menu_public:
|
||||||
iitc_view.loadUrl("javascript: window.show('public');");
|
iitc_view.loadUrl("javascript: window.show('public');");
|
||||||
actionBar.setTitle(getString(R.string.menu_public));
|
actionBar.setTitle(getString(R.string.menu_public));
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_faction:
|
case R.id.menu_faction:
|
||||||
iitc_view.loadUrl("javascript: window.show('faction');");
|
iitc_view.loadUrl("javascript: window.show('faction');");
|
||||||
actionBar.setTitle(getString(R.string.menu_faction));
|
actionBar.setTitle(getString(R.string.menu_faction));
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_debug:
|
case R.id.menu_debug:
|
||||||
iitc_view.loadUrl("javascript: window.show('debug')");
|
iitc_view.loadUrl("javascript: window.show('debug')");
|
||||||
actionBar.setTitle(getString(R.string.menu_debug));
|
actionBar.setTitle(getString(R.string.menu_debug));
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force mobile view.
|
// Force mobile view.
|
||||||
// New actions are not compatible with desktop mode
|
// New actions are not compatible with desktop mode
|
||||||
private String addUrlParam(String url) {
|
private String addUrlParam(String url) {
|
||||||
return (url + "?vp=m");
|
return (url + "?vp=m");
|
||||||
|
@ -90,15 +90,15 @@ public class IITC_WebViewClient extends WebViewClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.js = js;
|
this.js = js;
|
||||||
|
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
boolean hasMultitouch =
|
boolean hasMultitouch =
|
||||||
pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
|
pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
|
||||||
boolean forcedZoom = sharedPref.getBoolean("pref_user_zoom", false);
|
boolean forcedZoom = sharedPref.getBoolean("pref_user_zoom", false);
|
||||||
if (hasMultitouch && !forcedZoom) {
|
if (hasMultitouch && !forcedZoom) {
|
||||||
js = js.replace("window.showZoom = true;", "window.showZoom = false;");
|
js = js.replace("window.showZoom = true;", "window.showZoom = false;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// need to wrap the mobile iitc.js version in a document ready. IITC
|
// need to wrap the mobile iitc.js version in a document ready. IITC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user