Changeset 19732 for websites

Show
Ignore:
Timestamp:
09/22/08 20:35:57 (2 months ago)
Author:
NeoCat
Message:

add user-defined CSS in Cookie

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/twicli/twicli.html

    r19686 r19732  
    162162        }; 
    163163} 
     164// user-defined CSS 
     165var user_style = readCookie('user_style') || ""; 
     166document.write('<style>' + user_style + '</style>'); 
    164167 
    165168function twAuth(a) {} // 認証(FIXME - FF:毎回認証要求される・Safari:ログインできない) 
     
    594597        $("tw2h").innerHTML = '<p><a target="twitter" href="index.html"><b>twicli</b></a> : browser-base Twitter client</p><hr>' + 
    595598                                        '<p><form onSubmit="switchUser($(\'user_id\').value); return false;">show user info : @<input type="text" size="15" id="user_id" value="' + myname + '"><input type="image" src="go.png"></form></p><hr>' + 
    596                                         '<p><b>Preferences:</b><form onSubmit="setPreps(this.limit.value, this.maxc.value, this.maxu.value, this.list.value); return false;">max #msgs in TL: <input name="limit" size="3" value="' + nr_limit + '"><br>#msgs in TL on update (max=200): <input name="maxc" size="3" value="' + max_count + '"><br>#msgs in user on update (max=200): <input name="maxu" size="3" value="' + max_count_u + '"><br>Plugins:<br><textarea cols="30" rows="4" name="list">' + pluginstr + '</textarea><br><input type="submit" value="Save"></form></p><hr>'; 
     599                                        '<p><b>Preferences:</b><form onSubmit="setPreps(this.limit.value, this.maxc.value, this.maxu.value, this.list.value, this.user_style.value); return false;">max #msgs in TL: <input name="limit" size="3" value="' + nr_limit + '"><br>#msgs in TL on update (max=200): <input name="maxc" size="3" value="' + max_count + '"><br>#msgs in user on update (max=200): <input name="maxu" size="3" value="' + max_count_u + '"><br>Plugins:<br><textarea cols="30" rows="4" name="list">' + pluginstr + '</textarea><br>user stylesheet:<br><textarea cols="30" rows="4" name="user_style">' + user_style + '</textarea><br><input type="submit" value="Save"></form></p><hr>' 
    597600        callPlugins("miscTab", $("tw2h")); 
    598601        $("loading").style.display = "block"; 
     
    600603                                                                                '&id=' + myname + '&callback=twLimit', update_ele2); 
    601604} 
    602 function setPreps(limit, maxc, maxu, plugin_list) { 
     605function setPreps(limit, maxc, maxu, plugin_list, style) { 
    603606        writeCookie('limit', limit, 3652); 
    604607        writeCookie('max_count', maxc, 3652); 
    605608        writeCookie('max_count_u', maxu, 3652); 
    606609        writeCookie('tw_plugins', plugin_list, 3652); 
     610        writeCookie('user_style', style, 3652); 
    607611        alert("Saved in Cookie. Please reload."); 
    608612}