2 * (C) Copyright 2004-2007 Shawn Betts
3 * (C) Copyright 2007-2010 John J. Foerch
4 * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
6 * Use, modification, and distribution are subject to the terms specified in the
12 let (default_rc = get_home_directory()) {
13 default_rc.appendRelativePath(".conkerorrc");
14 default_pref("conkeror.rcfile", default_rc.path);
19 var rcfile = get_pref("conkeror.rcfile");
20 if (rcfile.length == 0)
21 //FIXME: log that the rc is disabled
23 path = make_file(rcfile);
24 if (! path.exists()) {
26 dumpln("w: broken symlink, \""+rcfile+"\"");
27 else if (pref_has_user_value("conkeror.rcfile"))
28 dumpln("w: preference conkeror.rcfile is set to "+
29 "non-existent path, \""+rcfile+"\"");
30 //FIXME: else log that the rc does not exist
35 if (path.isDirectory()) {
36 var entries = path.directoryEntries;
37 while (entries.hasMoreElements()) {
38 var entry = entries.getNext();
39 entry.QueryInterface(Ci.nsIFile);
40 if (entry.leafName.substr(-3).toLowerCase() == '.js')
43 files.sort(function (a, b) {
44 if (a.leafName < b.leafName)
46 else if (a.leafName > b.leafName)
51 path.appendRelativePath("a");
52 ret = path.path.substr(0, path.path.length - 1) + "*.js";
57 for (var i = 0; files[i]; i++) {
64 //FIXME: log what was loaded instead of returning the value to be
65 // logged by the caller.