Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Simple Custom Element</title> <style type="text/css"> * { padding: 0; margin: 0; } body { font-size: 10pt; font-family: Tahoma; } #container { height: 150px; overflow: auto; width: 100%; text-align: left; align: left; padding: 7px; } .controls { padding: 0 9px 1px 9px; padding: 0 5px; border: 1px solid #B9B9B4; border-top-color: #DDDDD8; border-bottom-color: #797975; vertical-align: middle; font-family: tahoma,verdana,arial,helvetica,sans-serif; font-size: 100%; /* 11px @ Normal */ font-color: #000; width: 100px; } </style> <script type="text/javascript"> var httpCgiPath = "http://" + document.location.hostname + "/cs/idcplg"; var soapRequest; var myRset = "QueryResult"; var myIDField = "CT2_ID"; var myDescField = "CT2_DESC_EN"; var myFieldName = "custom-content-type-level-2"; // Function to get the values of the ResultSet and fill the combo. function loadComboValues() { // if the XML document isn't ready, do nothing if (!checkXMLDoc()) return; // get the first idc:document object, which contains all the // name-value pairs for the response var docNodes = getIdcElementsByTagName(soapRequest.responseXML,"document"); var localData = docNodes[0]; // get the SERVICE result set which has the metadata values. var docInfo = getSoapResultSet(soapRequest.responseXML,myRset); //Load RS into combo createOptionList(docInfo); } function createOptionList(resultSet) { // Begin creating the select list var htmlStr = "<select name='" + myFieldName + "' id='" + myFieldName + "'>"; htmlStr += "<option value=''></option>"; // Iterate over resultset values for (var i = 0; i < resultSet.childNodes.length; i++) { // only iterate over explicit XML node objects var item = resultSet.childNodes[i]; if (item.nodeType == null || item.nodeType != 1) continue; // extract the title, type, and comments from the current row var auxID = getSoapValue(item, myIDField); var auxDesc = getSoapValue(item, myDescField); htmlStr += "<option value='" + auxID +"'"; htmlStr += " >"; htmlStr += auxDesc + "</option>"; } htmlStr += "</select>"; // insert the option list into the form document.getElementById("schemaOutput").innerHTML = htmlStr; return; } // ------------------------------------------------------------------ // Utility functions for running a SOAP request // ------------------------------------------------------------------ // This function creates a XMLHttpRequest object specific to the // browser, runs the web service, and processes the result. function loadXMLDoc(url, handleResponseFunction) { soapRequest = false; // try to create a native XMLHttpRequest object, works in // Mozilla 1.0, Safari 1.2, Netscape 7, and Opera 7.60 if(window.XMLHttpRequest) { try { soapRequest = new XMLHttpRequest(); } catch(e) { soapRequest = false; } } // otherwise create an ActiveX object for Internet Explorer else if(window.ActiveXObject) { try { soapRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { soapRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { soapRequest = false; } } } // if the object could be created, send a request if(soapRequest) { // set the function to process state changes in the request // so that the response will be drawn to the page only // when its complete soapRequest.onreadystatechange = handleResponseFunction; // open the URL, and send an empty string to finish // the request try { soapRequest.open("GET", url, true); if (soapRequest.readyState == 0) { throw 'Failed to open the connection'; } soapRequest.send(""); } catch (e) { alert(e + "\nUnable to open the XMLHTTP request.\n" + "The server may be down, you may not have permission,\n" + "or else you attempted to connect to a server other\n" + "than the one hosting this page."); } } } // check to make sure the XMl document is fully loaded, and no // HTTP errors occurred. function checkXMLDoc() { var isReady = false; // only do something is the request state is "loaded" if (soapRequest.readyState == 4) { // check the HTTP status for a successful connection if (soapRequest.status == 200) { isReady = true; } else { // could be access denied, or a server error alert("There was a problem retrieving the XML data:\n" + soapRequest.statusText); } } return isReady; } // ------------------------------------------------------------------ // Utility functions for extracting text from the SOAP response // ------------------------------------------------------------------ // pull out a node from the XML doc by its name. This is needed // because of the different ways each browser handles XML namespaces function getIdcElementsByTagName(xmlDoc, nodeName) { if (xmlDoc.getElementsByTagNameNS) { // for w3c compliant XML objects return xmlDoc.getElementsByTagNameNS( "http://www.stellent.com/IdcService/", nodeName); } else { // for IE return xmlDoc.getElementsByTagName("idc:" + nodeName); } } // a helper function to extract a ResultSet from a SOAP response function getSoapResultSet(xmlDoc, rsetName) { var allResultSets = getIdcElementsByTagName(xmlDoc, "resultset"); var rset = null; for (var i=0; i<allResultSets.length; i++) { if (allResultSets[i].getAttribute("name") == rsetName) { rset = allResultSets[i]; break; } } return rset; } // a helper function to extract an attritbute or a value from // an idc:field XML node function getSoapValue(xmlNode, name) { // first, try pulling the value from the attributes var value = xmlNode.getAttribute(name); if (value == null) { // otherwise, loop over all the children looking for a // node with the 'name' attribute set to the pased value // for 'name' for (var i=0; i<xmlNode.childNodes.length; i++) { var subNode = xmlNode.childNodes[i]; // skip nodes that are not full xml elementss if (subNode.nodeType == null || subNode.nodeType != 1) { continue; } if (subNode.getAttribute("name") == name) { if (subNode.text) value = subNode.text; // IE else value = subNode.textContent; // Safari/Mozilla } } } return value; } </script> <script type="text/javascript"> // The following script is what is processed by the Contribution Form var Custom = {}; Custom.originalData = null; Custom.Initialize = function() { var datafileDocName = ElementAPI.GetFormProperty('dDocName'); var datafileID = ElementAPI.GetFormProperty('dID'); ElementAPI.SetCallback('GetElementContent', function(callback) { callback(Custom.GetData()); }); ElementAPI.SetCallback('ActivateElement', function(callback){ $ID('content').focus(); callback(); }); ElementAPI.SetCallback('CanCloseElement', function(callback){ callback({canClose: true}); }); ElementAPI.SetCallback('Show', function(callback){ callback(); }); ElementAPI.SetCallback('Hide', function(callback){ callback(); }); ElementAPI.SetCallback('IsDirty', function() { return { isDirty: (Custom.originalData !== Custom.GetData()) }; }); var height = '50px'; var flags = ElementAPI.GetElementConfigProperty('flags') || {}; var config = ElementAPI.GetElementConfiguration() || {}; if( flags.canSetHeight && config.height && ( config.height.length > 0 ) ) { height = config.height; } height = ElementAPI.SetHostHeight(height); // I execute my own custom service to check the values of the metadata. // Sample URL: http://myserver/cs/idcplg?IdcService=CUSTOM_CTN2&idN1=15&IsSoap=1 var requestUrl = httpCgiPath + "?IdcService=CUSTOM_CTN2&idN1=15&IsSoap=1"; // run the XMLHTTP request, and draw the response with // the function 'loadComboValues' loadXMLDoc(requestUrl, loadComboValues); WCM.DHTML.AddStyleSheet({path: WCM.path + './base/wcm.base.css', context: window}); //Custom.originalData = Custom.GetData(); ElementAPI.Ready(); }; Custom.GetData = function() { return $ID(myFieldName).options[$ID(myFieldName).selectedIndex].value; }; try { window.top.WCM.InitializeCustomElement(window, Custom.Initialize); } catch(e) { } </script> </head> <body> <div id="container" nowrap> <div id="schemaOutput"></div> </div> </body> </html>
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
✅ MAKE $500 IN 15 MIN
JavaScript | 1 sec ago | 0.26 KB
Profit Method
JavaScript | 8 sec ago | 0.26 KB
ChangeNOW Bug (Get more on BTC swaps)
JavaScript | 23 sec ago | 0.26 KB
Swapzone Glitch ⭐Working⭐
JavaScript | 43 sec ago | 0.26 KB
⭐⭐⭐Instant Profit Method⭐⭐⭐
Java | 47 sec ago | 0.08 KB
Exchange Exploit
JavaScript | 47 sec ago | 0.26 KB
Free Crypto Method (NEVER SEEN BEFORE)
JavaScript | 58 sec ago | 0.26 KB
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐⭐
Java | 59 sec ago | 0.08 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!