Commit 58b80591 authored by CardBook's avatar CardBook

version 25.3

parent 2a0598cd
......@@ -21,6 +21,7 @@ locale cardbook ro chrome/locale/ro/
locale cardbook ru chrome/locale/ru/
locale cardbook sl chrome/locale/sl/
locale cardbook sv-SE chrome/locale/sv-SE/
locale cardbook vi chrome/locale/vi/
skin cardbook classic/1.0 chrome/skin/
skin cardbook-config classic/1.0 chrome/skin/configuration/
......@@ -35,7 +36,7 @@ skin cardbook-os classic/1.0 chrome/skin/os/windows/ os=
skin cardbook-os classic/1.0 chrome/skin/os/mac/ os=Darwin
# support for customizing toolbars
style chrome://global/content/customizeToolbar.xul chrome://cardbook/skin/toolbarButton.css
style chrome://global/content/customizeToolbar.xul chrome://cardbook-osversion/skin/mainToolbarButton.css
style chrome://global/content/customizeToolbar.xul chrome://cardbook-osversion/skin/cardbookToolbarButtons.css
# support for CardBook, yellow stars, creation from emails, formatting email fields
......
......@@ -15,7 +15,7 @@
title="&wizard.title;"
windowtype="Addressbook:NewAddressbookWizard"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
onload="wdw_addressbooksAdd.loadWizard();"
onwizardcancel="wdw_addressbooksAdd.cancelWizard();"
onclose="wdw_addressbooksAdd.cancelWizard();"
......@@ -154,9 +154,9 @@
<column flex="1"/>
</columns>
<rows>
<description>&remotePage.uri.description;</description>
<description>&remotePage.url.description;</description>
<row align="center">
<label id="remotePageUriLabel" value="&remotePage.uri.label;" control="remotePageURI"/>
<label id="remotePageUriLabel" value="&remotePage.url.label;" control="remotePageURI"/>
<textbox id="remotePageURI"
required="true"
oninput="wdw_addressbooksAdd.remotePageTextboxInput();"/>
......
if ("undefined" == typeof(wdw_addressbooksEdit)) {
Components.utils.import("chrome://cardbook/content/cardbookRepository.js");
var wdw_addressbooksEdit = {
initialDateFormat: "",
loadFnFormula: function () {
var strBundle = document.getElementById("cardbook-strings");
var orgStructure = cardbookPreferences.getStringPref("extensions.cardbook.orgStructure");
if (orgStructure != "") {
var allOrg = cardbookUtils.unescapeArray(cardbookUtils.escapeString(orgStructure).split(";"));
} else {
var allOrg = [];
}
var myLabel = "";
myLabel = myLabel + "{{1}} : " + strBundle.getString("prefixnameLabel") + " ";
myLabel = myLabel + "{{2}} : " + strBundle.getString("firstnameLabel") + " ";
myLabel = myLabel + "{{3}} : " + strBundle.getString("othernameLabel") + " ";
myLabel = myLabel + "{{4}} : " + strBundle.getString("lastnameLabel");
document.getElementById('fnFormulaDescriptionLabel1').value = myLabel.trim();
myLabel = "";
myLabel = myLabel + "{{5}} : " + strBundle.getString("suffixnameLabel") + " ";
var count = 6;
if (allOrg.length === 0) {
myLabel = "{{6}} : " + strBundle.getString("orgLabel");
} else {
for (var i = 0; i < allOrg.length; i++) {
var index = count + i;
myLabel = myLabel + "{{" + index + "}} : " + allOrg[i] + " ";
}
}
document.getElementById('fnFormulaDescriptionLabel2').value = myLabel.trim();
},
resetFnFormula: function () {
document.getElementById('fnFormulaTextBox').value = cardbookPreferences.getFnFormula(window.arguments[0].dirPrefId);
},
showAutoSyncInterval: function () {
if (document.getElementById('autoSyncCheckBox').checked) {
document.getElementById('autoSyncInterval').disabled = false;
document.getElementById('autoSyncIntervalTextBox').disabled = false;
} else {
document.getElementById('autoSyncInterval').disabled = true;
document.getElementById('autoSyncIntervalTextBox').disabled = true;
}
},
load: function () {
wdw_addressbooksEdit.initialDateFormat = cardbookPreferences.getDateFormat(window.arguments[0].dirPrefId);
document.getElementById("colorInput").value = cardbookPreferences.getColor(window.arguments[0].dirPrefId);
document.getElementById("nameTextBox").value = cardbookPreferences.getName(window.arguments[0].dirPrefId);
document.getElementById("typeTextBox").value = cardbookPreferences.getType(window.arguments[0].dirPrefId);
document.getElementById("urlTextBox").value = cardbookPreferences.getUrl(window.arguments[0].dirPrefId);
document.getElementById("usernameTextBox").value = cardbookPreferences.getUser(window.arguments[0].dirPrefId);
document.getElementById("readonlyCheckBox").setAttribute('checked', cardbookPreferences.getReadOnly(window.arguments[0].dirPrefId));
document.getElementById("vCardVersionTextBox").value = cardbookPreferences.getVCardVersion(window.arguments[0].dirPrefId);
cardbookElementTools.loadDateFormats("dateFormatMenuPopup", "dateFormatMenuList", wdw_addressbooksEdit.initialDateFormat);
document.getElementById("urnuuidCheckBox").setAttribute('checked', cardbookPreferences.getUrnuuid(window.arguments[0].dirPrefId));
if (document.getElementById("typeTextBox").value === "GOOGLE" || document.getElementById("typeTextBox").value === "APPLE" || document.getElementById("typeTextBox").value === "CARDDAV") {
document.getElementById('syncTab').setAttribute("collapsed", false);
document.getElementById("autoSyncCheckBox").setAttribute('checked', cardbookPreferences.getAutoSyncEnabled(window.arguments[0].dirPrefId));
document.getElementById("autoSyncIntervalTextBox").value = cardbookPreferences.getAutoSyncInterval(window.arguments[0].dirPrefId);
wdw_addressbooksEdit.showAutoSyncInterval();
} else {
document.getElementById('syncTab').setAttribute("collapsed", true);
}
document.getElementById("fnFormulaTextBox").value = cardbookPreferences.getFnFormula(window.arguments[0].dirPrefId);
wdw_addressbooksEdit.loadFnFormula();
},
save: function () {
if (document.getElementById('dateFormatMenuList').value != wdw_addressbooksEdit.initialDateFormat) {
cardbookDates.convertAddressBookDate(window.arguments[0].dirPrefId, document.getElementById('nameTextBox').value,
wdw_addressbooksEdit.initialDateFormat, document.getElementById('dateFormatMenuList').value);
}
cardbookPreferences.setName(window.arguments[0].dirPrefId, document.getElementById('nameTextBox').value);
cardbookPreferences.setColor(window.arguments[0].dirPrefId, document.getElementById('colorInput').value);
cardbookPreferences.setVCardVersion(window.arguments[0].dirPrefId, document.getElementById('vCardVersionTextBox').value);
cardbookPreferences.setReadOnly(window.arguments[0].dirPrefId, document.getElementById('readonlyCheckBox').checked);
cardbookPreferences.setDateFormat(window.arguments[0].dirPrefId, document.getElementById('dateFormatMenuList').value);
cardbookPreferences.setUrnuuid(window.arguments[0].dirPrefId, document.getElementById('urnuuidCheckBox').checked);
cardbookPreferences.setAutoSyncEnabled(window.arguments[0].dirPrefId, document.getElementById('autoSyncCheckBox').checked);
cardbookPreferences.setAutoSyncInterval(window.arguments[0].dirPrefId, document.getElementById('autoSyncIntervalTextBox').value);
cardbookPreferences.setFnFormula(window.arguments[0].dirPrefId, document.getElementById('fnFormulaTextBox').value);
window.arguments[0].serverCallback("SAVE", window.arguments[0].dirPrefId, document.getElementById('nameTextBox').value,
document.getElementById('readonlyCheckBox').checked);
close();
},
cancel: function () {
window.arguments[0].serverCallback("CANCEL", window.arguments[0].dirPrefId);
close();
}
};
};
......@@ -3,35 +3,37 @@
<?xml-stylesheet href="chrome://cardbook/skin/cardbookMain.css" type="text/css"?>
<?xul-overlay href="chrome://cardbook/content/ovl_cardbookStringBundle.xul"?>
<!DOCTYPE window [
<!ENTITY % addressbooksEditDTD SYSTEM "chrome://cardbook/locale/wdw_addressbooksEdit.dtd"> %addressbooksEditDTD;
<!ENTITY % configurationDTD SYSTEM "chrome://cardbook/locale/wdw_cardbookConfiguration.dtd"> %configurationDTD;
<!ENTITY % passwordDTD SYSTEM "chrome://cardbook/locale/wdw_password.dtd"> %passwordDTD;
<!ENTITY % addressbooksAddDTD SYSTEM "chrome://cardbook/locale/wdw_addressbooksAdd.dtd"> %addressbooksAddDTD;
<!ENTITY % buttonsDTD SYSTEM "chrome://cardbook/locale/wdw_editionButtons.dtd"> %buttonsDTD;
]>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload="wdw_serverEdition.load();" resizable="true"
onclose="wdw_serverEdition.cancel();"
id="wdw_serverEdition" title="&namePage.wizard.description;"
xmlns:html="http://www.w3.org/1999/xhtml"
onload="wdw_addressbooksEdit.load();" resizable="true"
onclose="wdw_addressbooksEdit.cancel();"
id="wdw_addressbooksEdit" title="&wdw_addressbooksEditTitle;"
persist="screenX screenY width height" class="cardbookBackgroundColorClass dialog-content-box"
style="min-width:600px;min-height:400px;">
style="min-width:700px;min-height:400px;">
<stringbundleset id="stringbundleset"/>
<script src="chrome://cardbook/content/preferences/cardbookPreferences.js"/>
<script src="chrome://cardbook/content/cardbookElementTools.js"/>
<script src="chrome://cardbook/content/cardbookDates.js"/>
<script src="chrome://cardbook/content/wdw_serverEdition.js"/>
<script src="chrome://cardbook/content/addressbooksconfiguration/wdw_addressbooksEdit.js"/>
<keyset id="wdw_serverEdition-keys">
<key keycode="VK_ESCAPE" oncommand="wdw_serverEdition.cancel();"/>
<keyset id="wdw_addressbooksEdit-keys">
<key keycode="VK_ESCAPE" oncommand="wdw_addressbooksEdit.cancel();"/>
</keyset>
<tabbox id="accountPrefs" width="400" height="300" flex="1">
<tabbox id="accountPrefs" flex="1">
<tabs>
<tab id="generalTab" label="&generalTabLabel;"/>
<tab id="syncTab" label="&syncTabLabel;"/>
<tab id="miscTab" label="&miscTabLabel;"/>
</tabs>
<tabpanels>
......@@ -48,42 +50,42 @@
<rows>
<row align="center">
<label value="&namePage.color.label;" control="cardbook-color" class="header"/>
<label value="&colorLabel;" accesskey="&colorAccesskey;" control="colorInput" class="header"/>
<hbox align="center">
<html:input id="serverColorInput"
<html:input id="colorInput"
class="small-margin"
type="color"/>
</hbox>
</row>
<separator class="thin"/>
<row align="center">
<label id="serverNameLabel" value="&namePage.name.label;" control="serverNameTextBox" class="header"/>
<textbox id="serverNameTextBox"/>
<label id="nameLabel" value="&nameLabel;" accesskey="&nameAccesskey;" control="nameTextBox" class="header"/>
<textbox id="nameTextBox"/>
</row>
<separator class="thin"/>
<row align="center">
<label id="serverTypeLabel" value="&remotePage.type.label;" control="serverTypeTextBox" class="header"/>
<textbox id="serverTypeTextBox" disabled="true"/>
<label id="typeLabel" value="&typeLabel;" control="typeTextBox" class="header"/>
<textbox id="typeTextBox" disabled="true"/>
</row>
<separator class="thin"/>
<row align="center">
<label id="serverUrlLabel" value="&remotePage.uri.label;" control="serverUrlTextBox" class="header"/>
<textbox id="serverUrlTextBox" disabled="true"/>
<label id="urlLabel" value="&urlLabel;" control="urlTextBox" class="header"/>
<textbox id="urlTextBox" disabled="true"/>
</row>
<separator class="thin"/>
<row align="center">
<label id="serverUserLabel" value="&usernameLabel;" control="serverUserTextBox" class="header"/>
<textbox id="serverUserTextBox" disabled="true"/>
<label id="usernameLabel" value="&usernameLabel;" control="usernameTextBox" class="header"/>
<textbox id="usernameTextBox" disabled="true"/>
</row>
<separator class="thin"/>
<row align="center">
<label id="serverReadOnlyLabel" value="&namePage.readonly.label;" control="serverReadOnlyCheckBox" class="header"/>
<checkbox id="serverReadOnlyCheckBox"/>
<label id="readonlyLabel" value="&readonlyLabel;" accesskey="&readonlyAccesskey;" control="readonlyCheckBox" class="header"/>
<checkbox id="readonlyCheckBox"/>
</row>
<separator class="thin"/>
<row align="center">
<label value="&namePage.vCardVersion.label;" control="serverVCardVersionTextBox" class="header"/>
<textbox id="serverVCardVersionTextBox" disabled="true"/>
<label value="&vCardVersionLabel;" control="vCardVersionTextBox" class="header"/>
<textbox id="vCardVersionTextBox" disabled="true"/>
</row>
</rows>
</grid>
......@@ -102,7 +104,7 @@
<rows>
<row align="center">
<label value="&dateFormatLabel;" control="dateFormatMenuList" class="header"/>
<label value="&dateFormatLabel;" accesskey="&dateFormatAccesskey;" control="dateFormatMenuList" class="header"/>
<hbox align="center">
<menulist id="dateFormatMenuList">
<menupopup id="dateFormatMenuPopup"/>
......@@ -111,8 +113,8 @@
</row>
<separator class="thin"/>
<row align="center">
<label value="&namePage.urnuuid.label;" control="serverUrnuuidCheckBox" class="header"/>
<checkbox id="serverUrnuuidCheckBox" disabled="true"/>
<label value="&urnuuidLabel;" accesskey="&urnuuidAccesskey;" control="urnuuidCheckBox" class="header"/>
<checkbox id="urnuuidCheckBox" disabled="true"/>
</row>
</rows>
</grid>
......@@ -133,12 +135,12 @@
<rows>
<row align="center">
<label value="&autoSyncLabel;" control="autoSyncCheckBox" class="header"/>
<checkbox id="autoSyncCheckBox" oncommand="wdw_serverEdition.showAutoSyncInterval();"/>
<label value="&autoSyncLabel;" accesskey="&autoSyncAccesskey;" control="autoSyncCheckBox" class="header"/>
<checkbox id="autoSyncCheckBox" oncommand="wdw_addressbooksEdit.showAutoSyncInterval();"/>
</row>
<row align="center">
<label value="&autoSyncIntervalLabel;"
control="autoSyncIntervalTextBox" class="header"
<label value="&autoSyncIntervalLabel;" accesskey="&autoSyncIntervalAccesskey;"
control="autoSyncIntervalTextBox" class="header indent"
id="autoSyncInterval"/>
<textbox id="autoSyncIntervalTextBox"/>
</row>
......@@ -147,12 +149,48 @@
</hbox>
</groupbox>
</tabpanel>
<tabpanel orient="vertical">
<groupbox>
<caption label="&fnFormulaLabel;" class="header"/>
<description>&fnLabelExplanation;</description>
<hbox flex="1">
<image id="dummyMiscGroupbox" class="cardbookNoPrefStarClass"/>
<grid align="center" flex="1">
<columns>
<column/>
<column flex="1"/>
<column/>
</columns>
<rows>
<row align="center">
<label value="&fnFormulaLabel;" accesskey="&fnFormulaAccesskey;" control="fnFormulaTextBox" class="header"/>
<textbox id="fnFormulaTextBox"/>
<button id="resetFnFormulaButton" label="&resetFnFormulaLabel;" accesskey="&resetFnFormulaAccesskey;"
oncommand="wdw_addressbooksEdit.resetFnFormula();"/>
</row>
<row align="center">
<label value=""/>
<label id="fnFormulaDescriptionLabel1"/>
<label value=""/>
</row>
<row align="center">
<label value=""/>
<label id="fnFormulaDescriptionLabel2"/>
<label value=""/>
</row>
</rows>
</grid>
</hbox>
</groupbox>
</tabpanel>
</tabpanels>
</tabbox>
<hbox>
<spacer flex="1"/>
<button id="saveEditionLabel" label="&saveEditionLabel;" accesskey="&saveEditionAccesskey;" oncommand="wdw_serverEdition.save();"/>
<button id="cancelEditionLabel" label="&cancelEditionLabel;" accesskey="&cancelEditionAccesskey;" oncommand="wdw_serverEdition.cancel();"/>
<button id="saveEditionLabel" label="&saveEditionLabel;" accesskey="&saveEditionAccesskey;" oncommand="wdw_addressbooksEdit.save();"/>
<button id="cancelEditionLabel" label="&cancelEditionLabel;" accesskey="&cancelEditionAccesskey;" oncommand="wdw_addressbooksEdit.cancel();"/>
</hbox>
</window>
......@@ -6,9 +6,9 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="wdw_newGoogleToken" title="&NewGoogleTokenTitle;"
persist="screenX screenY width height"
height="740px"
width="700px"
onclose="wdw_newGoogleToken.closeKO();">
height="740px"
width="700px"
onclose="wdw_newGoogleToken.closeKO();">
<stringbundleset id="stringbundleset"/>
......
......@@ -144,7 +144,7 @@ if ("undefined" == typeof(wdw_birthdayList)) {
for (var i = 0; i < numRanges; i++) {
myTree.view.selection.getRangeAt(i,start,end);
for (var k = start.value; k <= end.value; k++){
for (var k = start.value; k <= end.value; k++){
var myEmail = myTree.view.getCellText(k, myTree.columns.getNamedColumn('email'));
var myName = myTree.view.getCellText(k, myTree.columns.getNamedColumn('name'));
if (myEmail == "") {
......@@ -169,7 +169,7 @@ if ("undefined" == typeof(wdw_birthdayList)) {
}
}
}
}
}
}
},
......
......@@ -650,7 +650,7 @@ if ("undefined" == typeof(wdw_cardEdition)) {
setDisplayName: function () {
var myNewOrg = wdw_cardEdition.getOrg(false);
var myNewFn = cardbookUtils.getDisplayedName([document.getElementById('prefixnameTextBox').value.trim(),
var myNewFn = cardbookUtils.getDisplayedName(document.getElementById('dirPrefIdTextBox').value, [document.getElementById('prefixnameTextBox').value.trim(),
document.getElementById('firstnameTextBox').value.trim(),
document.getElementById('othernameTextBox').value.trim(),
document.getElementById('lastnameTextBox').value.trim(),
......
......@@ -121,9 +121,8 @@ if ("undefined" == typeof(wdw_imageEdition)) {
var myCard = wdw_cardEdition.workingCard;
myExtension = cardbookUtils.formatExtension(myExtension, myCard.version);
var targetFile = wdw_imageEdition.getEditionPhotoTempFile(myExtension);
var ioService = Services.io;
var myFileURISpec = "file:///" + targetFile.path;
var myFileURI = ioService.newURI(myFileURISpec, null, null);
var myFileURI = Services.io.newURI(myFileURISpec, null, null);
var myFile1 = myFileURI.QueryInterface(Components.interfaces.nsIFileURL).file;
aFile.copyToFollowingLinks(myFile1.parent, myFile1.leafName);
cardbookUtils.formatStringForOutput("imageSavedToFile", [myFile1.path]);
......@@ -202,9 +201,8 @@ if ("undefined" == typeof(wdw_imageEdition)) {
},
saveImageCardNext: function (aFile) {
var ioService = Services.io;
var myFileURISpec = document.getElementById('photolocalURITextBox').value;
var myFileURI = ioService.newURI(myFileURISpec, null, null);
var myFileURI = Services.io.newURI(myFileURISpec, null, null);
var myFile1 = myFileURI.QueryInterface(Components.interfaces.nsIFileURL).file;
myFile1.copyToFollowingLinks(aFile.parent,aFile.leafName);
cardbookUtils.formatStringForOutput("imageSavedToFile", [aFile.path]);
......
......@@ -453,7 +453,7 @@ if ("undefined" == typeof(cardbookCardParser)) {
}
if (this.fn == "") {
this.fn = cardbookUtils.getDisplayedName([this.prefixname, this.firstname, this.othername, this.lastname, this.suffixname], this.org);
this.fn = cardbookUtils.getDisplayedName(this.dirPrefId, [this.prefixname, this.firstname, this.othername, this.lastname, this.suffixname], this.org);
}
cardbookUtils.addEtag(this, vEtag);
......
......@@ -19,19 +19,19 @@ if ("undefined" == typeof(cardbookDates)) {
getDateForCompare: function (aCard, aField) {
try {
if (aCard[aField] == "") {
return new Date('666', '6', '6');
return new Date(Date.UTC('666', '6', '6'));
} else {
var dateFormat = cardbookPreferences.getDateFormat(aCard.dirPrefId);
var myDate = cardbookDates.convertDateStringToDate(aCard[aField], dateFormat);
if (myDate == "WRONGDATE") {
return new Date('666', '6', '6');
return new Date(Date.UTC('666', '6', '6'));
} else {
return myDate;
}
}
}
catch (e) {
return new Date('666', '6', '6');
return new Date(Date.UTC('666', '6', '6'));
}
},
......@@ -71,9 +71,9 @@ if ("undefined" == typeof(cardbookDates)) {
} else {
if (Services.vc.compare(Services.appinfo.version, "57") >= 0) {
if (aTargetDateFormat == "0") {
var formatter = Services.intl.createDateTimeFormat(undefined, { dateStyle: "long"});
var formatter = Services.intl.createDateTimeFormat(undefined, {dateStyle: "long"});
} else {
var formatter = Services.intl.createDateTimeFormat(undefined, { dateStyle: "short"});
var formatter = Services.intl.createDateTimeFormat(undefined, {dateStyle: "short"});
}
return formatter.format(myDate);
} else {
......@@ -174,7 +174,7 @@ if ("undefined" == typeof(cardbookDates)) {
lThirdField = aDateString.replace(EmptyParamRegExp2, "$3");
lThirdField = (lThirdField.length<2?'0':'') + lThirdField;
}
lReturn = new Date(lFirstField, lSecondField-1, lThirdField);
lReturn = new Date(Date.UTC(lFirstField, lSecondField-1, lThirdField));
} else {
var EmptyParamRegExp2 = new RegExp("^([^\-]*)\\" + lSeparator + "([^\-]*)", "ig");
if (aDateString.replace(EmptyParamRegExp2, "$1")!=aDateString) {
......@@ -183,7 +183,7 @@ if ("undefined" == typeof(cardbookDates)) {
lSecondField = aDateString.replace(EmptyParamRegExp2, "$2");
lSecondField = (lSecondField.length<2?'0':'') + lSecondField;
}
lReturn = new Date('666', lFirstField-1, lSecondField);
lReturn = new Date(Date.UTC('666', lFirstField-1, lSecondField));
}
break;
case "DD-MM-YYYY":
......@@ -199,7 +199,7 @@ if ("undefined" == typeof(cardbookDates)) {
lThirdField = aDateString.replace(EmptyParamRegExp2, "$3");
lThirdField = (lThirdField.length<2?'0':'') + lThirdField;
}
lReturn = new Date(lThirdField, lSecondField-1, lFirstField);
lReturn = new Date(Date.UTC(lThirdField, lSecondField-1, lFirstField));
} else {
var EmptyParamRegExp2 = new RegExp("^([^\.]*)\\" + lSeparator + "([^\.]*)", "ig");
if (aDateString.replace(EmptyParamRegExp2, "$1")!=aDateString) {
......@@ -208,7 +208,7 @@ if ("undefined" == typeof(cardbookDates)) {
lSecondField = aDateString.replace(EmptyParamRegExp2, "$2");
lSecondField = (lSecondField.length<2?'0':'') + lSecondField;
}
lReturn = new Date('666', lSecondField-1, lFirstField);
lReturn = new Date(Date.UTC('666', lSecondField-1, lFirstField));
}
break;
case "MM-DD-YYYY":
......@@ -224,7 +224,7 @@ if ("undefined" == typeof(cardbookDates)) {
lThirdField = aDateString.replace(EmptyParamRegExp2, "$3");
lThirdField = (lThirdField.length<2?'0':'') + lThirdField;
}
lReturn = new Date(lThirdField, lFirstField-1, lSecondField);
lReturn = new Date(Date.UTC(lThirdField, lFirstField-1, lSecondField));
} else {
var EmptyParamRegExp2 = new RegExp("^([^\/]*)\\" + lSeparator + "([^\/]*)", "ig");
if (aDateString.replace(EmptyParamRegExp2, "$1")!=aDateString) {
......@@ -233,7 +233,7 @@ if ("undefined" == typeof(cardbookDates)) {
lSecondField = aDateString.replace(EmptyParamRegExp2, "$2");
lSecondField = (lSecondField.length<2?'0':'') + lSecondField;
}
lReturn = new Date('666', lFirstField-1, lSecondField);
lReturn = new Date(Date.UTC('666', lFirstField-1, lSecondField));
}
break;
case "YYYYMMDD":
......@@ -244,12 +244,12 @@ if ("undefined" == typeof(cardbookDates)) {
lFirstField = aDateString.substr(0, 4);
lSecondField = aDateString.substr(4, 2);
lThirdField = aDateString.substr(6, 2);
lReturn = new Date(lFirstField, lSecondField-1, lThirdField);
lReturn = new Date(Date.UTC(lFirstField, lSecondField-1, lThirdField));
} else if (aDateString.length == 4 || aDateString.length == 3) {
lFirstField = aDateString.substr(0, 2);
lSecondField = aDateString.substr(2, 2);
lSecondField = (lSecondField.length<2?'0':'') + lSecondField;
lReturn = new Date('666', lFirstField-1, lSecondField);
lReturn = new Date(Date.UTC('666', lFirstField-1, lSecondField));
} else {
lReturn = "WRONGDATE";
}
......@@ -259,12 +259,12 @@ if ("undefined" == typeof(cardbookDates)) {
lFirstField = aDateString.substr(0, 2);
lSecondField = aDateString.substr(2, 2);
lThirdField = aDateString.substr(4, 4);
lReturn = new Date(lThirdField, lSecondField-1, lFirstField);
lReturn = new Date(Date.UTC(lThirdField, lSecondField-1, lFirstField));
} else if (aDateString.length == 4 || aDateString.length == 3) {
lFirstField = aDateString.substr(0, 2);
lSecondField = aDateString.substr(2, 2);
lSecondField = (lSecondField.length<2?'0':'') + lSecondField;
lReturn = new Date('666', lSecondField-1, lFirstField);
lReturn = new Date(Date.UTC('666', lSecondField-1, lFirstField));
} else {
lReturn = "WRONGDATE";
}
......@@ -274,12 +274,12 @@ if ("undefined" == typeof(cardbookDates)) {
lFirstField = aDateString.substr(0, 2);
lSecondField = aDateString.substr(2, 2);
lThirdField = aDateString.substr(4, 4);
lReturn = new Date(lThirdField, lFirstField-1, lSecondField);
lReturn = new Date(Date.UTC(lThirdField, lFirstField-1, lSecondField));
} else if (aDateString.length == 4 || aDateString.length == 3) {
lFirstField = aDateString.substr(0, 2);
lSecondField = aDateString.substr(2, 2);
lSecondField = (lSecondField.length<2?'0':'') + lSecondField;
lReturn = new Date('666', lFirstField-1, lSecondField);
lReturn = new Date(Date.UTC('666', lFirstField-1, lSecondField));
} else {
lReturn = "WRONGDATE";
}
......
......@@ -231,9 +231,9 @@ if ("undefined" == typeof(cardbookElementTools)) {
while ( contacts.hasMoreElements() ) {
var contact = contacts.getNext().QueryInterface(Components.interfaces.nsIAbDirectory);
// remote LDAP directory
if (contact.isRemote && contact.dirType === 0) {
continue;
}
if (contact.isRemote && contact.dirType === 0) {
continue;
}
if (aInclRestrictionList && aInclRestrictionList.length > 0) {
if (aInclRestrictionList[contact.dirPrefId]) {
sortedAddressBooks.push([contact.dirName, contact.dirPrefId, "standard-abook"]);
......
......@@ -1487,8 +1487,7 @@ var cardbookRepository = {
unregisterCss: function (aChromeUri) {
var sss = Components.classes['@mozilla.org/content/style-sheet-service;1'].getService(Components.interfaces.nsIStyleSheetService);
var ios = Services.io;
var uri = ios.newURI(aChromeUri, null, null);
var uri = Services.io.newURI(aChromeUri, null, null);
if (sss.sheetRegistered(uri, sss.AUTHOR_SHEET)) {
sss.unregisterSheet(uri, sss.AUTHOR_SHEET);
}
......@@ -1496,8 +1495,7 @@ var cardbookRepository = {
reloadCss: function (aChromeUri) {
var sss = Components.classes['@mozilla.org/content/style-sheet-service;1'].getService(Components.interfaces.nsIStyleSheetService);
var ios = Services.io;
var uri = ios.newURI(aChromeUri, null, null);
var uri = Services.io.newURI(aChromeUri, null, null);
if (sss.sheetRegistered(uri, sss.AUTHOR_SHEET)) {
sss.unregisterSheet(uri, sss.AUTHOR_SHEET);
}
......
......@@ -423,8 +423,8 @@ if ("undefined" == typeof(cardbookSynchronization)) {
},
getFileBinary: function (afileURI) {
var content = "";
var data = "";
var content = "";
var data = "";
var file = afileURI.QueryInterface(Components.interfaces.nsIFileURL).file;
if (file.exists() && file.isReadable()) {
......@@ -619,15 +619,14 @@ if ("undefined" == typeof(cardbookSynchronization)) {
}
} else if (aCard[aField].localURI != null && aCard[aField].localURI !== undefined && aCard[aField].localURI != "") {
if (!cacheDir.exists()) {
var ioService = Services.io;
var myFileURI = ioService.newURI(aCard[aField].localURI, null, null);
var myFileURI = Services.io.newURI(aCard[aField].localURI, null, null);
var myFile1 = myFileURI.QueryInterface(Components.interfaces.nsIFileURL).file;
myFile1.copyToFollowingLinks(cacheDir.parent,cacheDir.leafName);
aCard[aField].localURI = "file:///" + cacheDir.path;
}
} else if (aCard[aField].URI != null && aCard[aField].URI !== undefined && aCard[aField].URI != "") {
if (!cacheDir.exists()) {
if (aCard[aField].URI.indexOf("http") == 0) {
if (aCard[aField].URI.startsWith("http")) {
var listener_getimage = {
onDAVQueryComplete: function(status, response, askCertificate, etag) {
if (status > 199 && status < 400) {
......@@ -648,10 +647,31 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookUtils.formatStringForOutput("serverCardGettingImage", [aImageConnection.connDescription, aCard.fn]);
cardbookRepository.cardbookImageGetRequest[aCard.dirPrefId]++;
request.getimage();
} else {
var ioService = Services.io;
var myFileURI = ioService.newURI(aCard[aField].URI, null, null);
var fileContent = btoa(cardbookSynchronization.getFileBinary(myFileURI));
} else if (aCard[aField].URI.startsWith("file")) {
var myType = cardbookPreferences.getType(aCard.dirPrefId);