View MarkdownField.svelte
<script> | |
import { getSitecoreContext } from "jss-svelte"; | |
import marked from "marked"; | |
export let field = null; | |
export let cssClass = ""; | |
let eeElement = null; | |
const sitecoreContext = getSitecoreContext(); |
View create-default-disconnected-server.js
const Express = require('express'); | |
const { join } = require('path'); | |
const { ManifestManager } = require('../node_modules/@sitecore-jss/sitecore-jss-dev-tools/dist/manifest-manager'); | |
const { createDisconnectedDictionaryService } = require('../node_modules/@sitecore-jss/sitecore-jss-dev-tools/dist/disconnected-server/dictionary-service'); | |
const { createDisconnectedLayoutService } = require('../node_modules/@sitecore-jss/sitecore-jss-dev-tools/dist/disconnected-server/layout-service'); | |
const {createGraphQLService} = require('jss-disconnected-graphql'); | |
function createDefaultDisconnectedServer(options) { | |
let app = options.server; |
View disconnected-mode-proxy.js
/* | |
When the app runs in disconnected mode, and Sitecore is not present, we need to give | |
the app copies of the Sitecore APIs it depends on (layout service, dictionary service, content service) | |
to talk to so that the app can run using the locally defined disconnected data. | |
This is accomplished by spinning up a small Express server that mocks the APIs, and then | |
telling the dev server to proxy requests to the API paths to this express instance. | |
*/ | |
/* eslint-disable no-console */ |
View ClientSidePlaceholder.js
import React from 'react'; | |
import { withSitecoreContext, dataApi, Placeholder } from '@sitecore-jss/sitecore-jss-react'; | |
import { dataFetcher } from './dataFetcher'; | |
import config from './temp/config'; | |
class ClientSidePlaceholder extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { |
View gist:8390990
/*! | |
* jQuery JavaScript Library v1.8.2 | |
* http://jquery.com/ | |
* | |
* Includes Sizzle.js | |
* http://sizzlejs.com/ | |
* | |
* Copyright 2012 jQuery Foundation and other contributors | |
* Released under the MIT license | |
* http://jquery.org/license |
View MonoTouch.Dialog Currency Element
// Currency element, port of: https://github.com/rodchile/UITextCurrencyField | |
public class CurrencyElement : EntryElement | |
{ | |
public CurrencyElement (string caption, string placeholder, string value) | |
: base(caption, placeholder, value) | |
{ | |
} | |
private static string CleanString(string target) |
View gist:4480660
var YqlCollection = Backbone.Collection.extend({ | |
query: '', | |
url: 'http://query.yahooapis.com/v1/public/yql', | |
format: 'json', | |
timeout: 10000, | |
dataType: 'jsonp', | |
fetch: function (options) { | |
options = options ? _.clone(options) : {}; | |
options.data = options.data ? _.clone(options.data) : {}; | |
if (!options.data.q) { |
View gist:4254777
var Slideshow = (function($) { | |
function Slideshow(options) { | |
var defaults = { | |
timeout: 0.5, | |
selector: '.content' | |
}; | |
this.options = $.extend(defaults, options); | |
}; |
View gist:4115787
import requests | |
from django.conf import settings | |
def get_woeid(text): | |
if not text: | |
return | |
app_id = settings.WOEID_APP_ID | |
if not app_id: |
View gist:4028975
var app = app || {}; | |
app.models = app.models || {}; | |
app.collections = app.collections || {}; | |
app.views = app.views || {}; | |
(function($, window) { | |
(function(models) { | |
models.Tag = Backbone.Tastypie.Model.extend({ | |
urlRoot: '/api/v1/tag/' |
NewerOlder