Git Product home page Git Product logo

true-script-editor's Introduction

True Script Editor

Summary

This was built as a simple proof of concept and to restore the true power of the 'classic' SharePoint Script Editor Web Part

Working with

Built with SharePoint Framework GA, Office Fabric, and jQuery

Used SharePoint Framework Version

drop

Screenshots

Applies to

Solution

Solution Author(s)
true-script-editor Jeremy Coleman (PC Professional, Inc.)

Version history

Version Date Comments
1.0.2 March 10th, 2017 Updated External JS Loading function
1.0.1 March 7th, 2017 Added HTML Editor option
1.0.0 March 7th, 2017 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Prerequisites

  • SharePoint Online tenant with Office Graph content

Minimal Path to Awesome

  • clone this repo
  • $ npm i
  • $ gulp serve

Features

Sample Web Parts in this solution illustrate the following concepts on top of the SharePoint Framework:

  • Load (multiple, csv delimited) external CSS files onto the page
  • Load (multiple, csv delimited) external JS files onto the page
  • Execute script blocks on the page
  • Added CSS style directly to the page
  • Add HTML to render within the web part DOM element

true-script-editor's People

Contributors

jcoleman-pcprofessional avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

true-script-editor's Issues

Can't build

After many failed attempts trying to get the right version of NodeJS, I could land on version 8.15.4 which ran "NPM INSTALL" without failures... but the GULP BUILD failed miserably.

Can you please add some instructions? Versions required? It doesn't seem to work.

Here it is the shortened output (for brevity):

Building: C:\nodejs\node.exe C:\dev\SPFx\True-Script-Editor\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\nodejs\node.exe',
gyp verb cli 'C:\dev\SPFx\True-Script-Editor\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
..
...
...... and so on and on.....

Getting issue for cdn

We have installed web part in 2018 and now we are getting below error on page
[SPLoaderError.loadComponentError]:
Failed to load component "5b3ca4ee-a6df-493d-bd4f-8489a5b246a2" (TrueScriptEditorWebPart). Original error: Failed to load URL 'https://publiccdn.sharepointonline.com/pcpro365.sharepoint.com/163800463de5f9285ad4f6f9cc0a97985b96b057e062d4733849cc0fc90eeffbd6d72bb8/TrueScriptEditor/true-script-editor-truescripteditorstrings_en-us_536e65149b0acf4d52c0043073b9fc59.js' for resource 'trueScriptEditorStrings' in component '5b3ca4ee-a6df-493d-bd4f-8489a5b246a2' (TrueScriptEditorWebPart). There was an error requesting the file.

INNERERROR:
Failed to load URL 'https://publiccdn.sharepointonline.com/pcpro365.sharepoint.com/163800463de5f9285ad4f6f9cc0a97985b96b057e062d4733849cc0fc90eeffbd6d72bb8/TrueScriptEditor/true-script-editor-truescripteditorstrings_en-us_536e65149b0acf4d52c0043073b9fc59.js' for resource 'trueScriptEditorStrings' in component '5b3ca4ee-a6df-493d-bd4f-8489a5b246a2' (TrueScriptEditorWebPart). There was an error requesting the file.
CALLSTACK:
Error
at t [as constructor] (https://modernb.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_e216f9d2ceba19eb89f0f03a7b3d7c7b.js:67:19823)
at new t (https://modernb.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_e216f9d2ceba19eb89f0f03a7b3d7c7b.js:68:9374)
at Function.e.buildErrorWithVerboseLog (https://modernb.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_e216f9d2ceba19eb89f0f03a7b3d7c7b.js:68:46574)
at Function.e.buildLoadComponentError (https://modernb.akamai.odsp.cdn.office.net/files/sp-client/sp-pages-assembly_en-us_e216f9d2ceba19eb89f0f03a7b3d7c7b.js:68:42619)
at https://modernb.akamai.odsp.cdn.office.net/files/sp-client/chunk.systemjs-component-loader_en-us_5fb53ed0cfeca06f5fdc.js:1:66020

Installation Instructions

Would you please add more detailed installation and usage instructions to the README.md (like we use SPO? I would really appreciate it. Thank you, in advance.

Web part disappears in edit mode

Steps:
Insert web part
Add some html
Save and publish page
Code renders on page
Click edit
Issue:
Web part not visible in edit surface so contents can't be edited.

deployment

Hi Coleman

Hope you are well. How can I deploy this webpart?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.