Permalink
Browse files

ALL THE THINGS. I don’t even remember :(

  • Loading branch information...
1 parent eeae64b commit f061855842ca5d15a284cb56952b8752c37aeb24 @LeaVerou committed Jun 27, 2012
Showing with 2,043 additions and 65 deletions.
  1. +4 −4 code/code-highlight.js
  2. +9 −36 code/dabblet.js
  3. +359 −0 code/global.js
  4. +1 −1 code/incrementable.js
  5. +189 −0 code/user-profile.js
  6. +59 −15 code/utopia.js
  7. +2 −2 help/index.html
  8. +12 −7 index.html
  9. +516 −0 style/global.css
  10. +720 −0 style/style.css
  11. +6 −0 user/.htaccess
  12. +51 −0 user/index.html
  13. +115 −0 user/style.css
@@ -33,7 +33,7 @@ var _ = self.Highlight = {
'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally)\b/g,
'boolean': /\b(true|false)\b/g,
'number': /\b-?(0x)?\d*\.?\d+\b/g,
- 'regex': /\/.+?\/[gim]{0,3}/g
+ 'regex': /\/([^/]|\/)+\/[gim]{0,3}/g
},
css: {
'comment': /\/\*[\w\W]*?\*\//g,
@@ -71,13 +71,13 @@ var _ = self.Highlight = {
'pattern': /(&lt;|<)\/?[\w\W]+?(>|&gt;)/gi,
'inside': {
'attr-value': {
- 'pattern': /[\w-]+=(('|").*?(\2)|[^\s>]+(?=>|&|\s))/gi,
+ 'pattern': /[\w:-]+=(('|").*?(\2)|[^\s>]+(?=>|&|\s))/gi,
'inside': {
- 'attr-name': /^[\w-]+(?==)/gi,
+ 'attr-name': /^[\w:-]+(?==)/gi,
'punctuation': /=/g
}
},
- 'attr-name': /\s[\w-]+(?=\s)/gi,
+ 'attr-name': /\s[\w:-]+(?=\s)/gi,
'punctuation': /&lt;\/?|&gt;/g
}
},
View
@@ -1,6 +1,4 @@
-var Dabblet = {
- version: '1.0.6',
-
+window.Dabblet = $u.attach({
pages: {
css: window['css-page'],
html: window['html-page'],
@@ -104,7 +102,9 @@ var Dabblet = {
self.Previewer && Previewer.hideAll();
- pre.focus && pre.focus();
+ if(!Dabblet.embedded) {
+ pre.focus && pre.focus();
+ }
var ss = pre.getAttribute('data-ss'),
se = pre.getAttribute('data-se');
@@ -261,15 +261,7 @@ var Dabblet = {
this.cached[name] = value;
}
}
-};
-
-window.ACCESS_TOKEN = localStorage['access_token'];
-
-currentuser.onclick = function(){
- if(!this.hasAttribute('href')) {
- gist.oauth[0]();
- }
-}
+}, window.Dabblet);
window.onbeforeunload = function(){
if(!gist.saved) {
@@ -313,12 +305,15 @@ setTimeout(function(){
document.addEventListener('DOMContentLoaded', function() {
if(ACCESS_TOKEN) {
- gist.getUser();
+ gist.getUser(function(user){
+ Dabblet.user.afterLogin(user);
+ });
}
var a = $('h1 > a');
if(parent !== window) {
+ Dabblet.embedded = true;
document.body.setAttribute('data-embedded', '')
a.href = '';
@@ -470,28 +465,6 @@ document.onkeydown = function(evt) {
}
};
-// If only :focus and :checked bubbled...
-(function() {
- function ancestorClass(action, className, element) {
- var ancestor = element;
-
- do {
- ancestor = ancestor.parentNode;
- ancestor.classList[action](className)
- } while(ancestor && ancestor != document.body);
- }
-
- $u.event.bind('header a, header input, header button, header [tabindex="0"], pre', {
- focus: function(){
- ancestorClass('add', 'focus', this);
- },
-
- blur: function() {
- ancestorClass('remove', 'focus', this);
- }
- });
-})();
-
// Supports sliders?
(function(){
var slider = $u.element.create('input', {
Oops, something went wrong.

0 comments on commit f061855

Please sign in to comment.