Skip to content

Commit

Permalink
remove starry code
Browse files Browse the repository at this point in the history
  • Loading branch information
liviavinci committed Oct 17, 2014
1 parent bca69bc commit 2ff3a1c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
17 changes: 0 additions & 17 deletions boundary/boundary.css
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,4 @@ iframe.boundary-default-iframe {
z-index: initial;
zoom: initial;
border: none;
}

iframe#starry-sidebar {
position: fixed;
top: 0;
right: -310px;
/* prevent right side from showing empty pixels */
width: 310px;
padding-right: 10px;
height: 100vh;
z-index: 99999999999999999;
display: none;
background: rgba(76,76,94,0.97);
-webkit-box-shadow: -2px 0 10px rgba(0,0,0,0.5);
box-shadow: -2px 0 10px rgba(0,0,0,0.5);
overflow-y: scroll;
overflow-x: hidden;
}
54 changes: 44 additions & 10 deletions boundary/boundary.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
var Boundary = {};

/******************************** create a box ********************************/

Boundary.createBox = function(attrs) {
if (attrs) {
if (attrs.class) {
attrs.class = "boundary-default-iframe " + attrs.class;
} else {
attrs.class = "boundary-default-iframe";
}
} else {
attrs = {"class" : "boundary-default-iframe"}
}
var iframe = $('<iframe />', attrs);
$("body").append(iframe);
Expand All @@ -19,18 +23,18 @@ Boundary.createBox = function(attrs) {
return iframe;
};

/******************************** style elements within a box ********************************/

Boundary.loadBoxCSS = function(boxSelector, CSSPath) {
var head = $("iframe.boundary-default-iframe" + boxSelector).contents().find("head");
var head = $(boxSelector).contents().find("head");
head.append($("<link/>", {
rel: "stylesheet",
href: CSSPath,
type: "text/css"
}));
};

Boundary.findBoxBody = function(boxSelector) {
return $("iframe.boundary-default-iframe" + boxSelector).contents().find("body");
};
/******************************** find/modify a specific boxe ********************************/

Boundary.rewriteBox = function(boxSelector, HTML) {
Boundary.findBoxBody(boxSelector).html(HTML)
Expand All @@ -44,14 +48,44 @@ Boundary.prependToBox = function(boxSelector, HTML) {
Boundary.findBoxBody(boxSelector).prepend(HTML)
};

Boundary.find = function(selector) {
return $(".boundary-default-iframe").contents().find(selector);
/******************************** find/modify elements within all boxes ********************************/

Boundary.find = function(elemSelector) {
return $("iframe.boundary-default-iframe").contents().find(elemSelector);
};

Boundary.rewrite = function(elemSelector, HTML) {
Boundary.find(elemSelector).html(HTML)
};

Boundary.append = function(elemSelector, HTML) {
Boundary.find(elemSelector).append(HTML);
};

Boundary.prepend = function(elemSelector, HTML) {
Boundary.find(elemSelector).prepend(HTML);
};

/******************************** find/modify elements within a specific box ********************************/

Boundary.findElemInBox = function(elemSelector, boxSelector) {
return $(boxSelector).contents().find(elemSelector);
};

Boundary.rewriteElemInBox = function(elemSelector, boxSelector, HTML) {
Boundary.findElemInBox(elemSelector, boxSelector).html(HTML)
};

Boundary.appendToElemInBox = function(elemSelector, boxSelector, HTML) {
Boundary.findElemInBox(elemSelector, boxSelector).append(HTML);
};

Boundary.append = function(selector, HTML) {
Boundary.find(selector).append(HTML);
Boundary.prependToElemInBox = function(elemSelector, boxSelector, HTML) {
Boundary.findElemInBox(elemSelector, boxSelector).prepend(HTML);
};

Boundary.prepend = function(selector, HTML) {
Boundary.find(selector).prepend(HTML);
/******************************** helpers ********************************/

Boundary.findBoxBody = function(boxSelector) {
return $(boxSelector).contents().find("body");
};

0 comments on commit 2ff3a1c

Please sign in to comment.