Permalink
Browse files

Merge branch 'master' into nightly2

Nightly 2012-12-06
  • Loading branch information...
2 parents 1f83c1f + a30bbe1 commit cfe334420b4782b375d650aaf946a937198958d6 @dscravag committed Dec 7, 2012
Showing with 1,294 additions and 498 deletions.
  1. +10 −0 Android.mk
  2. +12 −21 Makefile
  3. +11 −8 apps/clock/index.html
  4. +4 −4 apps/clock/js/alarm.js
  5. +8 −21 apps/clock/js/onring.js
  6. +8 −0 apps/clock/locales/alarms.en-US.properties
  7. +0 −9 apps/clock/locales/clock.en-US.properties
  8. +1 −0 apps/clock/locales/locales.ini
  9. +30 −12 apps/communications/contacts/js/contacts_details.js
  10. +2 −1 apps/communications/contacts/js/contacts_form.js
  11. +14 −7 apps/communications/contacts/js/contacts_list.js
  12. +4 −2 apps/communications/contacts/js/contacts_settings.js
  13. +1 −1 apps/communications/contacts/js/fb/friends_list.js
  14. +1 −1 apps/communications/contacts/js/search.js
  15. +2 −2 apps/communications/contacts/js/utilities/import_sim_contacts.js
  16. +47 −29 apps/communications/contacts/js/utilities/normalizer.js
  17. +7 −7 apps/communications/contacts/locales/contacts.en-US.properties
  18. +16 −15 apps/communications/contacts/test/unit/contact_details_test.js
  19. +1 −0 apps/communications/contacts/test/unit/contacts_form_test.js
  20. +28 −11 apps/communications/contacts/test/unit/contacts_list_test.js
  21. +12 −0 apps/communications/contacts/test/unit/mock_utils.js
  22. +24 −15 apps/communications/dialer/js/oncall.js
  23. +3 −3 apps/communications/dialer/oncall.html
  24. +2 −1 apps/communications/dialer/style/oncall.css
  25. BIN apps/communications/dialer/style/ringtones/classic.ogg
  26. BIN apps/communications/dialer/style/ringtones/low_bit.ogg
  27. BIN apps/communications/dialer/style/ringtones/old_school.ogg
  28. BIN apps/communications/dialer/style/ringtones/sms.wav
  29. +1 −1 apps/communications/ftu/js/ui.js
  30. +7 −7 apps/communications/ftu/locales/ftu.en-US.properties
  31. +1 −1 apps/feedback/manifest.webapp
  32. +302 −88 apps/settings/index.html
  33. +171 −0 apps/settings/js/call.js
  34. +42 −34 apps/settings/js/carrier.js
  35. +1 −0 apps/settings/js/connectivity.js
  36. +1 −1 apps/settings/js/icc.js
  37. +1 −1 apps/settings/js/icc_menu.js
  38. +161 −51 apps/settings/js/sound.js
  39. +4 −2 apps/settings/js/utils.js
  40. +2 −0 apps/settings/locales/locales.ini
  41. +12 −0 apps/settings/locales/notifications.en-US.properties
  42. +15 −0 apps/settings/locales/ringtones.en-US.properties
  43. +53 −36 apps/settings/locales/settings.en-US.properties
  44. 0 apps/settings/{open-source-license.html → resources/open_source_license.html}
  45. +5 −1 apps/settings/style/icons.css
  46. BIN apps/settings/style/images/privacy_sprite.png
  47. +14 −11 apps/settings/style/settings.css
  48. +2 −6 apps/sms/js/pendingDBUtils.js
  49. +30 −1 apps/sms/js/sms.js
  50. +2 −4 apps/system/emergency-call/js/keypad.js
  51. +12 −7 apps/system/index.html
  52. +3 −1 apps/system/js/attention_screen.js
  53. +21 −7 apps/system/js/lockscreen.js
  54. +8 −1 apps/system/js/notifications.js
  55. +8 −0 apps/system/js/screen_manager.js
  56. +25 −3 apps/system/js/statusbar.js
  57. +11 −3 apps/system/js/window_manager.js
  58. +22 −12 apps/system/style/lockscreen/lockscreen.css
  59. BIN apps/system/style/notifications/ringtones/notification.wav
  60. BIN apps/system/style/statusbar/images/call-forwarding.png
  61. +6 −0 apps/system/style/statusbar/statusbar.css
  62. +1 −0 apps/system/style/zindex.css
  63. +5 −1 build/preferences.js
  64. +17 −2 build/settings.py
  65. +20 −0 build/utils.js
  66. +1 −2 build/webapp-manifests.js
  67. +2 −23 build/webapp-zip.js
  68. +2 −1 shared/resources/apn.json
  69. +14 −5 shared/resources/apn/README.md
  70. +0 −14 shared/resources/apn/apns_conf.xml
  71. +9 −1 shared/resources/apn/query.js
  72. BIN shared/resources/media/alarms/ac_classic_clock_alarm.opus
  73. BIN shared/resources/media/alarms/ac_classic_clock_alarm_prog.opus
  74. BIN shared/resources/media/alarms/ac_classic_clock_radio.opus
  75. BIN shared/resources/media/alarms/ac_normal_gem_echoes.opus
  76. BIN shared/resources/media/alarms/ac_normal_ringing_strings.opus
  77. BIN shared/resources/media/alarms/ac_soft_humming_waves.opus
  78. BIN shared/resources/media/alarms/ac_soft_into_the_void.opus
  79. BIN shared/resources/media/alarms/ac_soft_smooth_strings.opus
  80. +15 −0 shared/resources/media/notifications/list.json
  81. BIN shared/resources/media/notifications/notifier_bap.opus
  82. BIN shared/resources/media/notifications/notifier_bell.opus
  83. BIN shared/resources/media/notifications/notifier_bell_extd.opus
  84. BIN shared/resources/media/notifications/notifier_boomer.opus
  85. BIN shared/resources/media/notifications/notifier_bop.opus
  86. BIN shared/resources/media/notifications/notifier_dididi.opus
  87. BIN shared/resources/media/notifications/notifier_exclamation.ogg
  88. BIN shared/resources/media/notifications/notifier_minimal_bands.ogg
  89. BIN shared/resources/media/notifications/notifier_rewind.ogg
  90. BIN shared/resources/media/notifications/notifier_ring.ogg
  91. BIN shared/resources/media/notifications/notifier_spring.ogg
  92. BIN shared/resources/media/notifications/notifier_ting.opus
  93. +17 −0 shared/resources/media/ringtones/list.json
  94. BIN shared/resources/media/ringtones/ringer_bitbounce.opus
  95. BIN shared/resources/media/ringtones/ringer_classic_courier.opus
  96. BIN shared/resources/media/ringtones/ringer_classic_electric.ogg
  97. BIN shared/resources/media/ringtones/ringer_classic_prism.ogg
  98. BIN shared/resources/media/ringtones/ringer_classic_touchmatic.opus
  99. BIN shared/resources/media/ringtones/ringer_classic_wallphone.ogg
  100. BIN shared/resources/media/ringtones/ringer_digital_dapple.opus
  101. BIN shared/resources/media/ringtones/ringer_digitalascent.opus
  102. BIN shared/resources/media/ringtones/ringer_loude_windchimes.opus
  103. BIN shared/resources/media/ringtones/ringer_low_bit_swing.opus
  104. BIN shared/resources/media/ringtones/ringer_progressive_dapple.opus
  105. BIN shared/resources/media/ringtones/ringer_rain_echoes.opus
  106. BIN shared/resources/media/ringtones/ringer_ringing_gems.opus
  107. BIN shared/resources/media/ringtones/ringer_soft_disco_drive.opus
  108. BIN shared/resources/media/ringtones/ringer_vamos_la_elektro.opus
View
@@ -45,6 +45,16 @@ ifneq ($(GAIA_PROFILE_INSTALL_PARENT), $(GAIA_APP_INSTALL_PARENT))
mv $(GAIA_PROFILE_INSTALL_PARENT)/webapps $(GAIA_APP_INSTALL_PARENT)
endif
+GAIA_TESTS_STAGE := $(GAIA_PATH)/tests-stage
+
+.PHONY: gaia-tests-zip
+gaia-tests-zip:
+ rm -rf $(GAIA_TESTS_STAGE)
+ mkdir -p $(GAIA_TESTS_STAGE)/gaiatest/gaiatest/atoms
+ @(cd $(GAIA_PATH)/tests/python && tar -chf - *) | (cd $(GAIA_TESTS_STAGE)/gaiatest && tar -xf -)
+ @(cd $(GAIA_PATH)/tests/atoms && tar -chf - *) | (cd $(GAIA_TESTS_STAGE)/gaiatest/gaiatest/atoms && tar -xf -)
+ (cd $(GAIA_TESTS_STAGE) && zip -r $(GAIA_PATH)/gaia-tests.zip *)
+
.PHONY: $(LOCAL_PATH)/profile.tar.gz
$(LOCAL_PATH)/profile.tar.gz:
ifeq ($(CLEAN_PROFILE), 1)
View
@@ -209,7 +209,7 @@ endif
endif
app-makefiles:
- for d in ${GAIA_APP_SRCDIRS}; \
+ @for d in ${GAIA_APP_SRCDIRS}; \
do \
for mfile in `find $$d -mindepth 2 -maxdepth 2 -name "Makefile"` ;\
do \
@@ -221,23 +221,19 @@ app-makefiles:
# We duplicate manifest.webapp to manifest.webapp and manifest.json
# to accommodate Gecko builds without bug 757613. Should be removed someday.
webapp-manifests: install-xulrunner-sdk
- @echo "Generated webapps"
@mkdir -p profile/webapps
@$(call run-js-command, webapp-manifests)
- @cat profile/webapps/webapps.json
- @echo "Done"
+ @#cat profile/webapps/webapps.json
# Generate profile/webapps/APP/application.zip
webapp-zip: stamp-commit-hash install-xulrunner-sdk
ifneq ($(DEBUG),1)
- @echo "Packaged webapps"
@rm -rf apps/system/camera
@cp -r apps/camera apps/system/camera
@cat apps/camera/index.html | sed -e 's:shared/:../shared/:' > apps/system/camera/index.html
@rm apps/system/camera/manifest.webapp
@mkdir -p profile/webapps
@$(call run-js-command, webapp-zip)
- @echo "Done"
endif
offline-cache: webapp-manifests install-xulrunner-sdk
@@ -328,33 +324,28 @@ EXTENDED_PREF_FILES = \
# Generate profile/prefs.js
preferences: install-xulrunner-sdk
- @echo "Generating prefs.js..."
- test -d profile || mkdir -p profile
+ @test -d profile || mkdir -p profile
@$(call run-js-command, preferences)
@$(foreach prefs_file,$(addprefix build/,$(EXTENDED_PREF_FILES)),\
if [ -f $(prefs_file) ]; then \
cat $(prefs_file) >> profile/user.js; \
fi; \
)
- @echo "Done"
# Generate profile/
applications-data: install-xulrunner-sdk
- @echo "Generating application data..."
test -d profile || mkdir -p profile
@$(call run-js-command, applications-data)
- @echo "Done. If this results in an error remove the xulrunner/xulrunner-sdk folder in your gaia folder."
# Generate profile/extensions
EXT_DIR=profile/extensions
extensions:
- @echo "Generating extensions..."
@mkdir -p profile
@rm -rf $(EXT_DIR)
ifeq ($(DEBUG),1)
cp -r tools/extensions $(EXT_DIR)
endif
- @echo "Done"
+ @echo "Finished: Generating extensions"
@@ -417,8 +408,8 @@ test-agent-config: test-agent-bootstrap-apps
@rm -f $(TEST_AGENT_CONFIG)
@touch $(TEST_AGENT_CONFIG)
@rm -f /tmp/test-agent-config;
- # Build json array of all test files
- for d in ${GAIA_APP_SRCDIRS}; \
+ @# Build json array of all test files
+ @for d in ${GAIA_APP_SRCDIRS}; \
do \
find $$d -name '*_test.js' | sed "s:$$d/::g" >> /tmp/test-agent-config; \
done;
@@ -428,19 +419,19 @@ test-agent-config: test-agent-bootstrap-apps
sed -e ':a' -e 'N' -e '$$!ba' -e 's/\n/,\
/g' >> $(TEST_AGENT_CONFIG);
@echo ' ]}' >> $(TEST_AGENT_CONFIG);
- @echo "Built test ui config file: $(TEST_AGENT_CONFIG)"
+ @echo "Finished: test ui config file: $(TEST_AGENT_CONFIG)"
@rm -f /tmp/test-agent-config
.PHONY: test-agent-bootstrap-apps
test-agent-bootstrap-apps:
- for d in `find -L ${GAIA_APP_SRCDIRS} -mindepth 1 -maxdepth 1 -type d` ;\
+ @for d in `find -L ${GAIA_APP_SRCDIRS} -mindepth 1 -maxdepth 1 -type d` ;\
do \
mkdir -p $$d/test/unit ; \
mkdir -p $$d/test/integration ; \
cp -f $(TEST_COMMON)/test/boilerplate/_proxy.html $$d/test/unit/_proxy.html; \
cp -f $(TEST_COMMON)/test/boilerplate/_sandbox.html $$d/test/unit/_sandbox.html; \
done
- @echo "Done bootstrapping test proxies/sandboxes";
+ @echo "Finished: bootstrapping test proxies/sandboxes";
# Temp make file method until we can switch
# over everything in test
@@ -501,7 +492,7 @@ lint:
# let us remove the update-offline-manifests target dependancy of the
# default target.
stamp-commit-hash:
- (if [ -d ./.git ]; then \
+ @(if [ -d ./.git ]; then \
git log -1 --format="%H%n%at" HEAD > apps/settings/resources/gaia_commit.txt; \
else \
echo 'Unknown Git commit; build date shown here.' > apps/settings/resources/gaia_commit.txt; \
@@ -510,7 +501,7 @@ stamp-commit-hash:
# Erase all the indexedDB databases on the phone, so apps have to rebuild them.
delete-databases:
- @echo 'Stoping b2g'
+ @echo 'Stopping b2g'
$(ADB) shell stop b2g
$(ADB) shell rm -r $(MSYS_FIX)/data/local/indexedDB/*
@echo 'Starting b2g'
@@ -561,7 +552,7 @@ update-offline-manifests:
TARGET_FOLDER = webapps/$(BUILD_APP_NAME).$(GAIA_DOMAIN)
install-gaia: profile
$(ADB) start-server
- @echo 'Stoping b2g'
+ @echo 'Stopping b2g'
$(ADB) shell stop b2g
$(ADB) shell rm -r $(MSYS_FIX)/cache/*
View
@@ -11,6 +11,9 @@
<link rel="stylesheet" type="text/css" href="shared/style/headers.css">
<link rel="stylesheet" type="text/css" href="shared/style/switches.css">
+ <!-- Shared sounds -->
+ <link rel="resources" type="directory" href="shared/resources/media/alarms/">
+
<!-- Localization -->
<link rel="resource" type="application/l10n" href="/shared/locales/date.ini">
<link rel="resource" type="application/l10n" href="locales/locales.ini">
@@ -193,14 +196,14 @@ <h1 id="alarm-title"></h1>
<li class="singleline">
<span class="view-alarm-lbl" data-l10n-id="sound">Sound</span>
<select id="sound-select" class="abstract-menu">
- <option value="classic_buzz.ogg" data-l10n-id="classic_buzz">Classic Buzz</option>
- <option value="classic_pulse.ogg" data-l10n-id="classic_pulse">Classic Pulse</option>
- <option value="classic_pulse_progressive.ogg" data-l10n-id="classic_pulse_progressive">Classic Progressive</option>
- <option value="alarm_gem_echoes.ogg" data-l10n-id="alarm_gem_echoes">Gem Echoes</option>
- <option value="alarm_into_the_void.ogg" data-l10n-id="alarm_into_the_void">Into the Void</option>
- <option value="alarm_ringing_strings.ogg" data-l10n-id="alarm_ringing_strings">Ringing Strings</option>
- <option value="alarm_shimmering_waves.ogg" data-l10n-id="alarm_shimmering_waves">Shimmering Waves</option>
- <option value="alarm_smooth_strings.ogg" data-l10n-id="alarm_smooth_strings">Smooth Strings</option>
+ <option value="ac_classic_clock_alarm.opus" data-l10n-id="ac_classic_clock_alarm_opus"></option>
+ <option value="ac_classic_clock_alarm_prog.opus" data-l10n-id="ac_classic_clock_alarm_prog_opus"></option>
+ <option value="ac_classic_clock_radio.opus" data-l10n-id="ac_classic_clock_radio_opus"></option>
+ <option value="ac_normal_gem_echoes.opus" data-l10n-id="ac_normal_gem_echoes_opus"></option>
+ <option value="ac_normal_ringing_strings.opus" data-l10n-id="ac_normal_ringing_strings_opus"></option>
+ <option value="ac_soft_humming_waves.opus" data-l10n-id="ac_soft_humming_waves_opus"></option>
+ <option value="ac_soft_into_the_void.opus" data-l10n-id="ac_soft_into_the_void_opus"></option>
+ <option value="ac_soft_smooth_strings.opus" data-l10n-id="ac_soft_smooth_strings_opus"></option>
</select>
<a id="sound-menu" class="abstract-menu">Classic</a>
<p></p>
View
@@ -789,7 +789,7 @@ var AlarmEditView = {
minute: now.getMinutes(), // use current minute
enabled: true,
repeat: '0000000',
- sound: 'classic_buzz.ogg',
+ sound: 'ac_classic_clock_alarm.opus',
snooze: 5,
color: 'Darkorange'
};
@@ -863,9 +863,9 @@ var AlarmEditView = {
},
refreshSoundMenu: function aev_refreshSoundMenu(sound) {
- // Refresh and paser the name of sound file for sound menu.
+ // Refresh and parse the name of sound file for sound menu.
var sound = (sound) ? this.getSoundSelect() : this.alarm.sound;
- this.soundMenu.innerHTML = _(sound.slice(0, sound.lastIndexOf('.')));
+ this.soundMenu.innerHTML = _(sound.replace('.', '_'));
},
previewSound: function aev_previewSound() {
@@ -878,7 +878,7 @@ var AlarmEditView = {
}
var ringtoneName = this.getSoundSelect();
- var previewRingtone = 'style/ringtones/' + ringtoneName;
+ var previewRingtone = 'shared/resources/media/alarms/' + ringtoneName;
ringtonePlayer.mozAudioChannelType = 'alarm';
ringtonePlayer.src = previewRingtone;
ringtonePlayer.play();
View
@@ -36,14 +36,9 @@ var RingView = {
init: function rv_init() {
this.setAlarmTime();
this.setAlarmLabel();
- // If mozHidden is true in init state,
- // it means that alarm screen underneath the oncall screen.
- // Don't let the alarm ring and vibrate.
- if (!document.mozHidden) {
- this.setWakeLockEnabled(true);
- this.ring();
- this.vibrate();
- }
+ this.setWakeLockEnabled(true);
+ this.ring();
+ this.vibrate();
document.addEventListener('mozvisibilitychange', this);
this.snoozeButton.addEventListener('click', this);
this.closeButton.addEventListener('click', this);
@@ -81,7 +76,7 @@ var RingView = {
var ringtonePlayer = this._ringtonePlayer;
ringtonePlayer.mozAudioChannelType = 'alarm';
ringtonePlayer.loop = true;
- var selectedAlarmSound = 'style/ringtones/' +
+ var selectedAlarmSound = 'shared/ringtones/media/alarms/' +
window.opener.AlarmManager.getAlarmSound();
ringtonePlayer.src = selectedAlarmSound;
ringtonePlayer.play();
@@ -112,22 +107,14 @@ var RingView = {
stopAlarmNotification: function rv_stopAlarmNotification(action) {
switch (action) {
case 'ring':
- if (this._ringtonePlayer)
- this._ringtonePlayer.pause();
-
+ this._ringtonePlayer.pause();
break;
case 'vibrate':
- if (this._vibrateInterval)
- window.clearInterval(this._vibrateInterval);
-
+ window.clearInterval(this._vibrateInterval);
break;
default:
- if (this._ringtonePlayer)
- this._ringtonePlayer.pause();
-
- if (this._vibrateInterval)
- window.clearInterval(this._vibrateInterval);
-
+ this._ringtonePlayer.pause();
+ window.clearInterval(this._vibrateInterval);
break;
}
this.setWakeLockEnabled(false);
@@ -0,0 +1,8 @@
+ac_classic_clock_alarm_opus = Classic Buzz
+ac_classic_clock_alarm_prog_opus = Classic Pulse Progressive
+ac_classic_clock_radio_opus = Classic Pulse
+ac_normal_gem_echoes_opus = Gem Echoes
+ac_soft_smooth_strings_opus = Smooth Strings
+ac_soft_humming_waves_opus = Shimmering Waves
+ac_normal_ringing_strings_opus = Ringing Strings
+ac_soft_into_the_void_opus = Into the Void
@@ -59,12 +59,3 @@ nRemainMinutes[two] = and <strong>{{n}} minutes</strong>
nRemainMinutes[few] = and <strong>{{n}} minutes</strong>
nRemainMinutes[many] = and <strong>{{n}} minutes</strong>
nRemainMinutes[other] = and <strong>{{n}} minutes</strong>
-
-classic_buzz = Classic Buzz
-classic_pulse = Classic Pulse
-classic_pulse_progressive = Classic Progressive
-alarm_gem_echoes = Gem Echoes
-alarm_into_the_void = Into the Void
-alarm_ringing_strings = Ringing Strings
-alarm_shimmering_waves = Shimmering Waves
-alarm_smooth_strings = Smooth Strings
@@ -1,4 +1,5 @@
@import url(clock.en-US.properties)
+@import url(alarms.en-US.properties)
[ar]
@import url(clock.ar.properties)
@@ -241,7 +241,13 @@ contacts.Details = (function() {
var f = new navigator.mozL10n.DateTimeFormat();
var birthdayFormat = _('birthdayDateFormat') || '%e %B';
- var birthdayString = f.localeFormat(contact.bday, birthdayFormat);
+ var birthdayString = '';
+ try {
+ birthdayString = f.localeFormat(contact.bday, birthdayFormat);
+ } catch (err) {
+ console.error('Error parsing birthday');
+ return;
+ }
var element = utils.templates.render(birthdayTemplate, {
i: contact.id,
@@ -331,10 +337,11 @@ contacts.Details = (function() {
var telLength = Contacts.getLength(contact.tel);
for (var tel = 0; tel < telLength; tel++) {
var currentTel = contact.tel[tel];
+ var escapedType = utils.text.escapeHTML(currentTel.type, true);
var telField = {
- value: currentTel.value || '',
- type: currentTel.type || TAG_OPTIONS['phone-type'][0].value,
- carrier: currentTel.carrier || '',
+ value: utils.text.escapeHTML(currentTel.value, true) || '',
+ type: escapedType || TAG_OPTIONS['phone-type'][0].value,
+ carrier: utils.text.escapeHTML(currentTel.carrier, true) || '',
i: tel
};
var template = utils.templates.render(phonesTemplate, telField);
@@ -369,9 +376,10 @@ contacts.Details = (function() {
var emailLength = Contacts.getLength(contact.email);
for (var email = 0; email < emailLength; email++) {
var currentEmail = contact.email[email];
+ var escapedType = utils.text.escapeHTML(currentEmail['type'], true);
var emailField = {
- value: currentEmail['value'] || '',
- type: currentEmail['type'] || TAG_OPTIONS['email-type'][0].value,
+ value: utils.text.escapeHTML(currentEmail['value'], true) || '',
+ type: escapedType || TAG_OPTIONS['email-type'][0].value,
i: email
};
var template = utils.templates.render(emailsTemplate, emailField);
@@ -403,12 +411,22 @@ contacts.Details = (function() {
'locality', 'countryName'])) {
continue;
}
+ var address = currentAddress['streetAddress'] || '';
+ var escapedStreet = utils.text.escapeHTML(address, true);
+ var locality = currentAddress['locality'];
+ var escapedLocality = utils.text.escapeHTML(locality, true);
+ var escapedType = utils.text.escapeHTML(currentAddress['type'], true);
+ var country = currentAddress['countryName'] || '';
+ var escapedCountry = utils.text.escapeHTML(country, true);
+ var postalCode = currentAddress['postalCode'] || '';
+ var escapedPostalCode = utils.text.escapeHTML(postalCode, true);
+
var addressField = {
- streetAddress: currentAddress['streetAddress'] || '',
- postalCode: currentAddress['postalCode'] || '',
- locality: currentAddress['locality'] || '',
- countryName: currentAddress['countryName'] || '',
- type: currentAddress['type'] || TAG_OPTIONS['address-type'][0].value,
+ streetAddress: escapedStreet,
+ postalCode: escapedPostalCode,
+ locality: escapedLocality || '',
+ countryName: escapedCountry,
+ type: escapedType || TAG_OPTIONS['address-type'][0].value,
i: i
};
var template = utils.templates.render(addressesTemplate, addressField);
@@ -427,7 +445,7 @@ contacts.Details = (function() {
for (var i = 0; i < contact.note.length; i++) {
var currentNote = contact.note[i];
var noteField = {
- note: currentNote || '',
+ note: utils.text.escapeHTML(currentNote, true) || '',
i: i
};
var template = utils.templates.render(notesTemplate, noteField);
@@ -48,7 +48,7 @@ contacts.Form = (function() {
var fields = form.querySelectorAll('input.textfield');
var removedFields =
Array.slice(form.querySelectorAll('.removed input.textfield'));
- this._textFields = Array.filter(fields, function (field) {
+ this._textFields = Array.filter(fields, function(field) {
return removedFields.indexOf(field) == -1;
});
}
@@ -270,6 +270,7 @@ contacts.Form = (function() {
var def = (currentElem === 'type') ? default_type : '';
var defObj = (typeof(obj) === 'string') ? obj : obj[currentElem];
var value = currField[currentElem] = defObj || def;
+ currField[currentElem] = utils.text.escapeHTML(value, true);
if (!infoFromFB && value && nonEditableValues[value]) {
infoFromFB = true;
}
Oops, something went wrong.

0 comments on commit cfe3344

Please sign in to comment.