Skip to content

Commit

Permalink
consistancy in naming
Browse files Browse the repository at this point in the history
  • Loading branch information
calumk committed Nov 17, 2023
1 parent 6cb0e75 commit b3fa23d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 19 deletions.
Binary file modified assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/logo.psd
Binary file not shown.
2 changes: 2 additions & 0 deletions dist/codecup.bundle.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions dist/codecup.bundle.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/
4 changes: 2 additions & 2 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<script>

// new codeflask
// new placeholder
let cup = undefined

let current_language = 'javascript'
Expand Down Expand Up @@ -52,7 +52,7 @@

let demo_create = () => {
demo_dispose();
cup = new CodeCup('#cf_holder', {
cup = new codeCup('#cf_holder', {
language: current_language,
lineNumbers: true
});
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calumk/codecup",
"version": "1.6.0",
"version": "1.6.1",
"description": "A micro code-editor for awesome web pages",
"main": "dist/codeCup.bundle.js",
"files": [
Expand Down Expand Up @@ -28,7 +28,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/calumk/CodeCup.git"
"url": "git+https://github.com/calumk/codeCup.git"
},
"keywords": [
"code-editor",
Expand All @@ -39,7 +39,7 @@
"author": "Calum Knot",
"license": "MIT",
"bugs": {
"url": "https://github.com/calumk/CodeCup/issues"
"url": "https://github.com/calumk/codeCup/issues"
},
"homepage": "https://github.com/calumk/CodeCup"
"homepage": "https://github.com/calumk/codeCup"
}
20 changes: 10 additions & 10 deletions src/codecup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ Prism.plugins.autoloader.languages_path = 'https://cdnjs.cloudflare.com/ajax/lib

// import hljs from 'highlight.js';

export default class CodeCup {
export default class codeCup {
constructor (selectorOrElement, opts) {
if (!selectorOrElement) {
// If no selector or element is passed to CodeCup,
// If no selector or element is passed to codeCup,
// stop execution and throw error.
throw Error('CodeCup expects a parameter which is Element or a String selector')
throw Error('codeCup expects a parameter which is Element or a String selector')
}

if (!opts) {
// If no selector or element is passed to CodeCup,
// If no selector or element is passed to codeCup,
// stop execution and throw error.
throw Error('CodeCup expects an object containing options as second parameter')
throw Error('codeCup expects an object containing options as second parameter')
}

if (selectorOrElement.nodeType) {
Expand All @@ -46,7 +46,7 @@ export default class CodeCup {
const isCSSInjected = injectCss(editorCss, null, this.opts.styleParent)

if (!isCSSInjected) {
throw Error('Failed to inject CodeCup CSS.')
throw Error('Failed to inject codeCup CSS.')
}

// The order matters (pre > code). Don't change it
Expand Down Expand Up @@ -97,7 +97,7 @@ export default class CodeCup {

destroyLineNumbers () {
this.elWrapper.classList.remove('codeCup--has-line-numbers')
console.log(this.elLineNumbers)
// console.log(this.elLineNumbers)
this.elLineNumbers.remove()
}

Expand Down Expand Up @@ -176,7 +176,7 @@ export default class CodeCup {

listenTextarea () {
this.elTextarea.addEventListener('input', this.events._input = (e) => {
console.log()
// console.log()
if (this.opts.readonly) {
return;
}
Expand Down Expand Up @@ -423,9 +423,9 @@ export default class CodeCup {
}

onUpdate (callback) {
console.log("chanfge")
// console.log("chanfge")
if (callback && {}.toString.call(callback) !== '[object Function]') {
throw Error('CodeCup expects callback of type Function')
throw Error('codeCup expects callback of type Function')
}

this.updateCallBack = callback
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('path');

module.exports = {
entry: './src/codecup.js',
entry: './src/codeCup.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'codecup.bundle.js',
library: 'CodeCup',
filename: 'codeCup.bundle.js',
library: 'codeCup',
libraryExport: 'default',
libraryTarget: 'umd',
},
Expand Down

0 comments on commit b3fa23d

Please sign in to comment.