Permalink
Browse files

Merge branch 'next/3' into feature/node

Conflicts:
	index.php
  • Loading branch information...
aron committed Apr 19, 2012
2 parents 5ecc100 + 6d765fa commit d8a65053ddc5a087e957bcefc6893175b4999ad1
View
@@ -19,7 +19,6 @@
- Options for pre-rendering
- .getCode runs through panel language
- "insertionPoint" means we can have more panels
-- Horizontal/Vertical switching affects code panels only - this will make the implementation MUCH easier
# Save
View
@@ -3,4 +3,4 @@
chdir('public');
require('index.php');
-?>
+?>
View
@@ -871,7 +871,7 @@ ie6, li {
#live {
/*display: none;*/
/*top: 60%;*/
- border-top: 1px solid #ccc;
+ /*border-top: 1px solid #ccc;*/
background: white;
z-index: 9999;
}
@@ -894,7 +894,7 @@ ie6, li {
/*top: 0;*/
/*left: ;*/
border-top: 0;
- border-left: 1px solid #ccc;
+ /*border-left: 1px solid #ccc;*/
}
.live #source {
@@ -1711,20 +1711,23 @@ div.CodeMirror-selected { background: #d9d9d9; }
.panel {
/*display: none;*/
- border-left: 1px solid #ccc;
background: #fff;
background: hsl(0, 0%, 98%);
}
+.panelwrapper {
+ border-left: 1px solid #ccc;
+}
+
.panel:first-child {
border-left: 0;
}
.panel .label {
display: block;
position: relative;
- background: #FAFAFA;
- border-bottom: 1px solid #ededed;
+ /*background: #FAFAFA;*/
+ /*border-bottom: 1px solid #ededed;*/
}
.focus .label {
@@ -1733,13 +1736,13 @@ div.CodeMirror-selected { background: #d9d9d9; }
/*box-shadow: inset 0 0 10px #000000;*/
/*background-color: hsl(215, 100%, 96%)*/
background: rgb(179,218,252); /* Old browsers */
-background: -moz-linear-gradient(top, rgba(179,218,252,1) 0%, rgba(198,242,255,1) 8%, rgba(250,250,250,1) 16%, rgba(250,250,250,1) 100%); /* FF3.6+ */
-background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(179,218,252,1)), color-stop(8%,rgba(198,242,255,1)), color-stop(16%,rgba(250,250,250,1)), color-stop(100%,rgba(250,250,250,1))); /* Chrome,Safari4+ */
-background: -webkit-linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(250,250,250,1) 16%,rgba(250,250,250,1) 100%); /* Chrome10+,Safari5.1+ */
-background: -o-linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(250,250,250,1) 16%,rgba(250,250,250,1) 100%); /* Opera 11.10+ */
-background: -ms-linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(250,250,250,1) 16%,rgba(250,250,250,1) 100%); /* IE10+ */
-background: linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(250,250,250,1) 16%,rgba(250,250,250,1) 100%); /* W3C */
-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3dafc', endColorstr='#fafafa',GradientType=0 ); /* IE6-9 */
+ background: -moz-linear-gradient(top, rgba(179,218,252,1) 0%, rgba(198,242,255,1) 8%, rgba(255,255,255,0) 16%, rgba(255,255,255,0) 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(179,218,252,1)), color-stop(8%,rgba(198,242,255,1)), color-stop(16%,rgba(255,255,255,)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(255,255,255,0) 16%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(255,255,255,0) 16%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(255,255,255,0) 16%,rgba(255,255,255,0) 100%); /* IE10+ */
+ background: linear-gradient(top, rgba(179,218,252,1) 0%,rgba(198,242,255,1) 8%,rgba(255,255,255,0) 16%,rgba(255,255,255,0) 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3dafc', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}
@@ -1998,7 +2001,7 @@ a.button.active:hover {
/*overflow: hidden;*/
/*min-height: 34px;*/
/*line-height: 34px;*/
- padding: 10px;
+ padding: 10px 10px 0 10px;
}
.label label {
@@ -2075,15 +2078,19 @@ a.button.active:hover {
#history {
z-index: 0;
/*position: absolute;*/
- top: 31px;
+ /*top: 31px;*/
-webkit-transition: top ease-out 200ms;
font-family: MenschRegular, Menlo, Monaco, consolas, monospace;
text-shadow: none;
/*-webkit-transition-delay: 100ms;*/
font-size: 13px;
padding: 10px 0;
- position: relative;
- height: 100%;
+ position: absolute;
+ /*height: 100%;*/
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
overflow: auto;
}
@@ -2252,5 +2259,7 @@ a.button.active:hover {
#save {
width: 50px;
+ position: relative;
+ z-index: 1;
}
@@ -136,6 +136,11 @@ $('#runwithalerts').click(function () {
return false;
});
+$('#runconsole').click(function () {
+ editors.console.render();
+ return false;
+});
+
$('#createnew').click(function () {
var i, key;
// FIXME this is out and out [cr]lazy....
@@ -70,10 +70,6 @@ $.fn.splitter = function () {
refreshTimer = null,
settings = splitterSettings[guid] || {};
- // if (settings.y) {
- // type = 'y';
- // }
-
var tracker = {
down: { x: null, y: null },
delta: { x: null, y: null },
@@ -196,14 +192,12 @@ $.fn.splitter = function () {
} else {
// $el.css('border-right', '1px solid #ccc');
$el.css('border-top', 0);
- $prev.css('border-right', '1px solid #ccc');
+ $prev.css('border-left', '1px solid #ccc');
}
if ($el.is(':hidden')) {
- console.log('splitter hidden');
$handle.hide();
} else {
- console.log('splitter NOT hidden');
$el.css('border-' + props[type].cssProp, '1px solid #ccc');
moveSplitter(x !== undefined ? x : $el.offset()[props[type].cssProp]);
}
@@ -228,7 +222,7 @@ $.fn.splitter = function () {
delete settings.x;
- $originalContainer.next(':visible').trigger('init');
+ $originalContainer.nextAll(':visible:first').trigger('init');
// 2. change splitter to the right to point to new block div
} else {
$el = $prev;
@@ -244,7 +238,9 @@ $.fn.splitter = function () {
$handle.css('margin-left', -5);
delete settings.y;
- $originalContainer.next(':visible').trigger('init');
+ setTimeout(function() {
+ $originalContainer.nextAll(':visible:first').trigger('init');
+ }, 0);
}
resetPrev();
@@ -266,14 +262,20 @@ $.fn.splitter = function () {
// reset top/bottom positions
// reset left/right positions
- $handle.trigger('init', value || $el.offset()[props[type].cssProp] || props[type].size / 2);
+ if (!$el.is(':hidden') && value) {
+ $handle.trigger('init', value || $el.offset()[props[type].cssProp] || props[type].size / 2);
+ }
});
$prev.css('width', 'auto');
$prev.css('height', 'auto');
$el.data('splitter', $handle);
$el.before($handle);
+
+ // if (settings.y) {
+ // $handle.trigger('change', 'y');
+ // }
});
};
@@ -73,7 +73,7 @@ panels.restore = function () {
for (i = 0; i < toopen.length; i++) {
name = toopen[i];
if (panels.panels[name]) {
- console.log(name, 'width', state[name], width * parseFloat(state[name]) / 100);
+ // console.log(name, 'width', state[name], width * parseFloat(state[name]) / 100);
if (openWithSameDimensions) {
panels.panels[name].show(width * parseFloat(state[name]) / 100);
} else {
@@ -134,7 +134,7 @@ panels.distribute = function () {
var visible = $('#source .panelwrapper:visible'),
width = 100,
height = 0,
- innerW = window.innerWidth,
+ innerW = window.innerWidth - (visible.length - 1), // to compensate for border-left
innerH = $('#source').outerHeight(),
left = 0,
right = 0,
@@ -162,13 +162,10 @@ panels.distribute = function () {
if (nestedPanels.length > 1) {
top = 0;
nestedPanels = nestedPanels.filter(':visible');
- console.log(nestedPanels);
height = 100 / nestedPanels.length;
nestedPanels.each(function (i) {
- debugger;
bottom = 100 - (height * (i+1));
var panel = jsbin.panels.panels[$.data(this, 'name')];
- console.log(panel.id, top, bottom);
// $(this).css({ top: top + '%', bottom: bottom + '%' });
$(this).css('top', top + '%');
$(this).css('bottom', bottom + '%' );
View
@@ -94,24 +94,25 @@ Panel.prototype = {
// check to see if there's a panel to the left.
// if there is, take it's size/2 and make this our
// width
- var panel = this;
+ var panel = this,
+ panelCount = panel.$el.find('.panel').length;
// panel.$el.show();
if (panel.splitter.length) {
- if (panel.$el.find('.panel').length == 0) {
- console.log(panel.id, 'showing panel by name')
+ if (panelCount == 0 || panelCount > 1) {
var $panel = $('.panel.' + panel.id).show();
// $panel.next().show(); // should be the splitter...
+ $panel.closest('.panelwrapper').show();
} else {
- console.log(panel.id, 'showing default panel')
panel.$el.show();
}
panel.splitter.show();
} else {
- console.log('showing default panel 2')
panel.$el.show();
}
+ $body.addClass('panelsVisible');
+
panel.visible = true;
if (panel.settings.show) {
panel.settings.show.call(panel, true);
@@ -159,6 +160,12 @@ Panel.prototype = {
$panel.prev().hide(); // hide the splitter if there is one
// TODO trigger a distribute horizontally
+ if ($panel.closest('.panelwrapper').find('.panel:visible').length === 0) {
+ console.log('hiding related panel');
+ $panel.closest('.panelwrapper').hide();
+ // panel.splitter.hide();
+ // TODO FIXME
+ }
} else {
panel.$el.hide();
panel.splitter.hide();
View
@@ -1,7 +1,9 @@
var $live = $('#live'),
$body = $('body'),
showlive = $('#showlive')[0],
- throttledPreview = throttle(renderLivePreview, 200);
+ throttledPreview = throttle(renderLivePreview, 200),
+ killAlerts = '<script>try{window.print=function(){};window.alert=function(){};window.prompt=function(){};window.confirm=function(){};}catch(e){}</script>',
+ restoreAlerts = '<script>try{delete window.print;delete window.alert;delete window.prompt;delete window.confirm;}catch(e){}</script>';
var iframedelay = (function () {
var iframedelay = { active : false },
@@ -69,9 +71,9 @@ function renderLivePreview(withalerts) {
// nullify the blocking functions
// IE requires that this is done in the script, rather than off the window object outside of the doc.write
if (withalerts !== true) {
- doc.write('<script>try{window.print=function(){};window.alert=function(){};window.prompt=function(){};window.confirm=function(){};}catch(e){}</script>');
+ doc.write(killAlerts);
} else {
- doc.write('<script>try{delete window.print;delete window.alert;delete window.prompt;delete window.confirm;}catch(e){}</script>');
+ doc.write(restoreAlerts);
}
if (jsbinConsole) {
@@ -101,6 +103,7 @@ function renderLivePreview(withalerts) {
};
doc.write(source);
+ doc.write(restoreAlerts);
}
doc.close();
delete jsbin.panels.panels.live.doc;
View
@@ -2,8 +2,8 @@
[
'Use ctrl+shift+? to show the keyboard shortcuts',
'Make sure you check out the help and tutorials - a blog of screencasts',
-'To only show the HTML panel use #html on the end of the url, such as http://jsbin.com/#html',
+'To only show the HTML panel use ?html on the end of the url, such as http://jsbin.com/?html',
'Refreshing the window will not lose your changes.',
'Use console.log to display debug information. If a web console is present, then the logging goes there, otherwise it will show in a custom console window.',
-'To view only the JavaScript append /js to the url, i.e. http://jsbin.com/ujayi/js - useful for Ajax testing'
+'To view only the JavaScript append .js to the url, i.e. http://jsbin.com/ujayi.js - useful for Ajax testing'
]
View
@@ -110,7 +110,7 @@
<strong>Output</strong>
<span class="options">
<button id="runwithalerts" title="ctrl + enter
-Include alerts, prompts &amp; confirm boxes">Run JavaScript</button>
+Include alerts, prompts &amp; confirm boxes">Run JS with alerts</button>
<label>Always run JS<input type="checkbox" id="enablejs"></label>
</span>
</div>

0 comments on commit d8a6505

Please sign in to comment.