Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #11 from Healthx/sd-cleanup

removing references to prettify
  • Loading branch information...
commit 2ac3cbd4ceaea4b02986752d470406d472820ee0 2 parents 2d52808 + 241ec89
Jason Gross JasonAGross authored
Showing with 22 additions and 25 deletions.
  1. +17 −18 griddle.js
  2. +5 −7 index.html
35 griddle.js
View
@@ -1,7 +1,7 @@
/***********************************
*
* Griddle
-*
+*
* copyright 2012 Healthx, Inc.
* MIT Licensed http://healthx.mit-license.org
*
@@ -15,7 +15,7 @@ var griddle = {
var min = val - range,
max = val + range;
return x >= min && x <= max;
-
+
},
init: function (data, location) {
var griddleSelector = '#griddleContainer' + location + ' ';
@@ -67,7 +67,7 @@ var griddle = {
$(this).remove();
});
}
-
+
$(this).parent().remove();
griddle.setMessage("info", "Content Item Removed", location);
}
@@ -174,13 +174,13 @@ var griddle = {
var mx = 0,
cnt,
$itm;
-
+
$(griddleSelector + ".contentregion").each(function () {
var pattern = /[0-9]*$/;
var idx = parseInt($(this).attr("id").match(pattern), 10);
mx = mx < idx ? idx : mx;
});
-
+
cnt = mx + 100;
$itm = $("<div class='contentregion region" + cnt + "' id='ContentItemContainer" + cnt + "' ><span class='sortableinfo'>Drag any Item onto this region</span><div class='sortableregion'></div></div>")
.moveable({
@@ -210,7 +210,7 @@ var griddle = {
}
if ($(this).parent().data("regid")) {
data = { registryid: $(this).parent().data("regid") };
-
+
} else {
$(this).parent().remove();
griddle.setMessage("info", "Content Item Removed", location);
@@ -309,7 +309,7 @@ var griddle = {
}
},
validateLayout: function (isUpdating, location) {
-
+
var griddleSelector = '#griddleContainer' + location + ' ';
var movArr = [],
@@ -318,7 +318,7 @@ var griddle = {
colCnt = 0;
griddle.setMessage("clear", "", location);
$(griddleSelector + ".moveable," + griddleSelector + ".contentregion").each($.proxy(function (index, element) {
-
+
$this = $(element);
$data = $(element).data();
var leftPct = (($this.offset().left - $(griddleSelector + ".activeGrid").offset().left) / $(griddleSelector + ".activeGrid").width()) * 100;
@@ -326,13 +326,13 @@ var griddle = {
$data.rowId = griddle.getRowId($this.offset().top, location);
movArr.push($this);
if ($data.startCol === -1) {
-
+
var msg = isUpdating ? "Update failed. Please check alignments and try again" : "Oops, there was something wrong with that move. Please check alignments and try again.";
griddle.setMessage("error", msg, location);
return false;
}
}, this));
-
+
movArr.sort(function (a, b) {
//0 if eq , -1 if b > a, 1 if b < a
var result = 0;
@@ -407,7 +407,7 @@ var griddle = {
$data.suffix = 0; //reset
}
}
-
+
if (!$data.locationId) {
colCnt = colCnt + itmSz;
colCnt += ($data.suffix != undefined) ? $data.suffix : 0;
@@ -439,13 +439,13 @@ var griddle = {
} else {
outputDivs += "<div class='" + gridClassName + "'></div>\n";
}
-
+
} else {
-
+
movArr[i].closest(".contentregion");
}
-
+
if ($data.suffix < 0 || $data.prefix < 0) {
griddle.setMessage("error", "Oops, there was something wrong with that move. Please check alignments and try again.", location);
} else {
@@ -454,7 +454,7 @@ var griddle = {
updateSpec(movArr);
}
}
-
+
};
if (movArr.length > 0) {
updateSpec(movArr);
@@ -462,7 +462,6 @@ var griddle = {
griddle.container.children(".container_12").empty();
griddle.container.children(".container_12").append(outputDivs);
$("#output").text(griddle.container.html());
- prettyPrint();
}
};
@@ -575,7 +574,7 @@ $.widget("hx.moveable", {
childs = $tgt.children().children(".moveable");
cln.data("sortorder", childs.length);
$tgt.children(".sortableinfo").remove();
-
+
childsH += 55;
for (var i = 0; i < childs.length; i++) {
if (i === 0) {
@@ -584,7 +583,7 @@ $.widget("hx.moveable", {
childsH += 60;
}
}
-
+
$tgt.css("height", childsH + "px");
rowId = griddle.getRowId($tgt.offset().top, locId);
$(".r" + rowId).css("height", childsH + "px");
12 index.html
View
@@ -3,20 +3,18 @@
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.23/themes/base/jquery-ui.css" />
<link rel="stylesheet" href="griddle.css" />
-<link rel="stylesheet" type="text/css" href="prettify.css" />
<link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:400,700|Vollkorn'>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="griddle.js"></script>
-<script type="text/javascript" src="prettify.js"></script>
</head>
-<body onLoad="prettyPrint();">
+<body>
<h1 class="h1">Griddle</h1>
<div class="griddleContainer" id="griddleContainer100">
<span class="uxGriddleMessage infoMessage"></span>
<div class="griddleTopControls container_12 clearfix">
<div class="grid_12">
- <button class="button addItem">Add Item</button>
+ <button class="button addItem">Add Item</button>
<button class="button addRegion appendContainer" title="Add a Content Region to the Grid">
Add Content Region</button>
</div>
@@ -72,19 +70,19 @@ <h1 class="h1">Griddle</h1>
<h2>Current Markup</h2>
<pre class="prettyprint" id="output" ></pre>
</div>
-
+
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36027475-1']);
_gaq.push(['_trackPageview']);
-
+
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
-
+
</script>
</body>
Please sign in to comment.
Something went wrong with that request. Please try again.