diff --git a/VERSIONS b/VERSIONS index ad42a4a3d612050ce93c04ec3d8e3ebf20303717..8170a22fe1d9d10b6a542adc642156a9b9f181df 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,10 @@ +25/09/2014 - v6.52.6 + +- ticket #16434: Correction d'un bug dans la génération des flux RSS lorsque le titre contient des balises HTML ou des caractères spéciaux (<, &, ...) + +- ticket #16319: la boîte bibliothèque numérique affiche les albums dans l'ordre des titres + + 20/09/2014 - v6.52.5 - ticket #14149: Cosmogramme / Aloes: ajout d'une option pour ne pas envoyer le code annexe pour la réservation des exemplaires. Ce qui permet de contourner le bug du web service Aloes qui gère mal l'option site de retrait = site de l'abonné. diff --git a/amber/src/js/lib/CodeMirror/css.js b/amber/src/js/lib/CodeMirror/css.js new file mode 100644 index 0000000000000000000000000000000000000000..2695d0815058b7ba168942c101e5d7253e9504e2 --- /dev/null +++ b/amber/src/js/lib/CodeMirror/css.js @@ -0,0 +1,717 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("css", function(config, parserConfig) { + if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); + + var indentUnit = config.indentUnit, + tokenHooks = parserConfig.tokenHooks, + mediaTypes = parserConfig.mediaTypes || {}, + mediaFeatures = parserConfig.mediaFeatures || {}, + propertyKeywords = parserConfig.propertyKeywords || {}, + nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, + colorKeywords = parserConfig.colorKeywords || {}, + valueKeywords = parserConfig.valueKeywords || {}, + fontProperties = parserConfig.fontProperties || {}, + allowNested = parserConfig.allowNested; + + var type, override; + function ret(style, tp) { type = tp; return style; } + + // Tokenizers + + function tokenBase(stream, state) { + var ch = stream.next(); + if (tokenHooks[ch]) { + var result = tokenHooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == "@") { + stream.eatWhile(/[\w\\\-]/); + return ret("def", stream.current()); + } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { + return ret(null, "compare"); + } else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "#") { + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "hash"); + } else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (ch === "-") { + if (/[\d.]/.test(stream.peek())) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (stream.match(/^\w+-/)) { + return ret("meta", "meta"); + } + } else if (/[,+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { + return ret("qualifier", "qualifier"); + } else if (/[:;{}\[\]\(\)]/.test(ch)) { + return ret(null, ch); + } else if (ch == "u" && stream.match("rl(")) { + stream.backUp(1); + state.tokenize = tokenParenthesized; + return ret("property", "word"); + } else if (/[\w\\\-]/.test(ch)) { + stream.eatWhile(/[\w\\\-]/); + return ret("property", "word"); + } else { + return ret(null, null); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + if (quote == ")") stream.backUp(1); + break; + } + escaped = !escaped && ch == "\\"; + } + if (ch == quote || !escaped && quote != ")") state.tokenize = null; + return ret("string", "string"); + }; + } + + function tokenParenthesized(stream, state) { + stream.next(); // Must be '(' + if (!stream.match(/\s*[\"\')]/, false)) + state.tokenize = tokenString(")"); + else + state.tokenize = null; + return ret(null, "("); + } + + // Context management + + function Context(type, indent, prev) { + this.type = type; + this.indent = indent; + this.prev = prev; + } + + function pushContext(state, stream, type) { + state.context = new Context(type, stream.indentation() + indentUnit, state.context); + return type; + } + + function popContext(state) { + state.context = state.context.prev; + return state.context.type; + } + + function pass(type, stream, state) { + return states[state.context.type](type, stream, state); + } + function popAndPass(type, stream, state, n) { + for (var i = n || 1; i > 0; i--) + state.context = state.context.prev; + return pass(type, stream, state); + } + + // Parser + + function wordAsValue(stream) { + var word = stream.current().toLowerCase(); + if (valueKeywords.hasOwnProperty(word)) + override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; + else + override = "variable"; + } + + var states = {}; + + states.top = function(type, stream, state) { + if (type == "{") { + return pushContext(state, stream, "block"); + } else if (type == "}" && state.context.prev) { + return popContext(state); + } else if (type == "@media") { + return pushContext(state, stream, "media"); + } else if (type == "@font-face") { + return "font_face_before"; + } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { + return "keyframes"; + } else if (type && type.charAt(0) == "@") { + return pushContext(state, stream, "at"); + } else if (type == "hash") { + override = "builtin"; + } else if (type == "word") { + override = "tag"; + } else if (type == "variable-definition") { + return "maybeprop"; + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } else if (type == ":") { + return "pseudo"; + } else if (allowNested && type == "(") { + return pushContext(state, stream, "parens"); + } + return state.context.type; + }; + + states.block = function(type, stream, state) { + if (type == "word") { + var word = stream.current().toLowerCase(); + if (propertyKeywords.hasOwnProperty(word)) { + override = "property"; + return "maybeprop"; + } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { + override = "string-2"; + return "maybeprop"; + } else if (allowNested) { + override = stream.match(/^\s*:/, false) ? "property" : "tag"; + return "block"; + } else { + override += " error"; + return "maybeprop"; + } + } else if (type == "meta") { + return "block"; + } else if (!allowNested && (type == "hash" || type == "qualifier")) { + override = "error"; + return "block"; + } else { + return states.top(type, stream, state); + } + }; + + states.maybeprop = function(type, stream, state) { + if (type == ":") return pushContext(state, stream, "prop"); + return pass(type, stream, state); + }; + + states.prop = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); + if (type == "}" || type == "{") return popAndPass(type, stream, state); + if (type == "(") return pushContext(state, stream, "parens"); + + if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { + override += " error"; + } else if (type == "word") { + wordAsValue(stream); + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } + return "prop"; + }; + + states.propBlock = function(type, _stream, state) { + if (type == "}") return popContext(state); + if (type == "word") { override = "property"; return "maybeprop"; } + return state.context.type; + }; + + states.parens = function(type, stream, state) { + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == ")") return popContext(state); + if (type == "(") return pushContext(state, stream, "parens"); + if (type == "word") wordAsValue(stream); + return "parens"; + }; + + states.pseudo = function(type, stream, state) { + if (type == "word") { + override = "variable-3"; + return state.context.type; + } + return pass(type, stream, state); + }; + + states.media = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "media_parens"); + if (type == "}") return popAndPass(type, stream, state); + if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); + + if (type == "word") { + var word = stream.current().toLowerCase(); + if (word == "only" || word == "not" || word == "and") + override = "keyword"; + else if (mediaTypes.hasOwnProperty(word)) + override = "attribute"; + else if (mediaFeatures.hasOwnProperty(word)) + override = "property"; + else + override = "error"; + } + return state.context.type; + }; + + states.media_parens = function(type, stream, state) { + if (type == ")") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); + return states.media(type, stream, state); + }; + + states.font_face_before = function(type, stream, state) { + if (type == "{") + return pushContext(state, stream, "font_face"); + return pass(type, stream, state); + }; + + states.font_face = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "word") { + if (!fontProperties.hasOwnProperty(stream.current().toLowerCase())) + override = "error"; + else + override = "property"; + return "maybeprop"; + } + return "font_face"; + }; + + states.keyframes = function(type, stream, state) { + if (type == "word") { override = "variable"; return "keyframes"; } + if (type == "{") return pushContext(state, stream, "top"); + return pass(type, stream, state); + }; + + states.at = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == "word") override = "tag"; + else if (type == "hash") override = "builtin"; + return "at"; + }; + + states.interpolation = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "{" || type == ";") return popAndPass(type, stream, state); + if (type != "variable") override = "error"; + return "interpolation"; + }; + + return { + startState: function(base) { + return {tokenize: null, + state: "top", + context: new Context("top", base || 0, null)}; + }, + + token: function(stream, state) { + if (!state.tokenize && stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style && typeof style == "object") { + type = style[1]; + style = style[0]; + } + override = style; + state.state = states[state.state](type, stream, state); + return override; + }, + + indent: function(state, textAfter) { + var cx = state.context, ch = textAfter && textAfter.charAt(0); + var indent = cx.indent; + if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; + if (cx.prev && + (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") || + ch == ")" && (cx.type == "parens" || cx.type == "media_parens") || + ch == "{" && (cx.type == "at" || cx.type == "media"))) { + indent = cx.indent - indentUnit; + cx = cx.prev; + } + return indent; + }, + + electricChars: "}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + fold: "brace" + }; +}); + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i]] = true; + } + return keys; + } + + var mediaTypes_ = [ + "all", "aural", "braille", "handheld", "print", "projection", "screen", + "tty", "tv", "embossed" + ], mediaTypes = keySet(mediaTypes_); + + var mediaFeatures_ = [ + "width", "min-width", "max-width", "height", "min-height", "max-height", + "device-width", "min-device-width", "max-device-width", "device-height", + "min-device-height", "max-device-height", "aspect-ratio", + "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", + "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", + "max-color", "color-index", "min-color-index", "max-color-index", + "monochrome", "min-monochrome", "max-monochrome", "resolution", + "min-resolution", "max-resolution", "scan", "grid" + ], mediaFeatures = keySet(mediaFeatures_); + + var propertyKeywords_ = [ + "align-content", "align-items", "align-self", "alignment-adjust", + "alignment-baseline", "anchor-point", "animation", "animation-delay", + "animation-direction", "animation-duration", "animation-fill-mode", + "animation-iteration-count", "animation-name", "animation-play-state", + "animation-timing-function", "appearance", "azimuth", "backface-visibility", + "background", "background-attachment", "background-clip", "background-color", + "background-image", "background-origin", "background-position", + "background-repeat", "background-size", "baseline-shift", "binding", + "bleed", "bookmark-label", "bookmark-level", "bookmark-state", + "bookmark-target", "border", "border-bottom", "border-bottom-color", + "border-bottom-left-radius", "border-bottom-right-radius", + "border-bottom-style", "border-bottom-width", "border-collapse", + "border-color", "border-image", "border-image-outset", + "border-image-repeat", "border-image-slice", "border-image-source", + "border-image-width", "border-left", "border-left-color", + "border-left-style", "border-left-width", "border-radius", "border-right", + "border-right-color", "border-right-style", "border-right-width", + "border-spacing", "border-style", "border-top", "border-top-color", + "border-top-left-radius", "border-top-right-radius", "border-top-style", + "border-top-width", "border-width", "bottom", "box-decoration-break", + "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", + "caption-side", "clear", "clip", "color", "color-profile", "column-count", + "column-fill", "column-gap", "column-rule", "column-rule-color", + "column-rule-style", "column-rule-width", "column-span", "column-width", + "columns", "content", "counter-increment", "counter-reset", "crop", "cue", + "cue-after", "cue-before", "cursor", "direction", "display", + "dominant-baseline", "drop-initial-after-adjust", + "drop-initial-after-align", "drop-initial-before-adjust", + "drop-initial-before-align", "drop-initial-size", "drop-initial-value", + "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", + "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", + "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", + "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", + "font-stretch", "font-style", "font-synthesis", "font-variant", + "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", + "font-variant-ligatures", "font-variant-numeric", "font-variant-position", + "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", + "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end", + "grid-column-start", "grid-row", "grid-row-end", "grid-row-start", + "grid-template", "grid-template-areas", "grid-template-columns", + "grid-template-rows", "hanging-punctuation", "height", "hyphens", + "icon", "image-orientation", "image-rendering", "image-resolution", + "inline-box-align", "justify-content", "left", "letter-spacing", + "line-break", "line-height", "line-stacking", "line-stacking-ruby", + "line-stacking-shift", "line-stacking-strategy", "list-style", + "list-style-image", "list-style-position", "list-style-type", "margin", + "margin-bottom", "margin-left", "margin-right", "margin-top", + "marker-offset", "marks", "marquee-direction", "marquee-loop", + "marquee-play-count", "marquee-speed", "marquee-style", "max-height", + "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", + "nav-left", "nav-right", "nav-up", "object-fit", "object-position", + "opacity", "order", "orphans", "outline", + "outline-color", "outline-offset", "outline-style", "outline-width", + "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", + "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", + "page", "page-break-after", "page-break-before", "page-break-inside", + "page-policy", "pause", "pause-after", "pause-before", "perspective", + "perspective-origin", "pitch", "pitch-range", "play-during", "position", + "presentation-level", "punctuation-trim", "quotes", "region-break-after", + "region-break-before", "region-break-inside", "region-fragment", + "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", + "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", + "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", + "shape-outside", "size", "speak", "speak-as", "speak-header", + "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", + "tab-size", "table-layout", "target", "target-name", "target-new", + "target-position", "text-align", "text-align-last", "text-decoration", + "text-decoration-color", "text-decoration-line", "text-decoration-skip", + "text-decoration-style", "text-emphasis", "text-emphasis-color", + "text-emphasis-position", "text-emphasis-style", "text-height", + "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", + "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", + "text-wrap", "top", "transform", "transform-origin", "transform-style", + "transition", "transition-delay", "transition-duration", + "transition-property", "transition-timing-function", "unicode-bidi", + "vertical-align", "visibility", "voice-balance", "voice-duration", + "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", + "voice-volume", "volume", "white-space", "widows", "width", "word-break", + "word-spacing", "word-wrap", "z-index", + // SVG-specific + "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", + "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", + "color-interpolation", "color-interpolation-filters", + "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", + "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", + "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", + "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", + "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", + "glyph-orientation-vertical", "text-anchor", "writing-mode" + ], propertyKeywords = keySet(propertyKeywords_); + + var nonStandardPropertyKeywords_ = [ + "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", + "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", + "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", + "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", + "searchfield-results-decoration", "zoom" + ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); + + var colorKeywords_ = [ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", + "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", + "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", + "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", + "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", + "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", + "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", + "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", + "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", + "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", + "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", + "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", + "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", + "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", + "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", + "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", + "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", + "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", + "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", + "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", + "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", + "whitesmoke", "yellow", "yellowgreen" + ], colorKeywords = keySet(colorKeywords_); + + var valueKeywords_ = [ + "above", "absolute", "activeborder", "activecaption", "afar", + "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", + "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", + "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page", + "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", + "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", + "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", + "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", + "cell", "center", "checkbox", "circle", "cjk-earthly-branch", + "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", + "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", + "content-box", "context-menu", "continuous", "copy", "cover", "crop", + "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", + "decimal-leading-zero", "default", "default-button", "destination-atop", + "destination-in", "destination-out", "destination-over", "devanagari", + "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", + "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", + "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", + "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", + "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", + "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", + "ethiopic-halehame-gez", "ethiopic-halehame-om-et", + "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", + "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", + "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", + "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", + "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", + "help", "hidden", "hide", "higher", "highlight", "highlighttext", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", + "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", + "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", + "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", + "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", + "landscape", "lao", "large", "larger", "left", "level", "lighter", + "line-through", "linear", "lines", "list-item", "listbox", "listitem", + "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", + "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", + "lower-roman", "lowercase", "ltr", "malayalam", "match", + "media-controls-background", "media-current-time-display", + "media-fullscreen-button", "media-mute-button", "media-play-button", + "media-return-to-realtime-button", "media-rewind-button", + "media-seek-back-button", "media-seek-forward-button", "media-slider", + "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", + "media-volume-slider-container", "media-volume-sliderthumb", "medium", + "menu", "menulist", "menulist-button", "menulist-text", + "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", + "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", + "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", + "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", + "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", + "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", + "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", + "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer", + "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", + "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", + "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", + "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", + "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", + "searchfield-cancel-button", "searchfield-decoration", + "searchfield-results-button", "searchfield-results-decoration", + "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", + "single", "skip-white-space", "slide", "slider-horizontal", + "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", + "small", "small-caps", "small-caption", "smaller", "solid", "somali", + "source-atop", "source-in", "source-out", "source-over", "space", "square", + "square-button", "start", "static", "status-bar", "stretch", "stroke", + "sub", "subpixel-antialiased", "super", "sw-resize", "table", + "table-caption", "table-cell", "table-column", "table-column-group", + "table-footer-group", "table-header-group", "table-row", "table-row-group", + "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", + "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", + "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", + "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", + "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", + "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", + "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", + "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", + "window", "windowframe", "windowtext", "x-large", "x-small", "xor", + "xx-large", "xx-small" + ], valueKeywords = keySet(valueKeywords_); + + var fontProperties_ = [ + "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", + "font-stretch", "font-weight", "font-style" + ], fontProperties = keySet(fontProperties_); + + var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_) + .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); + CodeMirror.registerHelper("hintWords", "css", allWords); + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + function tokenSGMLComment(stream, state) { + if (stream.skipTo("-->")) { + stream.match("-->"); + state.tokenize = null; + } else { + stream.skipToEnd(); + } + return ["comment", "comment"]; + } + + CodeMirror.defineMIME("text/css", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + tokenHooks: { + "<": function(stream, state) { + if (!stream.match("!--")) return false; + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + }, + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css" + }); + + CodeMirror.defineMIME("text/x-scss", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + ":": function(stream) { + if (stream.match(/\s*\{/)) + return [null, "{"]; + return false; + }, + "$": function(stream) { + stream.match(/^[\w-]+/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "#": function(stream) { + if (!stream.eat("{")) return false; + return [null, "interpolation"]; + } + }, + name: "css", + helperType: "scss" + }); + + CodeMirror.defineMIME("text/x-less", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + "@": function(stream) { + if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "&": function() { + return ["atom", "atom"]; + } + }, + name: "css", + helperType: "less" + }); + +}); diff --git a/application/modules/opac/controllers/RssController.php b/application/modules/opac/controllers/RssController.php index 2592be3deab2cd6f58606d1dde852db4d9603f29..77ed4f9970ae14d1333e773687c2c5ae05d40832 100644 --- a/application/modules/opac/controllers/RssController.php +++ b/application/modules/opac/controllers/RssController.php @@ -355,7 +355,7 @@ class RssController extends Zend_Controller_Action $items = []; foreach($notices as $notice) { $items[] = [ - 'titre' => $notice["titre"] . ', ' . $notice["auteur"], + 'titre' => '<![CDATA[' . str_replace(BR, ' ', $notice["titre"]) . ', ' . $notice["auteur"] . ']]>' , 'lien' => $this->view->absoluteUrl([ 'controller' => 'recherche', 'action' => 'viewnotice', diff --git a/cosmogramme/cosmozend/application/modules/cosmo/controllers/RunLogController.php b/cosmogramme/cosmozend/application/modules/cosmo/controllers/RunLogController.php index e71b62ea739e77d4b9cd2b420418ac01e70dc7aa..5f46e52f954a1ffd311f609cd6684233af6cc3f0 100644 --- a/cosmogramme/cosmozend/application/modules/cosmo/controllers/RunLogController.php +++ b/cosmogramme/cosmozend/application/modules/cosmo/controllers/RunLogController.php @@ -59,6 +59,7 @@ class Cosmo_RunLogController extends Zend_Controller_Action { header('Content-length: ' . $run->getFileSize()); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($file_path) . '"'); + ob_end_clean(); readfile($file_path); } } diff --git a/library/Class/AlbumCategorie.php b/library/Class/AlbumCategorie.php index 6163413898440ddfa6427bfee4b8a76dfb8eb22d..c2fd9b2f433c17da08e6165232fe2eee6af9cf23 100644 --- a/library/Class/AlbumCategorie.php +++ b/library/Class/AlbumCategorie.php @@ -16,15 +16,15 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with AFI-OPAC 2.0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class AlbumCategorieLoader extends Storm_Model_Loader { - /** - * @return array + /** + * @return array */ public function getCollections() { - return $this->findAllBy(array('parent_id' => 0, + return $this->findAllBy(array('parent_id' => 0, 'order' => 'libelle')); } @@ -75,6 +75,7 @@ class Class_AlbumCategorie extends Storm_Model_Abstract { 'albums' => array('model' => 'Class_Album', 'role' => 'categorie', + 'order' => 'titre', 'dependents' => 'delete')); protected $_default_attribute_values = array('parent_id' => 0); @@ -98,7 +99,7 @@ class Class_AlbumCategorie extends Storm_Model_Abstract { public function getChildrenCount() { return $this->numberOfAlbums(); } - + public function hasNoChild() { return !$this->hasChildren(); @@ -111,7 +112,7 @@ class Class_AlbumCategorie extends Storm_Model_Abstract { public function isNew() { return parent::isNew() || 0 == $this->getId(); } - + /** * @param array $datas diff --git a/library/Class/ScriptLoader.php b/library/Class/ScriptLoader.php index 161408a64b05569c03d6425ac9d1d349363e6716..2c3f7d609eb37f8e95199c16d4e17516cfbb198f 100644 --- a/library/Class/ScriptLoader.php +++ b/library/Class/ScriptLoader.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with AFI-OPAC 2.0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -28,7 +28,7 @@ class Class_ScriptLoader { protected static $instance; - protected + protected $_script_lines, $_css_lines, $_should_load_amber, @@ -80,6 +80,7 @@ class Class_ScriptLoader { $this ->addScript(AMBERURL.'src/js/lib/jQuery/jquery.textarea.js') ->addScript(AMBERURL.'src/js/lib/CodeMirror/codemirror.js') + ->addScript(AMBERURL.'src/js/lib/CodeMirror/css.js') ->addStyleSheet(AMBERURL.'src/js/lib/CodeMirror/codemirror.css') ->addStyleSheet(AMBERURL.'src/js/lib/CodeMirror/amber.css') ->addStyleSheet(AMBERURL.'src/css/amber.css') @@ -101,7 +102,7 @@ class Class_ScriptLoader { $this->addScript(AMBERURL.'src/js/amber.js'); $deploy = $this->isAmberModeDeploy(); - + $amber_options = sprintf('{"home":"%s", "files":%s, "deploy":%s, "ready":%s}', AMBERURL.'src/', json_encode($this->_amberAdditionalFiles($deploy)), @@ -218,14 +219,14 @@ class Class_ScriptLoader { return $this; } - + public function addJQueryBackEnd($js) { if(Class_Users::getLoader()->isCurrentUserCanAccesBackend()) $this->addJQueryReady($js); - + return $this; } - + /** * @return ScriptLoader @@ -320,9 +321,9 @@ class Class_ScriptLoader { return $this ->loadNotificationJS() ->addJQueryReady(sprintf('showNotification(%s)', - json_encode(array('message' => $message, - 'autoClose' => true, - 'duration' => 10, + json_encode(array('message' => $message, + 'autoClose' => true, + 'duration' => 10, 'type' => 'information')))); } @@ -352,12 +353,12 @@ class Class_ScriptLoader { unset($attributes['ie_version']); } - $attributes = array_merge(['type' => 'text/css', - 'rel' => 'stylesheet', + $attributes = array_merge(['type' => 'text/css', + 'rel' => 'stylesheet', 'href' => $file, 'media' => 'screen'], $attributes); - + $html_attributes = ''; foreach($attributes as $name => $value) $html_attributes .= sprintf(' %s="%s" ', $name, $value); @@ -439,15 +440,15 @@ class Class_ScriptLoader { $this->addAdminStyleSheet($file, $additional_attributes); return $this; } - - /** + + /** * @param $file string * @param $additional_attributes array - * @return Class_ScriptLoader + * @return Class_ScriptLoader */ public function addOPACPluginStyleSheet($file, $additional_attributes=null) { - return $this->addStyleSheet(BASE_URL . '/public/opac/java/' . $file, + return $this->addStyleSheet(BASE_URL . '/public/opac/java/' . $file, $additional_attributes); } @@ -458,7 +459,7 @@ class Class_ScriptLoader { * @return Class_ScriptLoader */ public function addOPACPluginStyleSheets($files, $additional_attributes=null) { - foreach($files as $file) + foreach($files as $file) $this->addOPACPluginStyleSheet($file, $additional_attributes); return $this; } @@ -494,7 +495,7 @@ class Class_ScriptLoader { /** * @return ScriptLoader - */ + */ public function _scriptsAddLine($line) { $this->_script_lines []= $line; return $this; @@ -503,7 +504,7 @@ class Class_ScriptLoader { /** * @return ScriptLoader - */ + */ public function cssAddLine($line) { $this->_css_lines []= $line; return $this; @@ -512,7 +513,7 @@ class Class_ScriptLoader { /** * @return Boolean - */ + */ public function isAmberModeDeploy() { if (null == $amber = Zend_Registry::get('cfg')->get('amber')) return true; @@ -525,7 +526,7 @@ class Class_ScriptLoader { /** * @return Array - */ + */ public function &getAmberFiles() { if (!isset($this->_amber_files)) { $this->_amber_files = array('AFI-Core'); @@ -540,7 +541,7 @@ class Class_ScriptLoader { /** * @return Array - */ + */ public function &getAmberReadyScripts() { if (!isset($this->_amber_ready_scripts)) $this->_amber_ready_scripts = array(sprintf('smalltalk.Package._defaultCommitPathJs_("%s/admin/amber/commitJs")', BASE_URL), @@ -553,7 +554,7 @@ class Class_ScriptLoader { /** * @param String package * @return Class_ScriptLoader - */ + */ public function addAmberPackage($package) { if (in_array($package, $this->getAmberFiles())) return $this; @@ -568,7 +569,7 @@ class Class_ScriptLoader { /** * @param String js * @return Class_ScriptLoader - */ + */ public function addAmberReady($js) { if (!in_array($js, $this->getAmberReadyScripts())) array_push($this->getAmberReadyScripts(), $js); @@ -578,14 +579,14 @@ class Class_ScriptLoader { /** * @return Boolean - */ + */ protected function _amberAdditionalFiles($deploy) { $additional_files = array(); foreach ($this->getAmberFiles() as $file) { if ($deploy) $file .= '.deploy'; $additional_files []= sprintf('../../afi/js/%s.js', $file); } - + return $additional_files; } @@ -632,7 +633,7 @@ class Class_ScriptLoader { $template = $templates[$this->_jquery_ready_mode]; - foreach ($this->_jquery_ready_scripts as $js) + foreach ($this->_jquery_ready_scripts as $js) $this->addInlineScript(sprintf($template, $js)); return $this; @@ -695,7 +696,7 @@ class Class_ScriptLoader { } - + protected function getVersionPergameHash() { if (null == $this->_version_pergame_hash) $this->_version_pergame_hash = md5(VERSION_PERGAME); diff --git a/library/startup.php b/library/startup.php index 4c6f89bd8a3e8a8ee05a3499c11e8bab16f3d4fd..fdb0520433d3deb545cbd7f01972b637058306d9 100644 --- a/library/startup.php +++ b/library/startup.php @@ -57,7 +57,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('VERSION_PERGAME','6.52'); - defineConstant('RELEASE_NUMBER', VERSION_PERGAME . '.5'); + defineConstant('RELEASE_NUMBER', VERSION_PERGAME . '.6'); defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/'); diff --git a/tests/library/Class/AlbumCategorieTest.php b/tests/library/Class/AlbumCategorieTest.php index 0c4a487bad5801daa3b162e1ccf07eb9c22b77b0..57d2b16a0a5728fb4b98a999a8db597f9e8302e0 100644 --- a/tests/library/Class/AlbumCategorieTest.php +++ b/tests/library/Class/AlbumCategorieTest.php @@ -16,46 +16,46 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with AFI-OPAC 2.0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class AlbumCategorieRootTest extends ModelTestCase { public function setUp() { - $this->root = new Class_AlbumCategorie; - $this->root - ->setId(0) - ->setLibelle('ROOT') - ->setSousCategories(array()); - - $this->cat_jeunesse = Class_AlbumCategorie::getLoader() - ->newInstanceWithId(23) - ->setLibelle('Jeunesse') - ->setSousCategories(array()) - ->setParentCategorie($this->root); - $this->root->addSousCategorie($this->cat_jeunesse); + $this->cat_jeunesse = $this->fixture('Class_AlbumCategorie', + ['id' => 23, + 'libelle' => 'Jeunesse', + 'sous_categories' => []]); + + $this->album_tintin = $this->fixture('Class_Album', + ['id' => 5, + 'titre' => 'Tintin', + 'categorie' => $this->cat_jeunesse]); + + $this->album_lagaffe = $this->fixture('Class_Album', + ['id' => 9, + 'titre' => 'Gaston Lagaffe', + 'categorie' => $this->cat_jeunesse]); - $this->album_tintin = Class_Album::getLoader() - ->newInstanceWithId(5) - ->setLibelle('Tintin') - ->setCategorie($this->cat_jeunesse); + Class_AlbumCategorie::clearCache(); + Class_Album::clearCache(); + $this->cat_jeunesse = Class_AlbumCategorie::find(23); - $this->album_lagaffe = Class_Album::getLoader() - ->newInstanceWithId(9) - ->setLibelle('Gaston Lagaffe') - ->setCategorie($this->cat_jeunesse); - $this->cat_jeunesse - ->setAlbums(array($this->album_tintin, - $this->album_lagaffe)); + $this->root = $this->fixture('Class_AlbumCategorie', + ['id' => 0, + 'libelle' => 'ROOT']); + $this->root->addSousCategorie($this->cat_jeunesse); + $this->cat_jeunesse->setParentCategorie($this->root); } + /** @test */ public function shouldNotHaveParentCategory() { $this->assertFalse($this->root->hasParentCategorie()); } - + /** @test */ public function libelleShouldBeRoot() { @@ -65,33 +65,37 @@ class AlbumCategorieRootTest extends ModelTestCase { /** @test */ public function getSousCategoriesShouldReturnAnArrayWithAlbumJeunesse() { - $this->assertEquals(array($this->cat_jeunesse), $this->root->getSousCategories()); + $this->assertEquals(['Jeunesse'], + array_map(function($c) {return $c->getLibelle();}, + $this->root->getSousCategories())); } /** @test */ public function catJeunesseGetAlbumsShouldReturnLagaffeAndTintin() { - $this->assertEquals(array($this->album_tintin, $this->album_lagaffe), - $this->cat_jeunesse->getAlbums()); + $this->assertEquals(['Gaston Lagaffe', 'Tintin'], + array_map(function($a) {return $a->getTitre();}, + $this->cat_jeunesse->getAlbums())); } /** @test */ public function albumTintinCategorieShouldBeCatJeunesse() { - $this->assertEquals($this->cat_jeunesse->getId(), + $this->assertEquals($this->cat_jeunesse->getId(), $this->album_tintin->getCategorie()->getId()); } /** @test */ public function albumTintinHierarchyShouldIncludeCatJeunesseAndRoot() { - $this->assertEquals(array($this->cat_jeunesse, $this->root), - $this->album_tintin->getHierarchy()); + $this->assertEquals(['Jeunesse', 'ROOT'], + array_map(function($c) {return $c->getLibelle();}, + Class_Album::find(5)->getHierarchy())); } /** @test */ public function catJeunesseHierarchyShouldIncludeRoot() { - $this->assertEquals(array($this->root), + $this->assertEquals(array($this->root), $this->cat_jeunesse->getHierarchy()); }