Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>Infoplay 2.0 Beispiel</h1>

<p>
  <input id="item-number" value="123.456.78" />
  <button id="infoplay-button">Infoplay 2.0 aufrufen</button>
</p>

<p>
  <strong>Hinweis:</strong> Der Infoplay-Item-Lookup liefert immer die gleichen Daten.<br>Nutzen Sie die Entwicklertools Ihres Browsers, um die genaue Struktur des Infoplay-Objekts herauszufinden.
</p>


              
            
!

CSS

              
                
              
            
!

JS

              
                // Einstellungen für Integrationstest
oxomi_server = "oxomi.test.scireum.com";

// OXOMI JavaScript Bibliothek einbinden und laden
setTimeout(function() {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = (window.location.protocol == 'https:' ? 'https:' : 'http:') + "//" + (typeof oxomi_server == 'undefined' ? 'oxomi.com' : oxomi_server) + "/assets/frontend/oxomi.js";
  document.getElementsByTagName("head")[0].appendChild(script);
}, 0);

// Wir warten bis die OXOMI JavaScript Bibliothek geladen ist...
function oxomi_ready() {
 
    // Integration initialisieren
    oxomi.init({
      "portal": "demo",
      "infoplayItemLookup": function(infoplayData, nextStep) {

          // Hier werden Ihre Artikelinformationen nachgeschaut
          
          // Aufruf ihrer eigenen Webservice-Schnittstelle
          // ...hier am Beispiel eines Mock-Webservice 
          $.ajax('https://private-b64244-infoplay.apiary-mock.com/articel-info/'+ infoplayData.itemNumber, 
             {'success': function(meineDaten, status, jqxhr) { 

                // Neues Item zum befüllen definieren 
                var artikeldaten = {};

                // Artikelnummer aus dem Aufruf übernehmen
                artikeldaten['itemNumber'] = infoplayData.itemNumber;

                // Stammdaten
                artikeldaten['supplierName'] = meineDaten['supplierName'];
                artikeldaten['shortText'] = meineDaten['shortText'];
                // artikeldaten['previewImageUrl']
                // artikeldaten['itemUrl']

                // Verkaufsdaten
                artikeldaten['quantity'] = meineDaten['minQuantity'];
                artikeldaten['quantityUnitName'] = meineDaten['quantityUnitName'];
                artikeldaten['additionalSections'] = [
                  {'fields': [
                    {
                      'name': 'Verkaufspreis',
                      'value': meineDaten['price'] + ' '+ meineDaten['currency']
                    },
                    {
                      'name': 'Mindestbestellmenge',
                      'value': meineDaten['minQuantity'] + ' ' + meineDaten['quantityUnitName']
                    },
                    {
                      'name': 'Bestellschritt',
                      'value': meineDaten['quantityStep'] + ' ' + meineDaten['quantityUnitName']
                    }
                  ]},
                  {'title' : 'Verfügbarkeit',
                   'fields' : [
                     {
                       'name': 'Hauptstandort',
                       'value': meineDaten['availability'] + ' ' + meineDaten['quantityUnitName']
                     }
                   ]}
                ];

                //
                infoplayData.items.push(artikeldaten);

                // Nachfolgenden Verarbeitungs-Schritt auslösen
                nextStep(infoplayData);

              }}
          );
      },
      "infoplayBasketHandler": function(infoplayData, next) {

        // 
        alert(infoplayData.itemNumber + ": " + infoplayData.quantity);

        // Hier Warenkorb URL aufrufen und Antwort verarbeiten
        next(infoplayData);
      }
  });
  
  // Infoplay Funktion auf den Eingabe-Button legen
  $('#infoplay-button').bind('click', function(e) {
    
    // Infoplay für den angegeben Aritkel aufrufen 
    oxomi.infoplayItem({'itemNumber': $('#item-number').val()});
  });
};
              
            
!
999px

Console