diff --git a/index.html b/index.html index 21e8d05e..e0042ee9 100644 --- a/index.html +++ b/index.html @@ -25,6 +25,7 @@ + diff --git a/src/css/builder.css b/src/css/builder.css index b87caf01..ca1d6bca 100644 --- a/src/css/builder.css +++ b/src/css/builder.css @@ -654,6 +654,7 @@ body.ui-tabs.ui-widget { font-size: 12px; color: #111111; font-style: normal; + text-transform: capitalize; } .treeView span.widgetType:hover { color: #2c7a94; @@ -1329,13 +1330,15 @@ div.propertyItems label[for|=id] { size: 4; } -.deviceSetting #buttonSet{ - position: absolute; +center.title { + margin: 1em 1em 1.5em 1em; +} +#buttonSet{ bottom: 0px; width: 100%; } -.deviceSetting #buttonSet * { - margin: 0 1em 3em 1em; +#buttonSet * { + margin: 1.5em 1em 1.5em 1em; min-width: 25%; } diff --git a/src/js/main.js b/src/js/main.js index 17c3c576..98e32072 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -590,6 +590,33 @@ $(function() { var fsUtils, cookieUtils, supportedBrowser, supportedOS, errorMsg, redirect = 'https://01.org/rib'; + var startBuilder = function () { + cookieUtils = $.rib.cookieUtils; + // if can't get the cookie(no this record), then add exportNotice cookie + if (!cookieUtils.get("exportNotice")) { + if(!cookieUtils.set("exportNotice", "true")) { + // Failed to set the cookie + if (window.location.protocol === "file:") { + console.error("Browser needs " + + "'--allow-file-access-from-files" + + "--enable-file-cookies' option." + + + "\nClose the browser if you have already" + + " opened it before."); + } else { + console.error("Set exportNotice cookie failed."); + } + } + } + // Actually invoke the plugin that sets up our app UI + $(document).builder({debugMode: true, model: ADM}); + + // init the sandbox file system + fsUtils = $.rib.fsUtils; + // Try to init a temporary filesystem to test '--allow-file-access-from-files' option + requestFileSystem(window.TEMPORARY, 10, function(filesystem) { + fsUtils.initFS(fsUtils.fsType, fsUtils.fsSize, fsInitSuccess, fsInitFailed); + }, fsInitFailed); + } // Detect browser and platform supportedBrowser = /(Chrome|Chromium)\/(\S+)/; supportedOS = /(Win|Linux|Mac)/; @@ -597,37 +624,16 @@ $(function() { !supportedOS.test(navigator.platform)) { errorMsg = 'Only Google Chrome or Chromium are supported right now. ' + 'Unfortunately, it seems you are not using one of these, ' + - 'but instead:\n\n\t' + navigator.userAgent + '\n\n' + + 'but instead:

' + navigator.userAgent + '

' + 'To learn more about Rapid Interface Builder and how to ' + - 'use it, please visit our project website at:\n\n\t' + - redirect + '\n\n' + + 'use it, please visit our project website at:

' + + redirect + '

' + 'You will be redirected there now (or press "Cancel" to ' + 'try Rapid Interface Builder at your own risk).'; - if (confirm(errorMsg)) { + confirm(errorMsg, startBuilder, function (){ document.location = redirect; return; - } - } - cookieUtils = $.rib.cookieUtils; - // if can't get the cookie(no this record), then add exportNotice cookie - if (!cookieUtils.get("exportNotice")) { - if(!cookieUtils.set("exportNotice", "true")) { - // Failed to set the cookie - if (window.location.protocol === "file:") { - console.error("Browser needs '--allow-file-access-from-files --enable-file-cookies' option." + - "\nClose the browser if you have already opened it before."); - } else { - console.error("Set exportNotice cookie failed."); - } - } + }); } - // Actually invoke the plugin that sets up our app UI - $(document).builder({debugMode: true, model: ADM}); - - // init the sandbox file system - fsUtils = $.rib.fsUtils; - // Try to init a temporary filesystem to test '--allow-file-access-from-files' option - requestFileSystem(window.TEMPORARY, 10, function(filesystem) { - fsUtils.initFS(fsUtils.fsType, fsUtils.fsSize, fsInitSuccess, fsInitFailed); - }, fsInitFailed); + else startBuilder(); }); diff --git a/src/js/msg-box.js b/src/js/msg-box.js new file mode 100644 index 00000000..4c17d6bf --- /dev/null +++ b/src/js/msg-box.js @@ -0,0 +1,30 @@ +$.rib = $.rib || {}; +$.rib.msgbox = function (){ + var dlg = $("
").append('
' + + arguments[0] + '
'), + buttons = arguments[1], buttonSet; + if (buttons) { + buttonSet = $('
').appendTo(dlg); + $.each(buttons, function (name, value) { + buttonSet.append($('