function moveDom(id, data, num) { $('#' + id).find(".div").each(function (index, item) { $(item).css({"backgroundColor": "#dcdcdc"}) $(item).css({ 'left': diff * (data.index + index) + 'px' }) if(data.matchArr.length && index <= data.matchArr.length - 1) { $(item).css({"backgroundColor": "red"}) } }).parent().siblings('.num').find('span').html(num) }
function transformUserFromApiToKs5(user, { includeId = false } = {}) { return { ...(includeId && { id: user.id }), unsplashId: user.id, username: user.username, name: user.name, url: user.links.html, portfolioUrl: user.portfolio_url, bio: user.bio, location: user.location, }; }
Handlebars.registerHelper('subTemplate', function(name, sourceContext) { if ( ! templateCache[name]) templateCache[name] = Handlebars.compile($('#template-' + name).html()); var template = templateCache[name]; var templateContext = $.extend({}, this, sourceContext.hash); return new Handlebars.SafeString( template(templateContext) ); });
render() { // explicitly send className of '' here so we don't get the default of // "paragraph" var replyText = p( html( this.props.block ), '' ); return <div className="wpnc__reply">{ replyText }</div>; }
async function uploadData (uploadURL, authToken, filename, opts) { // filename may either be .clinic-doctor.html or the data directory // .clinic-doctor const filePrefix = path.join(filename).replace(/\.html$/, '') const isPrivate = opts && opts.private console.log(`Uploading data for ${filePrefix} and ${filePrefix}.html`) const result = await tarAndUploadPromisified(path.resolve(filePrefix), uploadURL, authToken, { private: isPrivate }) result.url = `${uploadURL}${result.html}` return result }
function descriptionText (description) { // preserve the line breaks when converting to text const html = cheerio.load('<div>' + description.replace(/<br>/g, '\r\n') + '</div>'); return cheerio.text(html('div')); }
nest('page.html.render', function mentions (path) { if (path !== '/mentions') return const getStream = api.sbot.pull.resumeStream((sbot, opts) => { return sbot.patchwork.mentionsFeed.roots(opts) }, { limit: 40, reverse: true }) return api.feed.html.rollup(getStream, { compactFilter, // compact context messages updateStream: api.sbot.pull.stream(sbot => sbot.patchwork.mentionsFeed.latest()) }) })
function showTooltip (event, text) { tooltip .style('left', event.pageX - 30 + 'px') .style('top', event.pageY - 30 + 'px') .style('display', 'inline-block') .html(text) }
function onCapture5 (event) { // console.log(event.offsetX,event.offsetY); if (event.offsetX > 152 && event.offsetX < 187 && event.offsetY > 71 && event.offsetY < 172) { tooltip .style('left', event.pageX - 30 + 'px') .style('top', event.pageY - 70 + 'px') .style('display', 'inline-block') .html("<i>Especially. . .<li>APAC 56%</li><li><100 ee's 48%</li></i>") } else { hideTooltip() } }
api.feed.html.rollup(getStream, { prepend, hidden: contact.hidden, compactFilter: (msg) => msg.value.author !== id, // show root context messages smaller ungroupFilter: (msg) => msg.value.author !== id, updateStream: api.sbot.pull.stream(sbot => sbot.patchwork.profile.latest({ id })) })
resolve (obj, args, context, info) { const value = obj[info.fieldName] const json = typeof value === 'string' ? JSON.parse(value) : null return args.html ? documentToHtmlString(json, options.richText) : json }
destory() { if (this._onLoad) { $(window).unbind('scroll', this._onLoad); } this.el.html(''); }
function updateCtn(con, html, name) { var elem = con.find('.modal-content>.modal-' + name + ':first'); if (html != null) { elem.html(html); } else if (html === false || html === null) { elem.hide(); } }
resolve (obj, args, context, info) { const value = obj[info.fieldName] const json = typeof value === 'string' ? JSON.parse(value) : null return args.html ? documentToHtmlString(json, options.richText) : json }