Commits

Frank Bennett committed 8a3e08a

Bump version in load.js, update CHANGES.txt, bundle code

  • Participants
  • Parent commits b0d338e

Comments (0)

Files changed (5)

 
 
 ==========================
+Changes in version 1.0.408
+==========================
+
+------------------------------------
+Mishandled or unimplemented features
+------------------------------------
+
+- Implement cite-group-delimiter
+
+==========================
 Changes in version 1.0.407
 ==========================
 
     };
 }
 var CSL = {
-    PROCESSOR_VERSION: "1.0.407",
+    PROCESSOR_VERSION: "1.0.408",
     PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
     STATUTE_SUBDIV_GROUPED_REGEX: /((?:^| )(?:art|ch|Ch|subch|p|pp|para|subpara|pt|r|sec|subsec|Sec|sch|tit)\.)/g,
     STATUTE_SUBDIV_PLAIN_REGEX: /(?:(?:^| )(?:art|ch|Ch|subch|p|pp|para|subpara|pt|r|sec|subsec|Sec|sch|tit)\.)/,
         };
         CSL.debug("Using collation sort");
     } catch (e) {
+        CSL.debug("Using localeCompare sort");
         strcmp = function (a, b) {
             return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase());
         };
         this.tmp.splice_delimiter = this.citation.opt["after-collapse-delimiter"];
     } else if (this.tmp.have_collapsed && this.opt.xclass === "in-text" && this.opt.update_mode !== CSL.NUMERIC) {
         this.tmp.splice_delimiter = ", ";
+    } else if (this.tmp.use_cite_group_delimiter) {
+        this.tmp.splice_delimiter = this.citation.opt.cite_group_delimiter;
     } else if (this.tmp.cite_locales[pos - 1]) {
         var alt_affixes = this.tmp.cite_affixes[this.tmp.cite_locales[pos - 1]];
         if (alt_affixes && alt_affixes.delimiter) {
         }
         if (this.tokentype === CSL.END) {
             state.opt.grouped_sort = state.opt.xclass === "in-text" 
-                && state.citation.opt.collapse 
-                && state.citation.opt.collapse.length
+                && (state.citation.opt.collapse 
+                    && state.citation.opt.collapse.length)
+                || (state.citation.opt.cite_group_delimiter
+                    && state.citation.opt.cite_group_delimiter.length)
                 && state.opt.update_mode !== CSL.POSITION
                 && state.opt.update_mode !== CSL.NUMERIC;
             if (state.opt.grouped_sort 
     }
     if ((this.item && this.item["suppress-author"] && this._first_creator_variable == this.variables[0])
         || (this.state[this.state.tmp.area].opt.collapse 
-            && this.state[this.state.tmp.area].opt.collapse.length)) {
+            && this.state[this.state.tmp.area].opt.collapse.length)
+        || (this.state[this.state.tmp.area].opt.cite_group_delimiter 
+            && this.state[this.state.tmp.area].opt.cite_group_delimiter.length)) {
         if (this.state.tmp.authorstring_request) {
             mystr = "";
             myqueue = this.state.tmp.name_node.top.blobs.slice(-1)[0].blobs;
             this.state.tmp.offset_characters = oldchars;
             this.state.registry.authorstrings[this.Item.id] = mystr;
         } else if (!this.state.tmp.just_looking
-            && !this.state.tmp.suppress_decorations) {
+                   && !this.state.tmp.suppress_decorations && (this.item["suppress-author"] || (this.state[this.state.tmp.area].opt.collapse && this.state[this.state.tmp.area].opt.collapse.length) || this.state[this.state.tmp.area].opt.cite_group_delimiter && this.state[this.state.tmp.area].opt.cite_group_delimiter)) {
             mystr = "";
             myqueue = this.state.tmp.name_node.top.blobs.slice(-1)[0].blobs;
             oldchars = this.state.tmp.offset_characters;
                 mystr = this.state.output.string(this.state, myqueue, false);
             }
             if (mystr === this.state.tmp.last_primary_names_string) {
-                this.state.tmp.name_node.top.blobs.pop();
-                this.state.tmp.name_node.children = [];
-                this.state.tmp.offset_characters = oldchars;
+                if (this.item["suppress-author"] || (this.state[this.state.tmp.area].opt.collapse && this.state[this.state.tmp.area].opt.collapse.length)) {
+                    this.state.tmp.name_node.top.blobs.pop();
+                    this.state.tmp.name_node.children = [];
+                    this.state.tmp.offset_characters = oldchars;
+                }
+                this.state.tmp.use_cite_group_delimiter = false;
             } else {
                 this.state.tmp.last_primary_names_string = mystr;
                 if (this.variables.indexOf(this._first_creator_variable) > -1 && this.item && this.item["suppress-author"] && this.Item.type !== "legal_case") {
                     this.state.tmp.term_predecessor = false;
                 }
                 this.state.tmp.have_collapsed = false;
+                if (this.state[this.state.tmp.area].opt.cite_group_delimiter && this.state[this.state.tmp.area].opt.cite_group_delimiter) {
+                    this.state.tmp.use_cite_group_delimiter = true;
+                }
             }
         }
     }
         state[this.name].opt.collapse = arg;
     }
 };
+CSL.Attributes["@cite-group-delimiter"] = function (state, arg) {
+    if (arg) {
+        state[state.tmp.area].opt.cite_group_delimiter = arg;
+    }
+};
 CSL.Attributes["@names-delimiter"] = function (state, arg) {
     state.setOpt(this, "names-delimiter", arg);
 };

File demo/citeproc.js

     };
 }
 var CSL = {
-    PROCESSOR_VERSION: "1.0.407",
+    PROCESSOR_VERSION: "1.0.408",
     PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
     STATUTE_SUBDIV_GROUPED_REGEX: /((?:^| )(?:art|ch|Ch|subch|p|pp|para|subpara|pt|r|sec|subsec|Sec|sch|tit)\.)/g,
     STATUTE_SUBDIV_PLAIN_REGEX: /(?:(?:^| )(?:art|ch|Ch|subch|p|pp|para|subpara|pt|r|sec|subsec|Sec|sch|tit)\.)/,
         };
         CSL.debug("Using collation sort");
     } catch (e) {
+        CSL.debug("Using localeCompare sort");
         strcmp = function (a, b) {
             return a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase());
         };
         this.tmp.splice_delimiter = this.citation.opt["after-collapse-delimiter"];
     } else if (this.tmp.have_collapsed && this.opt.xclass === "in-text" && this.opt.update_mode !== CSL.NUMERIC) {
         this.tmp.splice_delimiter = ", ";
+    } else if (this.tmp.use_cite_group_delimiter) {
+        this.tmp.splice_delimiter = this.citation.opt.cite_group_delimiter;
     } else if (this.tmp.cite_locales[pos - 1]) {
         var alt_affixes = this.tmp.cite_affixes[this.tmp.cite_locales[pos - 1]];
         if (alt_affixes && alt_affixes.delimiter) {
         }
         if (this.tokentype === CSL.END) {
             state.opt.grouped_sort = state.opt.xclass === "in-text" 
-                && state.citation.opt.collapse 
-                && state.citation.opt.collapse.length
+                && (state.citation.opt.collapse 
+                    && state.citation.opt.collapse.length)
+                || (state.citation.opt.cite_group_delimiter
+                    && state.citation.opt.cite_group_delimiter.length)
                 && state.opt.update_mode !== CSL.POSITION
                 && state.opt.update_mode !== CSL.NUMERIC;
             if (state.opt.grouped_sort 
     }
     if ((this.item && this.item["suppress-author"] && this._first_creator_variable == this.variables[0])
         || (this.state[this.state.tmp.area].opt.collapse 
-            && this.state[this.state.tmp.area].opt.collapse.length)) {
+            && this.state[this.state.tmp.area].opt.collapse.length)
+        || (this.state[this.state.tmp.area].opt.cite_group_delimiter 
+            && this.state[this.state.tmp.area].opt.cite_group_delimiter.length)) {
         if (this.state.tmp.authorstring_request) {
             mystr = "";
             myqueue = this.state.tmp.name_node.top.blobs.slice(-1)[0].blobs;
             this.state.tmp.offset_characters = oldchars;
             this.state.registry.authorstrings[this.Item.id] = mystr;
         } else if (!this.state.tmp.just_looking
-            && !this.state.tmp.suppress_decorations) {
+                   && !this.state.tmp.suppress_decorations && (this.item["suppress-author"] || (this.state[this.state.tmp.area].opt.collapse && this.state[this.state.tmp.area].opt.collapse.length) || this.state[this.state.tmp.area].opt.cite_group_delimiter && this.state[this.state.tmp.area].opt.cite_group_delimiter)) {
             mystr = "";
             myqueue = this.state.tmp.name_node.top.blobs.slice(-1)[0].blobs;
             oldchars = this.state.tmp.offset_characters;
                 mystr = this.state.output.string(this.state, myqueue, false);
             }
             if (mystr === this.state.tmp.last_primary_names_string) {
-                this.state.tmp.name_node.top.blobs.pop();
-                this.state.tmp.name_node.children = [];
-                this.state.tmp.offset_characters = oldchars;
+                if (this.item["suppress-author"] || (this.state[this.state.tmp.area].opt.collapse && this.state[this.state.tmp.area].opt.collapse.length)) {
+                    this.state.tmp.name_node.top.blobs.pop();
+                    this.state.tmp.name_node.children = [];
+                    this.state.tmp.offset_characters = oldchars;
+                }
+                this.state.tmp.use_cite_group_delimiter = false;
             } else {
                 this.state.tmp.last_primary_names_string = mystr;
                 if (this.variables.indexOf(this._first_creator_variable) > -1 && this.item && this.item["suppress-author"] && this.Item.type !== "legal_case") {
                     this.state.tmp.term_predecessor = false;
                 }
                 this.state.tmp.have_collapsed = false;
+                if (this.state[this.state.tmp.area].opt.cite_group_delimiter && this.state[this.state.tmp.area].opt.cite_group_delimiter) {
+                    this.state.tmp.use_cite_group_delimiter = true;
+                }
             }
         }
     }
         state[this.name].opt.collapse = arg;
     }
 };
+CSL.Attributes["@cite-group-delimiter"] = function (state, arg) {
+    if (arg) {
+        state[state.tmp.area].opt.cite_group_delimiter = arg;
+    }
+};
 CSL.Attributes["@names-delimiter"] = function (state, arg) {
     state.setOpt(this, "names-delimiter", arg);
 };
 
 var CSL = {
 
-    PROCESSOR_VERSION: "1.0.407",
+    PROCESSOR_VERSION: "1.0.408",
 
     PLAIN_HYPHEN_REGEX: /(?:[^\\]-|\u2013)/,
 

File tests/runners/run.js

 dojo.require("doh.runner");
-dojo.require("std.substitute");
+dojo.require("std.locale");
+dojo.require("std.abbrevs");
+dojo.require("std.affix");
+dojo.require("std.api");
+dojo.require("std.bibheader");
+dojo.require("std.bibsection");
+dojo.require("std.bugreports");
+dojo.require("std.citeprocjs");
+dojo.require("std.collapse");
+dojo.require("std.condition");
+dojo.require("std.date");
+dojo.require("std.dateparser");
+dojo.require("std.decor");
+dojo.require("std.decorations");
+dojo.require("std.disambiguate");
+dojo.require("std.discretionary");
+dojo.require("std.display");
+dojo.require("std.eclac");
+dojo.require("std.etal");
+dojo.require("std.flipflop");
+dojo.require("std.form");
+dojo.require("std.fullstyles");
+dojo.require("std.generate");
+dojo.require("std.group");
+dojo.require("std.initials");
+dojo.require("std.institutions");
+dojo.require("std.integration");
+dojo.require("std.label");
+dojo.require("std.language");
+dojo.require("std.layout");
+dojo.require("std.locator");
+dojo.require("std.magic");
+dojo.require("std.multilingual");
+dojo.require("std.name");
+dojo.require("std.nameattr");
+dojo.require("std.nameorder");
 dojo.require("std.namespaces");
-dojo.require("std.display");
-dojo.require("std.simplespace");
-dojo.require("std.initials");
+dojo.require("std.number");
+dojo.require("std.page");
 dojo.require("std.parallel");
-dojo.require("std.locale");
-dojo.require("std.citeprocjs");
+dojo.require("std.plural");
+dojo.require("std.position");
 dojo.require("std.punctuation");
 dojo.require("std.quotes");
-dojo.require("std.generate");
-dojo.require("std.dateparser");
-dojo.require("std.discretionary");
+dojo.require("std.simplespace");
+dojo.require("std.sort");
+dojo.require("std.sortseparator");
+dojo.require("std.spaces");
+dojo.require("std.statute");
+dojo.require("std.style-as");
+dojo.require("std.substitute");
+dojo.require("std.testers");
+dojo.require("std.textcase");
 dojo.require("std.unicode");
-dojo.require("std.api");
-dojo.require("std.textcase");
-dojo.require("std.decorations");
-dojo.require("std.abbrevs");
-dojo.require("std.nameorder");
-dojo.require("std.nameattr");
-dojo.require("std.form");
-dojo.require("std.disambiguate");
-dojo.require("std.decor");
-dojo.require("std.number");
-dojo.require("std.collapse");
-dojo.require("std.language");
-dojo.require("std.bibsection");
-dojo.require("std.page");
-dojo.require("std.flipflop");
-dojo.require("std.plural");
-dojo.require("std.affix");
+dojo.require("std.variables");
 dojo.require("std.virtual");
-dojo.require("std.bibheader");
-dojo.require("std.position");
 dojo.require("std.wrappers");
-dojo.require("std.locator");
-dojo.require("std.sort");
-dojo.require("std.variables");
-dojo.require("std.spaces");
-dojo.require("std.institutions");
-dojo.require("std.statute");
-dojo.require("std.etal");
-dojo.require("std.integration");
-dojo.require("std.multilingual");
-dojo.require("std.condition");
-dojo.require("std.sortseparator");
-dojo.require("std.bugreports");
-dojo.require("std.layout");
-dojo.require("std.name");
-dojo.require("std.fullstyles");
-dojo.require("std.style-as");
-dojo.require("std.magic");
-dojo.require("std.eclac");
-dojo.require("std.date");
-dojo.require("std.testers");
-dojo.require("std.group");
-dojo.require("std.label");
 tests.run();