diff --git a/ChangeLog b/ChangeLog index 9c6b8fe6..07834c91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,9 @@ and Util.setTimeout(pFunction [, pCallBack, pTime]) * From now api url on client readed from config.json. +* If choosen upload to -> Gist, and file in json have +not '.json' extension, it's added to the and of filename. + 2012.12.12, Version 0.1.8 diff --git a/config.json b/config.json index f21f6665..2dd79a63 100644 --- a/config.json +++ b/config.json @@ -4,7 +4,7 @@ "cache" : {"allowed" : false}, "minification" : { "js" : false, - "css" : true, + "css" : false, "html" : true, "img" : true }, diff --git a/css/style.css b/css/style.css index d930bd50..98cd2071 100644 --- a/css/style.css +++ b/css/style.css @@ -59,9 +59,6 @@ body{ text-shadow:black 0 2px 1px; } .path-icon:hover{ - /* - color:#45D827; - */ cursor:pointer; } .path-icon:active{ @@ -111,13 +108,14 @@ body{ background-color: white; border: 1.5px solid rgba(49,123,249,.40); } + .cmd-button:hover{ border: 1.5px solid rgb(0,0,0); } .cmd-button:active{ color: white; - background-color: rgb(49,123,249); + background-color: rgb(49,123,249); } .clear-cache{ @@ -126,19 +124,13 @@ body{ background:url(/img/console_clear.png) -4px -4px no-repeat; } .clear-cache:active{ - /* - background-position-y: -25px; - */ - top:5px; -} - -.settings:before{ - content:'k'; -} + top:5px; +} + .links{ color:red; } - + .mini-icon { position: relative; top: 2px; @@ -177,7 +169,7 @@ body{ height: 90%; margin: 26px 26px 0 26px; } -.fm_header{ +.fm-header{ font-weight: bold; } #path{ @@ -233,8 +225,6 @@ body{ */ text-align: right; } -.owner{ -} .mode{ float: right; width: 25%; @@ -252,14 +242,12 @@ button{ width:10%; } a{ - text-decoration:none; + text-decoration:none; } a:hover, a:active { color: #06e; cursor:pointer; - outline: 0; } -a:focus { outline: thin dotted; } /* Если размер окна очень маленький * располагаем имя и атрибуты файла @@ -276,6 +264,7 @@ a:focus { outline: thin dotted; } } /* текущий файл под курсором */ .current-file{ + background-color: rgb(49, 123, 249); background-color: rgba(49, 123, 249, .40); color:white; } @@ -297,12 +286,14 @@ a:focus { outline: thin dotted; } position: relative; top: -17px; + color: rgb(246, 224, 124); color: rgba(246, 224, 124, 0.56); } .directory::before{ content: '\f216'; } .text-file::before{ + color: rgb(26, 224, 124); color: rgba(26, 224, 124, 0.56); content: '\f211'; } @@ -353,7 +344,7 @@ a:focus { outline: thin dotted; } } } @media only screen and (min-width: 601px) and (max-width: 785px){ - .panel{ + .panel{ width:94% !important; } #right{ @@ -362,7 +353,7 @@ a:focus { outline: thin dotted; } } @media only screen and (min-width:786px) and (max-width: 1155px){ - .panel{ + .panel{ width:94% !important; } /* если правая панель не помещаеться - прячем её */ diff --git a/lib/client.js b/lib/client.js index 42aee3e6..3d67708e 100644 --- a/lib/client.js +++ b/lib/client.js @@ -361,15 +361,14 @@ function baseInit(pCallBack){ if( !DOM.Cache.get('/') ) DOM.Cache.set('/', cloudcmd._getJSONfromFileTable()); }); - + /* устанавливаем размер высоты таблицы файлов * исходя из размеров разрешения экрана */ - + /* выделяем строку с первым файлом */ - var lFmHeader = getByClass('fm_header'); - if(lFmHeader && lFmHeader[0].nextSibling) - DOM.setCurrentFile(lFmHeader[0].nextSibling); + var lFmHeader = getByClass('fm-header'); + DOM.setCurrentFile(lFmHeader[0].nextSibling); /* показываем элементы, которые будут работать только, если есть js */ var lFM = getById('fm'); @@ -383,7 +382,7 @@ function baseInit(pCallBack){ var lHeight = window.screen.height; lHeight = lHeight - (lHeight/3).toFixed(); - + lHeight = (lHeight / 100).toFixed() * 100; cloudcmd.HEIGHT = lHeight; diff --git a/lib/client/dom.js b/lib/client/dom.js index b062b26e..6de8ffaa 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -850,7 +850,7 @@ var CloudCommander, Util, DOM, CloudFunc; if (pCurrentFile.className === 'path') pCurrentFile = pCurrentFile.nextSibling; - if (pCurrentFile.className === 'fm_header') + if (pCurrentFile.className === 'fm-header') pCurrentFile = pCurrentFile.nextSibling; if(lCurrentFileWas) diff --git a/lib/client/menu.js b/lib/client/menu.js index 98c8b805..ea34ed92 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -78,8 +78,13 @@ var CloudCommander, Util, DOM, $; callback: function(key, opt){ DOM.getCurrentFileContent(function(pData){ var lName = DOM.getCurrentName(); - if( Util.isObject(pData) ) + if( Util.isObject(pData) ){ pData = JSON.stringify(pData, null, 4); + + var lExt = '.json'; + if( !Util.checkExtension(lName, lExt) ) + lName += lExt; + } var lGitHub = cloudcmd.GitHub; diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index b6cece81..24f426f3 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -8,7 +8,7 @@ var CloudCommander, Util, DOM, $, Github, cb; Cache = DOM.Cache, APIURL, - AuthURL = APIURL + '/auth', + AuthURL, GitHub_ID, GithubLocal, @@ -45,6 +45,8 @@ var CloudCommander, Util, DOM, $, Github, cb; cloudcmd.getConfig(function(pConfig){ GitHub_ID = pConfig.github_key; APIURL = pConfig.api_url; + AuthURL = APIURL + '/auth'; + Util.exec(pCallBack); }); } @@ -126,6 +128,7 @@ var CloudCommander, Util, DOM, $, Github, cb; */ cloudcmd.GitHub.createGist = function(pContent, pFileName){ if(pContent){ + DOM.Images.showLoad(); if(!pFileName) pFileName = Util.getDate(); @@ -144,7 +147,11 @@ var CloudCommander, Util, DOM, $, Github, cb; lOptions.files = lFiles; - lGist.create(lOptions, cb); + lGist.create(lOptions, function(pError, pData){ + DOM.Images.hideLoad(); + console.log(pError || pData); + console.log(pData && pData.html_url); + }); } return pContent; diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 8c9454eb..333bfacf 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -278,7 +278,7 @@ var CloudFunc, exports; */ CloudFunc._getFileTableHeader = function(pFileTableTitles) { - var lHeader='