Skip to content

Commit

Permalink
v2.7.0 ready
Browse files Browse the repository at this point in the history
  • Loading branch information
ChapelR committed Nov 24, 2020
1 parent 9f958db commit 07db5cc
Show file tree
Hide file tree
Showing 31 changed files with 175 additions and 82 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [The Popover Macro](popover.md)
- [The UI Macro](ui-macro.md)
- [The Fading Macro Set](fading-macros.md)
- [The Disable Macro](disable-macro.md)
- [The CSS Macro](css-macro.md)
- [The Notify Macro](notify-macro.md)
- [The Meter Macro Set](meter-macros.md)
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

[Back to the main page](./README.md).

### November 24, 2020 (v2.7.0)

- **[New]** Added the `<<disable>>` macro.
- **[Update]** Updated the meter macro set. Now has a `this.settings.id` property.

### August 2, 2020 (v2.6.1)

- **[Update]** Updated the event macro set.
Expand Down
159 changes: 103 additions & 56 deletions docs/demo/index.html

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions docs/disable-macro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## The Disable Macro

[Back to the main readme](./README.md).

The `<<disable>>` macro allows the user to disable (and re-enable) various interactive elements.

**THE CODE:** [Minified](https://github.com/ChapelR/custom-macros-for-sugarcube-2/blob/master/scripts/minified/disable.min.js). [Pretty](https://github.com/ChapelR/custom-macros-for-sugarcube-2/blob/master/scripts/disable.js).
**DEMO:** [Available](http://macros.twinelab.net/demo?macro=disable).
**GUIDE:** Not available.

### Macro: `<<disable>>`

**Syntax**:`<<disable [expression]>>...<</disable>>`

The first interactive element (such as a button or text input) between the macro tags will be disabled. If an expression is passed to the macro, it will be evaluated. If the evaluated expression yields a truthy result, the interactive element will be disabled. If the expression is falsy, the element will not be disabled.

**Usage**:

```
This button should be disabled:
<<disable>><<button "Submit">><</button>><</disable>>
This textbox should also be disabled:
<<disable 1 === 1>><<textbox "$name" "">><</disable>>
This listbox, too:
<<disable true>><<listbox '$whee'>><<optionsfrom ["1", "2", "3"]>><</listbox>><</disable>>
This button should ''not'' be disabled:
<<disable false>><<button "Submit">><</button>><</disable>>
This textbox should ''not'' be disabled:
<<disable 1 === 0>><<textbox "$name" "">><</disable>>
```

## Other usage notes:

Disabled elements are also given the class `disabled`.
1 change: 1 addition & 0 deletions docs/download/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'The Done Macro' : 'done',
'The Event Macro Set' : 'events',
'The Fading Macro Set' : 'fading-macro-set',
'The Disable Macro' : 'disable',
'The First Macro' : 'first-macro',
'File System Macros' : 'fs',
'The Message Macro' : 'message-macro',
Expand Down
1 change: 1 addition & 0 deletions scripts/meters.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
console.error('Meter "' + name + '" already exists.');
return;
}
Object.assign(opts, { id : name });
var meter = new Meter(opts, value);
Meter._list.set(name, meter);
return meter;
Expand Down
2 changes: 1 addition & 1 deletion scripts/minified/articles.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/continue.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/css-macro.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/cycles.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/dialog-api-macro-set.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/disable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/done.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// done.min.js, for SugarCube 2, by Chapel
// v1.0.1, 2020-11-14, 724b290b7263281a050cc930114cc5b0ebc86408
// v1.0.1, 2020-11-24, 9f958db927f80b0101af14e286ea0ad142026739
;!function(){var a=1;Macro.add("done",{skipArgs:!0,tags:null,handler:function(){var n=this.payload[0].contents.trim();""!==n&&(postdisplay[":chapel-done-macro-"+a]=function(a){delete postdisplay[a],$.wiki(n)},a++)}})}();
// end done.min.js
2 changes: 1 addition & 1 deletion scripts/minified/events.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/fading-macro-set.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/minified/first-macro.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07db5cc

Please sign in to comment.