Permalink
Browse files

Remove all code used by web* targets

It doesn't work, and with removed support for remote XUL there is no hope
to make it work again.
  • Loading branch information...
1 parent a3710a7 commit 4fe19676cd2ce0140a4e16de2faa4d698150fd81 @prefiks prefiks committed May 18, 2011
Showing with 14 additions and 869 deletions.
  1. +0 −9 Makefile
  2. +7 −22 build.pl
  3. +0 −75 chrome/oneteam/content/JavaScript/cache.js
  4. +0 −5 chrome/oneteam/content/JavaScript/console.js
  5. +0 −23 chrome/oneteam/content/JavaScript/dateutils.js
  6. +2 −12 chrome/oneteam/content/JavaScript/exceptions.js
  7. +0 −15 chrome/oneteam/content/JavaScript/l10n.js
  8. +2 −16 chrome/oneteam/content/JavaScript/model/account.js
  9. +0 −4 chrome/oneteam/content/JavaScript/model/roster.js
  10. +1 −9 chrome/oneteam/content/JavaScript/styles.js
  11. +0 −10 chrome/oneteam/content/JavaScript/utils.js
  12. +0 −14 chrome/oneteam/content/bindings/chatpane.xml
  13. +0 −8 chrome/oneteam/content/bindings/chattabbox.xml
  14. +0 −5 chrome/oneteam/content/fileTransferRequest.xul
  15. +0 −6 chrome/oneteam/content/history.xul
  16. +0 −15 chrome/oneteam/content/vcardEdit.xul
  17. +2 −2 tools/perl5lib/OneTeam/Builder/Bundle.pm
  18. +0 −45 tools/perl5lib/OneTeam/Builder/Filter/DialogSizeProcessor.pm
  19. +0 −14 tools/perl5lib/OneTeam/Builder/Filter/LocaleProcessor.pm
  20. +0 −31 tools/perl5lib/OneTeam/Builder/Filter/PathConverter.pm
  21. +0 −36 tools/perl5lib/OneTeam/Builder/Filter/Saver/WebDir.pm
  22. +0 −53 tools/perl5lib/OneTeam/Builder/Filter/Saver/WebJar.pm
  23. +0 −7 web/.gitignore
  24. BIN web/favicon.png
  25. +0 −97 web/index.html
  26. +0 −97 web/indexMUC.html
  27. BIN web/launch-button.png
  28. +0 −235 web/oneteam.js
  29. +0 −4 web/serverPrefs.dat.example
  30. BIN web/sounds/connected.mp3
  31. BIN web/sounds/disconnected.mp3
  32. BIN web/sounds/message1.mp3
  33. BIN web/sounds/message2.mp3
  34. BIN web/sounds/player.swf
  35. BIN web/sounds/sent.mp3
View
@@ -18,15 +18,6 @@ xpi:
xpidbg:
perl build.pl XPI 1 DEBUG 1
-webjar:
- perl build.pl
-
-webjardbg:
- perl build.pl DEBUG 1
-
-webdir:
- perl build.pl NOJAR 1 DEBUG 1
-
watch:
perl tools/autoup.pl
View
@@ -64,32 +64,17 @@ sub get_buildid {
exists $defs{NOJAR} ?
new OneTeam::Builder::Filter::Saver::XulApp::Flat($topdir, \&get_version_str, \&get_buildid, \%mar_options) :
new OneTeam::Builder::Filter::Saver::XulApp($topdir, \&get_version_str, \&get_buildid, \%mar_options) :
- exists $defs{XPI} ?
new OneTeam::Builder::Filter::Saver::XPI($topdir, \&get_version_str, \&get_buildid,
- $defs{UPDATE_URL}, $defs{XPI_URL}) :
- exists $defs{NOJAR} ?
- new OneTeam::Builder::Filter::Saver::WebDir($topdir, \&get_version_str, \&get_buildid) :
- new OneTeam::Builder::Filter::Saver::WebJar($topdir, \&get_version_str, \&get_buildid);
+ $defs{UPDATE_URL}, $defs{XPI_URL});
$defs{XULAPP} = 1 if exists $defs{XPI} or exists $defs{DMG};
-my $locale_processor = exists $defs{XULAPP} ?
- new OneTeam::Builder::Filter::LocaleProcessor::XulApp($saver, split /,/, ($defs{LANGS}||"")) :
- new OneTeam::Builder::Filter::LocaleProcessor::Web($saver, split /,/, ($defs{LANGS}||""));
-
-my @filters = (exists $defs{XULAPP} ?
- (
- new OneTeam::Builder::Filter::Preprocessor(%defs),
- $locale_processor,
- new OneTeam::Builder::Filter::CommentsStripper(),
- ):
- (
- new OneTeam::Builder::Filter::Preprocessor(%defs),
- $locale_processor,
- new OneTeam::Builder::Filter::PathConverter::Web(),
- new OneTeam::Builder::Filter::DialogSizeProcessor(),
- new OneTeam::Builder::Filter::CommentsStripper(),
- ),
+my $locale_processor =
+ new OneTeam::Builder::Filter::LocaleProcessor::XulApp($saver, split /,/, ($defs{LANGS}||""));
+
+my @filters = (
+ new OneTeam::Builder::Filter::Preprocessor(%defs),
+ new OneTeam::Builder::Filter::CommentsStripper(),
$saver);
my @locales = $locale_processor->locales;
@@ -3,7 +3,6 @@ var EXPORTED_SYMBOLS = ["PersistentCache"];
ML.importMod("roles.js");
ML.importMod("file.js");
-// #ifdef XULAPP
function PersistentCache(name)
{
var file = Components.classes["@mozilla.org/file/directory_service;1"].
@@ -244,77 +243,3 @@ _DECL_(StorageFunctionDelete).prototype =
f.remove();
}
}
-/* #else
-function PersistentCache(name)
-{
- this.storage = new StorageWrapper("cache");
-
- var keysToDel = [];
- for (var key in this.storage)
- if (key.indexOf("expiration:") == 0)
- if (this.storage.get(key) < Date.now())
- keysToDel.push(key.substr("expiration:".length));
-
- for (var i = 0; i < keysToDel.length; i++)
- this.removeValue(keysToDel[i]);
-}
-
-_DECL_(PersistentCache).prototype =
-{
- setValue: function(key, value, expirationDate, storeAsFile)
- {
- this.storage.set("value:"+key, value);
- if (expirationDate)
- this.storage.set("expiration:"+key, expirationDate.getTime());
- return value;
- },
-
- getValue: function(key, asFile)
- {
- var data = this.storage.get("value:"+key);
- if (data != null && asFile)
- return "data:image/png;base64,"+btoa(data);
- return data;
- },
-
- removeValue: function(key)
- {
- this.storage.delete("value:"+key);
- this.storage.delete("expiration:"+key);
- },
-
- bumpExpirationDate: function(key, expirationDate)
- {
- if (this.getValue(key) != null)
- this.storage.set("expiration:"+key, expirationDate.getTime());
- },
-
- clear: function()
- {
- var keys = [i for (i in this.storage)]
- for (var i = 0; i < keys.length; i++)
- this.storage.delete(keys[i]);
- },
-
- iterator: function(prefix, asFile)
- {
- return {
- prefix: "value:"+prefix,
- storage: this.storage,
- asFile: asFile,
-
- __iterator__: function(onlyKeys) {
- if (onlyKeys) {
- for (var key in this.storage)
- if (key.indexOf(this.prefix) == 0)
- yield (key.slice(6));
- } else
- for (var [key, val] in this.storage)
- if (key.indexOf(this.prefix) == 0)
- yield ([key.slice(6), this.asFile ?
- "data:image/png;base64,"+btoa(val) : val]);
- }
- };
- }
-}
-// #endif */
@@ -64,12 +64,7 @@ function onLoad() {
intoInput = document.getElementById("intoinput");
var link = console.contentDocument.createElement("link");
-// #ifdef XULAPP
link.setAttribute("href", "chrome://oneteam/skin/xmlconsole/content.css");
-/* #else
- link.setAttribute("href",
- document.location.href.replace(/content\/.*?$/, "skin/xmlconsole/content.css"));
-// #endif */
link.setAttribute("rel", "stylesheet");
console.contentDocument.documentElement.getElementsByTagName("HEAD")[0].appendChild(link);
handlers.register();
@@ -1,7 +1,6 @@
var EXPORTED_SYMBOLS = ["formatData", "dateToUTCString", "utcStringToDate",
"dateToISO8601Timestamp","iso8601TimestampToDate",
"readableTimestamp"];
-// #ifdef XULAPP
function formatDate(date, locale, dateFormat, timeFormat)
{
var formater = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
@@ -40,28 +39,6 @@ function formatDate(date, locale, dateFormat, timeFormat)
date.getFullYear(), date.getMonth()+1, date.getDate(),
date.getHours(), date.getMinutes(), date.getSeconds());
}
-/* #else
-function formatDate(date, locale, dateFormat, timeFormat)
-{
- var res = "";
-
- if (dateFormat != "none")
- res += date.getFullYear() + "-" +
- (date.getMonth()+101).toString().substr(1) + "-" +
- (date.getDate()+100).toString().substr(1);
-
- if (timeFormat == "none")
- return res;
-
- res += (res ? " " : "") +
- (date.getHours()+100).toString().substr(1) + ":" +
- (date.getMinutes()+100).toString().substr(1);
- if (timeFormat == "short" || timeFormat == "short24")
- res += ":" + (date.getSeconds()+100).toString().substr(1);
-
- return res;
-}
-// #endif */
function dateToUTCString(date)
{
@@ -55,7 +55,6 @@ function exceptionToString(exc, indent)
indent = indent || "";
if (exc) {
-// #ifdef XULAPP
if (exc instanceof Components.interfaces.nsIException) {
msg = indent+"Exception '"+exc.message+"' - "+
exc.result+"("+exc.name+") thrown at " +
@@ -68,9 +67,6 @@ function exceptionToString(exc, indent)
return msg+indent+"Stacktrace:\n"+
dumpStack(exc.location, indent+" ");
} else if (exc instanceof Error || exc.stack) {
-/* #else
- if (exc instanceof Error || exc.stack) {
-// #endif */
msg = indent+"Exception '"+exc.message+"' thrown at " +
exc.fileName+":"+exc.lineNumber +"\n";
@@ -101,7 +97,6 @@ function exceptionToString(exc, indent)
function logExceptionInConsole(exc)
{
-// #ifdef XULAPP
var cs = Components.classes["@mozilla.org/consoleservice;1"].
getService(Components.interfaces.nsIConsoleService);
var se = Components.classes["@mozilla.org/scripterror;1"].
@@ -112,7 +107,6 @@ function logExceptionInConsole(exc)
se.init(msg, file, null, line, 0, 0, "component");
cs.logMessage(se);
-// #endif
}
function TRACE(_this, args) {
@@ -145,9 +139,8 @@ function TRACE(_this, args) {
Error.prototype.toString = function() {
return exceptionToString(this, "");
}
-// #ifdef XULAPP
+
Components.interfaces.nsIException.toString = Error.prototype.toString;
-// #endif
/**
* Base class for all exception classes.
@@ -169,7 +162,6 @@ Components.interfaces.nsIException.toString = Error.prototype.toString;
*/
function GenericError(message, reason) {
var exc;
-// #ifdef XULAPP
var stack = Components.stack.caller;
var fun = arguments.callee;
@@ -192,9 +184,7 @@ function GenericError(message, reason) {
exc = new Error(message,
stack.filename,
stack.lineNumber);
-/* #else
- exc = new Error(message);
-// #endif */
+
exc.__proto__ = this.__proto__;
if (reason)
@@ -103,7 +103,6 @@ var l10nFormatService = {
}
}
-//#ifdef XULAPP
function _ (id) {
if (id != "plural.forms" && id.search(/^p([A-Z][a-zA-Z]*)?\d*$/) != 0) {
id = id.replace(/^\$\$\w+\$\$:\s*/, "");
@@ -134,17 +133,3 @@ function _xml (id) {
args[i] = xmlEscape(arguments[i]);
return _.apply(null, args);
}
-
-/* #else
-function _ (id) {
- id = id.replace(/^\$\$\w+\$\$:(?:\s*)/, "");
- return l10nFormatService.formatString.apply(l10nFormatService, arguments);
-}
-
-function _xml (id) {
- var args = [id.replace(/^\$\$\w+\$\$:(?:\s*)/, "")];
- for (var i = 1; i < arguments.length; i++)
- args[i] = xmlEscape(arguments[i]);
- return l10nFormatService.formatString.apply(l10nFormatService, args);
-}
-// #endif */
@@ -639,16 +639,10 @@ _DECL_(Account, null, Model, DiscoItem, vCardDataAccessor).prototype =
var base = this.connectionInfo.base.replace(/^\//, "").replace(/\/$/, "");
-// #ifdef XULAPP
var domain = host;
var httpbase = (this.connectionInfo.type == "https-bind" ? "https://" : "http://")+
host+":"+this.connectionInfo.port+"/"+base+"/";
-/* #else
- var domain = this.connectionInfo.domain || this.connectionInfo.host ||
- document.location.toString().replace(/(?:jar:)?\w+:\/\/([^:\/]+).*$/, "$1");
- var httpbase = document.location.toString().
- replace(/(?:jar:)?(\w+:\/\/[^:\/]+(?::\d+)?\/).*$/, "$1")+base+"/";
-// #endif */
+
var args = {
httpbase: httpbase,
oDbg: {log: function(a) {
@@ -659,11 +653,9 @@ _DECL_(Account, null, Model, DiscoItem, vCardDataAccessor).prototype =
timerval: 2000};
switch (this.connectionInfo.type) {
-// #ifdef XULAPP
case "native":
account.connection = new JSJaCMozillaConnection(args);
break;
-// #endif
case "http-bind":
case "https-bind":
account.connection = new JSJaCHttpBindingConnection(args);
@@ -807,7 +799,6 @@ _DECL_(Account, null, Model, DiscoItem, vCardDataAccessor).prototype =
function(account, items, item) {
account.getOrCreateContact(item._discoCacheEntry.jid);
});
-// #ifdef XULAPP
this.getDiscoItemsByCategory("proxy", "bytestreams", false,
function(account, items, item) {
socks5Service.registerProxy(item._discoCacheEntry.jid);
@@ -816,12 +807,7 @@ _DECL_(Account, null, Model, DiscoItem, vCardDataAccessor).prototype =
function(account, items, item) {
jingleNodesService.askForServices(item._discoCacheEntry.jid);
});
-/* #else
- this.getDiscoItemsByFeature("http://oneteam.im/bs-proxy", false,
- function(account, items, item) {
- socks5Service.registerProxy(item._discoCacheEntry.jid);
- });
-// #endif */
+
// Enable auto archiving
this.hasDiscoFeature("http://www.xmpp.org/extensions/xep-0136.html#ns", false,
function (account, value) {
@@ -887,13 +887,9 @@ _DECL_(Resource, null, Model, DiscoItem, Comparator,
onSendFile: function()
{
-// #ifdef XULAPP
var path = pickFile(_("Select a File"), false);
if (path)
this.sendFile(path);
-/* #else
- this.sendFile();
-// #endif */
},
sendFile: function(path)
@@ -130,19 +130,11 @@ _DECL_(StylesRegistry, null, Model).prototype =
var iconDefData = "";
try {
-// #ifdef XULAPP
var reader = new Reader(url+"/icondef.xml");
reader.open();
iconDefData = reader.read();
reader.close();
-/* #else
- url = url.replace(/^(\.\.\/)*content/,
- location.href.replace(/\/content\/.*$/,"/content"));
- var xhr = new XMLHttpRequest()
- xhr.open("GET", url+"/icondef.xml", false);
- xhr.send("");
- iconDefData = xhr.responseText;
-// #endif */
+
iconDefData = iconDefData.replace(/<\?xml.*\?>/, "");
iconDefData = new XML(iconDefData);
} catch (ex) { return }
@@ -929,27 +929,17 @@ function report(to, level, info, context)
msg += "E CONTEXT:\n";
msg += inspect(context);
}
-// #ifdef XULAPP
dump(msg);
logExceptionInConsole(info);
-/* #else
-// #ifdef DEBUG
- alert(msg);
-// #endif
-// #endif */
break;
default:
-// #ifdef XULAPP
dump(dumpStack());
-// #endif
throw new Error("Error while trying to report error, unrecognized level: " + level);
}
break;
default:
-// #ifdef XULAPP
dump(dumpStack());
-// #endif
throw new Error("Error while trying to reporting error, unrecognized receiver type: " + to);
}
}
Oops, something went wrong.

0 comments on commit 4fe1967

Please sign in to comment.