@@ -101,6 +101,7 @@ var terminal = new function() {
101
101
storage.set("history", terminal.history.export());
102
102
storage.set("language", terminal.language.export());
103
103
storage.set("favourites", terminal.favourites.export());
104
+ storage.set("definitions", terminal.definitions.export());
104
105
storage.set("settings", settings.export());
105
106
storage.modifySave();
106
107
terminal.output.write("Terminal state has been saved.")
@@ -124,6 +125,8 @@ var terminal = new function() {
124
125
terminal.language.import(storage.get("language"));
125
126
var favs = storage.get("favourites");
126
127
if (favs) terminal.favourites.import(favs);
128
+ var defs = storage.get("definitions");
129
+ if (defs) terminal.definitions.import(defs);
127
130
if (!settings.get_cleanStartup()) terminal.output.write("Terminal state has been loaded.");
128
131
129
132
return true;
@@ -824,7 +827,24 @@ var terminal = new function() {
824
827
string = string.replace(def,definitions[def]);
825
828
}
826
829
return string;
827
- }
830
+ };
831
+
832
+ this.export = function() {
833
+ return {
834
+ "!export:definitions": true,
835
+ definitions: definitions
836
+ };
837
+ };
838
+
839
+ this.import = function(languageImportObject) {
840
+ if (!(typeof languageImportObject === "object" &&
841
+ languageImportObject.hasOwnProperty("!export:definitions")) &&
842
+ languageImportObject.definitions) {
843
+ log.write("Wrong object to import as definitions import object: ", languageImportObject);
844
+ return;
845
+ }
846
+ definitions = languageImportObject.definitions;
847
+ };
828
848
829
849
};
830
850
0 commit comments