Skip to content

Commit

Permalink
tokenizer bugfix; social buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDittrich committed Oct 31, 2015
1 parent 4581da1 commit c1d24f2
Show file tree
Hide file tree
Showing 12 changed files with 423 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Branch 2.x ##

### Version 2.10 BETA ###
* Added: new social buttons to the website
* Added: some contribution guidelines
* Bugfix: removed `console.log` debugging outut from tokenizer

### Version 2.9 ###
* Bugfix: the final character of highlighted code got removed by the tokenizer engine in case it's a text token with length=1 - thanks to [dan-j on GitHub](https://github.com/AndiDittrich/WordPress.Enlighter/issues/15)
* Bugfix: Generic highlighting was accidentally removed from EnlighterJS
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ Contribution
EnlighterJS is OpenSource and managed on [GitHub](https://github.com/AndiDittrich/EnlighterJS) - if you like, you're welcome to contribute!
To simplify the release and quality control process, please follow these remarks:

### Notices ###
* Your commits/pull-request should only contain changes of the `Source/`, `Resources/TestcaseData` directories or the Examples located into the root directory - otherwise i have to merge the request manually
* **Do not change** the files located into the `Examples/` or `Build/` directory - they are automatically generated during the build-process using data from `Resources/TestcaseData`
* Related software packages like MooTools, Bootstrap, ANT-contrib are updated by the maintainer
* If you form a concept of larger project changes, please [discuss](https://github.com/AndiDittrich/EnlighterJS/issues) them with the contributors **before** implementing

### Adding a new Language ###
* First of all: take a look on other languages which are already available to learn about functions and coding styles
* To start with a new language please use the `LanguageDevelopment.phtml` workspace. It will automatically load `Source/Language/Template.mylang.js` (the startup file for your language development).
* Rename your language file `Template.mylang.js` to the **camel-cased** real language name - e.g. `Vhdl.js`
* Add detailed comments to each language rule!
* Keep the code as small as possible: e.g. use regex instead of long keyword lists
* In case your language is a superset of another one, please **extend** the origin language - do not copy the origin file
* Add an language testcase/demo to the `Resouces/TestcaseData` directory
* Finally create a [Pull Request on GitHub](https://help.github.com/articles/creating-a-pull-request/) - your changes will be reviewed and commonly added to the project
69 changes: 60 additions & 9 deletions Resources/EnlighterWeb.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

var HyperCoreJS = {
Modules: {}
};

function ContentNavigation(contentContainerSelector, navContainerSelector){
// content navi
var nav = document.getElement(navContainerSelector);
Expand Down Expand Up @@ -169,23 +165,78 @@ function StickyNavigation(navContainerSelector){
};

window.addEvent('domready', function(){
// create github buttons
/*
var repo = window._github_profile.repos.EnlighterJS;
var user = window._github_profile.user;
// create github buttons
document.id('ghb').grab(new GitHubButton({
owner : 'AndiDittrich',
repo : 'EnlighterJS',
large : false,
type : 'star'
type : 'star',
cache: false,
count: repo.stargazers
})).grab(new GitHubButton({
owner : 'AndiDittrich',
repo : 'EnlighterJS',
large : false,
type : 'fork'
type : 'fork',
cache: false,
count: repo.forks
})).grab(new GitHubButton({
owner : 'AndiDittrich',
repo : 'EnlighterJS',
large : false,
type : 'follow'
}));
type : 'follow',
cache: false,
count: user.followers
}));*/

// social buttons
var out = document.id('ghb');

SocialButton(out, {
type: 'github-star',
username: 'AndiDittrich',
repo: 'EnlighterJS',
large: false,
text: 'Star'
});

SocialButton(out, {
type: 'github-fork',
username: 'AndiDittrich',
repo: 'EnlighterJS',
large: false,
text: 'Fork'
});

SocialButton(out, {
type: 'github-followers',
username: 'AndiDittrich',
large: false
});

SocialButton(out, {
type: 'github-opensource',
username: 'AndiDittrich',
large: false
});

SocialButton(out, {
type: 'twitter-followers',
username: 'andidittrich',
large: false
});

SocialButton(out, {
type: 'wordpress-plugin',
username: 'Andi Dittrich',
plugin: 'Enlighter',
large: false
});


// initialize content navigation
ContentNavigation('article', '#content-nav');
Expand Down
2 changes: 1 addition & 1 deletion Resources/EnlighterWeb.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "bootstrap/bootstrap.less";

// Unofficial GitHubButtons
@import (inline) "github-buttons/GitHubButtons.css";
@import (inline) "social-buttons/social-buttons.css";

/*! EnlighterJS Syntax Highlighter | MIT License (X11) | http://enlighterjs.andidittrich.de/ */
body{
Expand Down
5 changes: 5 additions & 0 deletions Resources/MooTools.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion Resources/Web.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<link rel="stylesheet" href="EnlighterWeb.min.css">
<link rel="stylesheet" type="text/css" href="EnlighterJS.min.css?<?php echo EJS_VERSION; ?>" />
<link href='http://fonts.googleapis.com/css?family=Cutive+Mono|Roboto+Mono:400,700,400italic,500,500italic,700italic|Ubuntu+Mono:400,700,400italic,700italic|Droid+Sans+Mono|Source+Code+Pro:400,600' rel='stylesheet' type='text/css'>

<script type="text/javascript" src="http://api.andidittrich.de/social.js"></script>
<script type="text/javascript" src="MooTools.min.js?<?php echo EJS_VERSION; ?>"></script>
<script type="text/javascript" src="EnlighterJS.min.js?<?php echo EJS_VERSION; ?>"></script>
<script type="text/javascript" src="EnlighterWeb.min.js?<?php echo EJS_VERSION; ?>"></script>
Expand Down Expand Up @@ -85,10 +87,13 @@
<div id="beyond_corporate_credits">
<div class="container">
<div class="row">
<div class="col-xs-6"><a href="http://andidittrich.de/"><span class="slogan"">Beyond Technology</span><br /><small>beyond the visible world</small></a></div>
<div class="col-xs-6"><a href="http://andidittrich.de/"><span class="slogan">Beyond Technology</span><br /><small>beyond the visible world</small></a></div>
<div class="col-xs-6 text-right small"><a href="http://andidittrich.de/privacy_protection">Privacy Protection</a> | <a href="http://andidittrich.de/contact">Contact</a> | <a href="http://andidittrich.de/imprint">Imprint</a></div>
</div>
</div>
</div>



</body>
</html>
13 changes: 13 additions & 0 deletions Resources/social-buttons/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2014 Mark Otto, 2014-2015 Andi Dittrich

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
143 changes: 143 additions & 0 deletions Resources/social-buttons/social-buttons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
---
description: GitHub-Buttons Styles - Improved for use within own pages
license: Apache 2.0 License
authors:
- Mark Otto
- github-buttons contributors (https://github.com/mdo/github-buttons)
- Andi Dittrich
...
*/

.social-button{
display: inline-block;
position: relative;
height: 20px;
font: bold 11px/14px "Helvetica Neue", Helvetica, Arial, sans-serif;
overflow: hidden;
}

.social-btn,
.social-count {
float: left;
padding: 2px 5px 2px 4px;
color: #333;
text-decoration: none;
text-shadow: 0 1px 0 #fff;
white-space: nowrap;
cursor: pointer;
border-radius: 3px;
}
.social-btn {
background-color: #eee;
background-image: linear-gradient(to bottom, #fcfcfc 0, #eee 100%);
background-repeat: no-repeat;
border: 1px solid #d5d5d5;
}
.social-btn:hover,
.social-btn:focus {
text-decoration: none;
background-color: #ddd;
background-image: linear-gradient(to bottom, #eee 0, #ddd 100%);
border-color: #ccc;
}
.social-btn:active {
background-image: none;
background-color: #dcdcdc;
border-color: #b5b5b5;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
.github-ico {
float: left;
width: 14px;
height: 14px;
margin-right: 4px;
background-size: 100% 100%;
background-repeat: no-repeat;
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjQwcHgiIGhlaWdodD0iNDBweCIgdmlld0JveD0iMTIgMTIgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMTIgMTIgNDAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiMzMzMzMzMiIGQ9Ik0zMiAxMy40Yy0xMC41IDAtMTkgOC41LTE5IDE5YzAgOC40IDUuNSAxNS41IDEzIDE4YzEgMC4yIDEuMy0wLjQgMS4zLTAuOWMwLTAuNSAwLTEuNyAwLTMuMiBjLTUuMyAxLjEtNi40LTIuNi02LjQtMi42QzIwIDQxLjYgMTguOCA0MSAxOC44IDQxYy0xLjctMS4yIDAuMS0xLjEgMC4xLTEuMWMxLjkgMC4xIDIuOSAyIDIuOSAyYzEuNyAyLjkgNC41IDIuMSA1LjUgMS42IGMwLjItMS4yIDAuNy0yLjEgMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEgMC43LTMuNyAyLTUuMWMtMC4yLTAuNS0wLjgtMi40IDAuMi01YzAgMCAxLjYtMC41IDUuMiAyIGMxLjUtMC40IDMuMS0wLjcgNC44LTAuN2MxLjYgMCAzLjMgMC4yIDQuNyAwLjdjMy42LTIuNCA1LjItMiA1LjItMmMxIDIuNiAwLjQgNC42IDAuMiA1YzEuMiAxLjMgMiAzIDIgNS4xYzAgNy4zLTQuNSA4LjktOC43IDkuNCBjMC43IDAuNiAxLjMgMS43IDEuMyAzLjVjMCAyLjYgMCA0LjYgMCA1LjJjMCAwLjUgMC40IDEuMSAxLjMgMC45YzcuNS0yLjYgMTMtOS43IDEzLTE4LjFDNTEgMjEuOSA0Mi41IDEzLjQgMzIgMTMuNHoiLz48L3N2Zz4=');
}
.wordpress-ico {
float: left;
width: 14px;
height: 14px;
margin-right: 4px;
background-size: 100% 100%;
background-repeat: no-repeat;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2BJREFUeNpcU11MU2cYfs5PhRXoD1iko5QWK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dDrNFB9bwYUTBSNO+p2I7fImJyfPoF8PNTc37wic+hgMhqALm0isaNEIY6KVdSfQ5BoTExOq/8J++ioFOAV7S0tLWItTOyWF0AubiO0fMOjO42JlwgAMhFvMMJNteWFzqKC0j8Cc3Il7cR/t0SnVUZCFLiaYk1empqbCXtgctoUTcO+iQ5eYRUuv0EJCOZhAtVrtaldXl2dkZGTbC5tIuMa+L2z+BexZXK+OBaruAAAAAElFTkSuQmCC') 0 0 no-repeat;
background-position: -24px 0;
margin-right: 4px;
vertical-align: 3px;
}

.social-count {
position: relative;
display: block;
margin-left: 4px;
background-color: #fafafa;
border: 1px solid #d4d4d4;
}
.social-count:hover,
.social-count:focus {
color: #4183C4;
}
.social-count:before,
.social-count:after {
content: '';
position: absolute;
display: inline-block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.social-count:before {
top: 50%;
left: -3px;
margin-top: -4px;
border-width: 4px 4px 4px 0;
border-right-color: #fafafa;
}
.social-count:after {
top: 50%;
left: -4px;
z-index: -1;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #d4d4d4;
}
.social-btn-large {
height: 30px;
}
.social-btn-large .social-btn,
.social-btn-large .social-count {
padding: 3px 10px 3px 8px;
font-size: 16px;
line-height: 22px;
border-radius: 4px;
}
.social-btn-large .social-ico {
width: 20px;
height: 20px;
}
.social-btn-large .social-count {
margin-left: 6px;
}
.social-btn-large .social-count:before {
left: -5px;
margin-top: -6px;
border-width: 6px 6px 6px 0;
}
.social-btn-large .social-count:after {
left: -6px;
margin-top: -7px;
border-width: 7px 7px 7px 0;
}
Loading

0 comments on commit c1d24f2

Please sign in to comment.