Browse Source

Adding in frameworks

Toolbars, Action menus
Nathaniel van Diepen 10 years ago
parent
commit
77f63899b4
2 changed files with 16 additions and 72 deletions
  1. 13 4
      index.php
  2. 3 68
      js/index.js

+ 13 - 4
index.php

@@ -152,19 +152,28 @@
 		<section id="index" data-position="current">
 			<section id="sidebar" data-type="sidebar"></section>
 			<section id="drawer" role="region">
-				<header class="fixed" id="topbar">
-				</header>
+				<header class="fixed" id="topbar"></header>
 				<article id="content" class="scrollable header"></article>
+				<article class="content scrollable header fade-out">
+					<div id="toolbar" role="toolbar">
+						<ul>
+							<!-- Left -->
+						</ul>
+						<ul>
+							<!-- Right -->
+						</ul>
+					</div>
+				</article>
 			</section>
 		</section>
-		<!-- <section id="action-menu" data-position="back" class="fade-in">
+		<section id="action-menu" data-position="back" class="fade-out">
 			<form role="dialog" data-type="action">
 				<header>
 					Title
 				</header>
 				<menu></menu>
 			</form>
-		</section> -->
+		</section>
 		<div id="loading"></div>
 		<div id="dialog"></div>
 		<div id="comment" style="display:none;">

+ 3 - 68
js/index.js

@@ -281,6 +281,9 @@
 									}else{
 										console.log('No template used');
 									}
+									if(!exists(d.toolbar)){
+										$('#toolbar').hide();
+									}
 									$(window).resize();
 									loading(false);
 
@@ -364,14 +367,11 @@
 				$('#content').html(
 					Handlebars.compile(t)(c)
 				);
-				render.form('#content');
-				render.accordions('#content');
 				render.refresh('#content');
 			},
 			refresh: function(selector){
 				render.links(selector);
 				render.buttons(selector);
-				render.menus(selector);
 				render.time(selector);
 				$(window).resize();
 			},
@@ -386,20 +386,6 @@
 					);
 				});
 			},
-			accordions: function(selector){
-				$(selector).find('.accordion').each(function(){
-					var icons = {};
-					if($(this).children('.icons').length == 1){
-						icons = JSON.parse($(this).children('.icons').text());
-					}
-					$(this).children('.icons').remove();
-					$(this).accordion({
-						collapsible: true,
-						icons: icons,
-						active: false
-					});
-				});
-			},
 			buttons: function(selector){
 				$(selector).find('.more').off().each(function(){
 					var t = $(this);
@@ -505,54 +491,6 @@
 					});
 				},
 			},
-			menus: function(selector){
-				$(selector).find('.menu').css({
-					'list-style':'none'
-				}).menu({
-					icons:{
-						submenu: "ui-icon-circle-triangle-e"
-					}
-				}).removeClass('ui-corner-all').addClass('ui-corner-bottom').parent().click(function(e){
-					e.stopPropagation();
-				});
-			},
-			form: function(selector){
-				render.inputs(selector);
-			},
-			inputs: function(selector){
-				/*$(selector).find('input[type=text],input[type=password]').each(function(){
-					var input = $(this),
-						height = input.height()>=17?17:input.height();
-					input.siblings('.input-clear').remove();
-					input.off('focus').off('blur').after(
-						$('<div>').css({
-							position: 'absolute',
-							right: $(window).width() - (input.outerWidth() + input.position().left)+2,
-							top: input.position().top+2,
-							'background-image': 'url(img/headers/icons/clear.png)',
-							'background-position': 'center',
-							'background-size': height+'px '+height+'px',
-							'background-repeat': 'no-repeat',
-							width: input.height(),
-							height: input.height(),
-							cursor: 'pointer'
-						}).hide().addClass('input-clear').mousedown(function(){
-							input.val('');
-						})
-					);
-					input.focus(function(){
-						input.next().show();
-					}).blur(function(e){
-						input.next().hide();
-					});
-				});
-				$(selector).find('input[type=text],input[type=password],textarea').each(function(){
-					var input = $(this);
-					if(input.hasClass('fill-width')){
-						input.css('width','calc(100% - '+(input.outerWidth()-input.width())+'px)');
-					}
-				});*/
-			},
 			dialog: function(selector,title){
 				$(selector).dialog({
 					close: function(){
@@ -802,9 +740,6 @@
 					'display': ''
 				});
 			}
-
-			render.inputs('#content');
-			render.inputs('#topbar');
 		});
 		$.get(location.href,{
 			get: 'settings',