Skip to content

Commit

Permalink
Merge pull request #419 from techfg/migrate-im-website
Browse files Browse the repository at this point in the history
feat: migrate im website to github pages
  • Loading branch information
techfg authored Apr 29, 2024
2 parents 25a8c14 + 8e52a76 commit 7adcf6d
Show file tree
Hide file tree
Showing 88 changed files with 10,828 additions and 10,566 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
insert_final_newline = true
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Example: When "Adding a function to do X", explain why it is necessary to have a

## Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. The existing test framework (iqTest) is somewhat limited so if you are unable to add a test due to a limitation in the framework, please instead create a new example specific to the fuctionality changed/added covered in the PR.
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. The existing test framework (iqTest) is somewhat limited so if you are unable to add a test due to a limitation in the framework, please instead create a new example specific to the functionality changed/added covered in the PR.

## Closing issues

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [main, add-im-website]
branches: main
# Allows you to run this workflow manually from the Actions tab on GitHub.
# eslint-disable-next-line yml/no-empty-mapping-value
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ build/
!.vscode/extensions.json
!.vscode/settings.json
/docs/

13 changes: 11 additions & 2 deletions .remarkrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
'remark-preset-lint-markdown-style-guide',
'remark-preset-lint-recommended',
'remark-preset-prettier',
['remark-lint-list-item-indent', 'space'],
['remark-lint-file-extension', ['md', 'mdx']],
['remark-lint-list-item-indent', 'one'],
['remark-lint-maximum-line-length', false],
['remark-lint-list-item-spacing', { checkBlanks: true }],
['remark-lint-no-file-name-irregular-characters', false],
Expand All @@ -23,7 +24,15 @@ module.exports = {
['remark-lint-link-title-style', "'"],
['remark-lint-rule-style', '---'],
['remark-lint-strong-marker', '*'],
// remark-validate-links does NOT check headings in other markdown files, the CLI is required for that (see
// the note at the bottom of the Use section at https://github.com/remarkjs/remark-validate-links?tab=readme-ov-file#use).
// TODO: Determine how to configure .remarkrc.js to parse/evaluate content inside of MDX blocks when invoked via CLI and
// then add call to CLI during dist build to validate all links
'remark-validate-links',
// remark-link-no-dead-urls slows down eslint a lot so we disable during standard processing
// and check external urls only when explicitly enabled (e.g., dist build)
process.env.CHECK_LINKS ? 'remark-lint-no-dead-urls' : null,
'remark-frontmatter',
'remark-gfm'
]
].filter(Boolean)
};
10 changes: 8 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
// causes special characters to be escaped in md/mdx files unnecessarily
// so commenting out waiting for https://github.com/microsoft/vscode-eslint/issues/1814
//"source.fixAll.eslint": "explicit"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"markdown",
"mdx",
Expand All @@ -15,5 +20,6 @@
"typescript",
"astro"
],
"prettier.documentSelectors": ["**/*.astro"]
"prettier.documentSelectors": ["**/*.astro"],
"mdx.validate.validateFileLinks": "ignore"
}
261 changes: 14 additions & 247 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,265 +7,32 @@
[![jsDelivr downloads](https://data.jsdelivr.com/v1/package/npm/imagemapster/badge?style=rounded)](https://www.jsdelivr.com/package/npm/imagemapster)
[![cdnjs version](https://img.shields.io/cdnjs/v/imagemapster.svg?color=orange)](https://cdnjs.com/libraries/imagemapster)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Deploy to GitHub Pages](https://github.com/jamietre/ImageMapster/actions/workflows/gh-pages-deploy.yml/badge.svg)](https://github.com/jamietre/ImageMapster/actions/workflows/gh-pages-deploy.yml)

ImageMapster activates the areas in HTML image maps so you can highlight and select them. It has lots of other features for manual control, tooltips, resizing, and more. It is designed to be compatible with every common platform, and is tested with Internet Explorer 6-10, Firefox 3.0+, Safari, Opera, and Chrome. It works on mobile devices and doesn't use Flash.

## Release Information

See the [change log](CHANGELOG.md) for details on the release history and roadmap.

Read the [release notes](http://blog.outsharked.com/2012/06/imagemapster-125-released.html) for 1.2.5, the last significant feature update.

## Getting Started

### Installation

#### NPM

This package can be installed via NPM:

```sh
npm install jquery imagemapster --save
```

#### Browser

> ⚠️ **Warning**
>
> As of ImageMapster v1.3.0, if targeting ES5 browers, you must include a Promise polyfill such as [es6-promise](https://www.npmjs.com/package/es6-promise). See [Issue 341](https://github.com/jamietre/ImageMapster/issues/341) for details.
Download the latest version of ImageMapster from the [Releases](https://github.com/jamietre/ImageMapster/releases) page and include in your webpage:

```html
<!-- Optional: If targeting ES5 browers, as of ImageMapster v1.3.0, a Promise polyfill is required! -->
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.min.js"
></script>
<script
type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"
></script>
<script type="text/javascript" src="jquery.imagemapster.min.js"></script>
```

Alternatively, you can include ImageMapster from one of the following CDNs:

1. [jsDelivr](https://www.jsdelivr.com/package/npm/imagemapster) - <https://www.jsdelivr.com/package/npm/imagemapster>
2. [cdnjs](https://cdnjs.com/libraries/imagemapster) - <https://cdnjs.com/libraries/imagemapster>

### Usage

Activate all image maps on the page with default options: on mouseover areas are highlighted with a gray fill with no border, and clicking an area causes it to become selected.

```js
$('img[usemap]').mapster();
```

Activate all image maps on the page with some specific options.

```js
$('img[usemap]').mapster({
fillColor: 'ff0000',
stroke: true,
singleSelect: true
});
```

#### Methods

There are lots of ways to manipulate the image map from Javascript. Here area a few, see the [ImageMapster web site](http://www.outsharked.com/imagemapster) for complete documentation.

**select**: Cause an area to become "selected"

```js
$('area').mapster('select');
```

Programatically select elements from the image map. The programmatic selection/deselection methods will not honor the staticState property.

**deselect**: Cause an area to become "deselected"

```js
$('area').mapster('deselect');
```

**set**: select or deselect an element. If `selected` is true, the area is selected, if false, it is deselected.

```js
$('area').mapster('set', selected);
```

You can also select or deselect areas using a their `mapKey`. This is an attribute on each area in your HTML that identifies it. You define a mapKey using a configuration option: `mapKey: 'data-key'`.

```js
$('img[usemap]').mapster('set', true, 'key1,key2');
```

If two areas share the same value for the `mapKey` they will be automatically grouped together when activated. You can also use the values of the mapKey to select areas from code.

You can pass options to change the rendering effects when using set as the last parameter:

```js
$('img[usemap]').mapster('set', true, 'key', { fillColor: 'ff0000' });
```

MapKeys can contain more than one value. The first value always defines groups when you mouse over. Other values can be used to create logical groups. For example:

```html
<img id="usamap" src="map.jpeg" usemap="#usa" />
<map name="usa">
<area data-key="maine,new-england,really-cold" shape="poly" coords="..." />
<area
data-key="new-hampshire,new-england,really-cold"
shape="poly"
coords="..."
/>
<area data-key="vermont,new-england,really-cold" shape="poly" coords="..." />
<area data-key="connecticut,new-england" shape="poly" coords="..." />
<area data-key="rhode-island,new-england" shape="poly" coords="..." />
<area data-key="massachusetts,new-england" shape="poly" coords="..." />
<!-- more states... -->
</map>
```

```js
$('#usamap').mapster({ mapKey: 'data-key' });
```

Mousing over each state would cause just that state to be higlighted. You can also select other logical groups from code code:
## Documentation

```js
// select all New England states
$('#usamap').mapster('set', true, 'new-england');
Available on the [ImageMapster Website](https://jamietre.github.io/ImageMapster).

// select just Maine, New Hampshire & Vermont
$('#usamap').mapster('set', true, 'really-cold');
```

Groups created this way are _independent_ of the primary group. If you select "new-england" from code, you can't unselect just "MA" by clicking on it. You would have to unselect "new-england" from code.

To simply indentify a set of areas to turn on or off, but not treat them as a logical group, you can use CSS classes and select areas directly, or use the `keys` option to identify the primary keys associated with a group (see documentation).

#### Options

Please see the [ImageMapster web site](http://www.outsharked.com/imagemapster/default.aspx?docs.html) for complete documentation.

## Demos

ImageMapster includes several examples. To view the examples:

1. Clone the repo
2. Open [index.html](examples/index.html) directly from your file system in a browser

> ℹ️ **Note**
>
> By default, examples will run using jQuery. To run examples using Zepto, modify the examples HTML file per the information in [Development -> Examples](#examples).
## Zepto Compatibility

As of ImageMapster v1.3.2, ImageMapster contains full support for Zepto v1.2.0. The latest Zepto compatible version of ImageMapster is [1.6.0](https://github.com/jamietre/ImageMapster/releases/tag/v1.6.0).

Prior to ImageMapster v1.3.2 and with any version of Zepto except v1.2.0, ImageMapster is unlikely to work as expected. In the early versions of ImageMapster, Zepto support was maintained, however due to changes in Zepto, as of v1.2.5 of ImageMapster, support for Zepto compatability was not maintained as it required too much effort and pushing ImageMapster forward with jQuery was the priority.

> ⚠️ **Warning**
>
> Given that Zepto is no longer actively developed and with plans in the ImageMapster Roadmap to convert to a Native JS Library, ImageMapster will be officially dropping support of Zepto as of ImageMapster v2.0.0.
To use ImageMapster >= v1.3.2 < 2.0.0 with Zepto v.1.2.0, Zepto must contain the following [Zepto Modules](https://github.com/madrobby/zepto#zepto-modules) at a minimum:

- zepto
- event
- ie
- fx
- touch
- selector (required as of v1.5.0)

### Browser - Zepto

> ⚠️ **Warning**
>
> As of ImageMapster v1.3.0, if targeting ES5 browers, you must include a Promise polyfill such as [es6-promise](https://www.npmjs.com/package/es6-promise). See [Issue 341](https://github.com/jamietre/ImageMapster/issues/341) for details.
Download the latest Zepto version of ImageMapster from the [Releases](https://github.com/jamietre/ImageMapster/releases) page and include in your webpage **making sure to use `jquery.imagemapster.zepto.min.js` or `jquery.imagemapster.zepto.js`**:

```html
<!-- Optional: If targeting ES5 browers, as of ImageMapster v1.3.0, a Promise polyfill is required! -->
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.min.js"
></script>
<script type="text/javascript" src="/path/to/your/custom/zeptodist"></script>
<script
type="text/javascript"
src="/path/to/cdn/for/v1.6.0/dist/jquery.imagemapster.zepto.min.js"
></script>
```

Alternatively, you can include the Zepto version of ImageMapster from one of the following CDNs:

1. [jsDelivr](https://www.jsdelivr.com/package/npm/imagemapster?version=1.6.0) - <https://www.jsdelivr.com/package/npm/imagemapster?version=1.6.0>
2. [cdnjs](https://cdnjs.com/libraries/imagemapster/1.6.0) - <https://cdnjs.com/libraries/imagemapster/1.6.0>

### NPM - Zepto

The maintainers of Zepto decided not to support any module loaders so there is no official support of Zepto using AMD/CJS/etc. Given this, the Zepto version of ImageMapster expects a dependency of `jquery` when using a module loader. The Zepto version of ImageMapster will work with jQuery or Zepto. If you'd like to utilize Zepto, there are some projects that wrap Zepto and support UMD such as [zepto-modules](https://www.npmjs.com/package/zepto-modules). In order to use Zepto, you will need to configure your bundler to map `jquery` to your Zepto build.

Using `webpack` and `zepto-modules` as an example:

#### Install from NPM

```sh
npm install zepto-modules [email protected] --save
```

#### src/yourzepto.js

```js
var $ = require('zepto-modules/zepto');

require('zepto-modules/event');
require('zepto-modules/ie');
require('zepto-modules/fx');
require('zepto-modules/touch');
require('zepto-modules/selector');

module.exports = $;
```

#### src/yourmodule.js

```js
import $ from './yourzepto.js';
import im from 'imagemapster/dist/jquery.imagemapster.zepto.js';

$(yourImage).mapster({
// your config here
});
```

#### webpack.config.js
## Release Information

```js
module.exports = {
resolve: {
alias: {
jquery: path.resolve('./src/yourzepto')
}
}
};
```
See the [change log](CHANGELOG.md) for details on the release history and roadmap.

## Find out More
## Support

Please see how to obtain [ImageMapster Support](SUPPORT.md).
See the [support page](SUPPORT.md) for details on how to obtain support.

## Contributing

Please see our [Contributing Guidelines](CONTRIBUTING.md).
See the [contributing guidelines](CONTRIBUTING.md) for details on how to contribute.

## Development

The below covers the ImageMapster jQuery plugin. For information on how to develop the ImageMapster website, see its [README](site/README.md).

You can simultaneously make changes to both the plugin and the website by running `npm run dev` in both the plugin (./) and site (./site) directories. Any changes made to the plugin will be reflected in the site as its [imagemapster](./site/package.json#L17) dependency is linked to the root plugin package.

### Build

The source code is broken into several modules to make management easier and to make it possible to create feature-targeted builds. ImageMapster is built using grunt and can be invoked as follows:
Expand All @@ -276,11 +43,11 @@ The source code is broken into several modules to make management easier and to
- Debug Build (uncompressed) - `npm run build`
- Release Build (uncompressed/compressed/sourcemap) - `npm run dist`

### Debug
### Dev

1. Clone the repo
2. Install NPM dependencies - `npm install`
3. Run the debug task - `npm run debug`
3. Run the dev task - `npm run dev`

### Tests

Expand Down
8 changes: 4 additions & 4 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ImageMapster Support

**Please do not use the issue tracker for personal support requests.**
> \[!NOTE]
> Please do not use the issue tracker for personal support requests.
Have questions? Looking for support for ImageMapster?

- There are lots of examples and documentation on the [ImageMapster web site](http://www.outsharked.com/imagemapster).
- I write about ImageMapster on my blog from time to time. See [posts about imagemapster](http://blog.outsharked.com/search/label/imagemapster).
- There are lots of examples and documentation on the [ImageMapster web site](https://jamietre.github.io/ImageMapster/).
- Take a look at [ImageMapster questions on StackOverflow](http://stackoverflow.com/search?q=imagemapster); there are quite a few. Maybe someone's asked the same question already.
- There are also some very detailed discussions in the [GitHub issues](https://github.com/jamietre/imagemapster/issues?direction=desc&labels=support&page=1&sort=created&state=closed) section that I've flagged as "support". The issues section is no longer the way to request support but these issues can provide valuable insight.
- You can also check the [feedback](http://www.outsharked.com/imagemapster/default.aspx?feedback.html) page on the project web site.
- You can also check the [feedback](https://jamietre.github.io/ImageMapster/resources/feedback/) page on the project web site.
- You can review the [source code on GitHub](https://github.com/jamietre/ImageMapster).

If you identify a bug, please file a [bug report](https://github.com/jamietre/ImageMapster/issues/new?template=bug_report.yml) and if you'd like to see a new feature, please file a [feature request](https://github.com/jamietre/ImageMapster/issues/new?template=feature_request.yml)!
Loading

0 comments on commit 7adcf6d

Please sign in to comment.