Revision 498635 of Template:cssanimatableshorthand

  • Revision slug: Template:cssanimatableshorthand
  • Revision title: Template:cssanimatableshorthand
  • Revision id: 498635
  • Created:
  • Creator: SJW
  • Is current revision? No
  • Comment Added german translation

Revision Content

<% // $0 is the name of the definition (property or data type), without < > or '' // $1 is a string containing the list of the associated longhand properties // Read the word of the parameters one by one and store them in an array var values = $1.split(" "); // Array // Load the whole page (wiki.page does cache the original page var page = wiki.page(mdn.localString({ "en-US": "en-US/docs/CSS/CSS_animated_properties", "fr" : "fr/docs/CSS/proprietes_css_animees", "ja" : "ja/docs/Web/CSS/CSS_animated_properties", "de" : "de/docs/CSS/CSS_animierbare_Eigenschaften" })); var s_str = mdn.localString({ "en-US": [ "as each of the properties of the shorthand:", "is itself a shorthand, animates as each of its longhand properties." ], "fr": [ "pour chaque propriété individuelle de la propriété raccourcie :", "est elle-même une propriété raccourcie, s'anime comme chacune de ses propriétés individuelles." ], "ja": [ "以下の各プロパティのショートハンドとして補完します:", "is itself a shorthand, animates as each of its longhand properties." ] "de": [ "wie die jeweiligen Kurzschreibweisen:", "ist selber eine Kurzschreibweise, siehe jeweilige Langschreibweise." ] }); var s_result = s_str[0] + '
    '; var s_desc = ""; for (var i = 0; i < values.length; i++) { // var animatable_prop = page.getElementById('animatable-' + values[i]); var re = new RegExp("<\\s*(span|div)\\s+id\\s*=\\s*"+'"animatable-'+values[i]+'"'+"[^>]*>(.*)<\\s*/\\s*(span|div)\\s*\\>","igm"); var animatable_prop = re.exec(page); if (animatable_prop) { // Get the contents of "animatable-$1[i]" // s_desc = animatable_prop.innerHTML; s_desc = animatable_prop[2]; } else { // If not found, it is a shorthand itself s_desc = s_str[1]; } s_result += '
  • ' + values[i] + ': ' + s_desc +'
  • '; } s_result += '
'; var result = '' + s_result + ''; %><%- result %>

Revision Source

<%
// $0 is the name of the definition (property or data type), without < > or ''
// $1 is a string containing the list of the associated longhand properties

// Read the word of the parameters one by one and store them in an array
var values = $1.split(" ");  // Array

// Load the whole page (wiki.page does cache the original page
var page = wiki.page(mdn.localString({
    "en-US": "en-US/docs/CSS/CSS_animated_properties",
    "fr"   : "fr/docs/CSS/proprietes_css_animees",
    "ja"   : "ja/docs/Web/CSS/CSS_animated_properties",
    "de"   : "de/docs/CSS/CSS_animierbare_Eigenschaften"
}));
var s_str = mdn.localString({
    "en-US": [
      "as each of the properties of the shorthand:",
      "is itself a shorthand, animates as each of its longhand properties."
    ],
    "fr": [
      "pour chaque propriété individuelle de la propriété raccourcie :",
      "est elle-même une propriété raccourcie, s'anime comme chacune de ses propriétés individuelles."
    ],
    "ja": [
      "以下の各プロパティのショートハンドとして補完します:",
      "is itself a shorthand, animates as each of its longhand properties."
    ]
    "de": [
      "wie die jeweiligen Kurzschreibweisen:",
      "ist selber eine Kurzschreibweise, siehe jeweilige Langschreibweise."
    ]
});

var s_result = s_str[0] + '<ul>';
var s_desc = "";

for (var i = 0; i < values.length; i++) {
//     var animatable_prop = page.getElementById('animatable-' + values[i]);
    var re = new RegExp("<\\s*(span|div)\\s+id\\s*=\\s*"+'"animatable-'+values[i]+'"'+"[^>]*>(.*)<\\s*/\\s*(span|div)\\s*\\>","igm");
    var animatable_prop = re.exec(page);

    if (animatable_prop) {
        // Get the contents of "animatable-$1[i]"
//        s_desc = animatable_prop.innerHTML;
        s_desc = animatable_prop[2];
    } else {
        // If not found, it is a shorthand itself
        s_desc = s_str[1];
    }
    s_result += '<li><code>' + values[i] + '</code>: ' + s_desc +'</li>';
}
s_result += '</ul>';

var result = '<span id="animatable-' + $0 + '">' + s_result + '</span>';

%><%- result %>