Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

An attempt to mock the JavaScript API for Office in order to facilitate debugging using a regular browser and its tools

License

Notifications You must be signed in to change notification settings

brabantcourt/lopeway.mock-office

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lopeway.mock-office

An attempt to mock the JavaScript API for Office in order to facilitate debugging using a regular browser and its tools. The implementation is currently limited to part of the implementation of the TableBinding object although much of the infrastructure to support this object will support the creation of the additional objects.

Installation

If you don't already, your project will need to reference jQuery and KnockoutJS as these are required by the spreadsheet 'emulator'.

<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.1.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js"></script>

Replace the reference to Microsoft's JavaScript API for Office:

<!--<script src="//.../office.js"></script>-->

With a reference to the mock version:

<script src ="//.../lopeway.office.mock.1.2.js"></script>

Configuration

To override the mock library's default settings you must precede the lopeway.office.mock file reference to a configuration JSON of the form:

lopeway = {
    excel: {
        config: {
            debug: true,
            id: "lopeway-workbook",
            sheets: "sheets",
            tables: "tables",
            workbook: {
                name: "Book1",
                sheets: [],
                tables: []
            }
        }
    }
}
debug'true' to display tables/sheets as they're rendered; 'false' to hide the display
idID of the DIV to which rendered content will be appended
sheetsID of the DIV to which rendered sheets will be appended
tablesID of the DIV to which rendered tables will be appended
workbookDefinition of the Excel spreadsheet
nameUnused
sheetsFormat { name: 'sheetname' }
tablesFormat { name: 'tablename', cols = [c1, c2...], rows = [[r1c1,r1c2...],[r2c1,r2c2...] }

Unit Test(s)

/tests/lopeway.office.mock.1.3.unittests.js

Example(s)

/examples/default.html

About

An attempt to mock the JavaScript API for Office in order to facilitate debugging using a regular browser and its tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published