Skip to content

Commit

Permalink
rewrite part 1: new ui (WIP).
Browse files Browse the repository at this point in the history
  • Loading branch information
marsjaninzmarsa committed Aug 22, 2017
1 parent 1e65996 commit 62aeca0
Show file tree
Hide file tree
Showing 13 changed files with 822 additions and 123 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ bin-release/

# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
# information for Eclipse / Flash Builder.
wordpress-1click.zip
43 changes: 32 additions & 11 deletions wordpress-1click/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@ var blogs = [
name : "demo-blog",
url : "http://demo-blog.me/wp-admin"
}
]
];

var plugin;

$(document).ready(function(){
//detect if we're in iframe mode
loc = window.location.search.substr(1);
if(loc.split("=").length){
//set the page to "buttons" mode
window.location.hash = "buttons";
//save the plugin name from query params
plugin_name = loc.split('=')[1];
$('.plugin_name').text('"' + plugin_name + '"');

$(document).ready(function() {
uri = new URI(window.location)
//detect if we're in iframe mode
if(uri.fragment() == 'buttons' || !uri.fragment()){
if(uri.query()) {
//save the plugin name from query params
plugin = uri.search(true);
$('.plugin_name').text(plugin.name);
} else {
chrome.tabs.query({
active:true,
currentWindow:true
}, function(tabs) {
currentTab = tabs[0];
if(currentTab) {
console.log(cur)
}
});
}
}

chrome.storage.sync.get('settings',function(obj){
if(Object.keys(obj).length && obj.settings.length){
blogs = obj.settings;
Expand All @@ -30,7 +43,15 @@ $(document).ready(function(){
});
$('#blog_buttons').on('click','.install',function(e){
e.preventDefault();
win = new_win(this.href + "/plugin-install.php?tab=plugin-information&plugin=" + plugin_name +"&TB_iframe=true&width=600&height=550",this.textContent,600,550);
url = new URI(this.href);
url.segment('plugin-install.php').search({
tab: 'plugin-information',
plugin: plugin.slug,
TB_iframe: true,
width: 600,
height: 550
})
win = new_win(url.href(),this.textContent,600,550);
})
$('#blogs').on('change','input',function(){
//get the changed blog id
Expand Down
6 changes: 6 additions & 0 deletions wordpress-1click/src/page_action/account.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions wordpress-1click/src/page_action/arrowhead-left-12.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions wordpress-1click/src/page_action/arrowhead-left-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions wordpress-1click/src/page_action/delete-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions wordpress-1click/src/page_action/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions wordpress-1click/src/page_action/grip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions wordpress-1click/src/page_action/login-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 62aeca0

Please sign in to comment.