-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Worked a bit on the selection markers
- Loading branch information
Martin Berg
committed
Mar 25, 2014
1 parent
7bc46d6
commit 7f02d71
Showing
5 changed files
with
323 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
/*globals svgEditor*/ | ||
/* | ||
The config.js file is intended for the setting of configuration or | ||
preferences which must run early on; if this is not needed, it is | ||
recommended that you create an extension instead (for greater | ||
reusability and modularity). | ||
*/ | ||
|
||
// CONFIG AND EXTENSION SETTING | ||
/* | ||
See defaultConfig and defaultExtensions in svg-editor.js for a list | ||
of possible configuration settings. | ||
See svg-editor.js for documentation on using setConfig(). | ||
*/ | ||
|
||
// URL OVERRIDE CONFIG | ||
svgEditor.setConfig({ | ||
/** | ||
To override the ability for URLs to set URL-based SVG content, | ||
uncomment the following: | ||
*/ | ||
// preventURLContentLoading: true, | ||
/** | ||
To override the ability for URLs to set other configuration (including | ||
extensions), uncomment the following: | ||
*/ | ||
// preventAllURLConfig: true, | ||
/** | ||
To override the ability for URLs to set their own extensions, | ||
uncomment the following (note that if setConfig() is used in | ||
extension code, it will still be additive to extensions, | ||
however): | ||
*/ | ||
// lockExtensions: true, | ||
}); | ||
|
||
svgEditor.setConfig({ | ||
/* | ||
Provide default values here which differ from that of the editor but | ||
which the URL can override | ||
*/ | ||
}, {allowInitialUserOverride: true}); | ||
|
||
// EXTENSION CONFIG | ||
svgEditor.setConfig({ | ||
extensions: [ | ||
// 'ext-overview_window.js', | ||
// 'ext-markers.js', | ||
// 'ext-connector.js', | ||
'ext-eyedropper.js', | ||
// 'ext-shapes.js', | ||
// 'ext-imagelib.js', | ||
'ext-grid.js', | ||
'ext-polygon.js', | ||
'ext-star.js', | ||
'ext-panning.js', | ||
// 'ext-storage.js' | ||
] | ||
, noDefaultExtensions: true, // noDefaultExtensions can only be meaningfully used in config.js or in the URL | ||
}); | ||
|
||
// OTHER CONFIG | ||
svgEditor.setConfig({ | ||
// canvasName: 'default', | ||
// canvas_expansion: 3, | ||
initFill: { | ||
color: 'bbccdd', // bluish | ||
opacity: 1 | ||
}, | ||
initStroke: { | ||
width: 1, | ||
color: '444455', // slight gray | ||
opacity: 1 | ||
}, | ||
// initOpacity: 1, | ||
// colorPickerCSS: '', | ||
// initTool: 'select', | ||
// wireframe: false, | ||
showlayers: false, | ||
// no_save_warning: false, | ||
// PATH CONFIGURATION | ||
// imgPath: 'images/', | ||
// langPath: 'locale/', | ||
// extPath: 'extensions/', | ||
// jGraduatePath: 'jgraduate/images/', | ||
/* | ||
Uncomment the following to allow at least same domain (embedded) access, | ||
including file:// access. | ||
Setting as `['*']` would allow any domain to access but would be unsafe to | ||
data privacy and integrity. | ||
*/ | ||
// allowedOrigins: [window.location.origin || 'null'], // May be 'null' (as a string) when used as a file:// URL | ||
// DOCUMENT PROPERTIES | ||
// dimensions: [640, 480], | ||
// EDITOR OPTIONS | ||
// gridSnapping: false, | ||
// gridColor: '#000', | ||
// baseUnit: 'px', | ||
// snappingStep: 10, | ||
// showRulers: true, | ||
// EXTENSION-RELATED (GRID) | ||
// showGrid: false, // Set by ext-grid.js | ||
// EXTENSION-RELATED (STORAGE) | ||
// noStorageOnLoad: false, // Some interaction with ext-storage.js; prevent even the loading of previously saved local storage | ||
// forceStorage: false, // Some interaction with ext-storage.js; strongly discouraged from modification as it bypasses user privacy by preventing them from choosing whether to keep local storage or not | ||
// emptyStorageOnDecline: true, // Used by ext-storage.js; empty any prior storage if the user declines to store | ||
}); | ||
|
||
// PREF CHANGES | ||
/** | ||
setConfig() can also be used to set preferences in addition to | ||
configuration (see defaultPrefs in svg-editor.js for a list of | ||
possible settings), but at least if you are using ext-storage.js | ||
to store preferences, it will probably be better to let your | ||
users control these. | ||
As with configuration, one may use allowInitialUserOverride, but | ||
in the case of preferences, any previously stored preferences | ||
will also thereby be enabled to override this setting (and at a | ||
higher priority than any URL preference setting overrides). | ||
Failing to use allowInitialUserOverride will ensure preferences | ||
are hard-coded here regardless of URL or prior user storage setting. | ||
*/ | ||
svgEditor.setConfig( | ||
{ | ||
// lang: '', // Set dynamically within locale.js if not previously set | ||
// iconsize: '', // Will default to 's' if the window height is smaller than the minimum height and 'm' otherwise | ||
/** | ||
* When showing the preferences dialog, svg-editor.js currently relies | ||
* on curPrefs instead of $.pref, so allowing an override for bkgd_color | ||
* means that this value won't have priority over block auto-detection as | ||
* far as determining which color shows initially in the preferences | ||
* dialog (though it can be changed and saved). | ||
*/ | ||
// bkgd_color: '#FFF', | ||
// bkgd_url: '', | ||
// img_save: 'embed', | ||
// Only shows in UI as far as alert notices | ||
// save_notice_done: false, | ||
// export_notice_done: false | ||
} | ||
); | ||
svgEditor.setConfig( | ||
{ | ||
// Indicate pref settings here if you wish to allow user storage or URL settings | ||
// to be able to override your default preferences (unless other config options | ||
// have already explicitly prevented one or the other) | ||
}, | ||
{allowInitialUserOverride: true} | ||
); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
|
||
/* Layout */ | ||
#ruler_corner { | ||
box-sizing:border-box; | ||
height: 16px; | ||
} | ||
|
||
#ruler_x { | ||
box-sizing:border-box; | ||
right: 0; | ||
} | ||
|
||
#ruler_y { | ||
box-sizing:border-box; | ||
bottom: 41px; | ||
} | ||
|
||
.dropdown ul { | ||
left:-15px; | ||
} | ||
|
||
#workarea { | ||
right:0; | ||
} | ||
|
||
#tools_top { | ||
left: 41px; | ||
} | ||
|
||
/* Styles */ | ||
body { | ||
background-color:white; | ||
} | ||
|
||
#tools_left, .color_tool, #palette_holder { | ||
background:transparent; | ||
} | ||
|
||
.tool_sep { | ||
width:12px; | ||
border:none; | ||
background:transparent; | ||
} | ||
|
||
/* Buttons */ | ||
|
||
button { | ||
cursor:pointer !important; | ||
} | ||
|
||
button:active, button:focus { | ||
outline:none !important; | ||
} | ||
|
||
.tool_button, | ||
.push_button, | ||
.tool_button_current, | ||
.push_button_pressed, | ||
.buttondown, | ||
.tools_flyout .tool_button { | ||
border-radius:1px; | ||
-webkit-border-radius:1px; | ||
-moz-border-radius:1px; | ||
box-shadow:none !important; | ||
-moz-box-shadow:none !important; | ||
-webkit-box-shadow:none !important; | ||
background:transparent; | ||
border:1px solid #ddd; | ||
} | ||
|
||
.tool_button_current, | ||
.push_button_pressed, | ||
.buttondown { | ||
background:#eee !important; | ||
} | ||
|
||
.tools_flyout .tool_button { | ||
background:white; | ||
border-right-width:0; | ||
} | ||
|
||
.tools_flyout .tool_button:first-child { | ||
border-top-left-radius: 2px; | ||
border-bottom-left-radius: 2px; | ||
} | ||
|
||
.tools_flyout .tool_button:last-child { | ||
border-top-right-radius: 2px; | ||
border-bottom-right-radius: 2px; | ||
border-right-width:1px; | ||
} | ||
|
||
|
||
/* Dropdowns */ | ||
|
||
.dropdown li { | ||
border:1px solid #ddd; | ||
border-bottom-width:0; | ||
background:white; | ||
cursor:pointer; | ||
} | ||
|
||
.dropdown li:hover { | ||
background:#eee; | ||
} | ||
|
||
.dropdown li.special:hover { | ||
background:white; | ||
} | ||
|
||
.dropdown li:first-child { | ||
border-top-left-radius: 2px; | ||
border-top-right-radius: 2px; | ||
} | ||
|
||
.dropdown li:last-child { | ||
border-bottom-left-radius: 2px; | ||
border-bottom-right-radius: 2px; | ||
border-bottom-width:1px; | ||
} | ||
|
||
.dropdown button { | ||
border: 1px solid #ddd; | ||
border-radius: 2px; | ||
} | ||
|
||
.dropdown button.down { | ||
border: 1px solid #ddd; | ||
background:#ddd; | ||
} | ||
|
||
/* Slider */ | ||
.ui-slider { | ||
height:0; | ||
margin:0 5px; | ||
border-color:#bbb; | ||
} | ||
|
||
.ui-slider-horizontal .ui-slider-handle { | ||
outline:none; | ||
box-sizing:border-box; | ||
height:10px; | ||
width:10px; | ||
border-radius:5px; | ||
top:-5px; | ||
} | ||
|
||
.ui-slider-handle:hover { | ||
outline:none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.