Commit Graph
474 Commits
Author SHA1 Message Date
Gabriel Devillers 37076ebcd9 Hide close cross in slots if need be.
Better cross  (unicode as icon).
CSS settings are better applied.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 1dfd40961f Moved "new slot/diff" buttons. 2016-08-05 11:51:49 +02:00
Gabriel Devillers 9a755d03e9 Place the editor and options in a panel.
This panel could easily be set as not draggable.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 9adb54663b Adjust CSS to save space in panels. 2016-08-05 11:51:49 +02:00
Gabriel Devillers 3247579576 Fix bugs.
Serialization bug & restore on startup bug.
2016-08-05 11:51:49 +02:00
Gabriel Devillers ece6789e64 Description of slots in diffs.
Previously: in the diff windows it was written 'before'/'after' slot: id of slot.
which was unclear.
Now it displays the name of compiler + options.

I had to make a little change to the initialisation process of the web interface,
To allow the object Compiler to see what are the compilers available
as soon as the slots are placed.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 0586ec4bd7 Accesskey enabled in the leaderSlot slot.
Previously accesskeys were not working in slots when there was more than 1 slot.
This is working, but not very practical:
Why would you change your favorite compiler ? (more than another one)
2016-08-05 11:51:49 +02:00
Gabriel Devillers 6d7e68c8bd Switch new functions name to camelCase.
I would have prefered modifying history by rebasing but it was far too time
consuming.
(because new functions name appear in different commits,...)
2016-08-05 11:51:49 +02:00
Gabriel Devillers f6a5dd145d DOM access code refactorised.
to sum up:
what was:
    domRoot.find('#slot'+slot.id+' .compilers').append(elem);
is now:
    slot.node.find('.compilers').append(elem);
2016-08-05 11:51:49 +02:00
Gabriel Devillers a5857b91cb Fix typos in code. 2016-08-05 11:51:49 +02:00
Gabriel Devillers b0c90b49a2 Fix UI bug.
There was no coloration in the editor if you changed the parameters of a slot
that was not the leaderSlot.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 43d3d99e5a Improved diff UI.
Switch roles of slots.
Colorise buttons.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 6d94cab638 Big 'leaderSlot' UI improvements.
No more unclear leaderSlot drop-down menu, but a selectable icon in each slot,
that can be seen as a mark saying "I prefer this compiling environnement".
There is always exactly 1 such icon on "selected" state.

Also: fix "colorise" bug.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 84a5646183 Fix: prevent closing the last compiler slot.
Possible improvement: hide the X cross rather that make the user beleve the UI
is bugged.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 2e057e59d7 Fix: autospawn 1 compiler slot on startup.
Another way of implementing it would have been to check if at least on slot
exist in a $.onDocumentReady close, in static/gcc.js.
But there already was code to spawn slots from previous session in
static/compiler.js so I chose this place.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 90894e8abc Added wdiff configuration options.
Configuration is read from gccexplorer config file.
Default values are:
/tmp for temporary directory
/usr/bin/wdiff for the wdiff executable

Also: Cleaned lib/diff.js.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 4c279d734e Minor cleanings.
Cleans app.js output from previous debug outputs.
Renamed debug functions concerning window.localStorage settings.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 7a8fec3ad9 Fixed 2 small UI bugs & coding typos.
UI bug: "impossible to refresh page if you have closed all your slots".
UI bug: the size of compiler option zone is incoherent with the slot zone
(Not perfect but much better !).
typos:  some call to onDiffChange did not specify the fromEditor boolean.
2016-08-05 11:51:49 +02:00
Nicolas Brunie 97c73abfe3 Fix minor asm parsing bug.
If your compiler output assembly with C-like comment /* */,
the script static/asm-mode.js freezes to death.
2016-08-05 11:51:49 +02:00
Gabriel Devillers 1c7d490dac Minor changes to allow Unit/Functional tests. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 309da0c29f Added debug functions around windows.localStorage
You can now use wipeSettings(); in your browser's JS console and hit 'F5'
to start compiler-explorer for the first time again.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 3205e56f21 Smarter diff triggering.
When the editor is modified.
I am not satisfied with my implementation,
there might be something to do with JS Promises.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 60c96cdf28 Dumb but working version of diff trigerring. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 48c6e8d655 Set default slots in new diffs (if possible). 2016-08-05 11:51:48 +02:00
Gabriel Devillers 60c04b127f Reload previous diff panels.
The serialization is similar to what existed for slots.

(WIP).
2016-08-05 11:51:48 +02:00
Gabriel Devillers 269615a9ae Move computation of diff *color zones* server side.
(The diff was already done server side.)
Sorry for the messy diff in this commit: I changed my mind on how I compute the
zones to colorise.
Possible improvement: use regex to take into account first occurence of '{++}'
or '[--]', then remove the marks '{++}' or '[--]' then continue until no
occurence is found.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 711af7a7d8 Ajax request to compute diff server side.
WIP.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 8a02608666 Improved look of diff panel.
And bug fix: corrected slots numerotation in diff panels.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 7e5391043b Fix wrong 'leaderSlot' id bug.
leaderSlot was 'x' in "slots[x]" instead of a being slot.id number.
My code assume no order in the array slots.
2016-08-05 11:51:48 +02:00
Gabriel Devillers a49e0e9218 Begins to implement diff between slots. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 27463ac192 Fix duplication of slots bug when opening a full link url. Refactoring. Cleaning.
Some recent functions moved from gcc.js to compiler.js in order to return
a simpler Compiler object.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 39966c72b7 new object Slot. UI improves.
Code factorisation.
Windows can be closed.
Windows should be resized when the screen size changes.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 271892128c Demo of half working multiple windows. WIP
Beware that currently the DOM is updated only if the user click on "+",
therefore problems will arise if you set slotCount to something different than 0 in compiler.js.
2016-08-05 11:51:48 +02:00
Gabriel Devillers ef1665196d Working demo of 3 sortable asm windows (JQuery-ui + Bootstrap 3)
It was necessary to add JQuery-UI (but only for the sortable functionality),
I choosed the stable version : 1.11.4
Some code may have been left over when removing tab's functions.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 04dfe1e8f1 Added lineWrapping (auto line break) in asm's CodeMirror window. 2016-08-05 11:51:48 +02:00
Gabriel Devillers e157d9f9aa Improved UI with leaderSlot scroll down menu. 2016-08-05 11:51:48 +02:00
Gabriel Devillers af316ca6c3 Fixed two display bugs.
One concerning leaderSlot scroll down menu, another due to an accidental
deletion.
2016-08-05 11:51:48 +02:00
Gabriel Devillers e6581e4f7f Added refresh of CodeMirror's asm windows on tab change
(to correct display bug).
Also: Minor cleanings.
2016-08-05 11:51:48 +02:00
Gabriel Devillers b70d82e867 Improved tabs in index.html / gcc.css
Minor changes in compiler.js.
Added error message in setCompilersInSlot so that the user is notified
(via console.log) if he did not set an adequate value to the setting defaultCompiler.
Moved the static javascript code handling tabs to gcc.js.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 76e31d2840 Currently it is required to specify a default compilers.
This was done in etc/config/c++.defaults.properties
2016-08-05 11:51:48 +02:00
Gabriel Devillers f0d5dcd944 The page is now splitted with two columns...
But let's try to use bootstrap now.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 2c6ac0e845 Begining of implementing tabs. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 28ef76818e Cleaning. Reformated error messages. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 1f5b56e13f Some W3C validation errors fixed. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 58cc6d8c33 Added tiny shell script to start gcc-explorer with C++ language. 2016-08-05 11:51:48 +02:00
Gabriel Devillers fdbf39f338 Timeouts work again, cleaner code, back to previous way of handling filters
Added leaderSlot option,
to tell wich slot should be used to display compiler's errors in editor.

But added a new 'filter' (option) : leaderSlot.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 3f62aa64f6 Now compilation callbacks are divided in : onEditorChange and onParamChange
It will be usefull for next step : multiple params.
2016-08-05 11:51:48 +02:00
Gabriel Devillers 74766f5457 Multiple compilation(assembly) output / compiler output. ATM still single configuration. 2016-08-05 11:51:48 +02:00
Gabriel Devillers ac2338fe0a Multiple ouput working. but ATM only one compilation is done. 2016-08-05 11:51:48 +02:00
Gabriel Devillers 9973969c7d Comments. 2016-08-05 11:51:48 +02:00