Please specify a location
'); + return; + } + + const webPart: WeatherWebPart = this; + + ($ as any).simpleWeather({ + location: location, + woeid: '', + unit: 'c', + success: (weather: any): void => { + const html: string = + `${error.message}
`).removeAttr('style'); + } + }); + } + + protected get propertyPaneSettings(): IPropertyPaneSettings { + return { + pages: [ + { + header: { + description: strings.PropertyPaneDescription + }, + groups: [ + { + groupName: strings.DataGroupName, + groupFields: [ + PropertyPaneTextField('location', { + label: strings.LocationFieldLabel + }) + ] + } + ] + } + ] + }; + } + + protected get disableReactivePropertyChanges(): boolean { + return true; + } +} diff --git a/samples/jquery-cdn/src/webparts/weather/loc/en-us.js b/samples/jquery-cdn/src/webparts/weather/loc/en-us.js new file mode 100644 index 000000000..381f58b98 --- /dev/null +++ b/samples/jquery-cdn/src/webparts/weather/loc/en-us.js @@ -0,0 +1,7 @@ +define([], function() { + return { + "PropertyPaneDescription": "Manage the Weather Web Part settings.", + "DataGroupName": "Data", + "LocationFieldLabel": "Location" + } +}); \ No newline at end of file diff --git a/samples/jquery-cdn/src/webparts/weather/loc/mystrings.d.ts b/samples/jquery-cdn/src/webparts/weather/loc/mystrings.d.ts new file mode 100644 index 000000000..40a993703 --- /dev/null +++ b/samples/jquery-cdn/src/webparts/weather/loc/mystrings.d.ts @@ -0,0 +1,10 @@ +declare interface IWeatherStrings { + PropertyPaneDescription: string; + DataGroupName: string; + LocationFieldLabel: string; +} + +declare module 'weatherStrings' { + const strings: IWeatherStrings; + export = strings; +} diff --git a/samples/jquery-cdn/src/webparts/weather/tests/Weather.test.ts b/samples/jquery-cdn/src/webparts/weather/tests/Weather.test.ts new file mode 100644 index 000000000..caf42135b --- /dev/null +++ b/samples/jquery-cdn/src/webparts/weather/tests/Weather.test.ts @@ -0,0 +1,7 @@ +import * as assert from 'assert'; + +describe('WeatherWebPart', () => { + it('should do something', () => { + assert.ok(true); + }); +}); diff --git a/samples/jquery-cdn/tsconfig.json b/samples/jquery-cdn/tsconfig.json new file mode 100644 index 000000000..98c8662a9 --- /dev/null +++ b/samples/jquery-cdn/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "jsx": "react", + "declaration": true, + "sourceMap": true + } +} diff --git a/samples/jquery-cdn/tsd.json b/samples/jquery-cdn/tsd.json new file mode 100644 index 000000000..070c91895 --- /dev/null +++ b/samples/jquery-cdn/tsd.json @@ -0,0 +1,12 @@ +{ + "version": "v4", + "repo": "borisyankov/DefinitelyTyped", + "ref": "master", + "path": "typings", + "bundle": "typings/tsd.d.ts", + "installed": { + "jquery/jquery.d.ts": { + "commit": "154a9c0274fa8add9d0a7dd352ff5138d35ff53e" + } + } +} diff --git a/samples/jquery-cdn/typings/@ms/odsp-webpack.d.ts b/samples/jquery-cdn/typings/@ms/odsp-webpack.d.ts new file mode 100644 index 000000000..f2b3b03df --- /dev/null +++ b/samples/jquery-cdn/typings/@ms/odsp-webpack.d.ts @@ -0,0 +1,13 @@ +// Type definitions for webpack in Microsoft ODSP projects +// Project: ODSP-WEBPACK + +/* + * This definition of webpack require overrides all other definitions of require in our toolchain + * Make sure all other definitions of require are commented out e.g. in node.d.ts + */ +declare var require: { + (path: string): any; + (paths: string[], callback: (...modules: any[]) => void): void; + resolve: (id: string) => string; + ensure: (paths: string[], callback: (require: