/** * Temporary hack for adding a css class to the body * for a user who is assigned to the reskinned group of reskinSignupFlow a/b test. */ addCssClassToBodyForReskinnedFlow() { document.body.classList.add( 'is-white-signup' ); }
test.beforeEach(t => { let root = document.getElementById('root'); if (!root) { root = document.createElement('div'); root.id = 'root'; document.body.appendChild(root); } t.context.root = root; });
function $XPath(element, selector) { const found = document.evaluate(selector, element || document.body, null, 5, null); const res = []; let current = null; while (current = found.iterateNext()) { res.push(current); } return res; }
componentWillUnmount() { window.removeEventListener('resize', this.boundWindowResize); document.removeEventListener('keyup', this.boundKeyUp); document.body.classList.remove('modal-open'); }
const Modal = props => { if (!canUseDOM) return null; // the modal element component is separated so the keydown handler attaches // and detaches during mount and unmount respectively. return props.isOpen ? createPortal(<ModalElement {...props} />, document.body) : null; }
function onLoadSettings() { // font family ReplFonts.setFontFamily(global.Mancy.preferences.fontFamily); // page zoom factor webFrame.setZoomFactor(global.Mancy.preferences.pageZoomFactor); // water mark if(global.Mancy.preferences.watermark) { document.body.dataset.watermarkLogo = ReplConstants.REPL_WATERMARK_LOGO; document.body.dataset.watermarkMsg = ReplConstants.REPL_WATERMARK_MSG; } }
handleTorrentDownload(torrent, event) { event.preventDefault(); const baseURI = ConfigStore.getBaseURI(); const link = document.createElement('a'); link.download = torrent.isMultiFile ? `${torrent.name}.tar` : torrent.name; link.href = `${baseURI}api/download?hash=${torrent.hash}`; link.style.display = 'none'; document.body.appendChild(link); link.click(); }
onSetTheme(name) { this.updatePreference((preferences) => { preferences.theme = name; global.Mancy.session.theme = name; let theme = _.kebabCase(name); document.body.className = `${theme} cm-s-${theme}`; ReplActiveInputActions.setEditorOption({name: 'theme', value: _.kebabCase(name)}); }); }
$.ready(function () { document.body.onkeydown=function (e) { var event=window.event || e; if(event.keyCode==13) { var event1 = document.createEvent('HTMLEvents'); event1.initEvent("click", true, true); event1.eventType = 'message'; document.getElementById("login").dispatchEvent(event1); } } })
setTheme(name) { global.Mancy.session.theme = name; let theme = _.kebabCase(name); document.body.className = `${theme} cm-s-${theme}`; ReplActiveInputActions.setTheme(theme); }
constructor(props) { super(props); this.state = { elapsed: 0, start: 0 }; this.overlayContainer = document.createElement('div'); document.body.appendChild(this.overlayContainer); }
afterEach( () => { document.body.removeChild( container ); ReactDOM.unmountComponentAtNode( container ); container = null; } );
const Modal = props => { if (!canUseDOM) return null; // the modal element component is separated so the keydown handler attaches // and detaches during mount and unmount respectively. return props.isOpen ? createPortal(<ModalElement {...props} />, document.body) : null; }
test.beforeEach(t => { let root = document.getElementById('root'); if (!root) { root = document.createElement('div'); root.id = 'root'; document.body.appendChild(root); } t.context.root = root; });
test.beforeEach(t => { let root = document.getElementById('root'); if (!root) { root = document.createElement('div'); root.id = 'root'; document.body.appendChild(root); } t.context.root = root; });