diff options
| author | Mark Wells <mark@freeside.biz> | 2015-07-10 16:38:28 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2015-07-10 16:38:28 -0700 |
| commit | 0ed195595b5c7ea404c8848d9d1881ada4214489 (patch) | |
| tree | 6d6f3fe6e980cd123ff7a648d27fb9eb6b16ab13 /rt/share/static/js/titlebox-state.js | |
| parent | af05c3dda381122e0a45f72dbc0b4e9492f13fe7 (diff) | |
| parent | df4a68099abfa067014f36f92874fccefdea662e (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/share/static/js/titlebox-state.js')
| -rw-r--r-- | rt/share/static/js/titlebox-state.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/rt/share/static/js/titlebox-state.js b/rt/share/static/js/titlebox-state.js new file mode 100644 index 000000000..d4053390b --- /dev/null +++ b/rt/share/static/js/titlebox-state.js @@ -0,0 +1,36 @@ +function createCookie(name,value,days) { + var path = RT.Config.WebPath ? RT.Config.WebPath : "/"; + + if (days) { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + } + else + expires = ""; + + document.cookie = name+"="+value+expires+"; path="+path; +} + +function loadTitleBoxStates() { + var cookies = document.cookie.split(/;\s*/); + var len = cookies.length; + + for (var i = 0; i < len; i++) { + var c = cookies[i].split('='); + + if (c[0].match(/^TitleBox--/)) { + var e = document.getElementById(c[0]); + if (e) { + var e2 = e.parentNode; + + if (c[1] != 0) { + set_rollup_state(e,e2,'shown'); + } + else { + set_rollup_state(e,e2,'hidden'); + } + } + } + } +} |
