Skip to content

Commit

Permalink
Buttons to open more files
Browse files Browse the repository at this point in the history
  • Loading branch information
manngo committed Jul 31, 2019
1 parent 8554f1c commit aea8d55
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ <h3>Miscellaeous Actions</h3>
</div>
<div class="etc">
<p><button type="button" name="reset-mysql">Reset MySQL</button></p>
<p><button type="button" name="phpmyadmin-css">PHPMyAdmin CSS</button></p>
<p><button type="button" name="phpmyadmin-config">PHPMyAdmin Config</button></p>
</div>
</form>
</div>
Expand Down
21 changes: 17 additions & 4 deletions scripts/edit-virtual-hosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
htdocs: '/Applications/XAMPP/xamppfiles/htdocs',
mysql: '/Applications/XAMPP/xamppfiles/var/mysql',
phpini: '/Applications/XAMPP/xamppfiles/etc/php.ini',
phpmyadmin: '/Applications/XAMPP/xamppfiles/phpmyadmin/'
},
win32: {
conf: 'C:/xampp/apache/conf/httpd.conf',
Expand All @@ -70,6 +71,7 @@
htdocs: '/Applications/XAMPP/xamppfiles/htdocs',
mysql: '/Applications/MAMP/db/mysql57',
phpini: '/Applications/MAMP/bin/php/php{version}/conf/php.ini',
phpmyadmin: '/Applications/MAMP/bin/phpmyadmin/'
},
win32: {
conf: 'C:/MAMP/conf/apache/httpd.conf',
Expand All @@ -87,6 +89,7 @@
htdocs: '/Applications/AMPPS/apache/htdocs',
mysql: '/Applications/AMPPS/var/',
phpini: '/Applications/AMPPS/php/etc/php.ini',
phpmyadmin: '/Applications/AMPPS/phpmyadmin/'
},
win32: {
conf: 'C:/xampp/apache/conf/httpd.conf',
Expand Down Expand Up @@ -180,7 +183,7 @@
'virtual-hosts': {title: 'vhosts.conf', path: '', prefix: 'vhosts', save: 'Save vhosts conf', message: 'Open vhosts.conf file or Select Server', status: ''},
'generator': {title: 'Generator', path: '', message: 'Enter Values to Generate Virtual Host'},
'php-ini': {title: 'php.ini', path: '', prefix: 'php-ini', save: 'Save php ini file', message: 'Open php.ini file or Select Server', status: ''},
'misc-text': {title: 'Miscellaneous File', path: '', message: 'Open Any File', status: ''},
'misc-text': {title: 'Miscellaneous File', path: '', save: 'Save Miscellaneous File', message: 'Open Any File', status: ''},
'misc-actions': {title: 'Miscellaneous Actions', path: '', message: 'Miscellenous Actions', status: ''},
};

Expand Down Expand Up @@ -226,10 +229,20 @@
}
console.log(`${filepath} deleted`);
});


});
};
miscActions.elements['phpmyadmin-css'].onclick=function(event) {
if(!servers[server]) return;
tabs['misc-text'].path=`${servers[server][platform]['phpmyadmin']}/themes/pmahomme/css/common.css.php`;
load('misc-text');
buttons['misc-text'].click();
};
miscActions.elements['phpmyadmin-config'].onclick=function(event) {
if(!servers[server]) return;
tabs['misc-text'].path=`${servers[server][platform]['phpmyadmin']}/config.inc.php`;
load('misc-text');
buttons['misc-text'].click();
};

// Footer

Expand Down Expand Up @@ -262,7 +275,7 @@
;

if(DEVELOPMENT) {
buttons['php-ini'].click();
buttons['misc-actions'].click();
controls.elements['server'].value='xampp';
controls.elements['server'].dispatchEvent(new Event('change'));
window.webContents.openDevTools();
Expand Down
26 changes: 26 additions & 0 deletions styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
h3 {
margin: 0.5rem 0;
}

/* Layout
================================================
form#controls
Expand Down Expand Up @@ -396,3 +397,28 @@
div.help pre {
margin: .25rem 1.5rem;
}

/* Misc Actions
================================================ */

form#misc-actions div.etc {
padding: 1em;
width: 24em;
}

form#misc-actions div.etc p {
margin: .25em 0;
}
form#misc-actions div.etc p>button {
box-sizing: border-box;
background-color: #f8f8f8;
color: #333;
border: thin solid #666;
font-size: 1em;
padding: .5em 1em;
text-align: left;
width: 100%;
}
form#misc-actions div.etc p>button:hover {
background-color: #eee;
}

0 comments on commit aea8d55

Please sign in to comment.