- Enhancement: Use minified version of jpicker in svg-editor

- Build: Update minified version of jgraduate/jpicker per linted/improved files (and add to uglify script)
- Fix: jgraduate recent regressions
- Docs: Update CHANGES
master
Brett Zamir 2018-05-17 17:42:46 +08:00
parent e252e866b7
commit 4fd4054f03
6 changed files with 12 additions and 45 deletions

View File

@ -28,9 +28,12 @@
(though only if there is a single identity matrix) (fixes Chrome issue
with recalculate test 1:
"recalculateDimensions() on rect with identity matrix")
* Build: Update minified version of spinbtn/jgraduate/jpicker per linted/improved files
* Enhancement: Throw Error objects instead of strings (including in jgraduate->jpicker)
* Enhancement: Use minified version of jpicker in svg-editor
* Refactoring: Switch to ESLint in source
* Refactoring: Move scripts to own files
* npm: Add ESLint, uglify, start scripts
* Testing: Move JavaScript out of HTML to own files
* Testing: Add `node-static` to get tests working
* Testing: Fix timing of `all_tests.html` for ensuring expanding iframe size to fit content

File diff suppressed because one or more lines are too long

View File

@ -182,8 +182,8 @@ jQuery.fn.jGraduate =
$.extend(true, $this, { // public properties, methods, and callbacks
// make a copy of the incoming paint
paint: new $.jGraduate.Paint({copy: $settings.paint}),
okCallback: $.isFunction(($arguments[1]) && $arguments[1]) || null,
cancelCallback: $.isFunction(($arguments[2]) && $arguments[2]) || null
okCallback: ($.isFunction($arguments[1]) && $arguments[1]) || null,
cancelCallback: ($.isFunction($arguments[2]) && $arguments[2]) || null
});
var // pos = $this.position(),
@ -787,8 +787,8 @@ jQuery.fn.jGraduate =
stops = curGradient.getElementsByTagNameNS(ns.svg, 'stop');
// if there are not at least two stops, then
var numstops = stops.length;
// if there are not at least two stops, then
if (numstops < 2) {
while (numstops < 2) {
curGradient.appendChild(document.createElementNS(ns.svg, 'stop'));
@ -813,7 +813,7 @@ jQuery.fn.jGraduate =
$('#' + id + ' div.grad_coord').mousedown(function (evt) {
evt.preventDefault();
draggingCoord = $(this);
// var s_pos = draggingCoord.offset();
// var sPos = draggingCoord.offset();
offset = draggingCoord.parent().offset();
$win.mousemove(onCoordDrag).mouseup(onCoordUp);
});
@ -1097,7 +1097,7 @@ jQuery.fn.jGraduate =
$(this).addClass('jGraduate_tab_current');
$(idref + ' > div').hide();
var type = $(this).attr('data-type');
// var container = $(idref + ' .jGraduate_gradPick').show();
/* var container = */ $(idref + ' .jGraduate_gradPick').show();
if (type === 'rg' || type === 'lg') {
// Show/hide appropriate fields
$('.jGraduate_' + type + '_field').show();

File diff suppressed because one or more lines are too long

View File

@ -54,7 +54,7 @@
<!-- always minified scripts -->
<script src="jquery-ui/jquery-ui-1.8.17.custom.min.js"></script>
<script src="jgraduate/jpicker.js"></script>
<script src="jgraduate/jpicker.min.js"></script>
<!-- If you do not wish to add extensions by URL, you can load them
by creating the following file and adding by calls to svgEditor.setConfig -->

View File

@ -11,7 +11,7 @@
"engines": {},
"scripts": {
"eslint": "eslint .",
"uglify": "uglifyjs --compress -o ./editor/spinbtn/JQuerySpinBtn.min.js -- ./editor/spinbtn/JQuerySpinBtn.js",
"uglify": "uglifyjs --compress -o ./editor/spinbtn/JQuerySpinBtn.min.js -- ./editor/spinbtn/JQuerySpinBtn.js && uglifyjs --compress -o ./editor/jgraduate/jpicker.min.js -- ./editor/jgraduate/jpicker.js && uglifyjs --compress -o ./editor/jgraduate/jquery.jgraduate.min.js -- ./editor/jgraduate/jquery.jgraduate.js",
"start": "echo \"Open file to http://localhost:8000/test/all_tests.html\" && static -p 8000",
"test": "echo \"Error: no test specified\" && exit 1"
},